Not long ago, I worked my way through the upx code, and figured out what I needed to do to use it in another project. And started using that as the decompressor for etherboot.
Today I have gone through and replaced the copy from rom to ram in crt0.base with a decompression step. This allows me to compress all of the C code when it is stored in the rom chip, and only decompress it as it is copied to RAM. The upx decompressor is roughly 180 bytes. And I get a compression ratio of about 2:1
When I start compiling in a lot of debug messages, or the intel microcode updates this compressor gives me a lot more room to work with. I reduced my footprint on the E7500 port by 20KB :)
This interacts badly with my implementation of the cache as ram trick but that code wasn't stable enough to really trust. :(
And in theory since I am moving less data off of the rom chip things should go even faster.
Eric
it's interesting but it looks like cache-as-ram will work fine on PPC.
Sounds like a neat decompressor though, smaller and faster is always nice. ron
Ronald G Minnich rminnich@lanl.gov writes:
it's interesting but it looks like cache-as-ram will work fine on PPC.
Sounds like a neat decompressor though, smaller and faster is always nice.
It only conflicts with my implementation of the cache-asm-ram code, not the practice. For PPC where there is architectural support for locking cache blocks, we should be able to decompress into the cache...
If it looks like we need to run the code uncompressed from the ROM holler but for now I am going to assume we can compress everything. Among other things it greatly simplifies the linker scripts.
Eric
On 27 Sep 2002, Eric W. Biederman wrote:
If it looks like we need to run the code uncompressed from the ROM holler but for now I am going to assume we can compress everything. Among other things it greatly simplifies the linker scripts.
holler. I would like to have running-from-ROM as an option. Some of the people in the embedded space really want it.
How do we keep both options as a config-time possibility?
ron
Ronald G Minnich rminnich@lanl.gov writes:
On 27 Sep 2002, Eric W. Biederman wrote:
If it looks like we need to run the code uncompressed from the ROM holler but for now I am going to assume we can compress everything. Among other things it greatly simplifies the linker scripts.
holler. I would like to have running-from-ROM as an option. Some of the people in the embedded space really want it.
How do we keep both options as a config-time possibility?
So far we don't have a real running-from-ROM option for the C code as we started copying the code segment along with the data segment to RAM, a while ago, when I reduced the skew between Ollies boot from DOC code and the rest of LinuxBIOS.
I have some trouble seeing where running-from-ROM is an issue when it only happens at boot time. But except for the problem of maintaining very divergent code paths I have nothing against it.
Eric
The San Jose Mercury News had an announcement of the Linux NetworX/ LLNL deal on the front page of the business section today:
http://www.bayarea.com/mld/mercurynews/business/4169843.htm
-Steve