本文介绍了构建Linux Kernel 2.6.10时出错,错误:"mov"的操作数类型不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习编写Linux内核模块,并遵循《 Linux设备驱动程序》一书.它指示构建和配置2.6.x内核.我正在使用内核版本2.6.10.我在 thegeekstuff.com/compile-linux-kernel 即,我在/usr/src目录中解压缩后,就完成了

I am learning writing Linux Kernel Modules and following the book Linux Device Drivers. which instructs building and configure a kernel of 2.6.x . I am using kernel version 2.6.10. I followed the steps on thegeekstuff.com/compile-linux-kerneli.e. I after untarring in the /usr/src directory, I did

$ make menuconfig  #this opened up a gui

然后我保存配置而不进行任何更改,以希望强制执行默认配置,然后

then I saved the config without making any changes, in the hope to enforce default configuration and then

$ make.

当我做的时候,它给了我这个错误和警告.

when I did make, it gave me this error and the warning’

include/asm/mpspec_def.h:78:2:警告:字段的打包"属性被忽略
类型为'unsigned char [6]'[-Wattributes]

include/asm/mpspec_def.h:78:2: warning: ‘packed’ attribute ignored for field
of type ‘unsigned char[6]’ [-Wattributes]

arch/i386/kernel/process.c:在函数"show_regs"中:

arch/i386/kernel/process.c: In function ‘show_regs’:

arch/i386/kernel/process.c:259:2:警告:"show_trace"的传递参数2中的指针目标的签名[-Wpointer-sign]不同include/asm/processor.h:499:6:注意:预期为"long unsigned int *",但参数的类型为"long int *

arch/i386/kernel/process.c:259:2: warning: pointer targets in passing argument 2 of ‘show_trace’ differ in signedness [-Wpointer-sign]include/asm/processor.h:499:6: note: expected ‘long unsigned int *’ but argument is of type ‘long int *

arch/i386/kernel/process.c:汇编程序消息:arch/i386/kernel/process.c:384:错误:mov'arch/i386/kernel/process.c:385: Error: operand type mismatch for mov'的操作数类型不匹配arch/i386/kernel/process.c:461:错误:"mov"的操作数类型不匹配

arch/i386/kernel/process.c: Assembler messages:arch/i386/kernel/process.c:384: Error: operand type mismatch for mov'arch/i386/kernel/process.c:385: Error: operand type mismatch formov'arch/i386/kernel/process.c:461: Error: operand type mismatch for `mov'

include/linux/elfcore.h:92:错误:mov'include/linux/elfcore.h:92: Error: operand type mismatch for mov'的操作数类型不匹配arch/i386/kernel/process.c:583:错误:mov'arch/i386/kernel/process.c:584: Error: operand type mismatch for mov'的操作数类型不匹配arch/i386/kernel/process.c:591:错误:mov'arch/i386/kernel/process.c:592: Error: operand type mismatch for mov'的操作数类型不匹配make 1 :[arch/i386/kernel/process.o]错误1make:[arch/i386/kernel]错误2

include/linux/elfcore.h:92: Error: operand type mismatch for mov'include/linux/elfcore.h:92: Error: operand type mismatch formov'arch/i386/kernel/process.c:583: Error: operand type mismatch for mov'arch/i386/kernel/process.c:584: Error: operand type mismatch formov'arch/i386/kernel/process.c:591: Error: operand type mismatch for mov'arch/i386/kernel/process.c:592: Error: operand type mismatch formov'make1: [arch/i386/kernel/process.o] Error 1make: [arch/i386/kernel] Error 2

我以前没有写过专业的内核代码,所以我不确定是否应该对代码进行任何更改.任何人都可以帮助我解决为什么发生此错误以及如何将其清除.我使用了默认的内核配置.在使用make menu-config调用make之前.

I have not written professional kernel code before so I am not sure if I should make any changes in the code. Can anybody help me with why this error occurred and how it can be removed. I used the default kernel config. prior to calling make using make menu-config.

process.c中的错误在sav​​esegment(fs,p-> thread.fs)中; (错误的所有实例均来自同一函数)

The error in the process.c is in savesegment(fs,p->thread.fs); (all instances of the error are from the same function)

谢谢

推荐答案

我使用了一个内核版本,该版本更接近于本机内核版本〜3.11.1.并使用make oldconfig代替.这比弄清楚我的体系结构的每个配置设置都容易.

I used a kernel version who version was closer to my native kernel version ~ 3.11.1. and used make oldconfig instead. This was easier than figuring out each configuration setting for my architecture.

这篇关于构建Linux Kernel 2.6.10时出错,错误:"mov"的操作数类型不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 16:15