gdt 9 proc.h struct segdesc gdt[NSEGS]; // x86 global descriptor table gdt 12 vm.c struct segdesc gdt[NSEGS]; gdt 26 vm.c c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0); gdt 27 vm.c c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0); gdt 28 vm.c c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER); gdt 29 vm.c c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER); gdt 32 vm.c c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0); gdt 34 vm.c lgdt(c->gdt, sizeof(c->gdt)); gdt 168 vm.c cpu->gdt[SEG_TSS] = SEG16(STS_T32A, &cpu->ts, sizeof(cpu->ts)-1, 0); gdt 169 vm.c cpu->gdt[SEG_TSS].s = 0;