forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessing KSEG0

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
alanm



Joined: 28 Mar 2004
Posts: 2

PostPosted: Mon Mar 29, 2004 12:02 pm    Post subject: Accessing KSEG0 Reply with quote

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.
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Mar 29, 2004 2:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
alanm



Joined: 28 Mar 2004
Posts: 2

PostPosted: Mon Mar 29, 2004 4:33 pm    Post subject: Reply with quote

These two macros do the job. I wouldn't be able to figure this out without your help. Thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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