foliagecanine wrote:Well, for one thing, it's not a great idea to alloc memory below 1MiB.
The BIOS usually stores some important data structures here (ACPI stuff for instance).
I've found that nasty bug of the page frame allocator: I was aligning the memory with some divisions by the page size but doing this with integer I was wrongly rounding down. This caused the bitmap to be overritten by some other memory. I've added a +1 so even if a bit of memory is wasted it should be sure now.
foliagecanine wrote:
Second, you should REALLY improve your page fault handler.
The system gives you the address that caused the page fault in CR2 as well as the error code and return address at the top of the stack (you'll need to put the return address back on the stack though).
I've treated the page fault as a normal exception, just like a division by zero. Theoretically, with the system I have now, I should create on the fly a new page in that memory when the fault is raised right?
foliagecanine wrote:
Third, both VirtualBox and VMware can't get past "VBR Loaded."
The bootloader is designed to run from an HDD, (or in my case a USB in emulation mode) so if you load it as iso it would not work. I didn't test it on these two emulators but maybe this is something I need to specify in the readme file of the repo
Fixing that bug in the page frame allocator (surely a good improvement) didn't change the result on real hardware. I noticed that sometimes it raises a Page Fault but other times it is a General Protection Fault