RxDOS kernel compression (Developers)
Yesterday and today I finally got around to implementing one of these "killer" features of any DOS kernel which is packing the kernel and adding a depacker that lets it decompress itself at run-time.
As algorithm, I used Joergen Ibsen's BriefLZ, which is very simple and available under the zlib usage conditions. It still manages to compress the kernel to about 50% of its size, which is plenty for me. I haven't compared the compression ratio against that of UPX (as used by FreeDOS's and EDR-DOS's kernel compression), but the BriefLZ usage conditions are permissive and lack UPX's copyleft.
I used the C-source safe depacker as a base, and ported it to 8086-compatible assembly. I optimised it a bit and added the ability to make use of overlapping source and destination buffers. (The compressed source data is moved to the top of useable memory, then decompressed to the destination buffer at linear 0_0600h.) Unlike the solution suggested by BriefLZ, my port supports any block size, including blocks larger than 64 KiB, by implementing some segmentation work.
Unlike my earlier plans, I didn't write a specific utility program, opting instead to use the format of BriefLZ's example program, blzpack. This way, the kernel can be compressed during build time, and included as a compressed payload by iniblz. This, with its included depacker stub, is then the payload to iniload, which handles completely loading the kernel file from the file system.
It's available from https://bitbucket.org/ecm/iniblz/src/default/ (Though when releasing a new RxDOS build I will likely provide pre-built binaries.)
---
l
Complete thread:
- RxDOS kernel compression - ecm, 08.09.2018, 14:33 (Developers)
- RxDOS kernel compression - ecm, 08.09.2018, 23:45
- RxDOS kernel compression - swf, 11.09.2018, 00:22
- RxDOS kernel compression - Rugxulo, 11.09.2018, 00:31
- RxDOS kernel compression - swf, 11.09.2018, 01:39
- RxDOS kernel compression - Rugxulo, 11.09.2018, 02:08
- RxANSI and RxDOS kernel - ecm, 11.09.2018, 22:11
- RxANSI and RxDOS kernel - swf, 12.09.2018, 02:31
- RxANSI and RxDOS kernel - ecm, 12.09.2018, 09:09
- RxANSI and RxDOS kernel - swf, 12.09.2018, 18:33
- RxANSI and RxDOS kernel - ecm, 12.09.2018, 19:46
- RxANSI and RxDOS kernel - swf, 12.09.2018, 21:01
- RxANSI and RxDOS kernel - ecm, 12.09.2018, 21:05
- RxANSI and RxDOS kernel - swf, 12.09.2018, 21:01
- RxANSI and RxDOS kernel - ecm, 12.09.2018, 19:46
- RxANSI and RxDOS kernel - swf, 12.09.2018, 18:33
- RxANSI and RxDOS kernel - ecm, 12.09.2018, 09:09
- RxANSI and RxDOS kernel - swf, 12.09.2018, 02:31
- RxANSI and RxDOS kernel - ecm, 11.09.2018, 22:11
- RxDOS kernel compression - Rugxulo, 11.09.2018, 02:08
- RxDOS kernel compression - swf, 11.09.2018, 01:39
- RxDOS kernel compression - Rugxulo, 11.09.2018, 00:31
- RxDOS kernel compression - swf, 11.09.2018, 00:22
- RxDOS kernel compression - ecm, 08.09.2018, 23:45