terminal fixes

This commit is contained in:
boreddevnl
2026-03-08 21:17:40 +01:00
parent 3fbcf3d4fd
commit b40d3c050d
12 changed files with 149 additions and 28 deletions

View File

@@ -207,6 +207,10 @@ int sys_tcp_recv(void *buf, size_t max_len) {
return (int)syscall3(SYS_SYSTEM, SYSTEM_CMD_TCP_RECV, (uint64_t)buf, (uint64_t)max_len);
}
int sys_tcp_recv_nb(void *buf, size_t max_len) {
return (int)syscall3(SYS_SYSTEM, SYSTEM_CMD_TCP_RECV_NB, (uint64_t)buf, (uint64_t)max_len);
}
int sys_tcp_close(void) {
return (int)syscall2(SYS_SYSTEM, SYSTEM_CMD_TCP_CLOSE, 0);
}
@@ -223,3 +227,7 @@ void sys_network_force_unlock(void) {
syscall2(SYS_SYSTEM, SYSTEM_CMD_NET_UNLOCK, 0);
}
void sys_yield(void) {
syscall1(SYS_SYSTEM, SYSTEM_CMD_YIELD);
}

View File

@@ -69,6 +69,8 @@
#define SYSTEM_CMD_SET_DNS 38
#define SYSTEM_CMD_NET_UNLOCK 39
#define SYSTEM_CMD_SET_RAW_MODE 41
#define SYSTEM_CMD_TCP_RECV_NB 42
#define SYSTEM_CMD_YIELD 43
// Internal assembly entry into Ring 0
extern uint64_t syscall0(uint64_t sys_num);
@@ -133,10 +135,12 @@ void sys_set_text_color(uint32_t color);
int sys_tcp_connect(const net_ipv4_address_t *ip, uint16_t port);
int sys_tcp_send(const void *data, size_t len);
int sys_tcp_recv(void *buf, size_t max_len);
int sys_tcp_recv_nb(void *buf, size_t max_len);
int sys_tcp_close(void);
int sys_dns_lookup(const char *name, net_ipv4_address_t *out_ip);
int sys_set_dns_server(const net_ipv4_address_t *ip);
void sys_network_force_unlock(void);
void sys_yield(void);
#endif