How to set Kernel mode in asm ?

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

Moderators: cheriff, Herben

Post Reply
mad3d
Posts: 6
Joined: Thu May 18, 2006 9:38 am

How to set Kernel mode in asm ?

Post by mad3d »

Is there any source out there that I could check?
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

Does it have to be asm?

from ps2cam_rpc.c :

Code: Select all

...
        DI();
        ee_kmode_enter();
        
        iop_addr = (int *)(0xbc000000+ret[1]);

        memcpy(&campacket[0],iop_addr, ret[0]);
                
        ee_kmode_exit();
        EI();
...
infj
mad3d
Posts: 6
Joined: Thu May 18, 2006 9:38 am

Post by mad3d »

thanks a lot
but Im looking for asm way.
cloudhunter
Posts: 86
Joined: Thu Aug 17, 2006 3:27 am

Post by cloudhunter »

mad3d wrote:thanks a lot
but Im looking for asm way.
Forgive me if this isn't possible, but why not compile some code setting to kernel mode, and then disassemble it to see what it looks like in ASM?

Why does it specifically need to be in asm anyway? The PS2 SDK supports ASM embedded inside the C++ code.

Cloudy
:)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Go look at ee_kmode_enter, it's all inline asm anyway.
ps2sdk/ee/kernel/include/kernel.h
Post Reply