【发布时间】:2015-04-16 19:43:11
【问题描述】:
我正在构建一个用于教育目的的内核。
正确的我的操作系统启动如下: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
我正在使用 gas 进行编译,所以我使用的是 at&t 语法。
但是,当我尝试编译它时,编译器似乎无法识别 lidt 指令。
gcc -Wa,--32 -MMD -c -o boot.o boot.S boot.S:汇编程序消息:
boot.S:65:错误:不支持的指令“lidt”:
的配方 目标 'boot.o' 失败 make: *** [boot.o] 错误 1
那么正确的指令是什么?
编辑:我尝试使用lidtl,这也不起作用
【问题讨论】:
标签: assembly x86 gnu-assembler att