-I/O (Port I/O vs. MMIO)
-Interrupts (Exceptions and IRQs)
-Timers (PIT, APIC Timer, HPET)
-Virtual Memory
-CPU Specific Parts of Multitasking (Context Switching)
Most of the functions are pretty straightforward, but I'm still wondering about I/O. Since x86 is basically the only architecture that uses Port I/O (and even that's getting phased out), I definitely need to abstract the I/O interface somehow. But how exactly would I do that when Port I/O and MMIO are so different? My current idea is modifying the I/O functions to take the memory base address as another argument. On x86, if it's 0, a normal port operation is performed, but otherwise, there's a MMIO read or write performed. On any other architecture, it's used to do only MMIO reads and writes. Like so:
Code: Select all
unsigned char inportb(unsigned int base, unsigned short port);
void outportb(unsigned int base, unsigned short port, unsigned char data);