[Cbe-oss-dev] PS3 harddisk access problem
James Jacobsson
slowcoder at mac.com
Mon Oct 15 18:06:17 EST 2007
Hi Geert,
On Oct 15, 2007, at 12:29 AM, Geert Uytterhoeven wrote:
> Hi James,
>
> On Fri, 12 Oct 2007, James Jacobsson wrote:
>> On Oct 12, 2007, at 11:17 AM, Geert Uytterhoeven wrote:
>>> On Fri, 12 Oct 2007, James Jacobsson wrote:
>>>> Long time lurker, first time poster here.
>>>> I'm experimenting with trying to port AROS to the PS3 platform, and
>>>> so-far things have gone pretty smoothly, but I am running into a
>>>> problem with accessing the hard-disk.
>>>> As the documentation for the hypervisor interface is sparse at
>>>> best,
>>>> and the existing Linux source-code for this is quite heavily
>>>> intermixed with the SCSI and ATA subsystems, I have some problems
>>>> with deducing what needs to be set up for this to happen.
>>>>
>>>> I've iterated through the busses, and found the hard-disk at bus
>>>> #4,
>>>> device #2. When querying the device for the key "id", it also
>>>> returns
>>>> 2, so I'm pretty sure I'm bang on when it comes to this part.
>>>>
>>>> Now, here comes the problems.
>>>> I tried doing the following immediately after the bus-iteration:
>>>> r = lv1_storage_read( 2, // DevID
>>>> reg, // RegID
>>>> 0, // Start sector
>>>> 1, // Num sector(s)
>>>> 0, // Flags
>>>> r_buff, // Buffer
>>>> &tag);
>>>> But it returns non-zero, so something apparently needs to be done
>>>> before I can read a sector.
>>>
>>> What's the return value?
>>
>> r = 0xfffffffffffffff5 (or, -11, or -0xB)
>
> That's LV1_WRONG_STATE, which is expected, as you didn't manage to
> open the
> device.
That's pretty much what I expected to get as well, as I knew of the
existence of the lv1_open_device() call.
I wanted to give it a shot though. :)
>>>> Doing the following works though:
>>>> r = lv1_storage_send_device_command(2, // Device ID
>>>> 0x23, // LV1_STORAGE_ATA_HDDOUT
>>>> 0,0,0,0,
>>>> &tag);
>>>>
>>>> So at least something is working.
>>>>
>>>> I've also tried doing:
>>>> r = lv1_open_device(4,2,0);
>>>> on the device before doing the lv1_storage_read() call, but the
>>>> open_device call fails as well.
>>>
>>> You don't call lv1_open_device() before
>>> lv1_storage_send_device_command()?
>>
>> Not at this time. I can't get the lv1_open_device() to return 0 no
>> matter what/when I do it.
>
> What's the return value of lv1_open_device()?
> Note that the order of storage device may be different after each
> reboot.
The return-value of lv1_open_device() is -6 (LV1_NO_ENTRY).
I actually presumed that the order of the storage-devices could be
different on other models of the PS3, but not on the same unit. No
matter though. I iterate the buses on boot, as well as print them to
the bootup log, so I'm keeping an eye on them.
>>>> It's probably something trivial that I'm missing here, but I just
>>>> can't seem to find what it is.
>>>
>>> What's the value of reg in the lv1_storage_read() call?
>>
>> 0xfffffffffffffff5
>
> That doesn't look like a valid region ID. So far they always seemed
> to match
> the region index (i.e. numbered from 0 on).
Ah, it would seem that I mis-read your question.
Since the hdd reports its "n_regs" key as 0, I used 0 as the region
in the lv1_storage_read() call.
/James
More information about the cbe-oss-dev
mailing list