97 points · by tosh · 1y ago · 38 comments
* Log virtual POST codes to a text file for a physical motherboard I'm troubleshooting to see where it's hanging up
* Install an old OS to a .img file which I can then extract and pull bit-perfect files from
* Create a virtual hard drive with matching CHS values to a real hard drive, install an OS, then write the image to a real disk and boot it on real hardware
* And of course, play around with old hardware, software, and games in fairly accurate simulated way :)
I went as far as simulating defects by modifying individual hardware blocks in 86Box source code, recompiling, and checking resulting POST code because that seemed faster than carefully tracing BIOS :)
"Modified 86Box to break RTC always returning 0 or 0xff. POST_7 freeze." https://www.vogons.org/viewtopic.php?p=1041079#p1041079
That sounds awesome but my brain can't follow today.
What did the setup look like here?
My brain's looking at a test motherboard, then at 86Box (which would presumably run on your main system), and I can't figure out how to connect the dots.
I had a 486 motherboard that would hang somewhere during POST. I have a POST card that displays the current code from the ISA bus, but even with my phone camera in slow-mo mode, I wasn't able to capture the full list of codes - the value on the bus changed faster than what the POST card could output.
I turned to 86Box and found a very similar 486 board with the same chipset. There's an option to install a virtual POST card and show the codes in the application's status bar, but this also went by too fast for me to see what was going on.
So I downloaded the source, found the file for the POST card, and edited it to write the codes to the console as well. Then I fired up the virtual board again and produced a complete log of the POST codes during a cold start.
Together with the complete list from 86Box plus the codes from the real board, I found it was completing many steps but hanging on "chipset initialization". I still have some work to fix it, but it at least gave me some insight I wouldn't have otherwise had. :)
I would have been yelling at an Arduino (and possibly a shift register) wired to the 7-segment LEDs... (I don't do hardware :D but I would've been convinced it was necessary)
Maybe this can be done with blink, but probably not by selecting a few dropdowns and clicking some buttons...
I am not sure about the details, but I seem to remember it was not a very amicable fork.
It's instructive to look at the activity level of pcem (their forum, and their github account: https://github.com/sarah-walker-pcem/pcem/commits/dev/) versus 86box ( https://github.com/86Box/86Box/commits/master/ )
86box has a vibrant community around it (pop in the discord some time!) which PCEM really doesn't as far as I'm able to tell.
Yes, there is a lot of bad blood -but I would suggest taking any stories that you hear (but did not witness yourself) with a huge grain of salt.
> blink is a virtual machine that runs x86-64-linux programs on different operating systems and hardware architectures.
Where 86Box is, according to themselves:
> 86Box is a low level x86 emulator that runs older operating systems and software designed for IBM PC systems and compatibles from 1981 through fairly recent system designs based on the PCI bus.
In a sense it's also a history preservation project, though I doubt they would characterize it as such themselves. They don't do the documentation that pcjs does; but I think it's similar in spirit, if not in implementation specifics.
(I'm not planning to publish this, and it's very minimal: the only supported syscalls are read, write and exit, and the program needs to have exactly two segments, CS and DS=initial SS as defined in the EXE header. But it should be theoretically possible to make something more elaborate that can run at least a few "well-behaved" normal DOS programs, as long as they don't do any arithmetic on segment registers.)
What's no longer available in long mode is the virtual 8086 mode, for that you'd need to use either the more modern virtualization features (with "unrestricted guest" support), or a software emulator.
I don't know who has been spreading FUD (likely MS, just like they did with "32-bit Windows can't use more than 4GB of RAM") but that's not true.
https://www.dkia.at/en/node/180
There's another article I can't find at the moment which discusses this in a lot of technical detail, making references to using the "unrestricted guest" virtualisation feature on CPUs that have it (quite new at the time) which essentially runs 16-bit code as a VM, or classic modeswitching that jumps between 16, 32, and 64-bit mode as needed. Nonetheless, it is quite irritating that despite the hardware being perfectly capable of 16-bit, 32-bit, and 64-bit operation, the designers made it harder than necessary to do so.