Old hardware and boot sequences
Posted: Sat Mar 10, 2018 10:28 am
A fellow reader and I were discussing a few things about booting in another thread and we thought it best to move it over here.
I have multiple boot sectors, (at least) one for each file system I support, then one for each type of media within that file system.
As for the boot sector, I believe that assuming a 512 byte sector, on a Legacy BIOS, is acceptable, because it won't work with any other size. However, as soon as your loader or kernel take over, dropping the BIOS services, you should be sector size independent. I believe most of my code is sector size independent, but I have yet to run into a machine that uses 4096-byte sectors to verify it.
I haven't looked to closely if Qemu or even Bochs has a setting to allow a sector size change. If I remember correctly, and the code hasn't changed much since I last worked with it, I think the Bochs code could easily be changed to use a specified sector size with little efforts. Something I might look into adding.
Back to "160k" floppies. I too, for the fun of it, created boot sectors to load from this size floppy, as well as the other common sizes.
Anyway, thanks for checking my images[1] on your machines. Glad to hear that they work.
-Ben
[1]http://www.fysnet.net/blog/2018/03/
I think the key words here are (just for fun). That's why we do it anyway, right?Antti wrote:I just did my El Torito "no-emulation" tests with the FAT12/16 boot chain and it looks like there were no "512-byte sectors" hard-coded anywhere. Perhaps this does not sound very impressive but it was a feeling of success for me. If you add all the components together, I was really expecting that there were bugs that prevented the boot. Of course, there might be hidden bugs but this proves that it could work.
It is possible to have many boot floppy disks (perhaps a feature that is not very common in hobby systems) and I am planning to try (just for fun) this kind of boot sequence:
This is not very practical because it is not trivial to format those floppies. The common scenario is to use standard formats. The final test is to try the boot sequence on an ancient "160KB" floppy to test whether my 8086 compatible code really works or not... perhaps this is enough for now.
- Floppy #1, the "standard" format with 512-byte sectors that BIOSs should boot. First databases are read from this.
- Floppy #2, the "almost standard" format with 1024-byte sectors. More databases are read from this.
- Floppy #3, the "almost standard" format with 1024-byte sectors. More databases are read from this.
- etc.
I have multiple boot sectors, (at least) one for each file system I support, then one for each type of media within that file system.
As for the boot sector, I believe that assuming a 512 byte sector, on a Legacy BIOS, is acceptable, because it won't work with any other size. However, as soon as your loader or kernel take over, dropping the BIOS services, you should be sector size independent. I believe most of my code is sector size independent, but I have yet to run into a machine that uses 4096-byte sectors to verify it.
I haven't looked to closely if Qemu or even Bochs has a setting to allow a sector size change. If I remember correctly, and the code hasn't changed much since I last worked with it, I think the Bochs code could easily be changed to use a specified sector size with little efforts. Something I might look into adding.
Back to "160k" floppies. I too, for the fun of it, created boot sectors to load from this size floppy, as well as the other common sizes.
Anyway, thanks for checking my images[1] on your machines. Glad to hear that they work.
-Ben
[1]http://www.fysnet.net/blog/2018/03/