我正在尝试编译早期版本的 Linux,您可以从 git://github.com/azru0512/linux-0.12.git 下载源代码。在编译 ''kernel/blk_drv/ramdisk.c'' 时,我收到以下错误消息,
ramdisk.c:36:10: error: can't find a register in class 'CREG' while reloading 'asm'
ramdisk.c:40:10: error: can't find a register in class 'CREG' while reloading 'asm'
ramdisk.c:36:10: error: 'asm' operand has impossible constraints
ramdisk.c:40:10: error: 'asm' operand has impossible constraints
ramdisk.c 中有什么,
if (CURRENT-> cmd == WRITE) {
(void) memcpy(addr,
CURRENT->buffer,
len);
} else if (CURRENT->cmd == READ) {
(void) memcpy(CURRENT->buffer,
addr,
len);
} else
panic("unknown ramdisk-command");
memcpy 是,
extern inline void * memcpy(void * dest,const void * src, int n)
{
__asm__("cld\n\t"
"rep\n\t"
"movsb"
::"c" (n),"S" (src),"D" (dest)
:"cx","si","di");
return dest;
}
我猜这是 memcpy (include/string.h) 内联 asm 问题,所以我从中删除了 clobber 列表,但没有运气。你能帮我找出问题所在吗?谢谢!