Skip to content

Commit

Permalink
Moved tss.h to include/ and fixed TSS address
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinWieczorek committed Sep 1, 2018
1 parent 317aab1 commit 6648f12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kernel/tss.h → include/kernel/tss/tss.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <stdint.h>

#define TSS_ADDRESS (void *) 0xC24
#define TSS_ADDRESS (void *) 0xC2C

struct tss_entry_struct {
uint32_t prev_tss; // The previous TSS - if we used hardware task switching this would form a linked list.
Expand Down
2 changes: 1 addition & 1 deletion kernel/kernel.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdlib.h>

#include <kernel/idt.h>
#include <kernel/tss.h>
#include <kernel/tss/tss.h>

#include <drivers/screen.h>

Expand Down
8 changes: 6 additions & 2 deletions kernel/tss.c → kernel/tss/tss.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <kernel/tss.h>
#include <string.h>

#include <kernel/tss/tss.h>

tss_entry_t tss_entry;

void tss_write(gdt_entry_bits *g) {
Expand All @@ -25,8 +26,11 @@ void tss_write(gdt_entry_bits *g) {

memset(&tss_entry, 0, sizeof(tss_entry));

tss_entry.esp0 = 0x8ffa0; // Set the kernel stack pointer.
/* tss_entry.esp0 = 0x40000; // Set the kernel stack pointer. */
/* __asm__("movl %%esp, %0" */
/* : "=a" (tss_entry.esp0)); */
tss_entry.ss0 = 0x13; // Set the kernel stack segment.
tss_entry.esp0 = 0x452B; // Set the kernel stack pointer.
}

void tss_install() {
Expand Down
File renamed without changes.

0 comments on commit 6648f12

Please sign in to comment.