[OpenBIOS] How does one use the partition access functions

Laurent Vivier Laurent at vivier.eu
Mon Feb 9 18:25:16 CET 2009


Hi,

look at CHRP System binding, http://www.openfirmware.info/data/docs/CHRP.ps 
, p. 56:

11.1.2.  Open Method Algorithm
...

11.1.2.7.6.  CHECK_FOR_MAC_DISK
11.1.2.7.7.  If this is a Mac partitioned disk
11.1.2.7.7.1.  Search the Mac partition table for the first
"bootable" partition. A partition is "bootable"
when the pmPartStatus flags indicate that this is
a valid, allocated, readable and bootable
partition and the pmProcessor field contains
"powerpc" (using case-insensitive matching).
11.1.2.7.7.2.  If a Mac "bootable" partition is found
11.1.2.7.7.2.1.  If FILENAME$ is "%BOOT"
11.1.2.7.7.2.1.1.  If the Nth partition is marked bootable
11.1.2.7.7.2.1.1.1.  Set D.OFFSET to the byte offset from the
beginning of the disk to the beginning of
the boot area, as given by the
pmLgBootStart field.
11.1.2.7.7.2.1.1.2.  Set D.SIZE to the size of the partition in bytes
denoted by pmBootSize.
11.1.2.7.7.2.1.1.3.  Return OKAY
11.1.2.7.7.2.2.  Else
11.1.2.7.7.2.2.1.  If the FILENAME$ is the null string
11.1.2.7.7.2.2.1.1.  Set D.OFFSET to the byte offset of the "real"
partition data
11.1.2.7.7.2.2.1.2.  Set D.SIZE to the size of the "real" partition
data
11.1.2.7.7.2.2.2.  Else
11.1.2.7.7.2.2.2.1.  INTERPOSE_BY_TYPE
11.1.2.7.7.2.2.3.  Return OKAY
11.1.2.7.7.3.  Else
  ...

Le 9 févr. 09 à 17:40, Lennart Sorensen a écrit :

> I see there are functions for accessing partition info in
> modules/mac-parts.[ch] among others.  I do not see any of the code  
> using
> any of these functions however.
>
> I am trying to fix booting on powermac's under qemu so that it  
> actually
> looks at each partition entry and determines if it is flagged as
> bootable, and if so looks at the load size and load address specified
> there and boots that.
>
> The idea is to replace the broken quik boot code, with something that
> actually does what the boot loader says to do, not what the openbios
> assumes it wants to do.
>
> Does anyone have any hint as to how to actually use these nice  
> partition
> access functions so I can look at each partition table entry until I
> find the bootable one (if any)?
>
> -- 
> Len Sorensen
>
> --
> OpenBIOS                 http://openbios.org/
> Mailinglist:  http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you




More information about the OpenBIOS mailing list