module pipes
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, ... ?)
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
http://ps2dev.org/psp/Tutorials/PSP_Mod ... s.download
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
http://ps2dev.org/psp/Tutorials/PSP_Mod ... s.download
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 ;)
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 ;)
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 ;)
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 ;)