Re: [Etherboot-developers] upx compressor/decompressor...
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Eric W B. <ebi...@ln...> - 2002-08-21 20:04:09
|
Markus Gutschke <ma...@gu...> writes: > Eric W Biederman wrote: > > In it's final form the overhead for the nrv2b decompressor is just > > 180 bytes and should handle any size of file. The 32bit infrastructure > > is now an advantage instead of a liability size wise. > > Sweet! That's very impressive. Now, if only there was some documentation on > these algorithms. I've been browsing the project pages for UPX, but they are > extremely sparse on documentation. The simplied version is now checked in to etherboot cvs. Conceptually it is based on copying bytes. But instead of using a hufman tree to encode the bits, it uses an encoding based upon stop bits. Check out the decompressor in nrv2b.c it is only about a screenful so it isn't to hard to comprehend. Watch out for the GETBIT code though how it uses stop bits instead of a count to remember how far to go is interesting. Then look at the unnrv2b.S the optimized assembly version, and notice how a lot of the awkward cases in C, become straight easy to implement in the assembly. Eric |