[Cbe-oss-dev] PS3 harddisk access problem

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Mon Oct 15 17:29:21 EST 2007


	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.

> >> 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.

> >> 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).

With kind regards,
 
Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
 
Phone:    +32 (0)2 700 8453	
Fax:      +32 (0)2 700 8622	
E-mail:   Geert.Uytterhoeven at sonycom.com	
Internet: http://www.sony-europe.com/
 	
Sony Network and Software Technology Center Europe	
A division of Sony Service Centre (Europe) N.V.	
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium	
VAT BE 0413.825.160 · RPR Brussels	
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619


More information about the cbe-oss-dev mailing list