From: acevest Date: Thu, 28 Oct 2021 23:35:39 +0000 (+0800) Subject: fix gdtr idtr X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=2fb6fb536459596698f50c8da52d870ffb4d4a5b;p=kernel.git fix gdtr idtr --- diff --git a/.gitignore b/.gitignore index 67abe43..d312213 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ bin/hello bin/shell a.* snapshot.txt +*.lock diff --git a/include/system.h b/include/system.h index c72fb0f..ea8dbf6 100644 --- a/include/system.h +++ b/include/system.h @@ -67,7 +67,7 @@ void kfree(void *addr); extern char etext, edata, end; -char gdtr[6],idtr[6]; +extern char gdtr[6],idtr[6]; #define lgdt() __asm__ __volatile__("lgdt gdtr") #define sgdt() __asm__ __volatile__("sgdt gdtr") #define lidt() __asm__ __volatile__("lidt idtr") diff --git a/kernel/system.c b/kernel/system.c index 7035db0..2579677 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -187,3 +187,6 @@ void system_delay() } irq_restore(flags); } + + +char gdtr[6],idtr[6]; diff --git a/scripts/init.sh b/scripts/init.sh index 65dc7a2..d44e3bd 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -5,6 +5,8 @@ HDIMG=out.img TMP=build/tmp MNT=$TMP/mnt +mkdir -p ${MNT} + # 生成硬盘 dd if=/dev/zero of=$HDIMG bs=512 count=24576