As legacy BIOS isn't as straightforward to develop using a modern
system, modern emulators/VMs and virtual machine firmware, it was
decided to start work on an UEFI version of the Nightloader.
This commit leaves the not-yet boot-capable, but as far as it's
there already assembling and working legacy BIOS code behind for
later work on this edition.
The implementation of the A20 wraparound check was off in some way,
which is why the new implementation was copied from osdev.org, just
using minor modifications to the label naming.
The value of the GDTR register was set to be 8 bytes too small, with
the effect that an accurate emulation software would error out because
of trying to read over the buffer size, as was noticed when using KVM.
This was due to the perception that the 0th index wouldn't be taken
into account; for that reason, the length of the GDTR was one index
short of what it should've been.
The error in the GDT caused the whole memory space to be offset by
128B or 256B (It's not entirely sure which one of those). This was
only made visible by later changes, but now it's fixed.
This commit deletes the gdt.asm for the i386 architecture as it was
quite buggy in that state. In a short while, the real GDT code which
works is going to be committed.
This commit adds a check for whether the A20 line is usable; checking
whether more than one megabyte of RAM can be used. If it isn't usable,
it currently isn't activated, but rather, the boot process is stopped.