• Please review our updated Terms and Rules here

System BIOS hacking, high density floppy BIOS and PC Booters

CarlosTex

Experienced Member
Joined
Mar 26, 2013
Messages
272
Hi there!

Recently i was looking into the source code of the IBM 5160 BIOS, and although knowledge of 8088 assembly is pretty much non existant i found one piece of code that i found particularly interesting. So the system BIOS obviously has to stop looking for extension ROMs past a certain memory address and at F600h it starts looking for ROM BASIC. This is well known right?

So i really like the BIOS from Plasma which not only includes the source code but a also a very convenient way of assembling it back to binary. So i took a look into the code and made it so the BASIC ROM search becomes irrelevant and also made it so that the BIOS only stops look for ROM extensions past FC00h. The reason why i did this is simple. Some XT clones had several sockets that could be used not only for ROM BASIC but also for ROM extensions. Later clones however only include a single 32KB ROM socket that is wired for F600h to FCFFh. Exactly for ROM BASIC usage only. My opinion is that Cassete BASIC is pretty useless without a cassete port, so by hacking the BIOS the way i did made it possible that i can use the BASIC socket for extension ROMs, thus saving space in the C000h to EFFFh area.

Well usually these experiments don't have an happy ending, at least for me, but it actually works! So i moved my High Density floppy extensions (by Sergey) to the Fxxxh area and it works just as well as on my lo-tech 8 bit IDE socket. So if it works why am i here?

Well Sergey's BIOS is great, because one can patch it to change the floppy configuration, but the BIOS doesn't seem to be the most compatible ever. If i have the BIOS installed some PC Booter games refuse to work:

1 - Wizardry 1 (Original release) refuses to work, displays "Can't access system disk"
2 - Metropolis boots into the screen where it asks for the second disk but refuses to work, with a PC speaker message
3 - Oil's Well actually works with Sergey's BIOS, but only if i disable the XT-IDE BIOS, so the imcompatibility seems to come from XT-IDE BIOS

So i tried a different HD Floppy BIOS, actually this one from minuszerodegrees.net and it luckily its configuration matches the one in my system.

So i tried the booters that were not working with Sergey's BIOS. Metropolis still does not work and Oil's Well only works if i disable XT-IDE BIOS but Wizardry now works!!

Unfortunately i don't like the HD Floppy BIOS does a Floppy drive seek, moving the heads back and forth, right at cold boot, and everytime i warm boot too, so i was wondering if this BIOS can be hacked to remove all that floppy drive racket. Sergey's BIOS does not make the floppy drives move heads but it doesn't seem to be as compatible. So can any kind sould hack this floppy BIOS to remove all that floppy heads moving during boot?

I'm wondering if Sergey's BIOS is still being actively developed and improved. Because if there's improvements i just prefer to use it, as its great to change the floppy configuration.
 
Recently i was looking into the source code of the IBM 5160 BIOS, and although knowledge of 8088 assembly is pretty much non existant i found one piece of code that i found particularly interesting. So the system BIOS obviously has to stop looking for extension ROMs past a certain memory address and at F600h it starts looking for ROM BASIC. This is well known right?
Yes.

ROM BASIC (Cassette BASIC) always starts at address F6000.

A memory map of the three 5160 BIOS revisions is shown at [here]. Per [here], the last address that that POST component of the BIOS looks for a BIOS expansion ROM varies:
11/08/82 BIOS: F5800 (2K before F6000)
01/10/86 BIOS: EF800 (2K before F0000
05/09/86 BIOS: EF800 (2K before F0000
 
Well Sergey's BIOS is great, because one can patch it to change the floppy configuration, but the BIOS doesn't seem to be the most compatible ever. If i have the BIOS installed some PC Booter games refuse to work:
...
I'm wondering if Sergey's BIOS is still being actively developed and improved. Because if there's improvements i just prefer to use it, as its great to change the floppy configuration.

Well, last time I touched it was like two years ago :)
I don't have much time to wok on it. I do have a few improvements on my list. With my (limited) testing, I haven't find any incompatibilities, but it would be interesting to test the games you've mentioned.
The BIOS itself is open-source (https://github.com/skiselev/floppy_bios), and it would be much appreciated if someone with x86 and floppy programming experience would maintain/improve it.
 
The BIOS itself is open-source (https://github.com/skiselev/floppy_bios), and it would be much appreciated if someone with x86 and floppy programming experience would maintain/improve it.

Could you explain some more, please? I bought one of your Xi8088 boards in the past and had a lot of fun with experimenting with your BIOS. I even tried if I could extract the FDC part so I could use it for other PCs in combination with an AT FDC card. But that didn't work out right and most probably due to an errorous assumption (that I just found out :( ).
I already assembled the ASM and got a BIN what looks to me like a ROM extension. But what FDC card to use? I assume an AT one, but I still ask to be sure. Any info is welcome! TIA!
 
But that didn't work out right and most probably due to an errorous assumption (that I just found out :( ).
Studying the schematics again I found out I was right. Bit 4 of port 61h is toggled every 15 uS by OUT1 of the 8254. This is something you don't find in the original XT or clones. But your software does rely on it. I remembered I tried to emulate it by replacing a subroutine by one that emulates the delay but I failed.

The reason I thought I was errorous was that the doc from N8vem tells you that OUT0 is used but in reality it is OUT1. And that put me on the wrong track yesterday.

So any info is very welcome!
 
Back
Top