Hi to All,
I am porting minix to OLPC. Currently, I am able to boot minix on OLPC from a RAM disk. Minix can access the openfirmware services. As Minix doesn't have USB stack, it needs to use the openfirmware service routines to access the disk. Using openfirmware services I am able to read the disk. In order to properly initialize the minix disk device driver data structures, I need to figure out the size of the disk.
Following are the properties that I can see from openfirmware
ok devalias disk disk /usb@f,4/disk ok dev disk ok .properties iconname usbdisk compatible disk device_type block name disk
Can anyone please tell me how can I access the size of the disk parameter?
Thanks, Abhishek
Execute the "size" method. It returns the device size in bytes as a 64-bit number. You can invoke it with the "call_method" client service.
Alternatively, you can use the "#blocks" method (returns the number of blocks as a 32-bit number). The "block-size" method returns the size of a block, which will generally be 512 except for CD-ROM devices.
Abhishek Singh wrote:
Hi to All,
I am porting minix to OLPC. Currently, I am able to boot minix on OLPC from a RAM disk. Minix can access the openfirmware services. As Minix doesn't have USB stack, it needs to use the openfirmware service routines to access the disk. Using openfirmware services I am able to read the disk. In order to properly initialize the minix disk device driver data structures, I need to figure out the size of the disk.
Following are the properties that I can see from openfirmware
ok devalias disk disk /usb@f,4/disk ok dev disk ok .properties iconname usbdisk compatible disk device_type block name disk
Can anyone please tell me how can I access the size of the disk parameter?
Thanks, Abhishek
openfirmware mailing list openfirmware@openfirmware.info https://openfirmware.info/mailman/listinfo/openfirmware
openfirmware@openfirmware.info