compressed rom image
Terry Swanborough (455) 53 posts |
Hi I have been trying to look at the Raspberry PI ROM, for debugging purposes and because I am curious :-) I see that the ROM is now compressed is there a way to decompress the rom so that I can see the disassembly and then recompress after. I have read about Rompress but cannot find any download to the tool. |
john evans (1898) 63 posts |
Hello. I looked at the 12/02 release rom via a hex editor on my mac, & there’s plenty of ascii strings showing. How big were the older physical roms in Acorn machines? Also, trying: http://onlinedisassembler.com/odaweb/run_hex with snippets from the hex display, the instructions look plausible? |
Wouter Rademaker (458) 197 posts |
512 kb Arthur – RISC OS 2 |
john evans (1898) 63 posts |
Thank you. Those figures suggest that the rom then is in fact not compressed? I must check to see if “!Sid” will operate on the rom, or maybe it only works on executable files…. |
Jeffrey Lee (213) 6048 posts |
The Pi ROM is compressed. In fact, all ROMs except the IOMD ROM are currently compressed. There’s a copy of the rompress tool in CVS here, but I’m not sure if downloading it through the web interface will work (there have been problems in the past with it corrupting binary files). So you can either use a CVS client or download one of the ROM source archives. Another, perhaps easier solution would be to just dump the ROM from a running machine. On RISC OS 5 the ROM is at &FC000000. On IOMD it’s 4MB in size, on Iyonix & Beagle it’s 5MB, and on Pi it’s 6MB (although last time I checked we could get away with reducing it to 5MB). So the following command should save out a Pi ROM: save pirom fc000000 + 600000 |
john evans (1898) 63 posts |
Ok, thank you for the info’. I’ve downloaded the tool on mac, which appears as “rompress,ff8”, & also on RPi via Netsurf, where it downloads as “rompress2cff8” but of filetype Text, so I replaced Text with ff8 in the filetype, double clicked it, error (paraphrased) “undefined instruction at 8004”. So, onto the save statement, but neither a * command, or a BASIC SAVE worked :( Presumably that should work on RISC OS 5 on RPi? I was surprised to see the rom’s compressed since there’s so many ascii strings visible in the ROM dump. |
Jeffrey Lee (213) 6048 posts |
The *save command should work, unless I got the syntax wrong (I’m not at a machine now to be able to check). What error does it give?
That’ll just be debug stuff in the HAL. An uncompressed ROM would show a lot more. |
john evans (1898) 63 posts |
Just in case copy & paste was a problem, I’ve typed out the *save, & “No readable memory at this address” ok, forget that. One too many 0’s I typed for 6xxxx :-) HAL, ah, I see, thank you. |
Terry Swanborough (455) 53 posts |
Hi Jeffrey Just to let you know that the *save pirom fc000000 + 600000 works for me. I did download the PI archive to get rompress but that does not work on the image I get. *rompress -d comp uncomp where comp is the beta version of the PI rom on the website?. Interestingly it will not compress an uncompressed rom generated by the *save command above?. |
Jeffrey Lee (213) 6048 posts |
That’s true, you might run into issues using a Pi ROM that you’ve *saved from memory. That’s because ROM modifies itself on startup (it needs somewhere to store the results it gets when it queries the GPU for the available memory), and that will throw off the checksum values. However you should be able to use the —ignore option to force rompress to ignore the checksum errors. |
Steve Revill (20) 1361 posts |
I’ve certainly never tried that – the results would be interesting. I’d be amazed if it does very well though, given how much non-code is in a typical ROM image (such as nearly everything in ResourceFS). I’d also imagine it’d take a very long time to run. :) |