implements integer printing into printf, and adds some testing logs

This commit is contained in:
2025-05-30 13:19:22 -04:00
parent 0256466f4c
commit c115dcd4f7
8 changed files with 126 additions and 20 deletions

View File

@ -1,3 +1,6 @@
#ifdef __TESTING__
#include <kernel/_kernel.h>
#endif
#include <kernel/x86/io.h>
#include <kernel/x86/pic.h>
@ -10,6 +13,9 @@ void PIC_sendEOI(uint8_t irq)
void PIC_remap(int offset1, int offset2)
{
#ifdef __TESTING__
kinfo("Remapping the PIC...");
#endif
// The io_wait calls are necessary for older machines, to give the PIC time to react
//
// After the init, the PIC requires 3 init words
@ -38,12 +44,19 @@ void PIC_remap(int offset1, int offset2)
// Unmask the PICs
outb(PIC1_DATA, 0);
outb(PIC2_DATA, 0);
#ifdef __TESTING__
kinfo("Remapped the PIC!");
#endif
}
void pic_disable(void)
{ // Mask the PIC interrupts to disable them
outb(PIC1_DATA, 0xFF);
outb(PIC2_DATA, 0xFF);
#ifdef __TESTING__
kinfo("Disabled the PIC");
#endif
}
void IRQ_set_mask(uint8_t IRQline) // Masked IRQlines are ignored by the PIC, masked IRQ2 will fully ignore the slave