So yeah, now keep trace of those physical pages on kernel heap, Windows does that, linux does that, I have to do that since there are more attributes(paged/non-paged) that the kernel requires.
Hmm finished PMM alpha and redefined all those PMM/VMM interfaces.
The code is still broken right now.
1. Fix a stupid mistake in idt dispatch table (IDT_ENTRY_NUM instead of IDT_ENTRY_SIZE)!
2. Figured out that before enabling APIC, the PIC is not completely disabled/remapped. Took hours to debug why immediately after enabling interrupt, a double fault happens when executing "mov eax, 0". Turned out that PIC maps timer interrupt to int vet 8, which is double fault in the vector table. The double fault normally pushes an error code 0, the ISR is expecting the error code but the timer interrupt does not push an error code thereby screwing up the interrupt stack completely. The kernel runs normally after "sti" after changing the int 8 vector to just "iretq". (Remapping the PIC: http://wiki.osdev.org/I_Cant_Get_Interrupts_Working#I.27m_receiving_EXC9_instead_of_IRQ1_when_striking_a_key_.3F.21). Oh FML, hours wasted..
1. Added test for avl insertion and deletion (core functionalities).
2. Suppressed GCC's retarded multiline comment warnings.
3. Increased kernel heap size from 4k to 8k.
TODO:
1. Write test for salloc.
1. Intergrated my salloc allocator
2. hal.c: Got rid of some gcc warnings, mainly int -> pointer.
3. entry.asm: 64-bit int immediate moved to a reg first then anded with another reg.
Refactoring:
1. Got rid of kernel_status_t, IN, OUT, OPT. secX does not have to be Windows does it?
2. Renamed _KERNEL_ABI to SAPI.
3. Refactored library functions / interfaces to as "static" and "_" as possible
4. Restructured "common" folder