• Please review our updated Terms and Rules here

Modify XT BIOS to replace monitor and keyboard using UART port

NicolasF

Experienced Member
Joined
Jun 28, 2006
Messages
255
Location
Argentina
Hi,

I recently bought an XT with no monitor or keyboard. Where I live hercules monitors and XT keyboard are very difficult to find and therefore very expensive. So I'm thinking about modifying int 10h and int 09h so that any text that is displayed on screen is sent to the UART port. Do you guys think this will work? I would like to be able to test the system to see if it works until I'm able to find a working monitor and keyboard. What do you think the easiest way would be? I'm guessing that I should find a source code for a BIOS instead of trying to disassemble the original one that the machine has, right?

Thanks!
 
I have no idea of what would be required on a PC or XT or any limitations that might prevent success, but I do know that some fairly modern computers, for example x86 based servers, definitely have the option to have the POST, setup, and limited OS functionality over serial instead of VGA and keyboard. An OS like Linux can then be configured to redirect the primary console to the serial port as well. This allows you to create an “appliance” type of system where the only thing you need to configure it is a laptop with a usb to serial cable. I’ve even seen one embedded x86 server module that had a mini USB port on it and it was detected by laptop was a usb to serial, so all you needed was a short USB cable and the driver.
 
There is also the RBG2HDMI device too. So with the XTtoAT (PS2) two modern converters would get the job done.

Another option for video would be a CGA card with composite out. Some clones have this if the original IBM card is too hard to locate.
 

Same converter I am using currently , till I repair one of my XT keyboards.
 
And if you go VGA route, an OAK based card is most likely the cheapest option, and works well enough. Here's a cheapish one.

 
Why not grab a VGA card and use a modern monitor for now, and as far as the keyboard goes, there are AT to XT keyboard converters.
VGA ISA 8bit cards here are imposible to find. But I could buy one of these cards: Beltron / Realtek Cg-3105 256kb, Oak Oti-077 1Mb, Cirrus Logic CL-GD5401-42QC
I'm not sure if they are 8bit ISA compatible.
 
Yes--modifying the BIOS in and of itself to use serial I/O is no guarantee that even the bulk of programs will run correctly, as hardware access for display had become very common (scrolling of text, for example, using Int 10h services was very slow).
One approach was to implement a replacement for a display card that had its own memory and Z80 processor to map MDA direct-hardware access to serial port operations. I worked for a time as a contractor with a small firm that did exactly that (still have a couple of the cards). The target was a VT100-compatible terminal; one could even split-screen between a remote host computer and the PC. It was fascinating to use, but failed because of the increasing use of graphics, not text. EGA killed it for good.
 
While ago, I implemented INT 10h and INT 16h emulation using serial port for the SBC-188 project.
It should be possible to modify it to work in a regular PC, and create a BIOS extension ROM out of it.
BIOS Source (see int10ser.asm and int16ser.asm)
Of course, this will work as long as the applications use DOS / BIOS for the input and output. Most DOS utilities, especially with text interface do. Most 3rd party, menu driven applications don't...

As Chuck mentioned above, more compatible approach would be implementing a hardware card with display buffer, a CPU and a serial port (makes me want to do that... should I add yet another project to my long projects list?!)
 
As an aside, now that I think about the project work I did nearly 40 years ago, we also took the keyboard output of the VT100 terminal and translated it into XT keyboard info, feeding it into the XT keyboard jack. I think I still have a floppy with the code on it--somewhere. Used the Avocet cross-assembler to digest it.
 
should I add yet another project to my long projects list?!)
My opinion: no. Some questions come to my mind:
- how many people want to use it?
- which video system should it emulate?
- what about the keyboard?
If people want to use it for testing a system, IMHO they are better off with a BIOS that does the job.

And your time is much too valuable for other more important projects :)

(still a happy owner of a XI-8088 system)
 
My opinion: no. Some questions come to my mind:
- how many people want to use it?
- which video system should it emulate?
- what about the keyboard?
If people want to use it for testing a system, IMHO they are better off with a BIOS that does the job.

And your time is much too valuable for other more important projects :)

