From e0eb1a92bea7248614f6a613232ecfaf2e42c774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Thu, 5 Apr 2018 10:31:21 +0200 Subject: [PATCH] Move TSS load to boot.s --- src/kernel/arch/x86/boot.s | 3 +++ src/kernel/arch/x86/gdt.c | 3 --- src/kernel/arch/x86/gdt.h | 1 - src/kernel/arch/x86/gdt.s | 10 ---------- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/kernel/arch/x86/boot.s b/src/kernel/arch/x86/boot.s index 05d0457..cd5c47f 100644 --- a/src/kernel/arch/x86/boot.s +++ b/src/kernel/arch/x86/boot.s @@ -63,6 +63,9 @@ _start: # GDT, paging, and other features call gdt_install + # load the TSS which is in the 6th entry of the GDT + movw $0x28, %ax + ltr %ax boot_kernel: # enter high-level kernel (C) diff --git a/src/kernel/arch/x86/gdt.c b/src/kernel/arch/x86/gdt.c index 129c20e..7ce01a6 100644 --- a/src/kernel/arch/x86/gdt.c +++ b/src/kernel/arch/x86/gdt.c @@ -67,7 +67,4 @@ void gdt_install() { sizeof(tss), 0x89, 0x40); gdt_flush(&gdtr); - - // load the TSS - tss_load(); } diff --git a/src/kernel/arch/x86/gdt.h b/src/kernel/arch/x86/gdt.h index 63a33a5..3581e45 100644 --- a/src/kernel/arch/x86/gdt.h +++ b/src/kernel/arch/x86/gdt.h @@ -21,7 +21,6 @@ #include "structs.h" extern void gdt_flush(struct segreg *gdtr); -extern void tss_load(); void gdt_entry_set(struct segdesc *entry, uint32_t base, uint32_t limit, uint8_t access, uint8_t gran); void gdt_install(); diff --git a/src/kernel/arch/x86/gdt.s b/src/kernel/arch/x86/gdt.s index f036c72..85d9acf 100644 --- a/src/kernel/arch/x86/gdt.s +++ b/src/kernel/arch/x86/gdt.s @@ -35,13 +35,3 @@ gdt_flush: gdt_flush_end: popl %ebp ret - -.global tss_load -.type tss_load,@function -tss_load: - pushl %ebp - movl %esp, %ebp - movw $0x28, %ax - ltr %ax - popl %ebp - ret