| View previous topic :: View next topic |
| Author |
Message |
skarab
Joined: 30 Sep 2007 Posts: 5
|
Posted: Sun Aug 17, 2008 2:02 pm Post subject: module pipes |
|
|
| 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 |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
|
| Back to top |
|
 |
skarab
Joined: 30 Sep 2007 Posts: 5
|
Posted: Mon Aug 18, 2008 12:03 am Post subject: |
|
|
| oh thanks. i was miss-thinking |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Aug 18, 2008 1:38 am Post subject: |
|
|
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 |
|
 |
skarab
Joined: 30 Sep 2007 Posts: 5
|
Posted: Fri Aug 22, 2008 7:31 am Post subject: |
|
|
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 |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Fri Aug 22, 2008 8:25 am Post subject: |
|
|
| 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 |
|
 |
skarab
Joined: 30 Sep 2007 Posts: 5
|
Posted: Fri Aug 22, 2008 8:52 am Post subject: |
|
|
| wao! ;) thats the case. thanks :) |
|
| Back to top |
|
 |
|