XMB plugin and USB file creation (usbhostfs)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
psptools
Posts: 1
Joined: Wed Apr 02, 2008 5:24 am

XMB plugin and USB file creation (usbhostfs)

Post by psptools »

Hi all,

Recently I have begun development on the PSP, I have started with a (XMB) plugin module for firmware 3.90 m33.

I have a question regarding my plugin and, maybe it is related, a question about usbhostfs. If someone would be so kind as to explain a few things for me I would really appreciate it!

1) My understanding is a module (prx) can be either usermode or kernel mode. I use the following macro to start my plugin as kernel: PSP_MODULE_INFO("Save game manager", 0x1000, 1, 1);

The compiled prx is then stored in the memory stick under seplugins (and activated on the PSP recovery menu).

Is it correct to assume a XMB plugin can run correctly in kernel mode?

Is user mode just a restricted (non-administrator) mode, or is there a use for it?

2) I am trying to create a test file via USB using the usbhostfs driver with the sceIO functions.. however even though the calls to all functions return success no file is created?

Here is a snippet of my function:

Code: Select all

u32 module = sceKernelLoadModule("ms0:/usbhostfs.prx", 0, NULL);
sceKernelStartModule(module, 0, NULL, NULL, NULL);

sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0); 
sceUsbStart("USBHostFSDriver", 0, 0); 
sceUsbActivate(0x1C9);

// delay here for driver initialisation.
Then I assume it's ready for access? maybe I need to mount / assign usb drive first?

At this point the PC running usbhostfs acknowledges the usb connection.

Here is how I continue on to write a test file:

Code: Select all

 SceUID suid = sceIoOpen("host0:/test.txt", PSP_O_WRONLY | PSP_O_CREAT, 0777);
sceIoWrite(suid, "T", 1);
sceIoClose(suid);
again, I am only assuming from various source examples host0:/ is the correct drive name?

I really have searched and for days tried various methods to access usb host. It's definately put a halt on my development; so as a last resort I hope someone here can shed some light on what I missed or did wrongly.

Thank you for your time.

C.
Post Reply