Irix Iso's???
#21
RE: Irix Iso's???
(06-04-2023, 03:04 PM)bitpak Wrote:  I have a couple of original IRIX CDs and want upload them to archive.org. What's the best way to create disk images under Mac OS?

Code:
% diskutil list
/dev/disk0 [ignore the system disk]

/dev/disk1 [looks like an IRIX disklabel]
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:        CD_partition_scheme                        *14.6 MB    disk1
   1:              CD_ROM_Mode_1                         12.7 MB    disk1s0

% sudo dd if=/dev/disk1s0 of=SGI-IRIX-product.image bs=2k

Personaliris O2 Indigo2 R10000/IMPACT Indigo2 R10000/IMPACT Indigo2 Indy   (past: 4D70GT)
robespierre
refector peritus

Trade Count: (0)
Posts: 640
Threads: 3
Joined: Nov 2020
Location: Massholium
Find Reply
06-04-2023, 03:53 PM
#22
RE: Irix Iso's???
Thanks, that worked, but the size of the image is smaller than if I make it from the menu of DiskUtility. What about that 'CD_partition_scheme'? Isn't it also important for the image?

Octane Indy
bitpak
CG enthusiast

Trade Count: (0)
Posts: 23
Threads: 3
Joined: Nov 2021
Location: Far East
Website Find Reply
06-04-2023, 05:05 PM
#23
RE: Irix Iso's???
The images created by DiskUtility (or hdiutil, the command line version) contain headers that are specific to MacOS, which create problems when they are used on other systems.

The "CD_partition_scheme" is a synthesized device (marked by a * next to the size). It is there because CDs can have multiple tracks, each using different modes, and the operating system needs some place to store that information. On the disc itself there is no "partition scheme": it instead carries that information in the form of the lead-in and lead-out areas, which are inaccessible as data to the host. This additional information is also added to disk images when DiskUtility or hdiutil creates them, in a format specific to those tools.

An image of an IRIX CD comprises every 2048-byte sector in Track #1. When burned to a CD-R, it will function identically to the original (because although there may be some differences in ancillary data such as ATIP and MCN, only specialized burning software such as CDrecord can see them). The data is always on the first track using Mode 1 (2048-byte sectors). Some discs may have had additional audio tracks, but no additional data tracks as far as I am aware.

The way the data is partitioned from the SGI's point of view is actually irrelevant to making a perfect copy. It's just a blob of sectors.

To check if an image file is valid,

Code:
% hexdump -C SGI-IRIX-product.image | less -B
00000000  0b e5 a9 41 00 00 00 00  00 00 00 00 00 00 00 00 ....

This usually means the image was created correctly, although I have seen images on archive.org that began correctly but were prematurely truncated.
The "0b e5 a9 41" is a magic number used to identify the beginning of a MIPS/SGI disklabel.

An image of the sectors in a track has no internal indication of completeness. There are two ways to check if it has been truncated:
1. Check the length of the track on the original disc.
Code:
% drutil toc
Vendor   Product           Rev
PIONEER  DVD-RW  DVR-XD10  1.00

    First session:             1
    Last session:              1
    First track:               1
    Disc type:                 0 (CD-DA, or CD-ROM with first track in Mode 1)
    Last track:                1
    Lead-out:                  01:24.40
    Session  1, Track  1:      00:02.00  data track, digital copy prohibited

Because the first track begins at 2 seconds, and the lead-out begins at 1 minute, 24 seconds, 40 frames, we can calculate the number of frames in track 1 (in this example, it is 6190). Multiply that by 2048 bytes per frame (sector), and this disc has a data area 12677120 bytes long. If the image is that size, it was not truncated.

2. The second way is to interpret the SGI disklabel to see if the image is long enough to contain all of the SGI partitions. This is more involved, but you can read the archived Nekochan thread to see some ways to do it.

Personaliris O2 Indigo2 R10000/IMPACT Indigo2 R10000/IMPACT Indigo2 Indy   (past: 4D70GT)
(This post was last modified: 06-04-2023, 07:28 PM by robespierre. Edit Reason: added ways to check for truncation )
robespierre
refector peritus

Trade Count: (0)
Posts: 640
Threads: 3
Joined: Nov 2020
Location: Massholium
Find Reply
06-04-2023, 07:08 PM
#24
RE: Irix Iso's???
Thank you for such detailed explanation! It's very helpful.

Octane Indy
bitpak
CG enthusiast

Trade Count: (0)
Posts: 23
Threads: 3
Joined: Nov 2021
Location: Far East
Website Find Reply
06-05-2023, 01:57 AM
#25
RE: Irix Iso's???
If you have ksh or zsh, a shorter script to check if a disc image is long enough is:
Code:
#!/bin/zsh
print $(( 0x$(xxd -p -s432 -l4 "$1") * 512 ))
(It will also work with the first line changed to "#!/bin/ksh")

If you save this file as "efslength", for example, and make it executable with chmod +x efslength
You could invoke it using
Code:
./efslength SGI-IRIX-image.img
and it will print the minimum number of bytes that the image should contain. If the file length in
Code:
ls -l SGI-IRIX-image.img
is less than this minimum, the image has been truncated.

Putting it all together, (and this only works in zsh):
Code:
#!/bin/zsh
if [[ $( xxd -p -l4 "$1" ) != 0be5a941 ]] then
    print "${1:t} is not a valid IRIX disc image"; exit 1; fi
integer len1=$(( 0x$( xxd -p -s432 -l4 "$1" ) * 512 ))
integer len2=${$( ls -l "$1" ):4:1}
print "Disklabel Minimum Size: " $len1
print "Disc Image Size:        " $len2
if [[ -s "$1" && $len1 -le $len2 ]] then
    print "${1:t} appears to be a complete disc image"; else
    print "${1:t} appears to be truncated"; fi

Personaliris O2 Indigo2 R10000/IMPACT Indigo2 R10000/IMPACT Indigo2 Indy   (past: 4D70GT)
(This post was last modified: 06-24-2023, 05:43 PM by robespierre.)
robespierre
refector peritus

Trade Count: (0)
Posts: 640
Threads: 3
Joined: Nov 2020
Location: Massholium
Find Reply
06-24-2023, 04:01 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)