aboutsummaryrefslogtreecommitdiff
path: root/system.old/pulse/pulse.zig
blob: b917f8cbc0ac55124853fb6f9e57eb669b6003d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! Pulse - Akiba OS Init System

const format = @import("format");
const kata = @import("kata");
const sys = @import("sys");

export fn main(pc: u32, pv: [*]const [*:0]const u8) u8 {
    _ = pc;
    _ = pv;

    // Spawn Shinigami - the zombie reaper
    _ = kata.spawn("/system/shinigami/shinigami.gen") catch {
        format.println("Pulse: FATAL - Failed to spawn Shinigami");
        return 1;
    };
    format.println("Pulse: Shinigami started");

    // Main shell loop
    while (true) {
        const shell_pid = kata.spawn("/system/ash/ash.gen") catch {
            format.println("Pulse: Failed to spawn shell");
            kata.yield();
            continue;
        };

        _ = kata.wait(shell_pid) catch {
            format.println("Pulse: Shell wait failed");
            kata.yield();
            continue;
        };

        format.println("\nPulse: Shell exited, respawning...\n");
    }

    return 0;
}