Code: Select all
while (i < placement_address + 0x1000) {
// Kernel code is readable but not writeable from userspace.
alloc_frame(get_page(i, TRUE, kernel_directory), FALSE /* is_kernel */, FALSE /* is_writable */);
i += 0x1000;
}
Code: Select all
// code
switch_to_user_mode();
// other code
If I allocate frames with the supervisor (is_kernel) flag set to true (which I guess should be the correct way for protection), no other statement can be executed after that line. So I'm not sure how to make the switch and do some subsequent call to, say, spawn a shell in the user mode.
Any help would be appreciated. Thanks!