 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Wed Jul 20, 2005 5:21 pm Post subject: PSP Toolchain+PSPSDK/relocation/user vs kernel mode/LoadModu |
|
|
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 _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Wed Jul 20, 2005 6:10 pm Post subject: Re: PSP Toolchain+PSPSDK/relocation/user vs kernel mode/Load |
|
|
| 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) |
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: | | 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) ? |
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: | | 3. Does sceKernelLoadModule() reboot the kernel as sceKernelLoadExec () does ? |
No.
| 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 ? |
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. |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Thu Jul 21, 2005 5:30 pm Post subject: |
|
|
Perfect ! You thought of all ! :D amazing
Thanks Mr Brown ! _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
|
|
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
|