提交 e470eb3a 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Set UCSEG and UDSEG in gdt.

上级 c53c558b
...@@ -5,13 +5,17 @@ ...@@ -5,13 +5,17 @@
struct segdesc __attribute__((aligned(16))) bootgdt[NSEGS] = { struct segdesc __attribute__((aligned(16))) bootgdt[NSEGS] = {
// null // null
SEGDESC(0, 0, 0), [0]=SEGDESC(0, 0, 0),
// 32-bit kernel code // 32-bit kernel code
SEGDESC(0, 0xfffff, SEG_R|SEG_CODE|SEG_S|SEG_DPL(0)|SEG_P|SEG_D|SEG_G), [1]=SEGDESC(0, 0xfffff, SEG_R|SEG_CODE|SEG_S|SEG_DPL(0)|SEG_P|SEG_D|SEG_G),
// 64-bit kernel code // 64-bit kernel code
SEGDESC(0, 0, SEG_R|SEG_CODE|SEG_S|SEG_DPL(0)|SEG_P|SEG_L|SEG_G), [2]=SEGDESC(0, 0, SEG_R|SEG_CODE|SEG_S|SEG_DPL(0)|SEG_P|SEG_L|SEG_G),
// kernel data // kernel data
SEGDESC(0, 0xfffff, SEG_W|SEG_S|SEG_DPL(0)|SEG_P|SEG_D|SEG_G) [3]=SEGDESC(0, 0xfffff, SEG_W|SEG_S|SEG_DPL(0)|SEG_P|SEG_D|SEG_G),
// 64-bit user code
[6]=SEGDESC(0, 0, SEG_R|SEG_CODE|SEG_S|SEG_DPL(3)|SEG_P|SEG_L|SEG_G),
// 64-bit user data
[7]=SEGDESC(0, 0xfffff, SEG_W|SEG_S|SEG_DPL(3)|SEG_P|SEG_D|SEG_G)
}; };
struct intdesc idt[256] __attribute__((aligned(16))); struct intdesc idt[256] __attribute__((aligned(16)));
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论