• Please review our updated Terms and Rules here

Diagnostic ROMs: disassembling Landmark and more....

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
1,413
Location
Heerlen, NL
Hallo allemaal,

Out of curiosity I started to disassemble the Landmark ROMs for the PC/XT and AT. So far some parts went smooth and in some parts I have no idea what is going on exactly. At least I know now how the ROMs are able to use subroutines without needing RAM.

I have only done a little with the AT ROM. Two reasons:
- After the reset the first thing the AT does is updating the error counter on the screen. That completely flabbergasted me. The only reason I can think of that this happens is that an AT can be resetted by the 8042 if a program/user wants to return from the protected mode: the only way an AT can do that is through a reset. I can imagine that this mechanism is used by the ROM for its own purposes as well.
- Digging deeper and having a rough look, I found out that quite some parts are the same as the code of the PC/XT. I could save some time later by completing the PC/XT ROM first.

Because of the various troubles I ran into and being interested in having a diagnostic ROM with the complete source code, I have been thinking to write my own one. For the moment I would start with the PC/XT one because I'm familiar with the regular BIOS ROM. But it doesn't make sense inventing the wheel twice so my question is: has such a diagnostic ROM (with free source code) been developed before?

I'm not particularly fond of the display of the Landmark, IMHO it is a bit crowded. I rather would prefer a scrolling screen but then what to do with errors? I have some ideas regarding the layout and more, but I don't mind to get suggestions, ideas or even pieces of code. My work will be open source anyway.

FYI:
- I use NASM to assemble the result. The result won't be byte exact as the original due to the fact that NASM sometimes uses other code for certain instructions than the original assembler. I created a program that compares the new and original binary but discards equivalent codes. FYI: I created a BIN with NASM using the original IBM source code for the first PC and I had no problems whatever.
- The disassembler provided by NASM is bad IMHO, so I created my own one. So far it does it job good but it still has its flaws: I'm not familiar with specific 8087 and 80286 code so these sometimes come out wrong. 808386 and higher are not supported (yet).
 
Thank you for this link.

A small update:
Thinking about my own diagnostic ROM I ran into something completely unknown to me. The ROM should run on compatible clones as well and they use bit 2 of port B the 8255 for activating the turbo feature. I always thought that this bit was used for the cassette port on one or another way on the 5150. Surprise, that is done here by bit 3! Bit 2 takes care of reading a dip switch, something that is done by bit 3 on the 5160.
The Landmark ROM can be used for both the 5150 and 5160 so there is something in the ROM that determines what motherboard it is dealing with, something I now have to find out as well.
 
Hi Ruud

the Supersoft manual scan I have says they did separate roms for pc and xt, and a dual pc xt one that it describes as "switch selectable". So the user determines the motherboard type. I've never seen an original selectable or the rom code for it so not sure how these worked.
 
Thank you for this link.
Re the "6) Send a POST code to show boot progress (Requires POST card at 80H Port)" on the page.

Many years ago, when diagnosing a problem with the prototype of the PC-Retro motherboard, programming code that sent diagnostic codes to port 80h was created for some temporary diagnostic ROM's. Both mmruzek and I were using a vintage ISA POST card, and they worked fine for displaying the codes in the PC-Retro motherboard and IBM PC (IBM 5150) motherboard.

But it was later discovered that a modern ISA POST card would not display the codes, the commonly available card at [here]. The problem cause may be related to the 'ALE signal' issue discussed at [here] (see from about post #40 onward).

I later tried the temporary diagnostic ROM's and my modern ISA POST card in an IBM XT (IBM 5160), and found that it only displayed the codes when the modern POST card was in slot 8.

SUMMARY: Any 'sends diagnostic codes to port 80h' functionality that you produce, will not be usable by all who have an ISA POST card.
 
the Supersoft manual scan I have says they did separate roms for pc and xt, and a dual pc xt one that it describes as "switch selectable". So the user determines the motherboard type. I've never seen an original selectable or the rom code for it so not sure how these worked.
There is a user manual at [here]. Page 10 shows that the 'combined PC/XT' ROM was fitted on an adapter, and that the subject switch was on that adapter. The switch likely catered for the fact that the PC and XT used different types of ROM's.
 
" The switch likely catered for the fact that the PC and XT used different types of ROM's. "

That's always been my interpretation. I don't believe my kit came with a 5150 adapter.
 
... the commonly available card at [here].
I built one myself that I used to debug my own BIOS for Sergey's Xi8088 card. But I just bought the one you mentioned the day before yesterday. For the huge amount of $3.28 including P&P (I really wonder how that is possible, just sending the thing would could cost me about $8). I'll see how it works when it arrives.

SUMMARY: Any 'sends diagnostic codes to port 80h' functionality that you produce, will not be usable by all who have an ISA POST card.
I intend to include writing the code to the three LPT ports as well. IMHO there is room enough to do that.
 
Hallo Justanotherhacker,
justanotherhacker;549799the Supersoft manual scan I have says they did separate roms for pc and xt said:
Very good find! My first thought after reading that was that the (EP)ROM contains two images and using the switch you tell the PCB what one to use. But minuszerodegrees.net provides an 8 KB ROM that can be used in two systems. If it contained two images, I expected it to be at least 16 KB big. And I checked the other images and they all only contain multiple copies of the same version.

I'll simply have to find the spot that handles the switches and see how it is done. It shouldn't be difficult, I only have to check I/O instructions handling the port 61h and 62h.
 
I'm interested in this because I'm currently trying to revive a dead PCjr motherboard. But is there any reason why the Landmark ROM or any new diagnostic ROM you may create can't be made to use on a PCjr for diagnostics?

I understand that despite sharing a lot of the same components it has a lot of differences too (a lack of DMA controller for one) but I'm just wondering how hard it would be?

A lack of any diagnostic ROM for the PCjr is a real stumbling block in trying to diagnose issues on boards which appear completely dead so I think it would be very much welcomed by the IBM PCjr community.
 
The PCjr has enough built-in diagnostics that, if a board won't boot, it definitely won't boot with a landmark diag rom. The PCjr lacks a keyboard controller and DMA controller, so there is actually less that can go wrong on a PCjr board, and less to troubleshoot.

The dead PCjr boards in my experience were due to cracked boards/broken traces.
 
But is there any reason why the Landmark ROM or any new diagnostic ROM you may create can't be made to use on a PCjr for diagnostics?
I'm not familiar with the PCjr at all. My source will be freeware so you can edit it in the way it suits you best.
 
IDA has a free version for download, have you given that any thought? It is a massive time-saver.
As you mention, it is a free version. Being a business I assume they prefer selling the product. So the free version will certainly lack certain features.

Haven written my own one means that I can insert any feature I like. For free. And like my other software, it is free, including the sources (Free Pascal).
Has it disadvantages? Unfortunately yes:
- it still has some bugs like disassembling some 8087 and 80286 commands wrongly.
- there is no manual (so far)
 
Back
Top