implements integer printing into printf, and adds some testing logs
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __TESTING__
|
||||
#include <kernel/_kernel.h>
|
||||
#endif
|
||||
#include <kernel/x86/idt.h>
|
||||
|
||||
__attribute__((aligned(0x10)))
|
||||
@ -29,6 +32,9 @@ void idt_set_descriptor(uint8_t vector, void *isr, uint8_t flags)
|
||||
extern void* isr_stub_table[];
|
||||
void idt_init(void)
|
||||
{
|
||||
#ifdef __TESTING__
|
||||
kinfo("Initializing the IDT");
|
||||
#endif
|
||||
idtr.base = (uintptr_t)&idt[0];
|
||||
idtr.limit = (uint16_t) sizeof(idt_entry_t) * IDT_MAX_DESCRIPTORS - 1;
|
||||
|
||||
@ -40,5 +46,8 @@ void idt_init(void)
|
||||
// The "m" indicates actual data, not a pointer
|
||||
__asm__ volatile("lidt %0" : : "m"(idtr)); // load the new IDT
|
||||
__asm__ volatile("sti"); // set the interrupt flag
|
||||
#ifdef __TESTING__
|
||||
kinfo("Initialized the IDT");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user