• Please review our updated Terms and Rules here

5160 BIOS Source Code

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
I recently aquired an EPROM programmer from Chuck(G) (Thanks Chuck!), an el-cheapo Chinese UV EPROM eraser and a hand full of 27C256-20 EPROMS. So, I'm thinking I'd like to tweak the BIOS a little on my 5155. My first goal is to modify the POST to eliminate the test routine that causes the floppy drive head carriage to seek back and forth, this can be pretty noisy on a 5155 and causes unnecessary wear and tear on the stepper motor and carriage rails on both floppy drives. Most non-IBM BIOS's just turn on the motor on drive A and check to see if there is a disk to boot. My second goal is to change the routine that initializes the parallel port(s). I have a parallel port that I modified for bi-directional commuinication which works well with one exception. If the port is left in "recieve" mode when a CNTRL-ALT DEL is performed, the port is not initialized durring the reboot and the only remedy is to cycle the power switch. I've searched HI and low for the source code and have only found it in PDF documents that were scanned from the IBM Tech Ref. Obviously, these can not be compiled, and I haven't found a utillity that can reliably convert a PDF to text with zero errors, and I'm not to thrilled to try to Re-type over 2000 lines of code.

So, I'm hoping someone could help me find a text file (preferably with comments) that could be compiled with somthing like Microsoft Macro Assembler 3.01. I would prefer the 05/09/86 version of the IBM XT BIOS but the earlier versions would be OK if that's all that's available.

Thanks in advance

Greg
 
Last edited:

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
Wow,
That was quick thanks PLASMA! I'll give that one a try.
Would you be able to direct me to newer releases?

Edit:
It appears that the listing isn't quite complete. The file ROMEQU.ASM is needed. Note the "include romequ.asm" statement near the top of the listing. Now I think I can type it in from the IBM Tech Ref. It is about 200+ lines of code. A whole lot less than 2000!

Also, still looking for later versions.
 
Last edited:

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
I don't know of any other plain-text versions of the IBM XT BIOS, sorry. If you don't mind a non-IBM BIOS, I have a documented and modified PC/XT BIOS on my site here:

http://www.phatcode.net/downloads.php?id=101

It includes everything you need to build it.

I've tried that one. Either I'm not building it right, or it's a little buggy. Certain drivers won't load correctly when running with that bios. Namely microsoft's networking client IFSHLP.SYS and sound blaster driver that I can't remember the name of. Complains that IRQ vector is not available. If these problems can be fixed, it would be a great bios for my 5155. But I'm less than a beginner with Assembly programming, so I won't be able to get these buggs worked out for some years to come. That's why I would rather work with IBM source.
 

per

Veteran Member
Joined
Jan 21, 2008
Messages
3,006
Location
Western Norway
Edit:
It appears that the listing isn't quite complete. The file ROMEQU.ASM is needed. Note the "include romequ.asm" statement near the top of the listing. Now I think I can type it in from the IBM Tech Ref. It is about 200+ lines of code. A whole lot less than 2000!

The entire listing, including what would be ROMEQU.ASM, can be found in the IBM XT technical reference manual. The ROMEQU.ASM-part is only about 2 pages long, and can be typed into a file easily.
 

Plasma

Veteran Member
Joined
Nov 7, 2005
Messages
1,299
I've tried that one. Either I'm not building it right, or it's a little buggy. Certain drivers won't load correctly when running with that bios. Namely microsoft's networking client IFSHLP.SYS and sound blaster driver that I can't remember the name of. Complains that IRQ vector is not available. If these problems can be fixed, it would be a great bios for my 5155. But I'm less than a beginner with Assembly programming, so I won't be able to get these buggs worked out for some years to come. That's why I would rather work with IBM source.

