[OpenBIOS] testing Mac OS X boot on latest trunk (revision 1075)

Amadeusz Sławiński amade at asmblr.net
Mon Dec 3 23:30:18 CET 2012


On Mon, Dec 03, 2012 at 08:22:36PM +0000, Mark Cave-Ayland wrote:
> On 30/11/12 21:09, Amadeusz Sławiński wrote:
> 
> > Current trunk (1075) lists some files and doesn't boot at all
> >
> > Welcome to OpenBIOS v1.0 built on Nov 30 2012 19:55
> > Trying hd:,\\:tbxi...
> > Trying hd:,\ppc\bootinfo.txt...
> > No valid state has been set by load or init-program
> >
> > 0>  boot cd:,\\:tbxi>>  Not a bootable ELF image
> > No valid state has been set by load or init-program
> >   ok
> > 0>  dir cd:9,\
> >       73728 2002-07-18 08:21:48 Desktop DB
> >           0 2002-07-18 08:21:49 Desktop DF
> >           0 2002-07-18 08:21:49 Finder
> >           0 2002-07-18 08:21:49 OSXBoot!
> >           0 2002-07-18 08:21:50 System
> >        1778 2002-07-18 08:21:49 Where_have_all_my_files_gone?
> >   ok
> > 0>  boot cd:9,\\:tbxi No valid state has been set by load or init-program
> >   ok
> > 0>
> >
> > After testing with this patch:
> > http://lists.openbios.org/pipermail/openbios/2011-August/006618.html
> > I have better results
> >
> > Welcome to OpenBIOS v1.0 built on Nov 30 2012 20:00
> > Trying hd:,\\:tbxi...
> > Trying hd:,\ppc\bootinfo.txt...
> > No valid state has been set by load or init-program
> >
> > 0>  boot cd:,\\:tbxi>>  Not a bootable ELF image
> > No valid state has been set by load or init-program
> >   ok
> > 0>  dir cd:9,\
> >          82 2002-07-24 17:47:43  ._Welcome to Mac OS X
> >        6148 2002-07-31 23:59:42  .DS_Store
> >           0 2002-07-31 23:59:37  .Trashes\
> >           0 2002-07-29 03:06:27  .vol\
> >           0 2002-07-30 10:00:25  Applications\
> >           0 2002-07-31 23:43:08  bin\
> >        5120 2002-07-31 23:59:40  Desktop DB
> >       25410 2002-07-31 23:59:40  Desktop DF
> >           0 2002-07-15 06:20:41  dev\
> >          11 2002-07-31 23:57:11  etc
> >           0 2002-07-30 10:14:44  Library\
> >          11 2002-07-31 23:57:11  mach
> >     3678188 2002-07-28 20:19:43  mach_kernel
> >           0 2002-07-30 10:57:00  private\
> >           0 2002-07-31 23:41:16  sbin\
> >           0 2002-07-30 10:57:38  System\
> >          11 2002-07-31 23:58:55  tmp
> >           0 2002-07-30 10:03:14  usr\
> >          11 2002-07-31 23:58:58  var
> >           0 2002-07-29 03:06:27  Volumes\
> >           0 2002-07-30 11:07:00  Welcome to Mac OS X\
> >           0 2002-07-19 08:21:48  HFS+ Private Data\
> >   ok
> > 0>  boot cd:9,\\:tbxi call-method slw_update_keymap: exception -21
> >
> >
> > Here is also a listing of partitions on mine boot disk,
> >
> > # mac-fdisk /home/amade/emu/Mac\ OS\ 10.2\ \(Disc\ 1\).img
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img
> > Command (? for help): p
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img
> >                                          #                    type name                length   base    ( size )  system
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img1     Apple_partition_map Apple                   63 @ 1       ( 31.5k)  Partition map
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img2          Apple_Driver43 Macintosh               56 @ 64      ( 28.0k)  Driver 4.3
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img3       Apple_Driver43_CD Macintosh              140 @ 120     ( 70.0k)  Unknown
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img4              Apple_Void                          0 @ 0       (  0.0k)  Unknown
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img5      Apple_Driver_ATAPI Macintosh               56 @ 260     ( 28.0k)  Unknown
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img6      Apple_Driver_ATAPI Macintosh              140 @ 316     ( 70.0k)  Unknown
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img7           Apple_Patches Patch Partition        512 @ 456     (256.0k)  Unknown
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img8              Apple_Void                          0 @ 0       (  0.0k)  Unknown
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img9               Apple_HFS Mac_OS_X           1278432 @ 968     (624.2M)  HFS
> > /home/amade/emu/Mac OS 10.2 (Disc 1).img10             Apple_Free                      45656 @ 1279400 ( 22.3M)  Free space
> >
> > Block size=2048, Number of Blocks=331264
> > DeviceType=0x1, DeviceId=0x1
> > Drivers-
> > 1: @ 16 for 5, type=0x1
> > 2: @ 30 for 25, type=0xffff
> > 3: @ 65 for 5, type=0x701
> > 4: @ 79 for 31, type=0xf8ff
> >
> > Command (? for help):
> >
> > Two similar (to me) things which probably still need fixing in filesystem handling are
> > 1. "boot cd:,\\:tbxi" should do some kind of search through partitions
> > 2. later in boot process it goes through partitions 0,1,2 seemingly from
> > comments on GSOC patches expecting some of them to be ignored
> > (http://asmblr.net/scrot/2012-11-30-211915_1366x768_scrot.png)
> > screenshot is from bios with gsoc patches
> >
> > Also I wonder if "Still waiting for root device" problem which I have
> > with gsoc patches, isn't caused by not going properly through partitions
> > or even expecting them to be numbered differently (but those are just
> > speculations)
> 
> The code to auto-search for partitions is present, but the criteria used 
> to select the partition is not exactly known. The current choices are 
> either based upon partition flags, e.g. is it bootable or filesystem 
> type which is the approach the patch takes. If you could temporarily 
> modify OpenBIOS to dump the partition flags for each of the above 
> partitions, that may reveal a suitable combination of flags.
> 
> 
> ATB,
> 
> Mark.
> 
> -- 
> OpenBIOS                 http://openbios.org/
> Mailinglist:  http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you

Code for reference (and in case I need to use it again :P)

printk("mac-parts: counted %d partitions\n", __be32_to_cpu(par.pmMapBlkCnt));
for (d = 1; d <= __be32_to_cpu(par.pmMapBlkCnt); d++) {
			
SEEK( bs * d );
READ( &par, sizeof(par) );

printk("Partition: %d\n", d);

printk("pmSig: %x\n", __be16_to_cpu(par.pmSig));
printk("pmSigPad: %x\n", __be16_to_cpu(par.pmSigPad));
printk("pmMapBlkCnt: %x\n", __be32_to_cpu(par.pmMapBlkCnt));
printk("pmPyPartStart: %x\n", __be32_to_cpu(par.pmPyPartStart));

printk("pmPartBlkCnt: %x\n", __be32_to_cpu(par.pmPartBlkCnt));
printk("pmPartName: %s\n", par.pmPartName);
printk("pmPartType: %s\n", par.pmPartType);

printk("pmLgDataStart: %x\n", __be32_to_cpu(par.pmLgDataStart));
printk("pmDataCnt: %x\n", __be32_to_cpu(par.pmDataCnt));
printk("pmPartStatus: %x\n", __be32_to_cpu(par.pmPartStatus));
printk("pmLgBootStart: %x\n", __be32_to_cpu(par.pmLgBootStart));
printk("pmBootSize: %x\n", __be32_to_cpu(par.pmBootSize));
printk("pmBootLoad: %x\n", __be32_to_cpu(par.pmBootLoad));
printk("pmBootLoad2: %x\n", __be32_to_cpu(par.pmBootLoad2));
printk("pmBootEntry: %x\n", __be32_to_cpu(par.pmBootEntry));
printk("pmBootEntry2: %x\n", __be32_to_cpu(par.pmBootEntry2));
printk("pmBootCksum: %x\n", __be32_to_cpu(par.pmBootCksum));
printk("pmPartType: %s\n", par.pmProcessor);
printk("filler: %s\n", par.filler);

printk("\n");
}

Output Max OS X 10.2 disk 1:
>> mac-parts: counted 10 partitions
>> Partition: 1
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 1
>> pmPartBlkCnt: 3f
>> pmPartName: Apple
>> pmPartType: Apple_partition_map
>> pmLgDataStart: 0
>> pmDataCnt: 3f
>> pmPartStatus: 17
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 2
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 40
>> pmPartBlkCnt: 38
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver43
>> pmLgDataStart: 0
>> pmDataCnt: 38
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: 2400
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 7b04
>> pmPartType: 
>> filler: ptDR

>> Partition: 3
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 78
>> pmPartBlkCnt: 8c
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver43_CD
>> pmLgDataStart: 0
>> pmDataCnt: 8c
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: c400
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 934b
>> pmPartType: 
>> filler: CDrv

>> Partition: 4
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 0
>> pmPartBlkCnt: 0
>> pmPartName: 
>> pmPartType: Apple_Void
>> pmLgDataStart: 0
>> pmDataCnt: 0
>> pmPartStatus: 0
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 5
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 104
>> pmPartBlkCnt: 38
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver_ATAPI
>> pmLgDataStart: 0
>> pmDataCnt: 38
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: 2600
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 70da
>> pmPartType: 
>> filler: ptDR

>> Partition: 6
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 13c
>> pmPartBlkCnt: 8c
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver_ATAPI
>> pmLgDataStart: 0
>> pmDataCnt: 8c
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: f200
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 8b46
>> pmPartType: 
>> filler: ATPI

>> Partition: 7
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 1c8
>> pmPartBlkCnt: 200
>> pmPartName: Patch Partition
>> pmPartType: Apple_Patches
>> pmLgDataStart: 0
>> pmDataCnt: 200
>> pmPartStatus: 1
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 1
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 8
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 0
>> pmPartBlkCnt: 0
>> pmPartName: 
>> pmPartType: Apple_Void
>> pmLgDataStart: 0
>> pmDataCnt: 0
>> pmPartStatus: 0
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 9
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 3c8
>> pmPartBlkCnt: 1381e0
>> pmPartName: Mac_OS_X
>> pmPartType: Apple_HFS
>> pmLgDataStart: 0
>> pmDataCnt: 1381e0
>> pmPartStatus: 4000007f
>> pmLgBootStart: 3af0
>> pmBootSize: c1000
>> pmBootLoad: 1c00000
>> pmBootLoad2: 0
>> pmBootEntry: 1c00cb0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: powerpc
>> filler: 

>> Partition: 10
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 1385a8
>> pmPartBlkCnt: b258
>> pmPartName: 
>> pmPartType: Apple_Free
>> pmLgDataStart: 0
>> pmDataCnt: 0
>> pmPartStatus: 0
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

Output Mac OS X 10.0

>> mac-parts: counted 10 partitions
>> Partition: 1
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 1
>> pmPartBlkCnt: 3f
>> pmPartName: Apple
>> pmPartType: Apple_partition_map
>> pmLgDataStart: 0
>> pmDataCnt: 3f
>> pmPartStatus: 17
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 2
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 40
>> pmPartBlkCnt: 38
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver43
>> pmLgDataStart: 0
>> pmDataCnt: 38
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: 2400
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: eb19
>> pmPartType: 
>> filler: ptDR

>> Partition: 3
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 78
>> pmPartBlkCnt: 78
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver43_CD
>> pmLgDataStart: 0
>> pmDataCnt: 78
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: c800
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: e9ad
>> pmPartType: 
>> filler: CDrv

>> Partition: 4
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 0
>> pmPartBlkCnt: 0
>> pmPartName: 
>> pmPartType: Apple_Void
>> pmLgDataStart: 0
>> pmDataCnt: 0
>> pmPartStatus: 0
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 5
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: f0
>> pmPartBlkCnt: 38
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver_ATAPI
>> pmLgDataStart: 0
>> pmDataCnt: 38
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: 2600
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 3cd4
>> pmPartType: 
>> filler: ptDR

>> Partition: 6
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 128
>> pmPartBlkCnt: 78
>> pmPartName: Macintosh
>> pmPartType: Apple_Driver_ATAPI
>> pmLgDataStart: 0
>> pmDataCnt: 78
>> pmPartStatus: 37f
>> pmLgBootStart: 0
>> pmBootSize: ea00
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: ce67
>> pmPartType: 
>> filler: ATPI

>> Partition: 7
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 1a0
>> pmPartBlkCnt: 200
>> pmPartName: Patch Partition
>> pmPartType: Apple_Patches
>> pmLgDataStart: 0
>> pmDataCnt: 200
>> pmPartStatus: 1
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 4
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 8
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 0
>> pmPartBlkCnt: 0
>> pmPartName: 
>> pmPartType: Apple_Void
>> pmLgDataStart: 0
>> pmDataCnt: 0
>> pmPartStatus: 0
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 

>> Partition: 9
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 3a0
>> pmPartBlkCnt: 11a788
>> pmPartName: Mac_OS_X
>> pmPartType: Apple_HFS
>> pmLgDataStart: 0
>> pmDataCnt: 11a788
>> pmPartStatus: 4000007f
>> pmLgBootStart: 3af0
>> pmBootSize: b4000
>> pmBootLoad: 1c00000
>> pmBootLoad2: 0
>> pmBootEntry: 1c005b4
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: powerpc
>> filler: 

>> Partition: 10
>> pmSig: 504d
>> pmSigPad: 0
>> pmMapBlkCnt: a
>> pmPyPartStart: 11ab28
>> pmPartBlkCnt: 254d0
>> pmPartName: 
>> pmPartType: Apple_Free
>> pmLgDataStart: 0
>> pmDataCnt: 0
>> pmPartStatus: 0
>> pmLgBootStart: 0
>> pmBootSize: 0
>> pmBootLoad: 0
>> pmBootLoad2: 0
>> pmBootEntry: 0
>> pmBootEntry2: 0
>> pmBootCksum: 0
>> pmPartType: 
>> filler: 




More information about the OpenBIOS mailing list