adds some more data types for printf, and moves gdt_init to a different file
This commit is contained in:
@ -10,33 +10,13 @@
|
||||
|
||||
uint64_t gdt[GDT_SIZE];
|
||||
|
||||
void gdt_init()
|
||||
{
|
||||
#ifdef __TESTING__
|
||||
kinfo("Initializing the GDT");
|
||||
#endif
|
||||
gdt[0] = create_descriptor(0, 0, 0); // null
|
||||
gdt[1] = create_descriptor(0, 0x000FFFFF, (GDT_CODE_PL0)); // kernel code
|
||||
gdt[2] = create_descriptor(0, 0x000FFFFF, (GDT_DATA_PL0)); // kernel data
|
||||
gdt[3] = create_descriptor(0, 0x000FFFFF, (GDT_CODE_PL3)); // user code
|
||||
gdt[4] = create_descriptor(0, 0x000FFFFF, (GDT_DATA_PL3)); // user data
|
||||
|
||||
setGdt((sizeof(uint64_t) * GDT_SIZE) - 1, &(gdt[0])); // limit, base
|
||||
reloadSegments();
|
||||
#ifdef __TESTING__
|
||||
kinfo("Initialized the GDT");
|
||||
#endif
|
||||
}
|
||||
|
||||
void kmain(void)
|
||||
{
|
||||
#ifdef __TESTING__ // important components should be declared first, but if we're testing we want to log all of that
|
||||
terminal_initialize();
|
||||
serial_initialize();
|
||||
#endif
|
||||
|
||||
|
||||
gdt_init();
|
||||
gdt_init(gdt);
|
||||
idt_init();
|
||||
PIC_remap(0x20, 0x28);
|
||||
|
||||
@ -46,6 +26,6 @@ void kmain(void)
|
||||
#endif
|
||||
|
||||
|
||||
printf("Integer: %d\n", 10);
|
||||
printf("Integer: %1\n", gdt[1]);
|
||||
printf("Hex Int: %x\n", 2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user