If you can give me more details on your setup (expansion cards, IRQs used, DOS version, contents of CONFIG.SYS/AUTOEXEC.BAT, etc.) I will see if I can replicate your problems and find a fix.
 

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
If you can give me more details on your setup (expansion cards, IRQs used, DOS version, contents of CONFIG.SYS/AUTOEXEC.BAT, etc.) I will see if I can replicate your problems and find a fix.
I'll do that. I really like your BIOS and would be thrilled to get it working completely on my machine, although it might take me a while to compile all the info for you. I might try taking it down to a minimal setup first. Right now there is quite a bit goin on in that old 5155, in the mod department. 640k (actually 1 Meg) on the motherboard, a custom programmed GAL in U44(memory decoder) that that lets me use ram in the D000h-EFFFh range as UMB, Ega wonder version 1, Sound blaster16, Intel Ether-express network card, AST Hotshot 286 accelerater with a 80286 at 10mhz and a 80287, NEC V20, 8087, parallel/serial card, Original floppy controller, Silicon Valley Computer ADP50L IDE CONTROLLER WITH CF TO IDE ADAPTER AND CF Card operating as drive C. As you might guess, this leaves me with no IRQ's left. In fact, the Sound Blaster is useing IRQ 2 and the EGA Wonder is not using an IRQ. This setup works with the IBM 5-86 BIOS and PC DOS 7. But with Super PC/Turbo XT BIOS, Microsoft Network Client for DOS Hangs when loading IFSHLP.SYS in config.sys and Sound Blaster SBFMDRV.COM complains about no interrupt vector available when loading in autoexec.bat and refuses to continue loading. I'll try to get my config.sys and autoexec.bat files posted as soon as possible. Maybe I'm Trying to get to much out of this old machine, but that's the main thing that keeps me interested, trying to push the envelope on performance without replaceing the motherboard or modifying the outward appearance.
 

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
Have you tried using the 5160 BIOS as-is? Does it work? Then the printer port issue should be pretty simple to solve.
Yes, I've been using the 05-09-86 version of IBM 5160 BIOS and it works great except for the modified parallel port issue. Also, as I mentioned, I'd like to elliminate the head carriage seeking of the floppy drives durring POST.
 

Plasma

Veteran Member
Joined
Nov 7, 2005
Messages
1,299
I'll do that. I really like your BIOS and would be thrilled to get it working completely on my machine, although it might take me a while to compile all the info for you. I might try taking it down to a minimal setup first. Right now there is quite a bit goin on in that old 5155, in the mod department. 640k (actually 1 Meg) on the motherboard, a custom programmed GAL in U44(memory decoder) that that lets me use ram in the D000h-EFFFh range as UMB, Ega wonder version 1, Sound blaster16, Intel Ether-express network card, AST Hotshot 286 accelerater with a 80286 at 10mhz and a 80287, NEC V20, 8087, parallel/serial card, Original floppy controller, Silicon Valley Computer ADP50L IDE CONTROLLER WITH CF TO IDE ADAPTER AND CF Card operating as drive C. As you might guess, this leaves me with no IRQ's left. In fact, the Sound Blaster is useing IRQ 2 and the EGA Wonder is not using an IRQ. This setup works with the IBM 5-86 BIOS and PC DOS 7. But with Super PC/Turbo XT BIOS, Microsoft Network Client for DOS Hangs when loading IFSHLP.SYS in config.sys and Sound Blaster SBFMDRV.COM complains about no interrupt vector available when loading in autoexec.bat and refuses to continue loading. I'll try to get my config.sys and autoexec.bat files posted as soon as possible. Maybe I'm Trying to get to much out of this old machine, but that's the main thing that keeps me interested, trying to push the envelope on performance without replaceing the motherboard or modifying the outward appearance.

I'm fairly certain I found the problem...I'm guessing you built the BIOS with the fast memory check enabled. When this happens the IVT is not "zeroed" out and so SBFMDRV and IFSHLP think there are no free interrupt vectors. (They are looking for vectors set to 0.) I have a turbo system so I don't normally use the fast memory check option and never noticed this. So thanks for bringing it to my attention :)

I have a new version up now if you want to try it out.
 

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
I'm fairly certain I found the problem...I'm guessing you built the BIOS with the fast memory check enabled. When this happens the IVT is not "zeroed" out and so SBFMDRV and IFSHLP think there are no free interrupt vectors. (They are looking for vectors set to 0.) I have a turbo system so I don't normally use the fast memory check option and never noticed this. So thanks for bringing it to my attention :)

