#include <arch/x86/boot/multiboot.h>
#include <lunaix/common.h>
#include <lunaix/lunistd.h>
+#include <lunaix/lxconsole.h>
#include <lunaix/mm/pmm.h>
#include <lunaix/mm/vmm.h>
#include <lunaix/peripheral/ps2kbd.h>
void
__do_reserved_memory(int unlock);
-//#define DEMO_SIGNAL
+#define DEMO_SIGNAL
+
+extern void
+_pconsole_main();
+
+extern void
+_signal_demo_main();
+
+extern void
+_lxinit_main();
void __USER__
__proc0_usr()
{
+ pid_t p;
if (!fork()) {
+ _pconsole_main();
+ }
+
+ if (!(p = fork())) {
#ifdef DEMO_SIGNAL
- asm("jmp _signal_demo_main");
+ _signal_demo_main();
#else
- asm("jmp _lxinit_main");
+ _lxinit_main();
#endif
}
+ // waitpid(p, 0, 0);
+
while (1) {
yield();
}
{
assert_msg(kalloc_init(), "Fail to initialize heap");
- // Fuck it, I will no longer bother this little 1MiB
- // I just release 4 pages for my APIC & IOAPIC remappings
- // for (size_t i = 0; i < 3; i++) {
- // vmm_del_mapping(PD_REFERENCED, (void*)(i << PG_SIZE_BITS));
- // }
-
// 锁定所有系统预留页(内存映射IO,ACPI之类的),并且进行1:1映射
lock_reserved_memory();
syscall_install();
+ console_start_flushing();
+
unlock_reserved_memory();
for (size_t i = 0; i < (uintptr_t)(&__init_hhk_end); i += PG_SIZE) {