diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-01 12:47:35 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-01 12:47:35 +0100 |
| commit | 85bcada8cf78bdf2bfb3be583289686026e0f25e (patch) | |
| tree | 0ce404c4840432db9b6d3addd3947a736d103382 /src/init | |
| parent | 2ce14aec655589f00442ab469b9d877a143eeefd (diff) | |
screen: start drm implementation
Diffstat (limited to 'src/init')
| -rw-r--r-- | src/init/main.zig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/init/main.zig b/src/init/main.zig new file mode 100644 index 0000000..0af43bc --- /dev/null +++ b/src/init/main.zig @@ -0,0 +1,21 @@ +const std = @import("std"); +const os = std.os.linux; + +pub fn main() !void { + std.debug.print("\u{1b}[1;1H\u{1b}[J", .{}); + _ = std.os.linux.mount("none", "/dev/", "devtmpfs", 0, 0); + + + const pid = @as(i32, @intCast(os.fork())); + + if (pid == 0) { + _ = os.execve("process", &[_:null]?[*:0]const u8 { "process" }, &[0:null]?[*:0]const u8{}); + + return error.ExecFailed; + } + + var status: u32 = undefined; + _ = os.waitpid(pid, &status, 0); + + while (true) { std.time.sleep(100); } +} |