gdt.h (658B)
1 #ifndef __GDT_H__ 2 #define __GDT_H__ 3 4 #include <stdint.h> 5 6 struct gdt_descriptor_t { 7 uint16_t limit_lo : 16; 8 uint16_t base_lo : 16; 9 uint8_t base_middle : 8; 10 uint8_t type : 4; 11 uint8_t s : 1; 12 uint8_t privilege_level : 2; 13 uint8_t segment_present : 1; 14 uint8_t limit_hi : 4; 15 uint8_t available : 1; 16 uint8_t l : 1; 17 uint8_t db : 1; 18 uint8_t granularity : 1; 19 uint8_t base_hi : 8; 20 } __attribute__((packed)); 21 22 struct gdt_selector_t { 23 uint16_t limit; 24 uint32_t base; 25 } __attribute__((packed)); 26 27 extern void initialize_gdt(void); 28 29 #endif 30