module pipes

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

Moderators: cheriff, TyRaNiD

Post Reply
skarab
Posts: 5
Joined: Sun Sep 30, 2007 4:35 am

module pipes

Post by skarab »

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, ... ?)
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

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_Mod ... s.download
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

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_Mod ... s.download
skarab
Posts: 5
Joined: Sun Sep 30, 2007 4:35 am

Post by skarab »

oh thanks. i was miss-thinking
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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 ;)
skarab
Posts: 5
Joined: Sun Sep 30, 2007 4:35 am

Post by skarab »

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 ;)
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

The current path is taken from the first argument passed to the module in sceKernelStartModule, I assume you are not passing anything to it :)
skarab
Posts: 5
Joined: Sun Sep 30, 2007 4:35 am

Post by skarab »

wao! ;) thats the case. thanks :)
Post Reply