Hello,
Some dumb questions but as I did not find the answers by myself, time to ask...
1. Before using the toolchain and PSPSDK makefiles, we were using custom makefiles where we had to set :
- the relocation address : 0x08900000 (-Ttext 8900000)
As now, using PSPSDK makefiles, the LDFLAG doesn't need to specify this address, where is it hardcoded ? And if I want to change it, is adding -Ttext 8040000 for example enough ? (I tried but the execution is refused)
2. As the 1st version of Tyranid's KDumper showed, it was possible to make a custom crt0.s startup to provide "mains" entrypoints for user and kernel mode, is it still possible with the pspsdk (and how ?) or should we create a user thread for the kernel thread (as the loadmodule example shows) ?
3. Does sceKernelLoadModule() reboot the kernel as sceKernelLoadExec () does ?
4. Last (very) dumb question, what is the major reason to try as much as possible to execute PSP code in user mode (and not in kernel mode), is it just for safety reason ?
Thanks in advance to make my education :D
PSP Toolchain+PSPSDK/relocation/user vs kernel mode/LoadModu
PSP Toolchain+PSPSDK/relocation/user vs kernel mode/LoadModu
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
Re: PSP Toolchain+PSPSDK/relocation/user vs kernel mode/Load
The default address is now handled in a linker script that's part of the toolchain. As far as setting your own address, we use psp-gcc to link so if you want to use "-Ttext 8040000" you have to tell GCC to pass it to the linker: "-Wl,-Ttext -Wl,8040000".Shazz wrote:As now, using PSPSDK makefiles, the LDFLAG doesn't need to specify this address, where is it hardcoded ? And if I want to change it, is adding -Ttext 8040000 for example enough ? (I tried but the execution is refused)
We now have a system in place to make it easy to access kernel mode (to install patches, exception handlers, stdio rerouting, etc.) and still have your main() called in user mode. See this post for an example of how it's used. You can also check out Warren's usb/storage sample in PSPSDK SVN.Shazz wrote:2. As the 1st version of Tyranid's KDumper showed, it was possible to make a custom crt0.s startup to provide "mains" entrypoints for user and kernel mode, is it still possible with the pspsdk (and how ?) or should we create a user thread for the kernel thread (as the loadmodule example shows) ?
No.Shazz wrote:3. Does sceKernelLoadModule() reboot the kernel as sceKernelLoadExec () does ?
The main reason is safety. If you make a mistake, you don't want to crash or potentially brick your PSP. Running in user mode reduces the chances of doing so considerably.Shazz wrote:4. Last (very) dumb question, what is the major reason to try as much as possible to execute PSP code in user mode (and not in kernel mode), is it just for safety reason ?
Perfect ! You thought of all ! :D amazing
Thanks Mr Brown !
Thanks Mr Brown !
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org