diff options
author | dzwdz | 2022-04-21 17:52:18 +0200 |
---|---|---|
committer | dzwdz | 2022-04-21 17:52:18 +0200 |
commit | 76221c214ec6907ecd52cf57232fa063e2f937d3 (patch) | |
tree | 03fc614432e51fb280c737324e49d021dab94dce /src/kernel/main.c | |
parent | e07fba53d972cfd4cf13c2e025200e40958f013d (diff) |
kernel: `shutdown()`; temporarily print process states on shutdown
Diffstat (limited to 'src/kernel/main.c')
-rw-r--r-- | src/kernel/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kernel/main.c b/src/kernel/main.c index 19cc970..9188370 100644 --- a/src/kernel/main.c +++ b/src/kernel/main.c @@ -30,3 +30,14 @@ void kmain(struct kmain_info info) { kprintf("loading init...\n"); run_init(&info); } + +void shutdown(void) { + size_t states[PS_LAST] = {0}; + for (struct process *p = process_first; p; p = process_next(p)) + states[p->state]++; + for (size_t i = 0; i < sizeof(states) / sizeof(*states); i++) + kprintf("state 0x%x: 0x%x\n", i, states[i]); + + mem_debugprint(); + cpu_shutdown(); +} |