Page 1 of 1
Accessing KSEG0
Posted: Mon Mar 29, 2004 12:02 pm
by alanm
Is there a way to load and store data to KSEG0? If I ask Naplink to load a elf file to 0x80001000, PS2 just hang. Is it because Naplink is running in user mode?
Thanks.
Posted: Mon Mar 29, 2004 2:21 pm
by mrbrown
Yes. Only the kernel runs in kernel mode. To access KSEG0 you have to switch the processor into kernel mode by setting the appropiate bits in the Status register on COP0. See ps2lib's kernel.h header for two inline macros, ee_kmode_enter() and ee_kmode_exit() that will do this for you.
Posted: Mon Mar 29, 2004 4:33 pm
by alanm
These two macros do the job. I wouldn't be able to figure this out without your help. Thanks a lot!