diff options
| author | hachem <im@hachem.wtf> | 2026-10-10 08:53:20 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-10-10 08:53:20 +0200 |
| commit | 89abe49aad1ac7416844f3c5e95655ad2614392b (patch) | |
| tree | ff9170aa0673b3db76e03ab80a5056e576a48e7b /boot/user.zig | |
| parent | 7642b3819c90ec0c4686c32e5f89c59cc47cc2d3 (diff) | |
feat: brk/sbrk syscalls + shitty heap
Diffstat (limited to 'boot/user.zig')
| -rw-r--r-- | boot/user.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/boot/user.zig b/boot/user.zig index 78d20ff..0cda97d 100644 --- a/boot/user.zig +++ b/boot/user.zig @@ -214,6 +214,12 @@ export fn syscallHandler(frame: *SyscallFrame) callconv(.c) void { const src: [*]const u8 = @ptrFromInt(frame.rsi); frame.rax = if (bridge.fsStore(name, src[0..len])) 1 else 0; }, + 10 => { // brk(addr) + frame.rax = @bitCast(sched.brk(frame.rdi)); + }, + 11 => { // sbrk(increment) + frame.rax = @bitCast(sched.sbrk(@bitCast(frame.rdi))); + }, else => serial.write("[syscall] unknown\r\n"), } } |
