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 

Need some advice for a filesystem project

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



Joined: 17 Apr 2007
Posts: 39

PostPosted: Wed Jul 04, 2007 11:38 pm    Post subject: Need some advice for a filesystem project Reply with quote

Hi everyone,
I'm thinking about implementing a different filesystem for accessing the memory stick, FAT is really not good for flash devices anyway, i'm able to redirect access to ms0 to my own driver, and it works in a test homebrew.
But i can't find a way to make the redirect stable , so that XMB will use it.

I'm using CF 3.40, in 1.50 kernel mode, to bypass the protection against redirecting ms0 of newer firmwares.
Back to top
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Thu Jul 05, 2007 5:15 am    Post subject: Reply with quote

You'll need to reimplement fatmsmod.prx & co.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Jul 05, 2007 5:40 am    Post subject: Reply with quote

You should probably check for FAT anyway and pass calls along to the old functions (or implement FAT yourself) so that "normal" sticks can also be used by your new fs.
Back to top
View user's profile Send private message AIM Address
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Thu Jul 05, 2007 6:22 am    Post subject: Reply with quote

adrahil wrote:
You'll need to reimplement fatmsmod.prx & co.

I don't think that it's really needed, i already can open the raw memstick using sceIoOpen("msstor0:",PSP_O_RDWR,0), so it should be possible to write a driver that acces the raw memory, and call sceAssign("ms0", "my_fs",NULL,IOASSIGN_RDWR,NULL,0)

At this moment i have a prototype driver loaded as a plugin by the custom firmware, it registers the "my_fs" driver, but i can't find a way to call it with my homebrew, if i do

sceIoOpen("my_fs:/whatever",PSP_O_RDWR|PSP_O_CREAT,777)
i got a NODEV error.

Is there anything i'm missing to use a driver registered from a plugin?

It worked perfectly when i was loading the module with pspSdkLoadStartModule from the homebrew
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Thu Jul 05, 2007 11:10 am    Post subject: Reply with quote

alexp wrote:

At this moment i have a prototype driver loaded as a plugin by the custom firmware, it registers the "my_fs" driver, but i can't find a way to call it with my homebrew, if i do

sceIoOpen("my_fs:/whatever",PSP_O_RDWR|PSP_O_CREAT,777)
i got a NODEV error.

Is there anything i'm missing to use a driver registered from a plugin?

It worked perfectly when i was loading the module with pspSdkLoadStartModule from the homebrew

I've solved this problem, it happens using the 1.50 kernel mode, switching to 3.40 fixes it, but now i need to find out how to circumvent the ms0 redirect protection
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Mon Jul 09, 2007 2:24 am    Post subject: Reply with quote

Why don't you just delete the current fatms driver, and call your driver the same?

I mean, something like:

sceIoDelDrv("fatms");
sceIoAddDrv(&my_driver); // named "fatms" too

sceIoAssign("ms0:", "msstor0p1:", "fatms0:", IOASSIGN_RDWR, NULL, 0);

Also, the option of replacing fatmsmod of the flash with yours (at least in 3.XX kernel) would be fine, you wouldn't need the assign, because some other module would do it for you.

Btw, can i ask which filesystem are you gonna to implement? Just for curiosity :p
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Mon Jul 09, 2007 5:47 am    Post subject: Reply with quote

I'm now working on a custom log structured filesytem, which is more adapt to flash memory. It's not easy to implement other log structured filesytem (such as jffs2 or yaffs), because we have no access to the raw memory card, only a block device interface to it. I'm working both to a FUSE implementation of the filesytem under linux and to the psp driver

No plan for a windows port, sorry
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Wed Jul 11, 2007 11:45 am    Post subject: Reply with quote

hi,
i'm having a bit of problems with my fileystem and i feel i'm missing something.
I'm loading my code as a custom firmware plugin, so in XMB i got correct filesystem size, but if i try to select for example PHOTO, i only get a request for /DCIM, which is not present, so i return 0x80010002 (no such file or directory). I think that i should be getting other dopen request, such as /PSP/PHOTO, so i suspect i'm missing something, should i override something else apart ms0: to make XMB happy?

Thanks a lot for your help guys

Alessandro
Back to top
View user's profile Send private message
kururin



Joined: 05 Jul 2006
Posts: 36

PostPosted: Wed Jul 11, 2007 5:15 pm    Post subject: Reply with quote

alexp wrote:
hi,
i'm having a bit of problems with my fileystem and i feel i'm missing something.
I'm loading my code as a custom firmware plugin, so in XMB i got correct filesystem size, but if i try to select for example PHOTO, i only get a request for /DCIM, which is not present, so i return 0x80010002 (no such file or directory). I think that i should be getting other dopen request, such as /PSP/PHOTO, so i suspect i'm missing something, should i override something else apart ms0: to make XMB happy?

Thanks a lot for your help guys

Alessandro


I think there were two fatms drivers. fatms, and fatmsOem (or something like that). Also, i think you should handle the ioctl and devctl of the original drivers...
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Thu Jul 12, 2007 5:18 am    Post subject: Reply with quote

kururin wrote:

I think there were two fatms drivers. fatms, and fatmsOem (or something like that). Also, i think you should handle the ioctl and devctl of the original drivers...


I'm not writing a new fatms driver, I'm just doing something like this in my plugin:

sceIoUnassign("msoem0:");
sceIoAssign("msoem0:","pspfs0:",NULL,0, IOASSIGN_RDWR , 0);
sceIoUnassign("ms0:");
sceIoAssign("ms0:","pspfs0:",NULL,0, IOASSIGN_RDWR , 0);
sceIoUnassign("fatms0:");

Strangely enough if i do
sceIoAssign("fatms0:","pspfs0:",NULL,0, IOASSIGN_RDWR , 0);
the memory stick disappear from the xmb menu, anyone knows why?

Alessandro
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Thu Jul 12, 2007 9:35 am    Post subject: Reply with quote

I'm facing other strange behaviours, i hope someone can explain them to me

i have a DCIM directory in the root of my filesystem, it contains
.
..
101MSDCF <- directory

if i select the MC from the PHOTO menu in XMB, after a dopen & dread call to my filestem i get a call to getstat for /PSP/GAME/101MSDCF%/EBOOT.PBP, is there any reason for that? and most important, then i don't get any more calls, while i was expecting a call to dread for listing the file inside 101MSDCF

Any ideas will be really appreciated, the project is now going fairly well, it's possible from linux to create a directory tree and files around it
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Thu Jul 19, 2007 11:48 pm    Post subject: Reply with quote

hi,
in the end i was successfull in my file system writing attempt, and during the development i found out the meaning of some new devctl and ioctl codes, I want to release the code, so i was wondering what kind of license i can use,
pspsdk is BSD license, i'd like to release my code under GPL2/3 is that possible?
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Fri Jul 20, 2007 12:39 am    Post subject: Reply with quote

Yes
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Fri Jul 20, 2007 2:55 am    Post subject: Reply with quote

is it possible to publish it on ps2dev svn server or should i find some other storage solution?
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Fri Jul 20, 2007 5:28 am    Post subject: Reply with quote

Here it is my really_not_yet_ready filesystem code, i hope it can be useful to anyone

http://allievi.sssup.it/tatiana/pspfs-0.1.tar.bz2
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Jul 20, 2007 8:24 am    Post subject: Reply with quote

this link doesn't work at all
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri Jul 20, 2007 9:10 am    Post subject: Reply with quote

hlide wrote:
this link doesn't work at all


Try now
Back to top
View user's profile Send private message AIM Address
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