I have a new version up now if you want to try it out.
Great, I'll try it out in the next day or two. Your assumption that I had used the "Fast Memory Check Option" was correct. So, should I abandon the fast memory check, or should I try the new version with the "Fast Memory Check Option" enabled? Also, can I put ROM Basic on one 32k chip in U19? If so, does the bios need to be changed to work with Basic on one chip? I have been putting the bios on a 32k chip(27c256) in U18 (using the \xtbios21\EPROMS\27256\PCXTBIOS.ROM). I used \xtbios21\IMAGES\BASICC11.BIN for the 32k chip in U19. But if I press the space bar when prompted durring boot, the system freezes. Not sure if this is because it expects BASIC to be on 4 8k chips or is this another symptom of the interrupt vector problem?
 

Plasma

Veteran Member
Joined
Nov 7, 2005
Messages
1,299
Either way should work. But I would recommend using the new version with fast memory check enabled since it will boot faster. I just updated the make batch to generate special 32K ROMs for the 5155/5160. Because U19 is mapped to F000h and U18 is mapped to F800h, BASIC is split across U18 and U19 because it needs to start at F600h. The new batch file will generate U18.ROM and U19.ROM for you, in the EPROMS\IBMXT folder.
 

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
Does the 4 here need to be changed to 2, since basic will now be on two roms instead of 4? Sorry, I couldn't get the tabs to work in my reply window. But hopefully you can understand what I'm trying to refer to.


@@high_vectors:
movsw ; Set interrupt vector offset
mov ax, cs
stosw ; Set interrupt vector segment (BIOS segment)
loop @@high_vectors
mov ax, 0F600h ; ax --> ROM BASIC segment
mov ds, ax ; ds --> " " "
xor bx, bx ; bx = ROM BASIC offset
mov ah, 4 ; Four BASIC ROMs to check

 

Plasma

Veteran Member
Joined
Nov 7, 2005
Messages
1,299
Nope. The BIOS only cares about the location of BASIC in memory, not how many actual chips it is on.
 

ibmapc

Veteran Member
Joined
Apr 5, 2010
Messages
1,030
Location
Albany, OR USA
Plasma,
Looks like the interrupt vector issue is solved. I programmed a couple of 27c256's and plugged 'em into u18 and u19 and it booted up perfectly. IFSHLP.SYS loaded ok and so did SBFMDRV.COM. Also, ROM BASIC comes up perfectly when the space bar is pressed durring the pause at startup.

Now for the not so good news. Dos Navigator version 1.51 doesn't respond to input from the keyboard after it is started. The Control, Alt, and Shift keys cause the menu selections to change but none of the other keys work, and after enough key presses, the speaker starts to chirp as the buffer fills up. If you're not familiar with Dos Navigator, it can be found HERE. It's a very powerefull dos shell that ran great with IBM BIOS and a minimum V-20 proccessor. I don't think it will run on a 8088.

Let me know if you need more info, and / or if you figure out the problem.

Thanks for your help. I think "Super PC/Turbo XT BIOS" is great!! It could be super great if this issue is fixed!!

P.S.
I built the bios with MAX_MEMORY = 640, FAST_MEM_CHECK = 1, BOOT_DELAY = 3, all other options dissabled. I also tried it with the KEYB_SHIFT_FIX enabled, but that didn't make a difference. Just a shot in the dark.
 
Last edited:

Plasma

Veteran Member
Joined
Nov 7, 2005
Messages
1,299
Sorry I haven't had a chance to look at this yet. I will try to have something for you by Saturday.
 

Plasma

Veteran Member
Joined
Nov 7, 2005
Messages
1,299
Ok, I found the problem. DOS Navigator calls enhanced keyboard functions which are only found in the 1986 XT and later BIOSes (Int 16h ah=10h/11h). The 1982 IBM XT BIOS as well as all other clone BIOSes I tested (Phoenix, Award, and DTK) have the same problem with DOS Navigator because they do not support the enhanced functions either.

However since my BIOS doesn't discard extended scan codes, this is easy to fix. I just mapped the enhanced functions to the standard ones, problem solved. :) I did a quick test with DOS Navigator and it seemed to work fine. The new version is up on my site, let me know if you find any issues.
 
Top