Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

RxDOS kernel compression (Developers)

posted by ecm Homepage E-mail, Düsseldorf, Germany, 08.09.2018, 14:33

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:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 42 users online (0 registered, 42 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum