General Category > Building LOS From Source

New PACKSEG Implementation For The Workshop

(1/3) > >>

AlexTheCat123:
The absence of PACKSEG has been really bothering me, and not being able to make a new set of LOS install disks or a LisaGuide disk has felt like a pretty major limitation of my source compilation efforts. So I got to work trying to write PACKSEG from scratch several days ago.

And wow, it's been a lot harder than expected. Partly due to Lisa Pascal's lack of bitwise operators and annoying tendency to treat everything as a signed integer. And partly because of the challenge of figuring out the specifics of the packing algorithm and how the other non-code blocks of an object file have to be updated for packed code.

But as of today, I have a mostly-working implementation going! It's not ready for release yet (I need to clean things up, add comments, and allow the user to specify input/output files instead of hard-coding them), but I've tried it on quite a few executables and it's able to pack them all. It can even produce a bootable packed copy of SYSTEM.OS, so clearly it's working pretty well. I haven't even bothered trying it on an intrinsic library yet, so I bet there will be a bunch of bugs to work out when it comes to writing to the library header blocks, but it works great for executables right now.

I'll keep providing updates as I get closer to having a copy that's ready for release!

ried:
Alex, do you think it might be found on an early Twiggy disk? I uploaded a pre-release version of Lisa Pascal to the files section this week, for example. Happy to keep digging into old Twiggy disks if there's hope that it might have been included somewhere.

stepleton:
Congrats! Are you making use of assembly code? If not, I recommend it; for small tasks like bitwise operations, it should be relatively easy to introduce subroutines that are callable from Pascal. Some examples here from earlier projects:

https://github.com/stepleton-xx/lisabbs/blob/master/LIBASM.TEXT (interface)
https://github.com/stepleton-xx/lisabbs/blob/master/LIBASM.ASM.TEXT (asm code)

https://github.com/stepleton/LisaMandelbrot/blob/master/Pro/MANDLIB.TEXT (interface plus some Pascal routines)
https://github.com/stepleton/LisaMandelbrot/blob/master/Pro/MANDLIB.ASM.TEXT (asm code)

AlexTheCat123:

--- Quote from: ried on August 05, 2025, 08:02:49 pm ---Alex, do you think it might be found on an early Twiggy disk? I uploaded a pre-release version of Lisa Pascal to the files section this week, for example. Happy to keep digging into old Twiggy disks if there's hope that it might have been included somewhere.

--- End quote ---

Hmm, whenever I try to list the directory of those disks with lisafsh-tool, they appear to be empty. It might just be a lisafsh-tool bug though. If anybody has a Lisa 1 (or LisaEm configured to work with Twiggies; I've never been able to get it to work) and is willing to look at these disks from the Workshop, let me know if you're able to find anything!


--- Quote from: stepleton on August 05, 2025, 08:28:29 pm ---Congrats! Are you making use of assembly code? If not, I recommend it; for small tasks like bitwise operations, it should be relatively easy to introduce subroutines that are callable from Pascal. Some examples here from earlier projects:

--- End quote ---

I certainly thought about it, but no. Although that's definitely the way that I should've done it. I was initially thinking something along the lines of "this program is going to be so simple that it would feel weird not to write it all in Pascal", and by the time I realized that the program was not going to be quite that simple anymore, I had already written all the assembly-friendly stuff in Pascal. It might be worth going back and rewriting some of that stuff after I've got things fully-working though; I haven't checked the speed of the packing algorithm yet and it might be pretty slow in its current form when not being run at 512MHz in LisaEm.

stepleton:
Eh, don't do it for speed, do it for fun/learning, says I  :D
(People are only going to run packseg a few times during a hands-off process and they'll already have arranged other things to do while they wait.)

But what I really came online to say was this:


--- Code: ---~/Downloads/tmp/Pascal A5+$ ls -l
total 2616
-rw-r--r-- 1 tss tss 892928 Aug  4 02:36 Pascal_0
-rw-r--r-- 1 tss tss 892928 Aug  4 03:49 Pascal_1
-rw-r--r-- 1 tss tss 892928 Aug  4 05:03 Pascal_2
~/Downloads/tmp/Pascal A5+$ for i in *; do echo $i; strings $i | grep -i packseg; done
Pascal_0
Pascal_1
PACKSEG.OBJ
PACKSEG.OBJ
Pascal_2
~/Downloads/tmp/Pascal A5+$ strings Pascal_1 | grep -i pack
UNPACK  Jo
SYSTEM.UNPACK SYSTEM.OS
PACKSEG.OBJ
RAM STRINGMREPE ATMRECORDMPACK"EDMDOWN
PACKEDC
PackedCod
PACKTAB
PackVersion P
Unpacked
zePacked
packed
 SizePack
#TAdev = PACKED RECORD  {Type declaration for "Print Style"}
#TFntid = PACKED RECORD
#TLfntid = PACKED RECORD
#TMpccwid = PACKED ARRAY [TCc] OF TWid;
#TCharstyle = PACKED RECORD
PACKBITSPACKBITS
PACKRGN PACKRGN
UNPACKBIUNPACKBI
#KeyEvent        = Packed Record
 - !Unpacke
PACKSEG.OBJ
File is already packed.
EADPACK
PackTable record in
No PackTable record in
PACKTABLE.LIB
PACKTABLE.LIB
File with Pack Table [
Unpack error
Packing
Total code size packed   
Total code size unpacked
Read Pack Table ? (y/n)
File to pack [.OBJ] -
2Pack Code Segment Utility                 {A5.2.5}
NITPACK
AKEPACK
UNPACK 
NGMREPEATMRECO"RDMPACKEDMDOWN"
UNPACK *PACKM *@PAGEMMWRITELN
Variable cannot be packed field
Fields of packed records cannot be var parameters
Pack and unpack are not implemented
TNOrFd = PACKED RECORD
TARgCHAR = PACKED ARRAY[0..0] OF CHAR;
 TStn = PACKED RECORD ubt: TB; fDirty: TF; fLock: TF; fill: 0..63; END;
+(hdr: PACKED RECORD
8: (fun_field : packed record            (* one integer *)
%Pattern   =  PACKED ARRAY[0..7] OF 0..255;
PACKRGN NV

--- End code ---

Obviously references to packed records and other things in there, but it really does seem like this disk contains PACKSEG.OBJ and PACKTABLE.LIB files. (If it doesn't, it used to and then the files were deleted.)

Navigation

[0] Message Index

[#] Next page

Go to full version