ESP8266 PCXT Emulator Build Notes
Note: This has been made 100% functional by WS, project at:
WS's code works, and I will probably not be going further on any development here. I may attempt to add keyboard out capabilities so that more keyboards will work properly and other BIOS's that require a working keyboard can be used. This might require changing GPIO assignments and may also require removing the serial I/O emulation. The ESP8266 has many "gotchas" on the GPIO's and what you can do with them (and when, especially in the boot process).
Pics or it didn't happen, so I added photos of WS' code working. I made a case for my project over Christmas. I couldn't get the nice 1/4" oak that I use for project boxes so I used poplar. Because of my "old school" construction techniques, ways, and equipment, I used a MAX232 to convert the serial I/O to RS-232 and a DB-9 connector.
I saw this project here on Hackaday ( https://hackaday.com/2018/02/26/pc-xt-emulator-on-esp8266/ ) and I just had to try it, to complement my 8008 and 8080 ESP8266 emulators. For you "kids", the original PC or PCXT with any kind of RAM or disks was very expensive, way beyond what a young person would buy straight out of college such as myself. The only way I could afford one was to solder up a bare board with parts, install it into a wooden box, build a (linear) power supply for it (I didn't have a prayer of building a switcher from scratch 35 years ago), get a (quite expensive) CGA card for it, and hook it up to a surplus black and white "monitor" that I had (which was basically de-contented, tuner-less 9" Admiral TV guts inside from the late 1960's). So, this machine emulates my first PC fairly closely.
The emulator works, and it's amazing. The video is pretty darned good on my 9" Sony studio monitor. The circuit on MCUhacker's website is missing a value for the output cap; I used 100uF and the video was fine. The video code itself will be very useful for me in other projects, although I can't believe that it would be compatible with highly interrupt driven WiFi (but, who knows). The emulator version posted on MCUhacker's site is incomplete and has a few oddities and bugs. I thought that I'd try to "fix" (i.e., "hack") it with my limited skills.
I had a bit of compiling trouble due to some formatting issues in the code, but I straightened those out. I could not get the boot to MS-DOS working, but I'm saving that for last.
I knew that the keyboard was missing, so I thought that I'd put together some PS/2 code, and then combine it with a PCXT converter (both of which exist on GitHub). This was trickier than expected. The PCXT code was missing some key translations, so to speak, so I added them; a bigger problem was the levels between the +5 keyboard and the 3.3V of the ESP8266. Nonetheless, with 200 ohms between them and 4.7K pull downs at the ESP8266, I believe that I got this to (mostly) work, by making "fake open collector" outputs at the ESP8266. The keyboard pulls up to +5 through probably 10K resistors; when I want a "1" on the line, I turn the ESP8266 into an input and those resistors pull up to +5; when I want a 0, I turn it into an output which "shorts" the resistors to low. The keyboard to ESP communication works OK, but I cannot get the communication working yet from the ESP to the keyboard. Nonetheless , it worked, although the code is "big" and pushed the already strained size of the emulator up to using 88% of the RAM (although the tables are in ROM). I will work on shrinking this later.
The keyboard code was integrated into the emulator code via new "ports" for 0x60 and 0x61 (the 8155). I removed the fake int 16 handler. The "boot self test" 0xAA keycode creating procedure was also written.
After doing this, I can report that the emulator's speed is rather good computationally and good in writing video through int 10h (through direct RAM access,...
Hi Steve. Hope everything is going well. Just came across your article and happy to realise that someone was actually doing the same thing as what I have been doing for the past few weeks.
I was very lucky to be able to get the emulator working with the help of the PSRAM. Just like what you have mentioned in your post, the speed is not going to be 100% of the PC-XT at 4.77Mhz. The speed for my emulator ranges from 30% to 80%, depending on the amount of RAM read/write. If you are interested, I am happy to share my work!
A few videos for you to take a look: https://youtu.be/vZD38C4uZs4
EDIT: I have just created a Hackaday article for my project: