From 40bff7788865b519b79b1ee7eb9851914010ffb4 Mon Sep 17 00:00:00 2001 From: turret Date: Sun, 19 Nov 2023 19:13:40 -0600 Subject: misc: minor bugs and comments sprinkle a little bit of commenting throughout the codebase. hopefully i dont regret what i've written - clone: bottom of stack is passed through - print: write newline at end of message - initcall: functions return void type very basic net startup. hopefully i dont regret implementing the websocket protocol myself in a language as holy as C. --- init/init.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'init/init.c') diff --git a/init/init.c b/init/init.c index 5363082..7c2d6a6 100644 --- a/init/init.c +++ b/init/init.c @@ -10,6 +10,10 @@ static unsigned long __1bsafebuf __attribute__((used)) __attribute__((section(".1bsafebuf.init"))) = 0; +/* We start initcall levels at [1] instead of [0], so we must adjust + in code for this minor design choice. Math is done on the level passed + through i.e. do_initcall_level so that you can call it with (1) and have + the expected initcall (l1_initcall) run. */ extern initcall_entry_t __initcall1_start[]; extern initcall_entry_t __initcall2_start[]; extern initcall_entry_t __initcall3_start[]; @@ -46,6 +50,9 @@ int main(void) { do_initcalls(); + /* Reaper. Much like init. */ + // BUG: doesnt actually work?? we have defunct processes still + // TODO: fix bug static sigset_t set; sigaddset(&set, SIGCHLD); sigprocmask(SIG_BLOCK, &set, NULL); -- cgit v1.2.3