• Please review our updated Terms and Rules here

Assistance with assembly code for 5160 ROM

alejack12001

Veteran Member
Joined
Jul 26, 2020
Messages
603
Location
Fredericksburg, VA
I need help configuring the assembly code for a ROM that will host GLaBIOs and handle floppy-drive selection for an IBM 5160 PC‑XT system. My interest in using GLaBIOs on this system came from a video on Adrian’s Digital Basement. In that video, Adrian demonstrates how to speed up the 5160’s boot process by using a GLaBIOs ROM, integrated into a OneROM component, to replace the U18 ROM on the 5160 motherboard.

The video can be viewed on YouTube under the Title: Possibly the fastest booting IBM PC (Running at 4.77MHz). The video is somewhat long and spends a lot of time comparing the 5160’s boot speed under different configurations—OneROM plus GLaBIOs versus the standard BIOS. In those comparisons, the OneROM and GLaBIOs combination clearly comes out ahead. GLaBIO's ROM source code is available from the GLaBIOS webpage (https://glabios.org/)

However, a limitation of this modernization is that the user is still restricted to the standard 360‑KB floppy drive (and the original hard drive). I would like to take the modernization a step further by adding a 1.44‑MB drive. My goal is to use a GoTek configured as a 1.44‑MB B: drive (drive 1) while keeping the original 360‑KB drive as A: (drive 0).

For context, my motherboard is one of the 16–256‑KB models built in 1982. The floppy drive included with the machine is a Tandon 100A with a terminating resistor. The floppy controller matches the three‑quarter‑length board shown on the minuszerodegrees website.

On the GLaBIOs website, there is a reference to a pre-release ROM called GLaDISK. This GLaDISK ROM is described as supporting up to a 2.88‑MB floppy drive on IBM systems, specifically the PC‑XT, AT, and CMOS‑based systems. The documentation and GLaDISK code referenced can be obtained from the GLaDISK GitHub page: https://github.com/640-KB/GLaDISK.

The “setup and configuration of the drives” section of the GLaDISK ROM currently shows three possible configurations, as shown in the enclosed JPG file. The first configuration does not apply to my situation, although I do plan to use an AST SixPack Plus, which provides a real‑time clock, serial and parallel ports, and 384 KB of RAM, bringing total system memory to 640 KB. The third configuration describes drive‑type definitions located at offsets 0005h–0006h for different drive types. For my desired configuration, those values would be 14h and ECh, respectively.

The real difficulty lies in the GLaDISK code itself: there are multiple setup paths for systems with 2 or 4 drives and for systems with CMOS settings. I have tried to locate a default configuration for the floppy drives and used the value at 0005h as my reference, but without success. The address goes to a lot of different locations within the code, and finding just two drives is complex, even though the code is well-documented.

I have very little assembly coding experience, and I am therefore asking for assistance from those with assembly‑language experience to:
1. Identify the default floppy‑drive configuration used by GLaDISK/GLaBIOs, and
2. Show how to modify it to support my specific configuration: a 360‑KB A: drive and a 1.44‑MB B: drive (GoTek), using the 14h / ECh settings described above.

Any assistance would be greatly appreciated.


 
Last edited:
The floppy controller matches the three‑quarter‑length board shown on the minuszerodegrees website.
That is the 'IBM 5.25" Diskette Drive Adapter' described at [here], which is a double-density type.

Adding a 1.44M drive (to be used with 1.44M media) to a stock IBM 5160 requires two things:
* Hardware: Upgrading the floppy controller to one that (from a hardware perspective) supports high-density (HD); and
* Software: Software (somewhere) to support the HD floppy controller.

Some solutions are shown in the '1.44M diskette in 1.44M drive' subsection at the bottom of [here].

GLaDISK

Having a quick look at the GLaDISK site, GLaDISK is a BIOS expansion ROM. Presumably, you are putting that into a ROM fitted in socket U19.

Reading the documentation, for A:=360K and B:=1.44M, I agree that 14 is to be put into offset 0005 (drive types), and EC is to be put into offset 0006 (checksum adjustment). The documentation only states 0005 and 0006, which makes sense; the constant goes into one location to be referenced by all other code that uses the constant.

