Accessing KSEG0

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
alanm
Posts: 2
Joined: Sun Mar 28, 2004 5:42 pm

Accessing KSEG0

Post 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.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post 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.
alanm
Posts: 2
Joined: Sun Mar 28, 2004 5:42 pm

Post by alanm »

These two macros do the job. I wouldn't be able to figure this out without your help. Thanks a lot!
Post Reply