forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

XMB plugin and USB file creation (usbhostfs)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
psptools



Joined: 02 Apr 2008
Posts: 1

PostPosted: Wed Apr 02, 2008 5:55 am    Post subject: XMB plugin and USB file creation (usbhostfs) Reply with quote

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:

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:

 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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group