It sounds to me that your problem is a due to lack of a HD controller.
 
That is the 'IBM 5.25" Diskette Drive Adapter' described at [here], which is a double-density type.

Adding a 1.44M drive (to be used with 1.44M media) to a stock IBM 5160 requires two things:
* Hardware: Upgrading the floppy controller to one that (from a hardware perspective) supports high-density (HD); and
* Software: Software (somewhere) to support the HD floppy controller.

Some solutions are shown in the '1.44M diskette in 1.44M drive' subsection at the bottom of [here].

GLaDISK

Having a quick look at the GLaDISK site, GLaDISK is a BIOS expansion ROM. Presumably, you are putting that into a ROM fitted in socket U19.

Reading the documentation, for A:=360K and B:=1.44M, I agree that 14 is to be put into offset 0005 (drive types), and EC is to be put into offset 0006 (checksum adjustment). The documentation only states 0005 and 0006, which makes sense; the constant goes into one location to be referenced by all other code that uses the constant.

It sounds to me that your problem is a due to lack of a HD controller.
Thank you for responding.

I parked the PS/2 for a while, and I bought this PC-XT earlier this year. The PC-XT was a mess and quite filthy. Cleanup was a long-term process. I thought improvements could be made to the system, including this BIOS upgrade. Adrian from Adrian's Digital Basement used a microcontroller to substitute for U18 on the 5160 motherboard. Here is the link for the microcontroller: https://onerom.org/. The OneROM for the PC-XT is a 28-pin board that seats in the U18 socket. Apparently, U19 is unaffected by the change. Adrian used GLaBIOs along with the BASIC from U18's code to flash the BIOS card via a USB-C connector to activate the microcontroller and boost the startup speed. I plan to do the same.

I saw the suggested 1.44 floppy cards on minuszerodegrees' website. The cards suggested were an idea to lead me to get a modern floppy controller from TexElec, as seen on this website: https://texelec.com/product/quad-flop-four-port-isa-floppy-controller/. I have the TexElec controller and was going to use it in place of the controller from IBM. I was concerned that the BIOS on the controller would interfere with the ROM BIOS. However, now that I take a second look at those controllers suggested on the minuszerodegrees' website were used as floppy controllers that had their own BIOS, and so the sequence must have occurred after the initial BIOS. So, this TexElec controller might work where the need for editing the GLaBIOS and GLaDISK is unnecessary and essentially nullifies the initial post.
 
I parked the PS/2 for a while, and I bought this PC-XT earlier this year. The PC-XT was a mess and quite filthy. Cleanup was a long-term process. I thought improvements could be made to the system, including this BIOS upgrade. Adrian from Adrian's Digital Basement used a microcontroller to substitute for U18 on the 5160 motherboard. Here is the link for the microcontroller: https://onerom.org/. The OneROM for the PC-XT is a 28-pin board that seats in the U18 socket. Apparently, U19 is unaffected by the change. Adrian used GLaBIOs along with the BASIC from U18's code to flash the BIOS card via a USB-C connector to activate the microcontroller and boost the startup speed. I plan to do the same.
In the 5160, U19 is mapped to F000 and U18 is mapped to F800. Any external floppy/IDE BIOS and the first 8K of BASIC should be in U19. The last 24K of BASIC and the 8K system BIOS should be in U18. You can put a floppy/IDE BIOS in U18, but it will break BASIC.

Once you start needing more than a couple ROMs, OneROM isn't really cost-effective. Unless you need to frequently update in-place for testing, you might consider investing in a programmer and eraser that will allow you to use cheap (E)EPROMs on future projects.

I saw the suggested 1.44 floppy cards on minuszerodegrees' website. The cards suggested were an idea to lead me to get a modern floppy controller from TexElec, as seen on this website: https://texelec.com/product/quad-flop-four-port-isa-floppy-controller/. I have the TexElec controller and was going to use it in place of the controller from IBM. I was concerned that the BIOS on the controller would interfere with the ROM BIOS. However, now that I take a second look at those controllers suggested on the minuszerodegrees' website were used as floppy controllers that had their own BIOS, and so the sequence must have occurred after the initial BIOS. So, this TexElec controller might work where the need for editing the GLaBIOS and GLaDISK is unnecessary and essentially nullifies the initial post.
The TexElec controller will work fine without GLaDISK. The location of its floppy BIOS is configurable. Just avoid F000 or F800. If you have an EGA or VGA, also avoid C000.
 
