Page 1 of 1

How to set Kernel mode in asm ?

Posted: Thu Mar 22, 2007 11:50 am
by mad3d
Is there any source out there that I could check?

Posted: Thu Mar 22, 2007 5:34 pm
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();
...

Posted: Fri Mar 23, 2007 9:31 am
by mad3d
thanks a lot
but Im looking for asm way.

Posted: Fri Mar 23, 2007 9:41 am
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

Posted: Fri Mar 23, 2007 4:31 pm
by jimparis
Go look at ee_kmode_enter, it's all inline asm anyway.
ps2sdk/ee/kernel/include/kernel.h