aboutsummaryrefslogtreecommitdiffstats
path: root/init/log.c
AgeCommit message (Collapse)Author
2024-03-30*: directory changesturret
since this project is a skeleton and not meant to clutter up the code that will actually consume the bot, i've opted to consolidate the majority of files under a single directory and minimise extra files *: move code to util/ *: move include files to include/dbs/ net: consolidate net functions into single file config: remove config
2024-01-14misc: change RSL 2 -> 1turret
design choice since 1 << n == pow(2,n)
2024-01-14log: minor optimisationsturret
in panic, when killing process group, set pid to 0, where it gets our pgid for us, using kernel optimisations, saving a trip to kernel land to get the pgid ourselves
2024-01-14init: modify panic termination sequenceturret
in log: we ensure we panic by killing our process group with SIGTERM, raising it for ourselves, and exiting (if all else fails simply). in init: we catch SIGTERM and exit with 0 if we get it, as bash (and likely others) prints a nasty "Terminated" to stderr
2024-01-12log: implement lock breakingturret
2024-01-11init: panic on keyboard interruptturret
also: change panic signal to be SIGKILL as sigint being caught would result in a loop
2024-01-11init: panic on child exit status !=0turret
also: modify log to exit status 0 on panic instead of 1 (only runs exit on panicmode respawn which shouldn't cause a fatal termination)
2023-12-18log: edit inline assemblyturret
just read the note on osdev wiki that stated that input operands shouldn't be changed, so we move both rax and the console lock to the output operands so the compiler knows we are modifying them for our lovely optimisation
2023-12-18init: minor optimisationsturret
move spin locks to dedicated function so we can minimise repetition of code. now uses more C and less assembly. init.c uses 8192 * 512 as a maximum even if the stack rlimit is larger
2023-12-18*: enforce 78 char line limitturret
2023-12-18panic: add second cut-here for debug & respawnonlyturret
2023-12-18panic: use exit_group instead of exitturret
2023-12-18panic: fix memory leakturret
2023-12-18log: add panic featturret
rearrange print to use internal vaprint to accomadate print added additional options to vaprint (nolock, noparsecolon, etc) use subsystem modes to accomadate restarting
2023-11-24log: remove unused variableturret
2023-11-24misc: subsys upgrade, log timestampsturret
(log) - create LOGLEVEL constant numbers - implement CONSOLE_LOGLEVEL - color array now uses loglevel constants - timestamp now shown (thanks util-linux) (init) - register mainpid - hello world print - fix process reaper to refer to subsys when reaping (subsys) - create maximum subsystem count - create subsystem table - add debugging prints to subsystem entry and termination - create function to handle process termination (unmap stack, free subsystem malloc, clear entry in table) - disable subsystem inception - change die references to fail with print - supply clone with signal to send on termination (SIGCHLD)
2023-11-19misc: minor bugs and commentsturret
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.
2023-11-19Initial committurret
- create subsystem system using clone syscall, shared memory, shared file descriptors - printk-like logging facility (TODO: console loglevel) - initcall system (like linux kernel) TODO: determine license factors: linker.ld, linux kernel licensing (some ideas are more liberally taken rather than paraphrased)