Userland

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

Userland

Post by gmoney »

Does anyone know any good tut out there for switching to user land and back to kernel land?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

It's not difficult to switch from user land to kernel land. The difficulty comes the other way round.

switching from user land to kernel land

Code: Select all

int $0x80
syscalls are typically implemented using an interrupt service routine hook - set up eax,ebx,ecx etc to pass paramters then interrupt. The kernel handles the interrupt as a 'syscall'.

The other way is more difficult and involves an IRET to change the CPL. (current privilege level)
User avatar
JackScott
Member
Member
Posts: 1036
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Post by JackScott »

The following from osdever.net might be useful:
http://www.osdever.net/tutorials/soft_ts.php
Post Reply