feat: userspace overhaul, Intel GPU driver, and more

This commit is contained in:
2026-02-19 15:46:49 +01:00
parent d355d376f9
commit cae7dd352e
55 changed files with 9080 additions and 270 deletions
+37 -3
View File
@@ -3,7 +3,7 @@
syscalls - overview of ZenithOS system calls
.SH DESCRIPTION
ZenithOS provides 41 system calls (numbers 0-40) for userspace
ZenithOS provides 46 system calls (numbers 0-45) for userspace
programs. Syscalls use the x86-64 SYSCALL instruction with the
following register convention:
@@ -121,13 +121,22 @@
int32_t zenith::ping(uint32_t ip, uint32_t timeoutMs);
.B SYS_GETNETCFG (37)
Get the current network configuration (IP, mask, gateway, MAC).
Get the current network configuration (IP, mask, gateway, MAC,
DNS server).
void zenith::get_netcfg(Zenith::NetCfg* out);
.B SYS_SETNETCFG (38)
Set the network configuration (IP, mask, gateway).
Set the network configuration (IP, mask, gateway, DNS server).
int zenith::set_netcfg(const Zenith::NetCfg* cfg);
.B SYS_RESOLVE (44)
Resolve a hostname to an IPv4 address via DNS. Sends a UDP
query to the configured DNS server and waits up to 5 seconds
for a reply. Returns the IP in network byte order, or 0 on
failure. IP address strings (e.g. "10.0.0.1") are detected
and returned directly without a DNS query.
uint32_t zenith::resolve(const char* hostname);
.SH SOCKETS
.B SYS_SOCKET (29)
Create a socket. type=SOCK_TCP (1) or SOCK_UDP (2).
@@ -174,6 +183,17 @@
int zenith::recvfrom(int fd, void* buf, uint32_t maxLen,
uint32_t* srcIp, uint16_t* srcPort);
.SH FILE WRITE
.B SYS_FWRITE (41)
Write bytes to a file at a given offset.
int zenith::fwrite(int handle, const uint8_t* buf,
uint64_t offset, uint64_t size);
.B SYS_FCREATE (42)
Create a new file on the ramdisk. Returns a handle or negative
on error.
int zenith::fcreate(const char* path);
.SH FRAMEBUFFER
.B SYS_FBINFO (21)
Get framebuffer dimensions and format.
@@ -188,11 +208,25 @@
Get terminal dimensions (columns and rows).
void zenith::termsize(int* cols, int* rows);
.B SYS_TERMSCALE (43)
Get or set the terminal font scale factor. When scale_x is 0,
returns the current scale as (scale_y << 32 | scale_x). When
scale_x is non-zero, sets the font scale and returns the new
terminal dimensions as (rows << 32 | cols).
void zenith::termscale(int scale_x, int scale_y);
void zenith::get_termscale(int* scale_x, int* scale_y);
.SH ARGUMENTS
.B SYS_GETARGS (25)
Get the argument string passed to this process at spawn time.
int zenith::getargs(char* buf, uint64_t maxLen);
.SH RANDOM
.B SYS_GETRANDOM (45)
Fill a buffer with random bytes using RDTSC-seeded entropy.
Returns the number of bytes written.
int64_t zenith::getrandom(void* buf, uint32_t len);
.SH POWER MANAGEMENT
.B SYS_RESET (26)
Reboot the system.