不受支持的指令“小”

unsupported instruction `lidt`

我正在构建一个用于教育目的的内核。

右我的OS靴子如下:GRUB -> boot.S -> init.c

boot.S中我想加载一个中断描述符table。这是我的文件的摘录:

# 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: Assembler messages:
boot.S:65: Error: unsupported instruction `lidt' : recipe for
target 'boot.o' failed make: *** [boot.o] Error 1

那么正确的指令是什么?

编辑: 我试过使用 lidtl,这也不起作用

lidt 需要内存引用。正确的语法是 lidt (%eax)。诚然,错误消息可能会更好。再一次,我的 gas 版本(来自 GNU Binutils for Debian 2.22)确实说 operand type mismatch for 'lidt'.

PS:gas可以切换到intel语法,所以没有理由使用at&t。等效的英特尔语法当然是 lidt [eax],而 lidt eax 会产生相同的错误。