CP/M archive/compression tools

233 views
Skip to first unread message

Bob Kircher

unread,
Aug 23, 2023, 4:31:35 PMAug 23
to
Are there versions of nulu, squeeze, crunch etc that are capable of running on unix/Linux? It would be very convenient to do some archive/dearchive work on a modern system then copy to the CP/M machine.

-Bob

Dennis Boone

unread,
Aug 23, 2023, 7:46:16 PMAug 23
to
> Are there versions of nulu, squeeze, crunch etc that are capable of
> running on unix/Linux? It would be very convenient to do some
> archive/dearchive work on a modern system then copy to the CP/M machine.

A few:

arc - https://github.com/ani6al/arc
unar - https://theunarchiver.com/command-line

Plan B, run MS-DOS utilities under DOSBOX or similar. DOSBOX can treat
a host directory as a DOS disk volume, making interchange easy. There
are tools similar to DOSBOX for running CP/M tools from a unix command
line that might serve for directly running the CP/M archivers, but I
haven't explored the host filesystem support there.

De

Lawrence Sonderling

unread,
Aug 23, 2023, 9:02:42 PMAug 23
to
Dennis Boone wrote on 8/23/23 16:46:
There are a number of other programs that will compile and run under LINUX:

Carson Wilson's cfx13.zip
squeeze.zip (contains several programs)
uncr233.zip
ldir-ltype.zip

You can probably find these easily.

Good luck!

Russell Marks

unread,
Aug 24, 2023, 5:00:44 AMAug 24
to
Lawrence Sonderling <lsond...@gmail.com> wrote:

> There are a number of other programs that will compile and run under LINUX:
>
> Carson Wilson's cfx13.zip

It looks like CFX was meant to compile on Unix of some sort as well as
DOS, but unless I'm doing something wrong, the contents of cfx13.zip
don't seem to compile on Linux. Even if you avoid using the Makefile
entirely there are still errors.

The zip I tried was http://www.z80.eu/downloads/cfx13.zip .

-Rus.

Russell Marks

unread,
Aug 24, 2023, 5:14:11 AMAug 24
to
You seem to be referring to LBR there, but nowadays I think zip might
actually be a reasonable option. You could make a DOS-style zip with
"zip -k", then use this version of CP/M unzip (which supports the
Deflate method) to extract it:

https://github.com/agn453/UNZIP-CPM-Z80

Also, nomarch extracts .arc, and lbrate extracts .lbr and deals with
decompression:

https://zgedneil.nfshost.com/nomarch.html
https://www.ibiblio.org/pub/Linux/utils/compress/lbrate-1.1.tar.gz

Disclaimer - I may have had some involvement with the above, but they
seem to work despite that. :-)

(Compiling lbrate does give a warning for me after 20+ years - which
looks a lot like the issue I just fixed in nomarch - but in practice
it should still be ok to use as-is.)

-Rus.

Russell Marks

unread,
Aug 24, 2023, 6:19:36 AMAug 24
to
Aha - the Unix side seems to have been broken after 1.1. The source to
1.1 still seems to be available e.g. here:

http://www.museodelcomputer.org/parts/commodore/1541/docs/devil/pub/archivers/cfx11src.zip

Presumably the relevant parts like unixfunc.c could be reincorporated
to get 1.3 compiling again, but I'm not volunteering. :-)

-Rus.

Mark Ogden

unread,
Aug 25, 2023, 4:10:39 PMAug 25
to
My mlbr utility https://github.com/ogdenpm/mlbr builds under linux gcc -o mlbr *.c
The corresponding mklbr https://github.com/ogdenpm/mklbr also builds gcc -o mklbr *.c

mlbr extracts files from lbr, squeeze, crunch and lzh including variants. Options allow recursive expansion. It also supports conversion to zip and extraction of timestamp / info. For Windows it also renames files that are illegal, generating an information file on files renamed.
mklbr creates lbr files and allows timestamps to be set by using a recipe file.

Mark

ldkr...@gmail.com

unread,
Aug 26, 2023, 5:24:57 AMAug 26
to
Another option is to use RunCPM on Linux, and just copy the Utilities to
/home/user/RunCPM/A/0 and use the CP/M utilities to extract or unsqueeze
what you want from .LBR files or *.?Q? files.

Simple and works.

Larry

Bob Kircher

unread,
Aug 26, 2023, 7:09:48 PMAug 26
to
Lots of good information here, thanks to all. Sounds like Larry's suggestion of RunCPM just might be the most straightforward.

Russell Marks

unread,
Aug 27, 2023, 6:43:34 AMAug 27
to
Mark Ogden <ogd...@gmail.com> wrote:

> My mlbr utility https://github.com/ogdenpm/mlbr builds under linux

Speaking of mlbr, would you mind clarifying the licence? The closest
thing I can find (aside from miniz.h and uncrunch.c) is that "This is
an open source non-commercial project".

Also, what do you consider the licence to be on the original lzhuf.c?
I went to some effort to clarify this before adapting it for lbrate,
and I'd be interested in your perspective.

