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 

module pipes

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



Joined: 30 Sep 2007
Posts: 5

PostPosted: Sun Aug 17, 2008 2:02 pm    Post subject: module pipes Reply with quote

hi. im making a console homebrew, actually ive the base set up, 4 switchable tty with usual manipulations using keyboard ( pikey support, well only palm ok actually ), fnt font support, ... basics command (echo,cd,ls,...) are now embedded in the eboot, ive basics to run elf as modules, ... so my question is whats the best way to make pipes between eboot and modules ? in this case, ls - list will become a module and i need a way to pipe the return values ( files, sockets, ... ?)
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Aug 17, 2008 7:28 pm    Post subject: Reply with quote

I'm not sure to understand correctly your request, but if i do, you should take a look at the excellent module tutorial made by ???

http://ps2dev.org/psp/Tutorials/PSP_Modules,_Exports,_Imports_and_Patches.download
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Aug 17, 2008 7:28 pm    Post subject: Reply with quote

I'm not sure to understand correctly your request, but if i do, you should take a look at the excellent module tutorial made by ??? where you will find how to export some functions.

http://ps2dev.org/psp/Tutorials/PSP_Modules,_Exports,_Imports_and_Patches.download
Back to top
View user's profile Send private message
skarab



Joined: 30 Sep 2007
Posts: 5

PostPosted: Mon Aug 18, 2008 12:03 am    Post subject: Reply with quote

oh thanks. i was miss-thinking
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Mon Aug 18, 2008 1:38 am    Post subject: Reply with quote

There is a pipe primitive in the thread libraries you could use, however the issue comes down to having to pass those UIDs around, unfortunately each module/eboot does not get its own file descriptor table like on unix so you couldn't just use stdin/stdout/stderr.

Of course if you are willing to write a kernel module you might be able to do it ;) You could create a pipe file system which also hooks the sceKernelStdin/out/err and returns a different value depending on the module which called it. Massive cludge though ;)
Back to top
View user's profile Send private message
skarab



Joined: 30 Sep 2007
Posts: 5

PostPosted: Fri Aug 22, 2008 7:31 am    Post subject: Reply with quote

Thanks, i found my way through modules, simpler ;)
So, now i've: an eboot (called loader) which run a main module (called kernel), which run actually another module (called display_framebuffer).
Im adding config files stuff, got an arch. of files a bit like linux, but i've another problem:
in the loader.conf i specify which kernel the loader should run,
its run with LoadModule & StartModule and i make a chdir in the kernel folder (from the loader i mean & before load/start cause i know modules have different "current path"), kernel needs to read another config file (the very first step) which tell where is the "filesystem root" = fake partition. My problem is that the config file is located in the same folder than the kernel, but when the kernel starts the current path is not the kernel one (its empty, got it with getcwd without error).

So, when we load a module, does the "current path" seeing by the module has something to do with the "launcher" one ? can it be set in some parameters ?
.. else i know i should pass that with an exported function but it look more like a pain for that.

ps: i'll surely have few questions before uploading something to show here, so i wont open other thread and pollute only this one ;)
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Aug 22, 2008 8:25 am    Post subject: Reply with quote

The current path is taken from the first argument passed to the module in sceKernelStartModule, I assume you are not passing anything to it :)
Back to top
View user's profile Send private message
skarab



Joined: 30 Sep 2007
Posts: 5

PostPosted: Fri Aug 22, 2008 8:52 am    Post subject: Reply with quote

wao! ;) thats the case. thanks :)
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