Tuesday, December 24, 2013

Enter Kernel Mode from User Mode

各個系統的application user從mode到kernel mode的進入點。

說穿了,就是觸發一個interrupt/trap,使CPU的status改變,以下各個CPU跟不同OS間的配合:
X86 WINNT: INT 0x2E
X86 Linux: INT 0x80
X86 FreeBSD: INT 0x80
X86 BeOS: INT 0x25

sparc V8 Linux: ta 0x10 (trap 0x90)
  (linux/arch/sparc/kernel/head.S)
sparc V8 SunOS: ta 0x00 (trap 0x80)
  (linux/arch/sparc/kernel/head.S)
sparc V8 Slowaris: ta 0x08 (trap 0x88)
  (linux/arch/sparc/kernel/head.S)
sparc V8 Net-B.S:  ta 0x09 (trap 0x89)
  (linux/arch/sparc/kernel/head.S)
WINNT中,它被稱之為native API
Linux(UNIX)中,它被稱之為system call

No comments:

Post a Comment