summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2021-07-09 16:07:29 +0200
committerdzwdz2021-07-09 16:07:29 +0200
commit5ee08673199299769549f996a83c326c833801dc (patch)
treed4a1ecb5e6d47baeeb41967a90403de7dbf988fe
parent89537c396393c8569b39f14cb8e2c73e676a3e00 (diff)
fix the r0 data segment
-rw-r--r--kernel/gdt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/gdt.c b/kernel/gdt.c
index eaf81ba..c564f5f 100644
--- a/kernel/gdt.c
+++ b/kernel/gdt.c
@@ -68,7 +68,7 @@ static void gdt_prepare() {
// copy to r0 code
GDT[SEG_r0code] = GDT[SEG_r0data];
- GDT[SEG_r0code].code = SEG_r0data;
+ GDT[SEG_r0code].code = 1;
GDT[SEG_r3data] = GDT[SEG_r0data];
GDT[SEG_r3data].ring = 3;
@@ -106,6 +106,8 @@ static void gdt_load() {
}
static void gdt_check() {
+ // note: this only checks the r0data segment,
+ // it's far from a comprehensive test
tty_const("checking gdt...");
asm("mov %0, %%ds;"
: : "r" (SEG_r0data << 3) : "memory");