First, about the floppy...
In bochs and on a recent (about 2001) computer, when I try to use the BIOS to read 62 floppy sectors starting at head 0, cylinder 0, sector 2, it reads fine...
If I go with the same code to an old Olivetti M300-30, i486SX (not very important, but just to help defining the age of the computer!), the read keeps failing (CF=1)...
I've not checked the error code, but with further trials I found that the old Olivetti only reads if I ask 17 or less sectors (in other words, the BIOS cannot read multiple sectors across track boundaries at once... at least on floppies)... this is not very convenient, cause I don't know how large the 2nd stage boot loader will grow (and if I keep adding error-detection code to the boot sector I doubt it will fit in 512 bytes anymore! Also, I want to keep space after 0x1BE to leave space for the partition table)...
And about the Fast A20... in the OSFAQ Wiki (haven't been copied to the OSDEV Wiki yet) it says that the Fast A20 is only available on Pentiums and later... Well, on my old i486DX-based olivetti it worked (I tested removing the code and the A20 was not enabled)...
Well, about the screen-blaking issue, it did not happen... but I've read that this blanking can occur not right following the use of the System Control Port to enable the A20, but later... Unless I didn't understand correctly...
However, I'll rewrite the code that enables the A20 using the keyboard controller later... But now, I'm too lazy for that kind of low-levelness!
Now, and still about the A20 (but not the Fast one!), tell me another thing... I'm short of space in the boot-sector, so is it safe to enable the A20 using the kbd controller and do not run a test routine to check if it had the desired effect, or should I test anyway?
JJ
Reading floppy sectors across tracks... And also FAST A20...
I wrote my code as to load a single sector at a time, so I don't have to worry about that stuff, runs fine for a kernel loading routine . As far as I know, that is very common for older hardware to not cross tracks. You could programmatically split it into multiple 16 track reads, but I find it's much easier to just write a loop that loads it one track at a time, not very efficient, but my kernel is only a few kb.
I haven't touched the fast a20, but if it works, that's great, if not, well... i dunno, lol.
Regular A20, should you check it. That depends on you really, would you like to throw an error for your users, or have their machine randomly reboot at a later time from triple faulting by the memory wrapping around and overwriting the kernel? The check isn't all that difficult, and you don't need a pretty message, just something denoting the A20 isn't setting correctly. I don't know how your boot loader looks, but I do the A20 enable, memory detection, paging and pmode entry code in my second stage. My first stage is REALLY simple (and allows for expansion later!), it supplies my second stage with a function to read a blocks from the disk in an LBA fashion (so it has to convert itself), my second stage calls this function to load the kernel and base drivers, it also enables a20, etc. The benefit is, I can boot off of any media by supplying a very simple primary boot loader without having to touch the second stage at all, which does the majority of the detection and loading.
I haven't touched the fast a20, but if it works, that's great, if not, well... i dunno, lol.
Regular A20, should you check it. That depends on you really, would you like to throw an error for your users, or have their machine randomly reboot at a later time from triple faulting by the memory wrapping around and overwriting the kernel? The check isn't all that difficult, and you don't need a pretty message, just something denoting the A20 isn't setting correctly. I don't know how your boot loader looks, but I do the A20 enable, memory detection, paging and pmode entry code in my second stage. My first stage is REALLY simple (and allows for expansion later!), it supplies my second stage with a function to read a blocks from the disk in an LBA fashion (so it has to convert itself), my second stage calls this function to load the kernel and base drivers, it also enables a20, etc. The benefit is, I can boot off of any media by supplying a very simple primary boot loader without having to touch the second stage at all, which does the majority of the detection and loading.