In the 5160, U19 is mapped to F000 and U18 is mapped to F800. Any external floppy/IDE BIOS and the first 8K of BASIC should be in U19. The last 24K of BASIC and the 8K system BIOS should be in U18. You can put a floppy/IDE BIOS in U18, but it will break BASIC.

Once you start needing more than a couple ROMs, OneROM isn't really cost-effective. Unless you need to frequently update in-place for testing, you might consider investing in a programmer and eraser that will allow you to use cheap (E)EPROMs on future projects.


The TexElec controller will work fine without GLaDISK. The location of its floppy BIOS is configurable. Just avoid F000 or F800. If you have an EGA or VGA, also avoid C000.
I have the UV and GO 4x4 programmer with the software. I have programmed other ROMs using that system. You're right at $34/board; the OneROM is quite pricey. I guess I followed Adrian's lead too closely for the speed update of the 5160.

The avoidance of the F000 or F800 as well as the C000 addresses is good advice. A user can adjust the TexElec controller using the instructions and jumpers available on the reverse side of the card. Yes, I am using a VGA card, so I will be aware of that address space.
 
In the 5160, U19 is mapped to F000 and U18 is mapped to F800. Any external floppy/IDE BIOS and the first 8K of BASIC should be in U19. The last 24K of BASIC and the 8K system BIOS should be in U18. You can put a floppy/IDE BIOS in U18, but it will break BASIC.
Down the track, others may be reading this GLaBIOS+GLaDISK thread. And so, regarding putting GLaDISK within U18/U19, I have put a diagram at [here].
 
I have the UV and GO 4x4 programmer with the software. I have programmed other ROMs using that system. You're right at $34/board; the OneROM is quite pricey. I guess I followed Adrian's lead too closely for the speed update of the 5160.

The avoidance of the F000 or F800 as well as the C000 addresses is good advice. A user can adjust the TexElec controller using the instructions and jumpers available on the reverse side of the card. Yes, I am using a VGA card, so I will be aware of that address space.
You may also be interested in the Super PC/Turbo XT BIOS. It has options for both fast memory checking and no memory checking, and will automatically generate the required 32K U18 and U19 files for your 5160.
 
The avoidance of the F000 or F800 as well as the C000 addresses is good advice. A user can adjust the TexElec controller using the instructions and jumpers available on the reverse side of the card. Yes, I am using a VGA card, so I will be aware of that address space.
The Upper Memory Area (UMA) of the IBM 5160 is shown at [here]. Ideally, non-video BIOS expansion ROM's sit somewhere in the C8000 to EFFFF block, as long as they don't conflict with something else. For example, XT-class hard disk controllers typically have their BIOS expansion ROM starting at C8000.

Yes, I am using a VGA card, so I will be aware of that address space.
If you have an XT-class hard disk controller, be aware of the possibility described in the 'Possible BIOS ROM conflict - hard disk controller and VGA' section of [here].
 
Down the track, others may be reading this GLaBIOS+GLaDISK thread. And so, regarding putting GLaDISK within U18/U19, I have put a diagram at [here].
Thank you for the diagram of the stacking of the GLaBIOS and GLaDISK BIOS configurations.

In Adrian's video, Adrian copied the IBM BIOS to a file from the U18 and then used a hex editor to essentially edit the file by first finding the address 6000h and then deleting the remaining part to EOF. He saved the file, which matched the physical size of the IBM BASIC that Plasma referred to, or 24 kB. Adrian then used the editor to copy the 8 kB of hex data from the GLaBIOS into the BASIC file to create his rendition (starting at 6000h), which made 32 kB. In addition, as an alternative, he did a concatenation of the two, namely the BASIC file and the GLaBIOS file, to make the BIOS for his machine. The concatenation was what I used to make my BIOS file. He then loaded his file onto the microcontroller inserted into U18. He then demonstrated its use by turning on his machine first without a boot disk to show that the machine would boot into BASIC, and later, how much faster the boot process was with this improvement. I am dubious about my success.

