Some info about XPK crunching

Home    Various Info    Some info about XPK crunching

If you decide to create a Low-Mem version of the Amiga911 disk (which are meant for Amigas with less than 2MB RAM), then most files will be copied directly to the boot disk instead of them being present in the lzx archives. The problem with this is that these files will not be compressed in any way - something which leads to there not being much space left on the disk for any extra stuff.

Fortunately it is possible to use XPK crunching (compressing) on those otherwise uncompressed files in Low-Mem disk projects, but if you decide to use XPK on your Amiga911 disk, there are certain things you should be aware of, so please continue reading.

XPK (which is short for eXternal PacKer) is a library system for crunching and decrunching of files, it consists of a main library called xpkmaster.library and several sub-libraries which handles the actual (de)crunching. Programs must by default have built-in xpk support in order for them to properly (de)crunch files. One example of this is MiniXpkGuide (renamed to MultiView) which is included on the Amiga911 disk, this viewer is able to use the xpkmaster.library for decrunching xpk compressed text files and amigaguides.

The xLoadSeg patch
So when software that's especially made to support xpkmaster is required for handling xpk crunched files, how come it's possible to boot a disk where the majority of system files actually are xpk crunched? Well the answer is to use something that patches the system upon booting.
And what's used is xLoadSeg. It wedges into LoadSeg() and NewLoadSeg (if available) and allows to directly run programs that were compressed using the XPK standard. They are decompressed while being loaded.  xLoadSeg uses less than 700 bytes when installed - which really is a small price to pay.
Furthermore, xLoadSeg should always be the first thing to be run in the Startup-Sequence.

It's important you understand that xpk crunched files can't be used directly on your Amiga unless the system is patched with xLoadSeg or the files are used with software that supports xpk decrunching. If you for example have just installed Workbench on your harddisk, and you want to copy some xpk crunched files from the Amiga911 disk, then remember that you MUST decompress them after they are copied! This can easily be done by using the xPack command which is included on the Amiga911 disk.

The xpkSHRI sub-library
You may remember that I mentioned xpkmaster sub-libraries earlier, and although I could have included several of them on the Amiga911 disk, I decided to stick with only one. And the choice fell on the xpkSHRI.library because of the great compression it offers, but it must be said however that the price to pay with this library is speed since it's among the slowest ones. But then again, fast booting isn't the main priority of the Amiga911 disk.

What happens with crunched files
Each file that is crunched by using Amiga911 Maker will get a file comment which indicates that it's xpk crunched. Not all files will be crunched though, one example is icons, another is files that are 512 bytes or smaller, the reason for this is because there really isn't anything to gain by doing so (the block sizes on floppy disks are 512 bytes).

The most important files that won't be crunched and NEVER should be crunched either, are the actual files required for decrunching. They are the following:


The AmigaOS 2.0 Avail Flush problem
Upon booting the Amiga911 disk, an "Avail Flush" is run in order to free up some RAM. This can lead to problems on Amiga911 disks for OS 2.0 which uses XPK compression since it seems to mess up the xLoadSeg patch. What happens is that after flushing the memory, the Amiga can crash when the system tries to decrunch a file. This always happens on 68000 processors, while higher CPU's seems to be a bit more robust. As a result of this, Avail Flush will no longer be run upon booting an OS2.0 XPK Amiga911 disk which are meant for 68000 processors.
Please note that this problem only occurs with the following combination: Avail Flush + XPK + AmigaOS 2.0 + 68000 CPU (it might happen with higher CPU's as well, but as previously said, they are a bit more robust).

XPK vs. Turbo Imploder & PowerPacker
There are also a lot of other file cruncher/packer solutions out there, and two of the most popular ones is Turbo Imploder and PowerPacker. I  was considering to use one of them for my Amiga911 project, but in the end I decided to go for the XPK system instead because of the following two reasons:

1.  Although there is a lot of CLI only tools that can decrunch imploded and powerpacked files out there, none seems to exist for actually crunching files by using the imploder or powerpacker methods. This means that using the Gui of Turbo Imploder or PowerPacker is the only real option here, and this would have made things much more cumbersome in Amiga911 Maker, since the user would then have had to crunch all files manually instead of letting Amiga911 Maker handle things automatically.

2.  Both Turbo Imploder and PowerPacker have issues on Amigas with a 68040 or 68060 processor. Unless the CPU caches are turned off, the programs will crash when trying to crunch a file. In addition they may show other "weird" behavior as well.  XPK on the other hand, has none of these problems and will work fine on any CPU in the 68K family.

That being said, there is a few files which can be added to Amiga911 Maker projects that has now been imploder crunched. This consists of executables only, where the "Normal Imploded" method has been used in order to make them independant of the explode.library. All imploded files have a file comment that indicates that they are crunched.

    Followed a link? Please go to the Main Site                   © Roger E. Håseth 2011 - 2014