src/kernel/tables/gdt.c
/** 
 * This function sets the bits of a gdt entry.
 */
This function sets the bits of a gdt entry.
This function sets the bits of a gdt entry .
void gdt_setEntry(int index, uint32_t base, uint64_t limit, uint8_t access, uint8_t flags) {
    gdt_entry_t *gdt_entry = &gdt_entries[index];
    gdt_entry->base_low = base & 0xFFFF;
    gdt_entry->base_middle = (base >> 16) & 0xFF;
    gdt_entry->base_high = (base >> 24) & 0xFF;
    gdt_entry->limit_low = limit & 0xFFFF;
    gdt_entry->granularity = (limit >> 16) & 0xF;
    gdt_entry->access = access;
    gdt_entry->granularity = gdt_entry->granularity | (flags & 0xF0);
}
void gdt_setEntry ( int index , uint32_t base , uint64_t limit , uint8_t access , uint8_t flags ) { gdt_entry_t * gdt_entry = & gdt_entries [ index ] ; gdt_entry -> base_low = base & 0xFFFF ; gdt_entry -> base_middle = ( base >> 16 ) & 0xFF ; gdt_entry -> base_high = ( base >> 24 ) & 0xFF ; gdt_entry -> limit_low = limit & 0xFFFF ; gdt_entry -> granularity = ( limit >> 16 ) & 0xF ; gdt_entry -> access = access ; gdt_entry -> granularity = gdt_entry -> granularity | ( flags & 0xF0 ) ; }
This function sets the bits of a gdt entry.
This function sets the bits of a gdt entry .
// Set base attribute of the entry // Set limit attribute of the entry // Set access attribute of the entry // Set the flags of the entry (higher 4 bits)