skiselev / 8088_bios

BIOS for Intel 8088 based computers
GNU General Public License v3.0
513 stars 61 forks source link

keyboard doesn't work with micro8088 #67

Open jrstrick opened 5 months ago

jrstrick commented 5 months ago

On my micro8088, with v1.0 of the 8088_bios, right before OS load, there's a moment in the startup where the keyboard_clock line goes dead and never recovers. Rolling back to v0.95, this problem does not happen.

On close examination of the at_kbc.inc in the 1.0 source, the keyboard interface is disabled in the kbc_init module. However, in the 0.95 source, there seems to be a typo in the equivalent line, wherein the keyboard interface is not disabled, but a reserved register that must be zero is set to 1. All this assuming I'm reading your chart correctly.

mov ah,01101000b ; this value is what's used in 0.95 mov ah,01110000b; this is what's used in 1.0.

That being the case, it looks very much as though the keyboard interface is not, and was never re-enabled, but the bug in 0.95 masked this by not disabling the interface in the first place.

This is assuming AT_KEYBOARD is set for the FE2010A machine. If I read the logic in bios.asm starting at line 1042, if AT_KEYBOARD is set, we call kbc_init, and skip over all the code down to line 1067. In as much as the only keyboard socket on the micro8088 is an ps/2 port, one assumes AT_KEYBOARD is set, but I'm not proficient enough with nasm and make to really know for sure.

My suspicion is that because the interface is completely disabled, the keyboard interface subsequently fails testing, throws a post code, and the bios carries on without it. The system boots, but the keyboard doesn't work.

I'll test this as soon as I can.

skiselev commented 5 months ago

I am a bit confused. Version 1.0.0 works on Micro 8088 without any issues. I have two systems - one with Faraday FE2010A chipset and another with Proton PT8010AF chipset. Also, I believe a few other folks are using it.

Micro 8088 doesn't use AT keyboard controller. at_kbc.inc does not get included when building Micro 8088 BIOS.

There is not really any testing of the XT style keyboard in 8088 BIOS... It just assumes that it works...

Now, in an XT, it is the keyboard that actually generates the clock. Although, the PC has the ability to drive the clock line low and prevent the keyboard from sending any data.

In case of Micro 8088 that would be PIC12F629 microcontroller in AT2XT converter part of the circuit that generates the clock. Perhaps is it worth checking that it is programmed properly?

When you talk about the keyboard clock, are you talking about the AT / PS/2 clock signal on the PS/2 connector or the XT clock signal between the chipset and the microcontroller?

jrstrick commented 5 months ago

Okay, now I'm really confused. If the pic12f629 wasn't programmed right, would I get any keyboard activity? As I said, everything works normally with bios 0.95.

To answer your other question, the keyboard clock stops both on the chipset line and the pic12f629.

I didn't know Bios 1.0 was known to work with the micro8088. When I asked on retrobrew, the only response I got was someone else having similar problems, and searching on it gave me an old discussion between you and WBW about the keyboard system being messed up.

I should mention that my micro8088 has the FE2010 chipset (without the A). I'm going to try re-flashing to 1.0 and see if the problem persists. I've changed video cards since then, and my old card was plenty flakey.

jrstrick commented 5 months ago

To follow up, I reflashed with 1.0, reflashed the pic12f629 with the version of at2xt found here: https://forum.vcfed.org/index.php?threads/at2xt-keyboard-converter.26861/page-4, and got exactly the same result as before. The system boots, the faster startup chime happens, but the keyboard never works.

Question: is bios 1.0 starting up in turbo mode? I have the slower oscillator and my cpu/fpu are only good to 8mhz, if that.

Correction, my cpu is an 8mhz fujitsu part, but my fpu is a 5mhz intel part. More followup when my shipment of flash chips arrives, so I can test without screwing up my working bios.

jrstrick commented 4 months ago

Followup: Working bios 1.0.0 achieved.

After some study of the differences between bios 0.9.5 and 1.0.0, I saw some low hanging fruit. In config.inc, on lines 99 and 100, I commented out the AT_RTC configurations. Not a huge sacrifice for me, since I don't have an RTC in this system.

The result is that the speaker tick that announces that my keyboard clock has been pulled high and left there no longer happens, and my keyboard works as advertised.

What I'm unclear on is why.

Plausible (to me) explainations:

My FE2010 (not the A rev) does not support AT_RTC. This would be invisible to you if you only have the A rev and the Proton chipsets.

My FE2010 is defective. It is, after all, an Ebay part. Heaven only knows what it's been through. It's perfectly functional in all other respects, however.

If either of these two is (in your opinion) correct, I'll replace the chipset with a proton, in the interest of not having to customize the bios every time it updates.

It's also possible there is some other subtle hardware defect in my build that makes AT_RTC hang the keyboard controller when it should not. As I have no other defects observed in the system, this seems unlikely to me.

I don't run my system in turbo mode, as my 8087 is a 5mhz part, so that may be masking other hardware defects on my build. Anyway. At this point, I have a working bios. We can close this issue if you don't feel it's useful.

jrstrick commented 4 months ago

Appears to be hardware weirdness on my micro8088

skiselev commented 4 months ago

Sorry, it looks like I neglected to follow up on this issue. I just saw your thread at the RetroBrewComputers.

Probably you're the first person to try using the FE2010 (without the "A") chipset... It is quite possible that the issue that you're observing related to this chipset. As I mentioned previously, I tested the FE2010A chipset and the PT8010AF chipset... Likely, the problem is related to the RTC auto detection, rather than to the RTC code itself. The RTC auto detection code would write port 70h and read/write port 71h. It is plausible that FE2010 does not fully decode the I/O addresses, and instead of writing ports 70h/71h actually writes ports 60h/61h messing up with the keyboard function...

I am wondering if there is a way to detect the FE2010 vs. FE2010A. Perhaps we can try using the Configuration Register?

jrstrick commented 4 months ago

I've since switched out the FE2010 for the Proton chipset, (as well as the clock crystal, CPU and FPU) so I could run at 10mhz NECv20 speeds. I'll happily send you the FE2010 if you'd like to do further testing. I only intend to build one of these things. :)

In the process, I found a bent pin in my socket. I'm not sure whether this had anything to do with the original problem, or indeed at what point the pin got bent.

I have also not tried the un-edited BIOS since I switched chipsets, as I do not have an RT clock in my system. Syncing with SNTP over ethernet (one of your boards also) has been more than sufficient. I'll try swapping my BIOS rom back to the full version this weekend.

skiselev commented 3 months ago

I'll be more than happy to accept the FE2010 :) Can exchange it for something... e.g. I plan to make some RTC8088 boards. Maybe you'll want a PCB and a SPLD?

jrstrick commented 3 months ago

Sorry for the long delay. With the Proton chipset (and a 10MHz V20/8087 upgrade) and the stock BIOS, my keyboard works properly. Definitely looks like the FE2010 has problems. I'd be delighted to exchange it for an RTC8088 board with the 16v8. I think you have my contact information from when I bought an Ethernet board from you some months back. If not, can github do PMs?