VOGONS


First post, by GloriousCow

User metadata
Rank Member
Rank
Member

https://martypc.blogspot.com/2023/10/bus-snif … g-ibm-5150.html

reengine of course has already done this on the 5160 (https://www.reenigne.org/blog/isa-bus-sniffer-update/), but I put together my own version.

It's not quite as sophisticated on the hardware end - instead of a custom ISA card with a microcontroller we're just taking a shortcut and using a digital logic analyzer. But the main advantage is that since we stream to a PC we can take arbitrarily long captures.

I have two decoders - once that produces a plain CSV file, and then one that takes that and produces a formatted spreadsheet:

formatted_01.PNG
Filename
formatted_01.PNG
File size
89.82 KiB
Views
1225 views
File comment
Formatted cycle traces
File license
Public domain

The spreadsheet version is limited to 1M cycles; but that's still quite a lot to sort through.

I don't have a fancy server - but if anyone has some code they'd like run through this thing, I'll take requests! At some point this will be taken down and packed away when I deem MartyPC is accurate enough, but I expect I'll have it running for the next few weeks, at least.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 3 of 10, by awgamer

User metadata
Rank Oldbie
Rank
Oldbie

Couldn't resist. Gravis Ultrasound NMI handling and SBOS has been a bit of a mystery, I don't know if it was figured out with pcem, qemu or mame since last I saw it discussed with an attempt in DOSBox but this might shed some light.

Reply 4 of 10, by GloriousCow

User metadata
Rank Member
Rank
Member

I've written a native sigrok decoder for the 8088 and posted the details to my blog:

https://martypc.blogspot.com/2023/10/bus-snif … iting-8088.html

Example output if you don't feel like clicking through:

group_disassembly_01.png
Filename
group_disassembly_01.png
File size
37.99 KiB
Views
1024 views
File comment
8088 sigrok decoder example 1
File license
Public domain

This now allows for eventual publication of very long annotated cycle traces - potentially even the full IBM 5150 boot process.

It's especially useful when zoomed out. Here we can see the periods the CPU is halted:

halts_01.PNG
Filename
halts_01.PNG
File size
31.31 KiB
Views
1024 views
File comment
8088 sigrok decoder example 2
File license
Public domain

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 5 of 10, by GloriousCow

User metadata
Rank Member
Rank
Member

Ok, decoding the entire boot process isn't feasible since the decoder uses over 2GB of RAM per second of capture. Maybe some of y'all have 200GB of RAM but I do not.
But it's not all doom and gloom. Even a few seconds here and there is extremely useful.

My bus decoder has reached a pretty advanced state. There's no direct way to get the value of CS, and thus IP, but if we monitor control flow instructions, we can read CS either via an immediate operand, memory operand, or stack push/pop.
So as soon as an interrupt or far jump happens, we're in business:

bus_decoding_fun_01.png
Filename
bus_decoding_fun_01.png
File size
73.9 KiB
Views
930 views
File comment
cow's 8088 sigrok decoder 1
File license
Public domain

reenigne might recognize this one:

bus_decoding_fun_02.png
Filename
bus_decoding_fun_02.png
File size
122.92 KiB
Views
930 views
File comment
cow's 8088 sigrok decoder 2
File license
Public domain

The density of information available at a glance is really great. We can see the stack pushes during the hardware timer interrupt in red, we can see wait states in cyan on the t-cycle line.
This capture is the beginning of the Area 5150 Lake effect and subsequently 3 frames of the effect itself. The file size and performance is very reasonable. I will publish it once I've finished annotating it.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 7 of 10, by GloriousCow

User metadata
Rank Member
Rank
Member
awgamer wrote on 2023-10-12, 00:50:

If you get the urge to do that, 256gb of ram is economical using old xeon servers, $75-140 for 256gb of ddr3 16x16gb, 8x32gb on ebay.

My 5900X is already struggling at this point, no telling how an older server would perform. And the main issue is, even if I wanted to go nuts, it makes it not very usable for anyone else, either.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 9 of 10, by GloriousCow

User metadata
Rank Member
Rank
Member

I only see about four cores active when it is chewing through the decoding. Since the decoder is a python program that maintains state and executes one decode() function until all data is decoded, i can see that wouldn't be heavily parallelized.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc