|
48 | 48 | dq 0 |
49 | 49 |
|
50 | 50 | .kernel_code equ $ - gdt |
51 | | - dw 0xffff ; limit 0:15 |
52 | | - dw 0x0000 ; base 0:15 |
53 | | - db 0x00 ; base 16:23 |
54 | | - db 0b10011010 ; access byte - code |
55 | | - db 0xdf ; flags/(limit 16:19). flag is set to 32 bit protected mode |
56 | | - db 0x00 ; base 24:31 |
| 51 | + istruc GDTEntry |
| 52 | + at GDTEntry.limitl, dw 0xFFFF |
| 53 | + at GDTEntry.basel, dw 0 |
| 54 | + at GDTEntry.basem, db 0 |
| 55 | + at GDTEntry.attribute, db attrib.present | attrib.user | attrib.code | attrib.readable |
| 56 | + at GDTEntry.flags__limith, db 0xFF | flags.granularity | flags.default_operand_size |
| 57 | + at GDTEntry.baseh, db 0 |
| 58 | + iend |
57 | 59 |
|
58 | 60 | .kernel_data equ $ - gdt |
59 | | - dw 0xffff ; limit 0:15 |
60 | | - dw 0x0000 ; base 0:15 |
61 | | - db 0x00 ; base 16:23 |
62 | | - db 0b10010010 ; access byte - data |
63 | | - db 0xdf ; flags/(limit 16:19). flag is set to 32 bit protected mode |
64 | | - db 0x00 ; base 24:31 |
| 61 | + istruc GDTEntry |
| 62 | + at GDTEntry.limitl, dw 0xFFFF |
| 63 | + at GDTEntry.basel, dw 0 |
| 64 | + at GDTEntry.basem, db 0 |
| 65 | + at GDTEntry.attribute, db attrib.present | attrib.user | attrib.writable |
| 66 | + at GDTEntry.flags__limith, db 0xFF | flags.granularity | flags.default_operand_size |
| 67 | + at GDTEntry.baseh, db 0 |
| 68 | + iend |
65 | 69 |
|
66 | 70 | .user_code equ $ - gdt |
67 | | - dw 0xffff ; limit 0:15 |
68 | | - dw 0x0000 ; base 0:15 |
69 | | - db 0x00 ; base 16:23 |
70 | | - db 0b11111010 ; access byte - code |
71 | | - db 0xdf ; flags/(limit 16:19). flag is set to 32 bit protected mode |
72 | | - db 0x00 ; base 24:31 |
| 71 | + istruc GDTEntry |
| 72 | + at GDTEntry.limitl, dw 0xFFFF |
| 73 | + at GDTEntry.basel, dw 0 |
| 74 | + at GDTEntry.basem, db 0 |
| 75 | + at GDTEntry.attribute, db attrib.present | attrib.ring3 | attrib.user | attrib.code | attrib.readable |
| 76 | + at GDTEntry.flags__limith, db 0xFF | flags.granularity | flags.default_operand_size |
| 77 | + at GDTEntry.baseh, db 0 |
| 78 | + iend |
73 | 79 |
|
74 | 80 | .user_data equ $ - gdt |
75 | | - dw 0xffff ; limit 0:15 |
76 | | - dw 0x0000 ; base 0:15 |
77 | | - db 0x00 ; base 16:23 |
78 | | - db 0b11110010 ; access byte - data |
79 | | - db 0xdf ; flags/(limit 16:19). flag is set to 32 bit protected mode |
80 | | - db 0x00 ; base 24:31 |
| 81 | + istruc GDTEntry |
| 82 | + at GDTEntry.limitl, dw 0xFFFF |
| 83 | + at GDTEntry.basel, dw 0 |
| 84 | + at GDTEntry.basem, db 0 |
| 85 | + at GDTEntry.attribute, db attrib.present | attrib.ring3 | attrib.user | attrib.writable |
| 86 | + at GDTEntry.flags__limith, db 0xFF | flags.granularity | flags.default_operand_size |
| 87 | + at GDTEntry.baseh, db 0 |
| 88 | + iend |
81 | 89 |
|
82 | 90 | .tss equ $ - gdt |
83 | | - dw (tss.end-tss) & 0xFFFF ; limit 0:15 |
84 | | - dw (tss-$$+0x7C00) & 0xFFFF ; base 0:15 |
85 | | - db ((tss-$$+0x7C00) >> 16) & 0xFF ; base 16:23 |
86 | | - db 0b11101001 ; access byte - data |
87 | | - db 0x40 | ((tss.end-tss) >> 16) & 0xF ; flags/(limit 16:19). flag is set to 32 bit protected mode |
88 | | - db ((tss-$$+0x7C00) >> 24) & 0xFF ; base 24:31 |
89 | | - |
| 91 | + istruc GDTEntry |
| 92 | + at GDTEntry.limitl, dw (tss.end - tss) & 0xFFFF |
| 93 | + at GDTEntry.basel, dw (tss-$$+0x7C00) & 0xFFFF |
| 94 | + at GDTEntry.basem, db ((tss-$$+0x7C00) >> 16) & 0xFF |
| 95 | + at GDTEntry.attribute, db attrib.present | attrib.ring3 | attrib.tssAvailabe32 |
| 96 | + at GDTEntry.flags__limith, db ((tss.end - tss) >> 16) & 0xF |
| 97 | + at GDTEntry.baseh, db ((tss-$$+0x7C00) >> 24) & 0xFF |
| 98 | + iend |
90 | 99 | .end equ $ - gdt |
91 | 100 |
|
92 | 101 | struc TSS |
|
0 commit comments