我正在为教育目的构建一个内核。不受支持的指令`lidt`
右键我的操作系统启动如下:GRUB -> boot.S -> init.c
在boot.S
我要加载中断描述符表。这是我的文件的摘录:
# load_idt - Loads the interrupt descriptor table (IDT).
# stack: [esp + 4] the address of the first entry in the IDT
# [esp ] the return address
load_idt:
movl 4(%esp),%eax # load the address of the IDT into register eax
lidt %eax # load the IDT
ret # return to the calling function
我使用的气体进行编译,所以我在在& T语法工作。
但是,当我尝试编译这个时,编译器似乎无法识别lidt
指令。
gcc -Wa,--32 -MMD -c -o boot.o boot.S boot.S: Assembler messages:
boot.S:65: Error: unsupported instruction `lidt' : recipe for
target 'boot.o' failed make: *** [boot.o] Error 1
那么正确的指令是什么呢?
编辑:我使用lidtl
试过了,这不也是工作
太棒了,它的工作原理!它的奇怪,因为我的天然气版本是2.24,但我得到不受支持的指令错误。哦,至少现在起作用了。谢谢 – Krimson