|
-
August 30th, 2006, 09:28 PM
#8
Usually the only way to switch from user-mode to kernel-mode is a "software interrupt" (a.k.a. supervisor call on some archs). Context switch is (again usually) a priviledge instruction; so only kernel mode threads can execute it.
When you call a kernel program (under your user mode context) and this program needs to switch to kernel mode (i.e. needs to access some special registers or memory areas), this routine will isssue a supervisor call. That call will interrupt the thread and switch to 1st level interrupt handler. 1st level I.H is in kernel mode by default. So, you have switch from user mode to kernel.
To return from kernel to user, its easier, since kernel can use the priviledge instruction to do that.
But its architecture theory, it can varies from platform to platform.
Meu sítio
FORMAT C: Yes ...Yes??? ...Nooooo!!! ^C ^C ^C ^C ^C
If I die before I sleep, I pray the Lord my soul to encrypt. If I die before I wake, I pray the Lord my soul to brake.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|