(still a happy owner of a XI-8088 system)
I am happy you're still enjoying Xi 8088 :)

As for the project, I have some IDC7134 dual-port RAM, Z80 CPUs, some 32KiB SRAM and Flash/EEPROMs... basically most of the things needed for such a card. Just add address decode logic.
My thinking is to emulate MDA only (it is possible to extend to CGA, but some trickery would be required to implement 16 KiB display buffer).
As far as keyboard goes - there are two options:
- Emulate the keyboard - actually provide a connector that would plug into the XT keyboard connector. Shouldn't be that difficult really - 2 GPIOs? This is the preferable way, as it won't require any software on the system
- Have a software emulation - a driver that would read the data from the card and write it to the keyboard buffer in the host system

But yeah, I might put it on the project list, and do it whenever I have no other things to do
 
What do you think the easiest way would be?
Just spending your way out of this is good advice.

But if you like coding... you can just ignore the system ROM entirely and implement your solution as an option ROM. This can be a physically separate ROM you shove into any ISA card with an option ROM socket. This has the advantage of being something anyone interested can reproduce and use. It also is something you should be able to make work on a hardware emulator - you may not actually need a physical machine to develop the majority of the code. There are challenges: you need to allocate memory, you need reliable time slices to manage your UART, etc... but you could create a software only screen scraping tool that takes changes and output them to, say, a VT-100 terminal, and you need a failsafe refresh for when the depth of the tracked changes gets too insane. But its all just lots of fairly easy pieces.
 
This code seems to be using 386+ instructions. Some effort would be required to port it to 8086 only instructions
Yes, but it's a starting point and functionally quite close to NicolasF wishes. At least as far as an Option ROM emulating the BIOS calls can go.

VGA ISA 8bit cards here are imposible to find. But I could buy one of these cards: Beltron / Realtek Cg-3105 256kb, Oak Oti-077 1Mb, Cirrus Logic CL-GD5401-42QC
I'm not sure if they are 8bit ISA compatible.
Many 16-bit VGA cards (especially older ones) will work fine in an 8-bit slot. Just try any card you can find, and you may get lucky. Personally, VGA is (almost) a must-have, because it resolves the monitor problem and opens up new worlds. Even if the performance in higher resolutions is abysmal, the ability in itself is useful to me.

Where I live hercules monitors and XT keyboard are very difficult to find and therefore very expensive.
For testing purposes, you can use a cheap logic analyzer and a fast modern computer. The pixel clock of MDA/CGA/EGA is approximately 16 MHz, which these devices can sample in realtime. You can look at [this thread] or at the [more extensive thread] over at VOGONS. Source code (and executables) are available there.

While XT keyboards are rare, many older AT keyboards have a switch for "XT mode". Otherwise, going for a converter is probably the easiest way, and it would allow you to use new keyboards (many USB keyboards support PS/2 compatibility as well).

So I'm thinking about modifying int 10h and int 09h so that any text that is displayed on screen is sent to the UART port. Do you guys think this will work?
Yes, you can do that (see the SGABIOS). Obviously, many applications will use direct hardware access and fail. If you have a working video card, you can also read the screen content from video memory and turn that into ANSI escape codes to send over serial. This should allow you to use any text-mode program (unless the program does weird stuff to the hardware).

I would like to be able to test the system to see if it works until I'm able to find a working monitor and keyboard.
You can instruct DOS to input/output to a serial port using the following commands (also works from AUTOEXEC.BAT):
Code:
MODE COM1:1200,N,8,1
CTTY COM1

However, this only redirects the DOS I/O streams, so compatibility is even worse than redirecting at the BIOS level. If you can run DOS successfully, programs to scrape the screen content exist. Setting them up without a monitor or keyboard may be painful, though (use an emulator).
 
The VGA card Realtek RTG-3105E works perfectly! and the machine detects the ST-238R and boots fine! now all I need is to emulate the keyboard. I'm thinking about using an Orange Pi PC Plus that I have. The idea would be to use the GPIO pins to generate the XT keyboard scan codes, it doesnt seem to be that hard. So I'm going to abandon the idea of redirecting the monitor interrupt to the serial port. Thank you all for your ideas!
 
Back
Top