View Full Version : PC ROM debugger
nino
January 28th, 2004, 18:36
Does anybody know of a debugger for ROM code?
dELTA
January 28th, 2004, 19:18
I guess that would depend on which kind of ROM you are talking about, but if you are e.g. talking about the PC BIOS it should as far as I know use normal x86 code, which should be handled well by e.g. IDA (you can save it as a com file first if it is only linear x86 code not contained in any executable file, which is most likely the case).
nino
January 28th, 2004, 20:17
Yes indeed PC BIOS uses mostly real-time 16-bit x86 code. The problem is that it can't be debugged as a COM file since ROM code would initialize the device (in this case disk) and standard debuggers won't go further. The intended debugger should just require the screen and keyboard (and maybe mouse) so that the ROM code could be debugged as in real-time. Also it must hook the boot code in such a way that it would take control when the ROM code is called at boot time.
Maybe I'm asking too much but I would feel happy if it could just work. Since this is an UDMA controller BIOS that will manipulate the mass storage devices on my computer it won't work. Probably with 2 controller's it would but I first want to exhaust the possibility that there would exist a debugger specially targeted for ROM code.
disavowed
January 28th, 2004, 21:52
i looked for one of these a year or two ago and came up empty-handed. there are hardware-based bios debuggers, though
Aimless
January 29th, 2004, 01:20
Three ways to do it:
I. The Assembly Way
================
1. Get a ROM dumper utility
2. Dump the ROM
3. Use IDA Advanced
4. Disassemble
5. Make changes as required using a hex editor
6. Reload the dumps
7. (If you cannot think of any ROM dumper utility, the same is available in your HDD. Its called debug.com)
II. The Hardware Debugger Way
========================
1. Get a h/w debugger
2. Plug it into the board
3. Hit it to insert breaks at ROM instruction sequence streams
4. Quite messy, I belive.
III. The Software Emulator Way
========================
Your best bet:
1. Get Bocsh (NOT Bosch, unless you like drills)
2. Take a look at the SOURCE code of the BIOS code
3. See if you can learn something there
4. Better yet, get SIMICS (there is a Flexlm key also floating around, its gotta be the server method rather than plain key method)
5. Start the virtual machine
6. Close down the virtual machine
7. Grab all instructions till date (called tracing)
8. Debug to heart's content if required as it also supports debug options besides tracing instructions (Note: Not for the faint of heart. And oh yes, you gotta learn python before that. And that's more than just a passing knowledge of it)
Have Phun
nino
January 29th, 2004, 09:45
Well, the picture seems clear now.
Looks like the best way to go is the hardware debugger but since I have none within my reach, it must be discarded.
The assembly way is not applicable here since I don't have the board's datasheet and can't figure out the required changes from a static listing. Besides (for other people that may read this), don't dump your ROM code from within Windows (i.e. from a cmd prompt). Some drivers (as this one) shadow the ROM code, modify it in RAM and map the resulting code into the original ROM's page.
So let's try the emulator way. It's going to be a looong and painful attempt to gather the tools, find a crack, learn python and in the end it may not work :{
Thanks for your tips guys!
Powered by vBulletin® Version 4.2.2 Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.