[openfirmware] Using Open Firmware as a boot manager

Mitch Bradley wmb at laptop.org
Thu Mar 17 18:20:07 CET 2011



On 3/16/2011 7:43 AM, Mark Morgan Lloyd wrote:
> No rush, obviously.
> 
> OK, that's working. What is c actually representing here- the entire disc?


It represents the default partition, except in the case of ".partitions", which explicitly adds the "whole disk" partition specifier.

 /pci/pci-ide at 1f,1/ide at 0/disk at 0    means the default partition
 /pci/pci-ide at 1f,1/ide at 0/disk at 0:0  means the whole disk
 /pci/pci-ide at 1f,1/ide at 0/disk at 0:1  means the first partition
 /pci/pci-ide at 1f,1/ide at 0/disk at 0:2  means the second partition
 /pci/pci-ide at 1f,1/ide at 0/disk at 0:1,\foo   means the file "foo" on the first partition

> 
> I've set myself up a disk with DOS and Linux which .partitions c 
> describes as
> 
> 1 Primary Yes FAT-16>32M 37
> 2 Primary No Extended 2252
> 2 Logical No FAT-16>32M 2045
> 3 Logical No 0x82 207
> 
> That final partition isn't right, it's actually filling all the 
> otherwise-unused space on a 6Gb disc, but let's skip that for the moment.
> 
> What do I define d as so I can look at the content of the second FAT 
> partition? 


 /pci/pci-ide at 1f,1/ide at 0/disk at 0:2

> What is disk at 0- a reference to a block?

   ide at 0 means the primary IDE string.  ide at 1 means the secondary string
   disk at 0 means the master disk on the string.  disk at 1 means the slave disk

> 
> What do I need to do to look in the Linux filesystem, including 
> identifying what file in /boot can be booted?

ok dir /pci/pci-ide at 1f,1/ide at 0/disk at 0:2,\boot\

Alternatively:

ok dir /ide/disk:2,\boot\

You can omit path components that are unnecessary for disambiguation, because OFW will look for anything that matches.

 Can I then boot/load it?

ok boot /ide/disk:2,\boot\vmlinuz

> 
> Mitch Bradley wrote:
>> I'm traveling now and will be home tomorrow. I'll tell you more when I 
>> get home, but for now, you can try this:
>>
>> ok devalias c /pci/pci-ide at 1f,1/ide at 0/disk at 0
>> ok .partitions c
>> ok dir c:\
>>
>> On 3/16/2011 3:57 AM, Mark Morgan Lloyd wrote:
>>> Mark Morgan Lloyd wrote:
>>>
>>>>> http://www.firmworks.com/QuickRef.html
>>>>
>>>> Thanks, I'd missed that and had been working through the IEEE doc.
>>>
>>> OK, really trying baby steps here. Accepting that OFW doesn't implement
>>> or allow access to a PC-style BIOS, so can't be used to load any OS that
>>> makes BIOS calls (even if only during initialisation), how can I use it
>>> to examine the partition table, boot sectors, and possibly filesystems
>>> on an IDE disc?
>>>
>>> Specifically, on one of my development systems I can see a node
>>> /pci/pci-ide at 1f,1/ide at 0/disk at 0, but what comes next?
> 



More information about the openfirmware mailing list