- char buf[64];
-
- kprintf(KINFO "Hello higher half kernel world!\nWe are now running in virtual "
- "address space!\n\n");
-
- cpu_get_brand(buf);
- kprintf("CPU: %s\n\n", buf);
-
- void* k_start = vmm_v2p(&__kernel_start);
- kprintf(KINFO "The kernel's base address mapping: %p->%p\n", &__kernel_start, k_start);
-
- // no lxmalloc here! This can only be used within kernel, but here, we are in a dedicated process!
- // any access to kernel method must be done via syscall
-
- struct kdb_keyinfo_pkt keyevent;
- while (1)
- {
- if (!kbd_recv_key(&keyevent)) {
- // yield();
- continue;
- }
- if ((keyevent.state & KBD_KEY_FPRESSED) && (keyevent.keycode & 0xff00) <= KEYPAD) {
- tty_put_char((char)(keyevent.keycode & 0x00ff));
- tty_sync_cursor();
+ while ((p = wait(&status)) >= 0) {
+ short code = WEXITSTATUS(status);
+ if (WIFEXITED(status)) {
+ kprintf(KINFO "Process %d exited with code %d\n", p, code);
+ } else {
+ kprintf(KWARN "Process %d aborted with code %d\n", p, code);