Move TSS load to boot.s

This commit is contained in:
Nicolás Ortega Froysa 2018-04-05 10:31:21 +02:00
parent bb36ab3656
commit e0eb1a92be
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF
4 changed files with 3 additions and 14 deletions

View File

@ -63,6 +63,9 @@ _start:
# GDT, paging, and other features # GDT, paging, and other features
call gdt_install call gdt_install
# load the TSS which is in the 6th entry of the GDT
movw $0x28, %ax
ltr %ax
boot_kernel: boot_kernel:
# enter high-level kernel (C) # enter high-level kernel (C)

View File

@ -67,7 +67,4 @@ void gdt_install() {
sizeof(tss), 0x89, 0x40); sizeof(tss), 0x89, 0x40);
gdt_flush(&gdtr); gdt_flush(&gdtr);
// load the TSS
tss_load();
} }

View File

@ -21,7 +21,6 @@
#include "structs.h" #include "structs.h"
extern void gdt_flush(struct segreg *gdtr); extern void gdt_flush(struct segreg *gdtr);
extern void tss_load();
void gdt_entry_set(struct segdesc *entry, uint32_t base, void gdt_entry_set(struct segdesc *entry, uint32_t base,
uint32_t limit, uint8_t access, uint8_t gran); uint32_t limit, uint8_t access, uint8_t gran);
void gdt_install(); void gdt_install();

View File

@ -35,13 +35,3 @@ gdt_flush:
gdt_flush_end: gdt_flush_end:
popl %ebp popl %ebp
ret ret
.global tss_load
.type tss_load,@function
tss_load:
pushl %ebp
movl %esp, %ebp
movw $0x28, %ax
ltr %ax
popl %ebp
ret