src/drivers/cpu/gdt.c
void gdt_install(void) {
	gdt_pointer_t *gdtp = &gdt.pointer;
	gdtp->limit = sizeof gdt.entries - 1;
	gdtp->base = (uint32_t)&ENTRY(0);

	gdt_set_gate(0, 0, 0, 0, 0);                /* required NULL segment */
	gdt_set_gate(1, 0, 0xFFFFFFFF, 0x9A, 0xCF); /* Code segment */
	gdt_set_gate(2, 0, 0xFFFFFFFF, 0x92, 0xCF); /* Data segment */
	gdt_set_gate(3, 0, 0xFFFFFFFF, 0xFA, 0xCF); /* User code */
	gdt_set_gate(4, 0, 0xFFFFFFFF, 0xF2, 0xCF); /* User data */

	write_tss(5, 0x10, 0x0); /* Task segment */

	/* Go go go */
	gdt_flush((uint32_t)gdtp);
	tss_flush();
}
//
// installing gdt - right now, we are are using all available RAM for all segments
//
installing gdt - right now, we are are using all available RAM for all segments
installing gdt - right now we are are using all available RAM for all segments
void gdt_install(void) {
	gdt_pointer_t *gdtp = &gdt.pointer;
	gdtp->limit = sizeof gdt.entries - 1;
	gdtp->base = (uint32_t)&ENTRY(0);
	gdt_set_gate(0, 0, 0, 0, 0);                
	gdt_set_gate(1, 0, 0xFFFFFFFF, 0x9A, 0xCF); 
	gdt_set_gate(2, 0, 0xFFFFFFFF, 0x92, 0xCF); 
	gdt_set_gate(3, 0, 0xFFFFFFFF, 0xFA, 0xCF); 
	gdt_set_gate(4, 0, 0xFFFFFFFF, 0xF2, 0xCF); 
	write_tss(5, 0x10, 0x0); 
	gdt_flush((uint32_t)gdtp);
	tss_flush();
}
void gdt_install ( void ) { gdt_pointer_t * gdtp = & gdt . pointer ; gdtp -> limit = sizeof gdt . entries - 1 ; gdtp -> base = ( uint32_t ) & ENTRY ( 0 ) ; gdt_set_gate ( 0 , 0 , 0 , 0 , 0 ) ; gdt_set_gate ( 1 , 0 , 0xFFFFFFFF , 0x9A , 0xCF ) ; gdt_set_gate ( 2 , 0 , 0xFFFFFFFF , 0x92 , 0xCF ) ; gdt_set_gate ( 3 , 0 , 0xFFFFFFFF , 0xFA , 0xCF ) ; gdt_set_gate ( 4 , 0 , 0xFFFFFFFF , 0xF2 , 0xCF ) ; write_tss ( 5 , 0x10 , 0x0 ) ; gdt_flush ( ( uint32_t ) gdtp ) ; tss_flush ( ) ; }
installing gdt - right now, we are are using all available RAM for all segments
installing gdt - right now we are are using all available RAM for all segments
/* required NULL segment */ /* Code segment */ /* Data segment */ /* User code */ /* User data */ /* Task segment */ /* Go go go */