A floppy, through dd, into a ShrinkIt archive
Watch / ddshrink
Filmed on the Apple IIe 80-column display. The same session on the Videx UltraTerm: same keys, same text.
The Videx UltraTerm was an 80-column video card for the Apple IIe, with its own video memory and character generator, real hardware scrolling and more screen modes than the IIe's own 80 columns. This demo runs on either display; the UltraTerm film shows the original Videx UltraTerm, emulated.
A 5.25-inch ProDOS floppy sits in drive 1, an image of a disk that shipped on the GEM CD in 1990. dd reads it as 280 blocks and pipes the bytes straight into nulib2, which writes them as a ShrinkIt disk archive, a .SDK. The demo lists the archive, writes the disk back out of it, mounts that file and lists the volume, then compares it with the disk inside the 1990 archive it came from. cmp prints nothing.
What it types
Everything it types, in order. A line starting with $ is a command at the shell, RET included; keys lines are single keystrokes to a program (RET, ESC and the control keys are named).
$ cd /tmp $ mount $ dd if=/dev/s6d1 | nulib2 -a FLOP.SDK - $ nulib2 -v FLOP.SDK $ nulib2 -p FLOP.SDK > FLOP.PO $ mount /tmp/FLOP.PO $ mount $ ls /mnt/DEMO.PROGRAM $ umount /mnt/DEMO.PROGRAM $ mount $ nulib2 -v /mnt/MAUX/ARC/DEMOPROG.SDK $ nulib2 -p /mnt/MAUX/ARC/DEMOPROG.SDK > ORIG.PO $ cmp FLOP.PO ORIG.PO $ cksum FLOP.PO ORIG.PO
Between steps it presses ^L to clear the screen.
What the captions say
- A 5.25-inch ProDOS floppy is in drive 1: DEMO.PROGRAM, 280 blocks.
- It came from the GEM CD, 1990, as an 82,013-byte ShrinkIt archive.
- dd reads the whole floppy as 280 blocks and pipes it to nulib2.
- dd borrows its name from the DD statement of IBM job control.
- A name ending in .SDK makes it a disk archive.
- The x30 badge marks the sped-up read.
- One record, of type Disk, 143,360 bytes: 280 blocks.
- A disk archive lists as a single record.
- What is on the disk? nulib2 -p writes it back out, into a file.
- A disk image is a file: mount it and list the volume.
- Does the copy match the original?
- The 1990 archive is on maux's own disk too: one Disk record, DEMO.PROGRAM.
- Silent: same bytes, and the two checksums agree.
- Shrunk in 1990, read in 2026, and byte for byte the same.
The gate that proves it
This film is made by site/demos/ddshrink.py. Run as assertions, the
same file is make check-demo-ddshrink, and it runs with the rest of the tests. The floppy is the disk inside DEMOPROG.SDK, a 1990 ShrinkIt archive from the GEM CD, extracted on the host by an independent NuFX reader. The gate requires that dd reports 280 blocks in and 280 out; that nulib2 -v shows exactly one Disk record of 143,360 bytes; that the mounted image appears under its volume name and ls shows exactly the 14 files the host finds on the disk; that the 1990 archive lists as one Disk record of the same size; that the volume is unmounted again afterwards; that cmp of the two extracted disks is silent; and that cksum of both equals the host’s checksum of the disk. Everything is made in /tmp. The checks themselves were tested: with nulib2 replaced by a copy of cat, or dd replaced by true, the dd rows fail; with mount replaced by true the first mount listing fails; with umount replaced by true the listing after it fails; with one byte of the floppy flipped the gate fails before anything runs, because the file in the drive is not the archive’s disk; with a cmp that prints a difference, the silence row fails; with cksum replaced by true, the checksum row fails.
Transcript
The screen at every checkpoint the test checks, as the recorder saved it:
== host: the image in drive 1 is the 1990 archive's disk (t=0.0 s) $ == host: the archive record is dated 1990 (t=0.0 s) $ == host: the captions' block count, byte count and name (t=0.0 s) $ == host: the captions' file count (t=0.0 s) $ == host: the captions' archive size (t=0.0 s) $ == only the boot disk is mounted; the floppy is just a device, /dev/s6d1 (t=14.1 s) $ cd /tmp $ mount /dev/s7d1 on /mnt/MAUX $ == dd read and wrote every block (t=40.6 s) $ dd if=/dev/s6d1 | nulib2 -a FLOP.SDK - 280+0 records in 280+0 records out $ == one Disk record, named for the archive, 280 blocks (t=54.7 s) $ nulib2 -v FLOP.SDK Disk 143360 $0118 FLOP $ == nulib2 -p says nothing (t=66.8 s) $ nulib2 -p FLOP.SDK > FLOP.PO $ == mount attaches the image silently (t=77.3 s) $ mount /tmp/FLOP.PO $ == the image is a second device, mounted by its volume name (t=78.7 s) $ mount /tmp/FLOP.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/DEMO.PROGRAM $ == ls (t=82.5 s) $ mount /tmp/FLOP.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/DEMO.PROGRAM $ ls /mnt/DEMO.PROGRAM APPLE.COM CHECKIN.PRG EXPAND.PRG MENU.PRG STARTUP BACKUP.PRG CHECKOUT.PRG INTRO.PRG PRODOS STARTUP.PRG BASIC.SYSTEM DAILY.PRG INVENTORY.PRG PRT.INVENT.PRG $ == ls shows exactly the files the host finds on the disk (t=82.5 s) $ mount /tmp/FLOP.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/DEMO.PROGRAM $ ls /mnt/DEMO.PROGRAM APPLE.COM CHECKIN.PRG EXPAND.PRG MENU.PRG STARTUP BACKUP.PRG CHECKOUT.PRG INTRO.PRG PRODOS STARTUP.PRG BASIC.SYSTEM DAILY.PRG INVENTORY.PRG PRT.INVENT.PRG $ == umount detaches silently (t=90.9 s) $ mount /tmp/FLOP.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/DEMO.PROGRAM $ ls /mnt/DEMO.PROGRAM APPLE.COM CHECKIN.PRG EXPAND.PRG MENU.PRG STARTUP BACKUP.PRG CHECKOUT.PRG INTRO.PRG PRODOS STARTUP.PRG BASIC.SYSTEM DAILY.PRG INVENTORY.PRG PRT.INVENT.PRG $ umount /mnt/DEMO.PROGRAM $ == umount let the image go: the boot disk is alone again (t=92.4 s) $ mount /tmp/FLOP.PO $ mount /dev/s7d1 on /mnt/MAUX /dev/s3d2 on /mnt/DEMO.PROGRAM $ ls /mnt/DEMO.PROGRAM APPLE.COM CHECKIN.PRG EXPAND.PRG MENU.PRG STARTUP BACKUP.PRG CHECKOUT.PRG INTRO.PRG PRODOS STARTUP.PRG BASIC.SYSTEM DAILY.PRG INVENTORY.PRG PRT.INVENT.PRG $ umount /mnt/DEMO.PROGRAM $ mount /dev/s7d1 on /mnt/MAUX $ == the 1990 archive holds one Disk record, the same size, named DEMO.PROGRAM (t=107.7 s) $ nulib2 -v /mnt/MAUX/ARC/DEMOPROG.SDK Disk 143360 $0118 DEMO.PROGRAM $ == nulib2 -p says nothing (t=111.8 s) $ nulib2 -v /mnt/MAUX/ARC/DEMOPROG.SDK Disk 143360 $0118 DEMO.PROGRAM $ nulib2 -p /mnt/MAUX/ARC/DEMOPROG.SDK > ORIG.PO $ == cmp is silent: the disk imaged through dd is the disk inside the 1990 archive (t=113.3 s) $ nulib2 -v /mnt/MAUX/ARC/DEMOPROG.SDK Disk 143360 $0118 DEMO.PROGRAM $ nulib2 -p /mnt/MAUX/ARC/DEMOPROG.SDK > ORIG.PO $ cmp FLOP.PO ORIG.PO $ == both files are the host's disk, byte for byte (t=118.7 s) $ nulib2 -v /mnt/MAUX/ARC/DEMOPROG.SDK Disk 143360 $0118 DEMO.PROGRAM $ nulib2 -p /mnt/MAUX/ARC/DEMOPROG.SDK > ORIG.PO $ cmp FLOP.PO ORIG.PO $ cksum FLOP.PO ORIG.PO 3281621541 143360 FLOP.PO 3281621541 143360 ORIG.PO $