mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-04 02:23:10 +00:00
Full PMM implementation
This commit is contained in:
+10
-13
@@ -6,34 +6,31 @@
|
||||
#include <isr.h>
|
||||
#include <pmm.h>
|
||||
#include <tty.h>
|
||||
|
||||
// TODO: Commented out stuff
|
||||
#include <vmm.h>
|
||||
|
||||
__noreturn
|
||||
void kmain(void* ptr, uint32_t magic) {
|
||||
if (boot_initMB1(ptr, magic) != 0) panic("Unsupporred bootloader.");
|
||||
|
||||
// Serial console for debugging
|
||||
serial_init(COM1);
|
||||
if (serial_init(COM1) != 0) panic("Failed to initialize Serial driver.");
|
||||
debugf("\x1b[H\x1b[J\x1b[0mkern. \x1b[36m(serial console)\x1b[0m\n\n");
|
||||
|
||||
// VGA tty thingy
|
||||
tty_init();
|
||||
if (tty_init() != 0) panic("Failed to initalize TTY driver.");
|
||||
tty_puts("kern.\n\n");
|
||||
|
||||
// Memory manager init
|
||||
pmm_init();
|
||||
//vmm_init();
|
||||
// System init
|
||||
if (gdt_init() != 0) panic("Failed to initalize GDT.");
|
||||
if (isr_init() != 0) panic("Failed to initalize ISRs.");
|
||||
if (pag_init() != 0) panic("Failed to initalize Paging.");
|
||||
|
||||
gdt_init();
|
||||
isr_init();
|
||||
pag_init();
|
||||
// Memory manager init
|
||||
if (pmm_init() != 0) panic("Failed to initalize Physical Memory Manager.");
|
||||
//if (vmm_init() != 0) panic("Failed to initalize Virtual Memory Manager.");
|
||||
|
||||
debugf("Basic initialization complete!\n");
|
||||
|
||||
panic("kmain() reached end.");
|
||||
|
||||
// Temporary loop since panic() does not halt
|
||||
while (1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user