Finally, I found the most curious thing. This code from mlbr's
uncrunch.c (which I'm assuming it's reasonable to post in order to
comment on it):

if (pred == IMPRED && chr == 0) {
hashval = 0x800; /* special case (leaving the zero code free for EOF) */
} else {
/* normally we do a slightly awkward mid-square thing */
uint16_t a = (((pred + chr) | 0x800) & 0x1fff);
uint16_t b = (a >> 1);
hashval = (((b * (b + (a & 1))) >> 4) & 0xfff);
}

...seems to have remarkably similar comments to this code I wrote in
2001 for lbrate's readlzw.c:

if(oldcode==0xffff && chr==0)
hashval=0x800; /* special case (leaving the zero code free for EOF) */
else
{
/* normally we do a slightly awkward mid-square thing */
a=(((oldcode+chr)|0x800)&0x1fff);
b=(a>>1);
hashval=(((b*(b+(a&1)))>>4)&0xfff);
}

I also notice that most of an older version's "slightly odd approach"
comment at line 109 here:

https://github.com/ogdenpm/mlbr/blob/35cf3093a4e7b39c70383c1b085391ca7cc62aec/uncrunch.c

...was in lbrate many years earlier, with the same "If" typo.

So I'd be interested in your thoughts on this as well.

-Rus.

Mark Ogden

unread,
Aug 28, 2023, 6:48:49 AMAug 28
to
Russell
I originally wrote mlbr for personal use, mainly to support windows filename mapping. I went on to add support for date and information extraction, along with conversion to zip files. In previous new group chats I offered the code for others to use by posting on my github site. Although I didn't share, I had previously added some windows filename mapping to cfx1.3 and fixed some bugs.

It is plausible that the code you noted came from lbrate. Whilst refactoring the original code, it looks like I used your implementation of the hash algorithm. I will make sure that the copyright notice at the top of the code is updated to include your name. My apologies for the oversight. If you are not ok with this let me know.

As I use git, the fact that historic versions, contained the "slightly odd approach" text, would also suggest at some point I had copied other fragments of your code, prior to rewriting. In this case the count element of the for loop was removed as it is only called if there is room and the hash table probing ensures all entries are checked.

As to the general licencing position, I would suggest that as a whole, an open source non-commercial licence is sensible and inline with my original intent. This is based on the following
mizip - provided as is
lzhuf - based on your interaction with the respective authors
uncrunch - original Frank Prindle + prior work. I will add you to the list
unsqueeze - not sure where I derived this from. There are multiple similar versions available. None seem to have specific licence conditions.
crc16 - derived from public domain source
lbr support, date support, general program wrap, fixes and new errors - happy to licence these as open source non-commercial .

I am also happy for the sister application mklbr to be under the same licence.

Mark

Russell Marks

unread,
Aug 28, 2023, 12:17:35 PMAug 28
to
Mark Ogden <ogd...@gmail.com> wrote:

> It is plausible that the code you noted came from lbrate. Whilst
> refactoring the original code, it looks like I used your
> implementation of the hash algorithm. I will make sure that the
> copyright notice at the top of the code is updated to include your
> name. My apologies for the oversight. If you are not ok with this let
> me know.

Thank you, that's fine. I think it might be best from your perspective
to also say the code is included with permission - as it may not be
under the usual licence - but that's up to you.

Obviously, I do appreciate that this is a very small part of the code
overall.

> As to the general licencing position, I would suggest that as a whole,
> an open source non-commercial licence is sensible and inline with my
> original intent.

Maybe you should pick an actual specific licence though - one
compatible with the various things you're including. Usually you need
to at least be sure to grant users permission to copy your program,
for example. But this isn't legal advice, I'm not an expert, that's
just what I think. :-)

-Rus.

rwd...@gmail.com

unread,
Aug 29, 2023, 1:13:32 PMAug 29
to
On Wednesday, 23 August 2023 at 21:31:35 UTC+1, Bob Kircher wrote:
> Are there versions of nulu, squeeze, crunch etc that are capable of running on unix/Linux? It would be very convenient to do some archive/dearchive work on a modern system then copy to the CP/M machine.
>
> -Bob
Why not zip on PC, and use AGN (Tony Nicholson)'s unzip on CP/M . He keeps it bug fixed and updated. Can unzip Windows default zip compression. He is on Github.?

Tony Nicholson

unread,
Aug 30, 2023, 7:16:17 PMAug 30
to

> Why not zip on PC, and use AGN (Tony Nicholson)'s unzip on CP/M . He keeps it bug fixed and updated. Can unzip Windows default zip compression. He is on Github.?

I do check in here occasionally (but not as often as I used to due to health and
family issues).

There's been activity on the UNZIP-CPM-Z80 GitHub repo in the last week where
Jonathon Harston has tweaked a few things. He may be working on a CP/M
native Z80 version of ZIP too.

See https://github.com/agn453/UNZIP-CPM-Z80 for details (and my GitHub
profile has my e-mail contact details).

Tony
Reply all
Reply to author
Forward
0 new messages