x86 system programming 8 Exceptions and Interrupts

本系列博客用来记录自己对x86体系结构的学习总结,同时方便大家查阅,节省大家学习的时间。 Exceptions and interrupts force control transfers from the currently-executing program to a systemsoftware service routine that handles the interrupting event. Interrupt vector number as index to the IDT. IDT is used in all processor operation modes.(好奇的是,那么言外之意,service routine难道是没有什么特权需要的吗?)

  1. EXCEPTIONS. software execution error or other internal errors. debug purpose also could happen in this situation(single step, break point), 被称为同步的,因为他们总是由于那个interrupted instructions导致的.
  2. SOFTWARE INTERRUPTS. occurs as a result of exectuting interrupt instructions. 这个也是同步的. 比较特别的是这个是事先谋划好的(software Interrupts allow intentional triggering of the interrupt-handling mechanism.
  3. EXTERNAL INTERRUPTS. 这个是asynchronous,they occurs independtly of the interrupted instruction.

masking can refer to either disabling or delaying an interrupt.

Read More

x86 system programming 5 Page Translation and Protection

本系列博客用来记录自己对x86体系结构的学习总结,同时方便大家查阅,节省大家学习的时间。 除了最基本的virtual -> physical mapping和基本的protection,还有如下的用途 1 Shared mapping is typically used to allow access of shared-library routines by multiple applications. A read-only copy of the library routine is mapped to each application virtual-address space, but only a single copy of the library routine is present in physical memory.

Read More

x86 system programming 4 Segmented Virtual Memory

本系列博客用来记录自己对x86体系结构的学习总结,同时方便大家查阅,节省大家学习的时间。 10 segments, CS/DS/ES/FS/GS/SS user segments which hold software,data,and the stack and can be used by both application and system software. GDT/LDT/IDT/TR system segments contains data structures intialized and used only by system software.

Read More