• Please review our updated Terms and Rules here

GLaBIOS on the QX-16

brijohn

Experienced Member
Joined
Jul 18, 2021
Messages
234
Location
Michigan
So this is one of the things I started working on recently. Rather then trying to disassemble and modify the existing Epson BIOS used with the 8088 processor, I have decided to try porting GLaBIOS, an open source 8088/XT bios, to the QX-16. The biggest changes needed to get things working were a custom keyboard interrupt/handling routine as well as serial port handling. The graphics is required very little changes since it has a fairly compatible MDA/CGA graphics board. Since the ROM on the QX-16 is 16k in size i'm able to add some additional features such the RTC support that is not built into GLaBIOS, as well as put a small copy of TinyBasic compiled into the ROM as well. I also intend to add IDE support to hopefully allow it to boot from my CompactFlash adapter as well.

Currently i have yet to try booting on real hardware, my testing during development was done on my also work in progress QX-16 emulation in MAME. But it does boot up and sucessfully give me a command prompt using Epson's MS-DOS 2.11 disk image, so hopefully it should work on my real QX-16 when i get the chance to test it.
 

Attachments

  • glabios_qx16.png
    glabios_qx16.png
    191.9 KB · Views: 22
That is actually really cool. Are you planning to put MSDOS in ROM like they do for the QX-11 ?

In order to improve the QX-16 compatibility with a regular PC I been doing some system modifications in my QX-16. To mention one, I wrote a tiny application that will override INT 74 forcing the BIOS to make an INT 9 call after processing each keystroke. That allows any IBM compatible program that overrides the IBM's keyboard interrupt 9, to work on the QX-16.

Epson is already doing something similar for INT 8 (machine timer). The QX-16 msdos is already overriding EPSON int 71 so it calls int 8 at every timer tic. Something similar may be necessary for the Seiral and Parallel port interrupts.

Instead of making it a resident application as I'm doing right now, those changes could easily be part of the BIOS.
 
In order to improve the QX-16 compatibility with a regular PC I been doing some system modifications in my QX-16. To mention one, I wrote a tiny application that will override INT 74 forcing the BIOS to make an INT 9 call after processing each keystroke. That allows any IBM compatible program that overrides the IBM's keyboard interrupt 9, to work on the QX-16.
That is actually one of the things i am doing inside GLaBIOS. I still use Vector 74 for the keyboard handler but it calls INT 09 to process each key, with INT 74 just handling housekeeping.

Are you planning to put MSDOS in ROM like they do for the QX-11 ?
Probably not. I don't think there is enough room i only really have around 8k, but am using some it for additional extensions RTC, IDE, keyboard translation tables, etc. Even without tiny basic i probably only have 6-7 left.

Epson is already doing something similar for INT 8 (machine timer). The QX-16 msdos is already overriding EPSON int 71 so it calls int 8 at every timer tic. Something similar may be necessary for the Seiral and Parallel port interrupts.
So the timer is interesting, it actually ticks twice as fast as the standard PC timer, in the original BIOS Epson went and adjusted the tick value during calls to the set/get system ticks interrupt. I'm actually only calling INT 08 in GLaBIOS every other tick.

The serial interrupts are disabled by default in the original Epson BIOS and the standard INT 14 just does polling. However it does seem to support interrupt driven serial if you enable them on the 7201. In this case from what i can tell i think INT 74 will if it triggers for the RS232 port, rather then the keyboard, will call INT 7F. Be default INT 7F is just an IRET, so a user who wanted to use interrupts with the QX-16 could install their own INT 7F vector and then enable the serial interrupts.
 
That is actually one of the things i am doing inside GLaBIOS. I still use Vector 74 for the keyboard handler but it calls INT 09 to process each key, with INT 74 just handling housekeeping.


Probably not. I don't think there is enough room i only really have around 8k, but am using some it for additional extensions RTC, IDE, keyboard translation tables, etc. Even without tiny basic i probably only have 6-7 left.


So the timer is interesting, it actually ticks twice as fast as the standard PC timer, in the original BIOS Epson went and adjusted the tick value during calls to the set/get system ticks interrupt. I'm actually only calling INT 08 in GLaBIOS every other tick.

The serial interrupts are disabled by default in the original Epson BIOS and the standard INT 14 just does polling. However it does seem to support interrupt driven serial if you enable them on the 7201. In this case from what i can tell i think INT 74 will if it triggers for the RS232 port, rather then the keyboard, will call INT 7F. Be default INT 7F is just an IRET, so a user who wanted to use interrupts with the QX-16 could install their own INT 7F vector and then enable the serial interrupts.
I used this mappings for my experiments on the qx16 box and used the same approach for the qx11 mame driver.. Epson basically maps the irq controller starting by the master controller irq 0 to int 70 ...

I also did test overriding INT 7A to test running a task every time the rtc raises its irq and it did work perfectly. By default INT 7A points to an iret.
 

Attachments

  • Screenshot_20260408_170720_Samsung Notes.jpg
    Screenshot_20260408_170720_Samsung Notes.jpg
    85.1 KB · Views: 13
This is awesome! If there's anything I can do to help let me know.

640KB
 
That is actually one of the things i am doing inside GLaBIOS. I still use Vector 74 for the keyboard handler but it calls INT 09 to process each key, with INT 74 just handling housekeeping.


