It looks like the ps2dev9.irx and ps2atad.irx are loading OK, as I see their banners on the pksh console. My module will load OK if the start() routine does nothing. But when my module's start() tries to call ata_get_devinfo(), the PS2 hangs. I hear a clunk from the HDD, like something's being turned on, but that's it.
I have included the IRXs inline (irx2s) in the elf file, and they seem to be loading and initializing OK. Here are snippets of code, let me know if you need more:
exports.tab:
Code: Select all
DECLARE_EXPORT_TABLE(ext2fs, 1, 2)
DECLARE_EXPORT(_start)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(shutdown)
DECLARE_EXPORT(_retonly)
END_EXPORT_TABLE
void _retonly() {}
Code: Select all
stdio_IMPORTS_start
I_printf
stdio_IMPORTS_end
atad_IMPORTS_start
I_ata_get_devinfo
I_ata_device_dma_transfer
I_ata_device_sec_unlock
I_ata_device_idle
I_ata_device_sce_security_init
I_ata_device_smart_get_status
I_ata_device_smart_save_attr
I_ata_device_flush_cache
atad_IMPORTS_end
Code: Select all
#define MODNAME "ext2fs"
IRX_ID(MODNAME, 1, 1);
int _start(void)
{
int drive = 0;
ata_devinfo_t * devinfo;
printf("ext2fs: calling ata_get_devinfo(%d)\n", drive);
devinfo = ata_get_devinfo(drive);
if (devinfo == 0) {
printf("ext2fs: ata_get_devinfo() failed for drive %d\n", drive);
return 1;
}
printf("ext2fs: ata_get_devinfo(%d) success!\n", drive);
printf("ext2fs: exists = %d\n", devinfo->exists);
printf("ext2fs: has_packet = %d\n", devinfo->has_packet);
printf("ext2fs: total_sectors = %u\n", devinfo->total_sectors);
printf("ext2fs: security_status = %u\n", devinfo->security_status);
return 0;
}
int shutdown(void)
{
return 0;
}
Code: Select all
int main(int argc, char * argv[])
{
SifInitRpc(0);
sbv_patch_enable_lmb();
if (loadModule(usbd_IRX_START, usbd_IRX_SIZE, "usbd")) goto err;
if (loadModule(ps2kbd_IRX_START, ps2kbd_IRX_SIZE, "ps2kbd")) goto err;
if (loadModule(poweroff_IRX_START,poweroff_IRX_SIZE,"poweroff")) goto err;
if (loadModule(iomanX_IRX_START, iomanX_IRX_SIZE, "iomanX")) goto err;
if (loadModule(fileXio_IRX_START, fileXio_IRX_SIZE, "fileXio")) goto err;
if (loadModule(ps2dev9_IRX_START, ps2dev9_IRX_SIZE, "ps2dev9")) goto err;
if (loadModule(ps2atad_IRX_START, ps2atad_IRX_SIZE, "ps2atad")) goto err;
npmPuts("--loading my lib--\n");
if (loadModule(ext2fs_IRX_START, ext2fs_IRX_SIZE, "ext2fs")) goto err;
npmPuts("--my lib loaded--\n");
kbd_loop();
err:
npmPuts("-------EXITING-------\n");
SleepThread();
return 0;
}
thx, m