Page 1 of 1
Problems with HDD access
Posted: Wed Sep 15, 2004 8:55 am
by MrSiir[S]
Hello, i have problems with HDD access:
When start application, no load the HDD access modules, load SIO2MAN, PADMAN, MCMAN and MCSERV with "SifLoadModule", and NPM-USBD and USB_MASS with "SifExecModuleBuffer", if user presses one button, I need load HDD modules, I write another function with load of poweroff, iomanX, fileXio, ps2dev9, ps2atad, ps2hdd and ps2fs in this order, modules load with "SifExecModuleBuffer", if try to run application across ps2link or pukklink, works fine, but, if copy the application in the MC and run, freeze in loading HDD modules screen.
I try to load ps2ip and ps2map modules and same freeze.
Any one helps to me?
Thanks in advance,
MrSiir
Posted: Wed Sep 15, 2004 11:20 am
by MrSiir[S]
I have a small example of access to the hard disk that works to me with ps2link, but does not work to me from memory card, which I am making bad?
Code: Select all
/******************************************************************
*
* PS2 HDD Test - MrSiir / Siirlabs (mrsiir@gmail.com)
*
******************************************************************/
#include <kernel.h>
#include <sifrpc.h>
#include <loadfile.h>
#include <libhdd.h>
#include <sbv_patches.h>
#include <debug.h>
#include <fileio.h>
#include <iopheap.h>
#include <iopcontrol.h>
#define MAX_PARTITIONS 100
t_hddFilesystem parties[MAX_PARTITIONS] __attribute__((aligned(64)));
extern u8 *iomanx_irx;
extern int size_iomanx_irx;
extern u8 *filexio_irx;
extern int size_filexio_irx;
extern u8 *ps2dev9_irx;
extern int size_ps2dev9_irx;
extern u8 *ps2atad_irx;
extern int size_ps2atad_irx;
extern u8 *ps2hdd_irx;
extern int size_ps2hdd_irx;
extern u8 *ps2fs_irx;
extern int size_ps2fs_irx;
extern u8 *poweroff_irx;
extern int size_poweroff_irx;
void poweroffHandler(int i)
{
hddPowerOff();
}
void LoadModules()
{
int ret;
static char hddarg[] = "-o" "\0" "4" "\0" "-n" "\0" "20";
static char pfsarg[] = "-m" "\0" "4" "\0" "-o" "\0" "10" "\0" "-n" "\0" "40" /*"\0" "-debug"*/;
scr_printf("SIO2MAN\n");
SifLoadModule("rom0:SIO2MAN", 0, NULL);
scr_printf("MCMAN\n");
SifLoadModule("rom0:MCMAN", 0, NULL);
scr_printf("MCSERV\n");
SifLoadModule("rom0:MCSERV", 0, NULL);
scr_printf("PADMAN\n");
SifLoadModule("rom0:PADMAN", 0, NULL);
scr_printf("poweroff.irx %i bytes\n", size_poweroff_irx);
SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret);
scr_printf("iomanx.irx %i bytes\n", size_iomanx_irx);
SifExecModuleBuffer(&iomanx_irx, size_iomanx_irx, 0, NULL, &ret);
scr_printf("filexio.irx %i bytes\n", size_filexio_irx);
SifExecModuleBuffer(&filexio_irx, size_filexio_irx, 0, NULL, &ret);
scr_printf("ps2dev9.irx %i bytes\n", size_ps2dev9_irx);
SifExecModuleBuffer(&ps2dev9_irx, size_ps2dev9_irx, 0, NULL, &ret);
scr_printf("ps2atad.irx %i bytes\n", size_ps2atad_irx);
SifExecModuleBuffer(&ps2atad_irx, size_ps2atad_irx, 0, NULL, &ret);
scr_printf("ps2hdd.irx %i bytes\n", size_ps2hdd_irx);
SifExecModuleBuffer(&ps2hdd_irx, size_ps2hdd_irx, sizeof(hddarg), hddarg, &ret);
scr_printf("ps2fs.irx %i bytes\n", size_ps2fs_irx);
SifExecModuleBuffer(&ps2fs_irx, size_ps2fs_irx, sizeof(pfsarg), pfsarg, &ret);
}
int main()
{
int i=0,nparty;
const char *eeloadimg = "rom0:UDNL rom0:EELOADCNF";
char *imgcmd = (char *)eeloadimg;
SifInitRpc(0);
fioExit();
SifExitIopHeap();
SifLoadFileExit();
SifExitRpc();
SifIopReset(imgcmd, 0);
while (SifIopSync()) ;
SifInitRpc(0);
sbv_patch_enable_lmb();
sbv_patch_disable_prefix_check();
init_scr();
scr_printf("HDD Test\n");
hddPreparePoweroff();
hddSetUserPoweroffCallback((void *)poweroffHandler,(void *)i);
LoadModules();
if(hddCheckPresent() < 0) {
scr_printf("NO HDD\n");
while(1);
}
if(hddCheckFormatted() < 0) {
scr_printf("HDD no formateado\n");
while(1);
}
i = hddGetFilesystemList(parties, MAX_PARTITIONS);
scr_printf("%i particiones\n", i);
nparty=i-1;
for(i=nparty;i>=0;i--) {
scr_printf("Particion: %s\n", parties[i].name);
}
scr_printf("The End\n");
while(1); //forever
return 0;
}
Thanks in advance,
MrSiir
Posted: Thu Sep 16, 2004 10:49 am
by MrSiir[S]
Arranged the topic of the HD, it was through the fault of the IRX, was using the IRX compiled for my of the SDK of the CVS and me they do not work well, I have used other IRX and they have worked to the first one.