• Please review our updated Terms and Rules here

IBM PC 5150 Monitor + BIOS ROM

PorkyPiggy

Member
Joined
Jan 11, 2024
Messages
46
@RichCini and I have collaborated on reconstructing the Monitor + BIOS ROM code that Microsoft used to transfer 86-DOS binaries to prototype IBM PCs in the early days of PC-compatible DOS.

According to the notes written by Bob O'Rear (one of the core devs from Microsoft responsible for porting SCP 86-DOS to the PC), Microsoft transferred 86-DOS binaries in Intel HEX format to the prototype IBM PC via serial communication, and used the prototype PC to write them to 5.25" disks.
Start
1. Seattle Computer delivers source of QDOS and utilities on 8" QDOS formatted diskette & an absolute assembler.
2. Incorporate changes to QDOS using EDLIN + assemble into absolute code.
3. Run an encode program (written in BASIC) that converts absolute code to Intel ASCII hex format
4. Upload the encoded ASCII hex QDOS to the DEC 2020
5. BIOS for msdos written on 2020 in XMACRO-86 a cross assembler, assemble to absolute location.
6. Download BIOS + ASCII-hex encoded QDOS to Intel ISIS system
7. Encode the BIOS to Intel ASCII-hex on the Intel ISIS machine
8. Transfer the BIOS + QDOS over IBM RS232 to IBM PC prototype memory via ROM Debugger that accepts Intel ASCII hex.
9. Use IBM PC prototype debugger to write BIOS + QDOS to exact sector locations of PC prototype 5¼ diskette system
10. Repeat assembly, encoding, etc for QDOS utilities

Based on the aforementioned document and a photo of a prototype 5150, the BIOS ROM chip of prototype PCs contained both the ROM BIOS and a small monitor/debugger program. The monitor was capable of loading Intel HEX files into memory from serial ports and writing memory to disks.

After conversing with Rich, I decided to attempt the recreation of that monitor program. I had previously ported SCP's 8086 Monitor program to 8086tiny (a crude IBM PC/XT emulator somewhat similar to DOSBox), but this time it's for the actual PC.

The original 5150 ROM from April 1981 had only a few bytes of free space. Therefore, the first step was to get rid of unnecessary features to make room for the monitor. Compiling the original ROM source code was a challenging experience. I tried both MASM and ASM86, and neither worked out of the box. While they share very similar syntax, MASM is definitely smarter as it generates fewer useless NOPs, so I chose MASM. I had to remove the "AT 0F000H" and "AT 0FFFFH" from the CODE and VECTOR segments because MASM didn't accept them. However, this resulted in a huge (>64K) EXE file with relocations. Without a doubt, EXE2BIN refused to convert it to plain binary, so I had to create my own EXE2ROM utility. IBM also inexplicably hard coded various data offsets in the source, causing additional problems. After nuking CGA graphics mode and print screen support, I was left with about 2254 bytes of space for the monitor.

Porting the monitor was relatively straightforward. To align it with Bob's description, I added three commands: "H(EX) <address>," "L(OAD) <address> <disk> <head> <track> <sector> <count>," and "W(RITE) <address> <disk> <head> <track> <sector> <count>." These commands are for loading Intel HEX from the serial port to memory, loading disk sector(s) to memory, and writing memory to disk sector(s), respectively. I made the monitor work with both the keyboard/CRT and serial port 0. Outputs are sent to both the screen and serial port 0, and inputs are accepted from either, with the inputted character being echoed to both. However, I soon realized a problem - a separate port is needed for HEX file transfer, and the vanilla PC only has one port. To accommodate these PCs, I created a one-port version of the monitor that uses only the keyboard/CRT for interaction and port 0 for HEX transfer.

Demonstrations

Command execution. Commands can be entered in through both the keyboard and port 0 if you have 2 serial ports.

ROM Monitor Register Dump.png

Manual boot from disk. "L 7C00 0 0 0 1 1" loads 1 sector from disk 0, head 0, track 0 starting at sector 1 to physical memory address 0x7C00. "R CS" followed by "0000" and "R IP" followed by "7C00" sets CS:IP to 0000:7C00, the default boot sector load location. "G" continues execution at the new CS:IP location, which in this case, booted 86-DOS 0.34.

ROM Monitor Manual Boot.png

HEX transfer to memory. "L 8000 0 0 0 1 1" loads the boot sector to 0x8000, and "D 8000" performs a hex dump of the loaded boot sector. As you can see, the boot sector was originally empty (filled with the default patten F6). "H 8000" starts hex transfer from port 1 (or port 0 for the single-port version) to memory address 0x8000, and in this case I transferred a valid boot sector in the Intel HEX format over. "D 8000" generates another hex dump and you can see it now contains the boot sector code. "W 8000 0 0 0 1 1" writes the newly transferred boot sector code to disk, and "L 7C00 0 0 0 1 1" loads it from disk to another address (0x7C00). "D 7C00" verifies that that the write succeeded and "B" boots from the disk.

ROM Monitor Boot Sector Write.png

Download

"5150_mon_bios_v1.zip" has a 2-port version and a 1-port version of the ROM. The 2-port version assumes port 0 for monitor interaction and port 1 for hex transfer. The 1-port version assumes port 0 for hex transfer. Serial configuration is the exact same as PC-DOS 1.00's (2400 baud, 8N1). Source code and toolchain will be provided in the next post, I still have some code clean-up to do.

Genuine Proto PC ROM Request

This is merely a re-creation of the monitor/proto ROM, we would prefer to have an actual prototype 5150 ROM. If you have real 5150 protos, please consider dumping the ROMs! Alternatively, if you are in contact with the IBM engineers who worked on the original PC or TubeTime/Eric Schlaepfer, please leave a message here!

Sincerely,
Pig
 

Attachments

  • 5150_mon_bios_v1.zip
    13.2 KB · Views: 5
This is some awesome work from Pig and a fun project that I'm excited to be part of. Right now, I'm working on some "original" stuff like getting the ASM86 tool chain working properly. It would be great getting that done under an ISIS-II emulator, but I will likely use the semi-authentic DOS versions because it's just easier. More to come on that.

I echo Pig's request for help on obtaining a copy of the actual prototype ROM (which I believe is from December 1980). First, I think it's an important piece of history that needs to be preserved before the bits rot, and second, I'd like to see how close we got to estimating the functionality from Bob O'Rear's handwritten notes transcribed above.

@RichCini
 
I have attached the source code of the BIOS and monitor. Use MASM 1.25+ to build ROMBIOS.ASM and SCP's ASM assembler to build IBMMON.ASM. You must then combine the binaries together with a hex editor. Source code of my EXE2ROM and FIXSUM tools are in the .ZIP file too.

Sincerely,
Pig
 

Attachments

  • 5150_mon_bios_v1_src.zip
    50.6 KB · Views: 2
Back
Top