You may also be interested in the Super PC/Turbo XT BIOS. It has options for both fast memory checking and no memory checking, and will automatically generate the required 32K U18 and U19 files for your 5160.
Plasma: Thank you for the suggested alternative to the GLaBIOS upgrade. I guess I could use my standard 27256 chip instead of the microcontroller chip used with the GLaBIOS. Your alternative will require added study before I try it.

The Upper Memory Area (UMA) of the IBM 5160 is shown at [here]. Ideally, non-video BIOS expansion ROM's sit somewhere in the C8000 to EFFFF block, as long as they don't conflict with something else. For example, XT-class hard disk controllers typically have their BIOS expansion ROM starting at C8000.


If you have an XT-class hard disk controller, be aware of the possibility described in the 'Possible BIOS ROM conflict - hard disk controller and VGA' section of [here].
Yes, I had seen that there was an extensive array of hiccups that could come from retrofitting this machine with modern BIOS, cards, etc. The retrofit is a hobby more than a business. So, I am taking my time to explore all possibilities.

The plan was as follows:
1. BIOs change - ongoing
2. Use the WD Paradise VGA card for video.
3. AST Six PAC Plus multi I/O with 384 kB RAM to raise the memory to 640 kB.
4. Improved floppy controller using the TexElec quad floppy controller.
5. Improved IDE controller with an IDE/SD card for a hard drive.
6. Network card
 
I am dubious about my success.
My method:

1. I went to [here] and downloaded the precompiled BIN file for an 8088 in an "XT 5160". That file is named GLABIOS_0.4.2_8X.ROM, and is 8 KB sized.
2. I executed my hex editor (HxD).
3. [Hex editor]: Imported BIOS_5160_08NOV82_U18_1501512.BIN from within the BIOS_5160_08NOV82.zip at [here]. 32 KB sized.
4. [Hex editor]: Used the contents of file GLABIOS_0.4.2_8X.ROM to overwrite the last 8 KB (offset 6000 through 7FFF). Cassette BASIC portion (offset 0000 through 5FFF) left untouched.
5. [Hex editor]: Save to file '1501512 overwritten in part by 5160 version of GLaBIOS.bin'

I tested that file (together with the U19 file of 08NOV82) in PCem software (an emulator), watching as GLaBIOS displayed its start-up stuff, and then a boot to Cassette BASIC (version C1.10)

'1501512 overwritten in part by 5160 version of GLaBIOS.bin' is attached. Program that into a 27256/27C256/W27E257 for the U18 socket.

If you have 27256/27C256 for your early 5160 motherboard, note that per the 'Early 5160 motherboards' section of [here], the NEC µPD27C256 is unsuitable.
 

Attachments

Thanks for sharing the link to your GLaBIOS that you used in the U18 chip. Curious as to why the same ROM is not ported to U19?

The link you sent for the GLaBIOS is the same one I used to make my binary. I could save the microcontroller chip and use the 27C256 chip that I have, and use my programmer rather than the OneROMS website to populate the ROM. Thank you for the suggestion.
 
Thanks for sharing the link to your GLaBIOS that you used in the U18 chip. Curious as to why the same ROM is not ported to U19?
People typically refer to the U18+U19 pair as BIOS ROM's. That is slightly misleading for two reasons:
1. They contain Cassette BASIC as well; and
2. In the 1982 dated U18+U19, the BIOS is only located in U18.

So, per the diagram below, all that is being done is to replace the IBM BIOS component of U18 with GLaBIOS. U19 does not get touched.
1780100844555.png
 
Further to last.
Even for the 1986 dated U18+U19, only U18 needs altering:
View attachment 1322819
I found your description of the ROM and the cassette BASIC interesting. So, how would the cassette BASIC compare with the commercial off-the-shelf Turbo BASIC from the mid-1980's?

Sorry, I've gone off on one of my tangents. Chuck(G) helped me find a cassette recorder/player, cables, and software to use with my 5150. The 5150 had the cassette port and relay on the motherboard. The basic software worked quite well, and I was able to conduct a limited backup.
 
