Kazinsal wrote:
Stop taking about make-believe virtualization layers and listen to the people who know what they're talking about.
If you frob hardware that doesn't exist, bad things happen. Worse things happen if you frob hardware that the chipset and a microcontroller don't agree on whether or not they exist. Let's say there's something attached to ISA port 0x60 and 0x64, but the chipset has it lazily turned "off". A byte goes out I/O port 0x60, the CPU waits on the chipset to hand it over, the chipset just ignores it and doesn't tell the CPU that it's releasing the I/O bus. System hangs. Or maybe the chipset, knowing full well that the keyboard controller is off, decides the only thing that you could possibly want if you frob the keyboard controller is to pulse the reset line. System resets.
And don't tell me this doesn't happen, because it happens, and I've seen it happen several times.
You can base the initialization tasks on testing the results. You can have an API to record what worked and what didn't.
If you store the successful configuration on disk with journaling of its own, you can suffer resets and continue advancing until you end up loading the system correctly.
If you add APIs that inform the system whether the configuration succeeded or not, and write that on disk, you can try something else if you happen to need a reboot. Now you just skip the failing option (of course you will need to mark it as the last configuration point after failure, to try something else).
_____________________________________
_____________________________________
_____________________________________
_____________________________________
I personally have always only ever needed to use the KBC for the A20. Of course, I still can't handle machines that have exclusively USB ports. I still need the PS/2 machines because they are still modern and have everything I need right now, so why not end up learning how to handle it? That's the natural sequence that absolutely everybody in the planet followed to get to the current hardware state.
But once it's understood, it will be easy (and convenient) being able to have a system capable of booting in the oldest and newest machines, which will only ever reboot at most, and still continue loading, finding the right options until recording them (as a bare minimum system installation and configuration... some other reason for things like Windows to reboot so many times during install, don't you think?).I guess that sustaining the configuration process until loading, even against bogus resets, is the minimum that a small personal OS could do to work much better instead of just hanging. Probably this is exactly what they lack.
There are extremely tiny initialization details that even I have implemented but that bigger OSes don't for whatever reason, and in which case they also just hang, but mine don't, but then my OS loads but doesn't have all of the functions of the bigger one that hanged, but at least it booted correctly.