wip: TSS added to the gdt and start to implement scheduler
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
|
||||
extern void set_gdt(uint32_t gdt_ptr);
|
||||
|
||||
struct tss TSS;
|
||||
uint8_t gdt_entries[GDT_SIZE * 8];
|
||||
struct gdt_descriptor *gdtr = (struct gdt_descriptor *)GDT_ADDRESS;
|
||||
|
||||
@ -90,6 +91,9 @@ void init_gdt(void)
|
||||
GDT_ACCESS_RW_READABLE_FOR_CODE_WRITABLE_FOR_DATA |
|
||||
GDT_ACCESS_A_ACCESSED,
|
||||
GDT_FLAG_32BIT_MODE | GDT_FLAG_PAGE_MODE); // User stack
|
||||
// TSS
|
||||
set_gdt_entry_value(gdt_entries + GDT_OFFSET_TSS, (uint32_t)&TSS,
|
||||
sizeof(struct tss) - 1, 0x89, 0);
|
||||
|
||||
set_gdt(((uint32_t)gdtr));
|
||||
}
|
||||
|
Reference in New Issue
Block a user