Code: Select all
.section .multiboot.data, "aw"
/* GDT */
null_descriptor:
.quad 0
code_descriptor:
.quad 0x00AF9B000000FFFF
data_descriptor:
.quad 0x009F93000000FFFF
gdtr:
.long 23
.short 0x8000
/* ... */
.section .multiboot.text, "a"
.global _start
.type _start, @function
.code32
/* ... */
/* Setup a 64-bit GDT, then far return to the higher half */
lgdt gdtr
movw $16, %ax
movw %ax, %ds
movw %ax, %es
movw %ax, %fs
movw %ax, %gs
movw %ax, %ss
ljmp $0x08, $trampoline
Code: Select all
check_exception old: 0xffffffff new 0xe
0: v=0e e=0000 i=0 cpl=0 IP=0010:00000000002011ac pc=00000000002011ac SP=0018:0000000000202100 CR2=0000000080000010
EAX=80000010 EBX=00000000 ECX=c0000080 EDX=00000000
ESI=00000000 EDI=00000000 EBP=00000000 ESP=00202100
EIP=002011ac EFL=00000086 [--S--P-] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0018 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0010 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0018 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0018 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0018 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0018 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS64-busy
GDT= 0000000080000000 00000017
IDT= 0000000000000000 00000000
CR0=80000011 CR2=0000000080000010 CR3=0000000000203000 CR4=00000020
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
CCS=00210000 CCD=80000011 CCO=LOGICL
EFER=0000000000000500