Probably not. I don't think there is enough room i only really have around 8k, but am using some it for additional extensions RTC, IDE, keyboard translation tables, etc. Even without tiny basic i probably only have 6-7 left.


So the timer is interesting, it actually ticks twice as fast as the standard PC timer, in the original BIOS Epson went and adjusted the tick value during calls to the set/get system ticks interrupt. I'm actually only calling INT 08 in GLaBIOS every other tick.

The serial interrupts are disabled by default in the original Epson BIOS and the standard INT 14 just does polling. However it does seem to support interrupt driven serial if you enable them on the 7201. In this case from what i can tell i think INT 74 will if it triggers for the RS232 port, rather then the keyboard, will call INT 7F. Be default INT 7F is just an IRET, so a user who wanted to use interrupts with the QX-16 could install their own INT 7F vector and then enable the serial interrupts.
While working with the QX-11 I found out Epson put a group of Jumpers in the QX-11 motherboard to select the size of the ROM chips the QX-11 uses, you could select EProms ranging from 16k up to 128kb.

I was reading the QX-16 technical documentation to see if there was an equivalent jumper on the Qx16 to do the same, but what I did realized is that there is no such jumper in the qx-16 but the documentation says the ROM could be an 8,16 or 32K eprom. Looking at the motherboard the ROM socket is actually labeled as 2764/128/256

When toy mentioned you only have 8k left, is that trying a 32K EEPROM(27256) on your QX-16 for the GLA-BIOS?
 
The 8k was assuming the default 16k rom that is used.

Interesting that it has jumpers to allow a 32k rom as well. If i run out of space in the 16k rom, i can see if i can get a a 32k rom image working.
 
The 8k was assuming the default 16k rom that is used.

Interesting that it has jumpers to allow a 32k rom as well. If i run out of space in the 16k rom, i can see if i can get a a 32k rom image working.
on the qx16 I couldn't find any jumpers, I believe the rom socket is just wired to take a 32k rom...(if you use a 16kb the 16k rom will simply ignore a15)
 
So i now have an initial version of the GLaBIOS ROM available for the QX16 now, available at https://github.com/brijohn/GLaBIOS/releases. I still have some room left in the 16k rom if needed, but as of now it will fully boot and come up in MSDOS supports the RTC and my CompactFlash Adapter and i have successfully booted msdos from the CF adapter as well. It also supports embedding a basic/monitor (up to 4k) into the rom that can be booted into by setting dip switch 2 to the off position. One thing that is not curenntly implemented is that when you set the dip switches to the QX-16 native video position, in the original BIOS this would disable and unmap the icrt board from memory and make the bios use the upd7220 board for video output, in GLaBIOS it just interrperts this as another setting for MDA video.

The colors on my system are currently slightly off since i seem to have a broken conductor on my rgb2hdmi cable for the blue channel.
 

Attachments

  • PXL_20260824_142937056.jpg
    PXL_20260824_142937056.jpg
    1.6 MB · Views: 9
Small update to my QX-16 port. I added a custom INT10 video mode 40h that sets up 640x400 2 color graphics mode. I also now send the timer EOI during INT 71 rather then INT 08. This fixed an issue with how the SCI interpreter was hooking INT 08 but sending its own EOI to IBM's timer port leaving leaving the timer interrupt unresolved.
 
for INT 10h I created a TSR that hooks the interrupt and adds the 40h video mode. It works well, but having it directly in the BIOS is definitely cleaner and more transparent. It also has the nice side effect of making the QX-16 compatible with the Olivetti M24 / AT&T 6300 640×400 mode, so software that already supports that video mode can use it.

Related to the timer, I had to do something similar for INT 08 so the SCI game runs on the QX-11. On the QX-11, INT 71h runs at around 400 Hz, and the BIOS calls INT 1Ch every 22 ticks (400/22 is 18.18 hz, almost the same rate IBM calls INT 1C). The QX-11 doesn't really have an IBM-compatible INT 08h handler, though, so I wrote a TSR that provides one. I can also select the rate with something like /2, /3, etc. to run INT 08h at multiples of the normal IBM PC rate.

Having a different interrupt number for the keyboard is what brakes the keyboard on an SCI too. SCI normally hooks INT 09h directly, but Epson uses INT 74h for the keyboard on the QX-16 and INT 75h on the QX-11. Instead of trying to emulate the IBM keyboard interrupt, I changed the SCI keyboard driver to leave the Epson interrupt handling alone and just read the keyboard through INT 16h. That ended up working very well.

I want to get one of those One ROM devices to test a few things, and one of those things is your customized GLaBIOS for the QX-16.
 
With GLaBIOS now able to allow the QX-16 to natively handle finding and booting from the MS-DOS partition i have modified my older cfide.sys driver to scan for partition type 4 on the compact flash drive (rather then 01). The issue with just relying on GLaBIOS's cf support is that int 13h will only see a max of 32MB for your drive, this is due to the cylinder count being limited to 10 bits and not wanting to change head count as it would no longer be compatible with the CP/M side of things. So instead for CF cards larger then 32MB you can make additional partitions (also limited to 32 MB) of type 04 that are invisible to the BIOS but which can be accessed via the cfide.sys driver allowing for more storage on MS-DOS. My msdos 2.11 disk image in my repo has been updated with the newer driver as well as a QXPART.COM that allows creating these extra partitions inaddition to the original set of msdos/cpm/valdocs partitions.
 
Back
Top