kmain: put pic mask things into separate function

This commit is contained in:
2025-03-21 18:06:51 +03:00
parent 49d6231325
commit eb098b77fe
+9 -3
View File
@@ -9,6 +9,13 @@
#include <stdint.h> #include <stdint.h>
void apply_pic_masks()
{
//0x21 is master pic, 0xa1 is slave pic
outb(0x21,0xfc);//0b11111100 (bit 0 is PIT, bit 1 is keyboard and so on)
outb(0xa1,0xff);
}
void kmain() void kmain()
{ {
terminal_initialize(); terminal_initialize();
@@ -16,9 +23,8 @@ void kmain()
isr_install(); isr_install();
pic_remap(0x20, 0x28); pic_remap(0x20, 0x28);
pit_init(); pit_init();
//only enable keyboard IRQs
outb(0x21,0xfc); apply_pic_masks();
outb(0xa1,0xff);
printf("Kernel init sequence completed\n"); printf("Kernel init sequence completed\n");