mirror of
https://github.com/vivier/EMILE.git
synced 2025-02-25 23:29:10 +00:00
Create a more generic data structure for mkisofs, allows to write my own apple driver
This commit is contained in:
parent
54521d6fe9
commit
151189f71f
@ -118,46 +118,45 @@ static int create_apple_driver(char *temp, char *appledriver, char *first_level)
|
||||
memset(&block0, 0, sizeof(block0));
|
||||
write_short(&block0.Sig, DD_SIGNATURE);
|
||||
write_short(&block0.BlkSize, BLOCKSIZE);
|
||||
write_long(&block0.BlkCount, 0);
|
||||
write_long(&block0.BlkCount, 0); // set by mkisofs
|
||||
write_short(&block0.DevType, 1);
|
||||
write_short(&block0.DevId, 1);
|
||||
write_long(&block0.Data, 0);
|
||||
write_short(&block0.DrvrCount, 1);
|
||||
|
||||
write_long(&block0.DrvInfo[0].Block, 16); /* start block in BlkSize blocks */
|
||||
write_short(&block0.DrvInfo[0].Size, 4); /* in 512 block size */
|
||||
write_long(&block0.DrvInfo[0].Block, 0);
|
||||
write_short(&block0.DrvInfo[0].Size, (st.st_size + 512 - 1) / 512);
|
||||
write_short(&block0.DrvInfo[0].Type, kDriverTypeMacSCSI);
|
||||
|
||||
memset(&map512, 0, sizeof(map512));
|
||||
write_short(&map512.Sig, MAP_SIGNATURE);
|
||||
write_long(&map512.MapBlkCnt, 5);
|
||||
write_long(&map512.PyPartStart, 64); // 64 * 512
|
||||
write_long(&map512.PartBlkCnt, 128); // 128 * 512
|
||||
write_long(&map512.PartBlkCnt, (st.st_size + 512 - 1) / 512);
|
||||
write_long(&map512.PyPartStart,0);
|
||||
strncpy(map512.PartName, "Macintosh", 32);
|
||||
strncpy(map512.PartType, APPLE_DRIVER43, 32);
|
||||
write_long((unsigned int*)(map512.PartType + 28), kPatchSnag);
|
||||
write_long(&map512.LgDataStart, 0);
|
||||
write_long(&map512.DataCnt, 128);
|
||||
write_long(&map512.PartStatus, 0x0000007f);
|
||||
write_long(&map512.DataCnt, 0);
|
||||
write_long(&map512.PartStatus, kPartitionAUXIsValid |
|
||||
kPartitionAUXIsAllocated |
|
||||
kPartitionAUXIsInUse |
|
||||
kPartitionAUXIsBootValid |
|
||||
kPartitionAUXIsReadable |
|
||||
kPartitionAUXIsWriteable |
|
||||
kPartitionAUXIsBootCodePositionIndependent |
|
||||
kPartitionIsChainCompatible |
|
||||
kPartitionIsRealDeviceDriver);
|
||||
write_long(&map512.LgBootStart, 0);
|
||||
write_long(&map512.BootSize, 9622);
|
||||
write_long(&map512.BootSize, st.st_size);
|
||||
write_long(&map512.BootAddr, 0);
|
||||
write_long(&map512.BootAddr2, 0);
|
||||
write_long(&map512.BootEntry, 0);
|
||||
write_long(&map512.BootEntry2, 0);
|
||||
write_long(&map512.BootCksum, 0xb7fb);
|
||||
write_long(&map512.BootCksum, emile_checksum(driver, st.st_size));
|
||||
strncpy(map512.Processor, "68000", 16);
|
||||
map512.Pad[1] = 0x5200;
|
||||
map512.Pad[3] = 0x0e00;
|
||||
map512.Pad[13] = 0x2b00;
|
||||
write_long((u_int32_t*)map512.Pad, kSCSICDDriverSignature);
|
||||
|
||||
map2048 = map512;
|
||||
write_long(&map2048.BootSize, 7146);
|
||||
write_long(&map2048.PyPartStart, read_long(&map512.PyPartStart) / 4);
|
||||
write_long(&map2048.PartBlkCnt, read_long(&map512.PartBlkCnt) / 4);
|
||||
write_long(&map2048.BootCksum, 0x84b8);
|
||||
|
||||
write_long((unsigned int*)(map512.Pad + 186), 0x4d524b53); // 'MRKS'
|
||||
write_long(&map2048.PartBlkCnt, (st.st_size + BLOCKSIZE - 1) / BLOCKSIZE);
|
||||
|
||||
strcpy(temp, "/tmp/emile-mkisofs-XXXXXX");
|
||||
mkstemp(temp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user