Duje Mihanović [Sat, 30 Apr 2022 20:23:40 +0000 (22:23 +0200)]
Separate loading clusters and cluster chains
This will be crucial for stage 3 loading the kernel, because we will need to
relocate each cluster to 0x100000 (or somewhere after that) manually, and we
can't just do that in the driver as it's also used by the VBR which does not run
in unreal mode.
Duje Mihanović [Sat, 30 Apr 2022 14:35:18 +0000 (16:35 +0200)]
Fixes and improvements to FAT32 driver
* Fix issue where multiple clusters would be loaded 0x800 apart rather than
contiguously.
* Get rid of some global variables, saving space.
* si points to the start LBA address rather than the partition table entry,
saving a bit of space as we no longer need to use offsets.
* In read_cluster_chain, drop push/popad as they in fact do not
save the upper 16 bytes of the registers. Instead, just push
and pops the registers that are used.
Duje Mihanović [Wed, 22 Sep 2021 20:15:40 +0000 (22:15 +0200)]
Handle interrupts
Currently handles exception 8 and IRQ 1. EXC8 is double fault, and IRQ1 is
keyboard. EXC8 handler puts out a ':(' on the top left corner of the screen and
halts the machine, while IRQ1 puts out a string on the screen. However, it will
only do so once, and I have yet to figure out why.