Writing an x86 kernel in C: How to start making my IRQ, PIC, IDT handling mechanics?
I'm building a x86 hobby operating system from scratch. The early boot stage successfully transitions from assembly into a pure C entry point inside init/main.c.
I am currently trying to write my interrupt subsystem (irq.c) to handle hardware lines like the keyboard and timer, but right now it's just a placeholder stub. Here is my current layout: irq.c:
#include "irq.h"
/* TODO: implement real IDT/PIC setup */
void idt_init(void) {}
void pic_init(void) {}
void irq_register(int irq, void (*handler)(void)) {
(void)irq;
(void)handler;
}
irq.h:
#ifndef NOVIUM_IRQ_H
#define NOVIUM_IRQ_H
#include <novium/types.h>
void idt_init(void);
void pic_init(void);
void irq_register(int irq, void (*handler)(void));
#endif