notes

Personal notes
git clone git://git.laack.co/notes.git
Log | Files | Refs

KernelMode.md (725B)


      1 # Kernel Mode (Privileged Mode)
      2 
      3 **Source:** CS 6200
      4 
      5 **Chapter:** P1L2
      6 
      7 **Definition:** Kernel mode allows for direct hardware access, this differs from user mode where access to hardware is mediated by the OS.
      8 
      9 ## Specifics
     10 
     11 Most modern hardware supports this divide natively. When in kernel mode, a special bit in the CPU is set which allows any instruction that directly manipulates the hardware to execute. If such an instruction is attempted to be executed from user mode, a trap will be caused, interrupting the process and giving control to the operating system to check what is happening, and execute the instruction if permitted (otherwise it can terminate the process). 
     12 
     13 The mode bit is set to 0 for kernel mode.