User to kernel mode big picture?

Posted by fsdfa on Stack Overflow See other posts from Stack Overflow or by fsdfa
Published on 2010-05-30T07:34:46Z Indexed on 2010/05/30 7:42 UTC
Read the original article Hit count: 232

Filed under:
|
|
|

I've to implement a char device, a LKM.

I know some basics about OS, but I feel I don't have the big picture.

In a C programm, when I call a syscall what I think it happens is that the CPU is changed to ring0, then goes to the syscall vector and jumps to a kernel memmory space function that handle it. (I think that it does int 0x80 and in eax is the offset of the syscall vector, not sure).

Then, I'm in the syscall itself, but I guess that for the kernel is the same process that was before, only that it is in kernel mode, I mean the current PCB is the process that called the syscall.

So far... so good?, correct me if something is wrong.

Others questions... how can I write/read in process memory?. If in the syscall handler I refer to address, say, 0xbfffffff. What it means that address? physical one? Some virtual kernel one?

© Stack Overflow or respective owner

Related posts about linux

Related posts about user