HaRET user mode fix


On the Maui all applications are started in "user mode". User mode is a protected mode, where the application does not
have full access to the processor. Most PDA's run their applications in kernel mode, most Smartphones in user mode.

In order to make the kernel booting HaRET needs access to the processor in kernel mode. Therefore HaRET uses the
coredll.dll function SetKMode(TRUE). The original HaRET did not expect that it could be run in user mode, that is why
some modifications are needed, when your device starts HaRET in user mode:

1. Modify haret.cpp

Put

extern "C" BOOL SetKMode (BOOL fMode);
SetKMode(1);


just before "hInst = hInstance;".

2. Modify network.cpp

Put

SetKMode(1);
SetProcPermissions (0xffffffff);


on line 266 and define in network.cpp

extern "C" BOOL SetKMode (BOOL fMode);
extern "C" DWORD SetProcPermissions (DWORD newperms);


That's it. Those people with smartphones need to sign HaRET with a priviledged certifate. The Maui needs no signing.

Now HaRET runs in system mode and has full proc permissions.

Lets have fun on Maui ...
Chris

Back to "Linux on the Vodofone Power Handheld (bSquare Maui)"


Last update: 11.09.2005