So, how would the cassette BASIC compare with the commercial off-the-shelf Turbo BASIC from the mid-1980's?
Cassette (ROM) BASIC is pretty terrible in comparison to Turbo BASIC or Q(uick)BASIC. It's closer to GW-BASIC, but only supports CGA graphics and can only save to cassette.
 
Cassette (ROM) BASIC is pretty terrible in comparison to Turbo BASIC or Q(uick)BASIC. It's closer to GW-BASIC, but only supports CGA graphics and can only save to cassette.
Thank you for your reply. Some computer manufacturers followed IBM's lead by offering a snippet of coding software to whet the buyers' appetite. My first computer wasn't my icon associated with my userid. My first was the Timex Sinclare 1000. It was a bear to program with BASIC programs included in the user's manual. The computer included a cassette port for purchasing cassette tapes of watered-down games, like Pong. Of course, the user needed to add 16 kB of memory to run games.
 
My method:

1. I went to [here] and downloaded the precompiled BIN file for an 8088 in an "XT 5160". That file is named GLABIOS_0.4.2_8X.ROM, and is 8 KB sized.
2. I executed my hex editor (HxD).
3. [Hex editor]: Imported BIOS_5160_08NOV82_U18_1501512.BIN from within the BIOS_5160_08NOV82.zip at [here]. 32 KB sized.
4. [Hex editor]: Used the contents of file GLABIOS_0.4.2_8X.ROM to overwrite the last 8 KB (offset 6000 through 7FFF). Cassette BASIC portion (offset 0000 through 5FFF) left untouched.
5. [Hex editor]: Save to file '1501512 overwritten in part by 5160 version of GLaBIOS.bin'

I tested that file (together with the U19 file of 08NOV82) in PCem software (an emulator), watching as GLaBIOS displayed its start-up stuff, and then a boot to Cassette BASIC (version C1.10)

'1501512 overwritten in part by 5160 version of GLaBIOS.bin' is attached. Program that into a 27256/27C256/W27E257 for the U18 socket.

If you have 27256/27C256 for your early 5160 motherboard, note that per the 'Early 5160 motherboards' section of [here], the NEC µPD27C256 is unsuitable.
Modem7: I was able to attain an IBM 256-640 motherboard. With your assistance, I have the GLaBIOS on a 27256 chip setup for my 64-256 motherboard. I wanted to know if the BIOS developed for the 64-256 motherboard would work with the 256-640 motherboard, or if there is a similar web source housing the GLaBIOS that accommodates the U18 for the 256-640 motherboard?
 
Modem7: I was able to attain an IBM 256-640 motherboard.
- Which will have one of the 1986 dated IBM BIOS'.
- The version of Cassette BASIC is the same as what is on the 64-256KB motherboard.

With your assistance, I have the GLaBIOS on a 27256 chip setup for my 64-256 motherboard. I wanted to know if the BIOS developed for the 64-256 motherboard would work with the 256-640 motherboard, or if there is a similar web source housing the GLaBIOS that accommodates the U18 for the 256-640 motherboard?
The situation is per post #13.
The same U18 (GLaBIOS in last quarter) that you created for your 64-256KB 5160 motherboard is also suitable for your 256-640KB motherboard.
 
- Which will have one of the 1986 dated IBM BIOS'.
- The version of Cassette BASIC is the same as what is on the 64-256KB motherboard.


The situation is per post #13.
The same U18 (GLaBIOS in last quarter) that you created for your 64-256KB 5160 motherboard is also suitable for your 256-640KB motherboard.
Thank you for answering my inquiry. Markings on the BIOS are as follows on this 246-640 motherboard: 62x0852 (U18) and 62x0853 (U19). Both are II27256 copyright 1981, 85. Not quite 1986, however, close enough.
 
Markings on the BIOS are as follows on this 246-640 motherboard: 62x0852 (U18) and 62x0853 (U19). Both are II27256 copyright 1981, 85. Not quite 1986, however, close enough.
Per [here], the 01/10/86 dated BIOS.
If you were to look at the contents of that U18, you would see "01/10/86" close to the end.
 
Back
Top