File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,18 @@ gdt64_ptr:
54
54
.short gdt64_end - gdt64_start - 1 # GDT length is actually (length - 1)
55
55
.long gdt64_start
56
56
gdt64_start:
57
- .quad 0 # First descriptor is null
57
+ # First descriptor is null
58
+ .quad 0
58
59
code64_desc:
59
- .quad (1 <<43 ) | (1 <<44 ) | (1 <<47 ) | (1 <<53 ) # Only these bits do anything
60
+ # For 64-bit code descriptors, all bits except the following are ignored:
61
+ # - CS.A=1 (bit 40) segment is accessed, prevents a write on first use.
62
+ # - CS.R=1 (bit 41) segment is readable. (this might not be necessary)
63
+ # - CS.C=1 (bit 42) segment is conforming. (this might not be necessary)
64
+ # - CS.E=1 (bit 43) required, we are a executable code segment.
65
+ # - CS.S=1 (bit 44) required, we are not a system segment.
66
+ # - CS.DPL=0 (bits 45/46) we are using this segment in Ring 0.
67
+ # - CS.P=1 (bit 47) required, the segment is present.
68
+ # - CS.L=1 (bit 53) required, we are a 64-bit (long mode) segment.
69
+ # - CS.D=0 (bit 54) required, CS.L=1 && CS.D=1 is resevered for future use.
70
+ .quad (1 <<40 ) | (1 <<41 ) | (1 <<42 ) | (1 <<43 ) | (1 <<44 ) | (1 <<47 ) | (1 <<53 )
60
71
gdt64_end:
You can’t perform that action at this time.
0 commit comments