Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
208 views
in Technique[技术] by (71.8m points)

Error while building Linux Kernel 2.6.10 Error: operand type mismatch for `mov'

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-kernel i.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: warning: ‘packed’ attribute ignored for field
of type ‘unsigned char[6]’ [-Wattributes]

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

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: 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: 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 1 make: [arch/i386/kernel] Error 2

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.

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

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is not clear from your question that what are the exact steps you did.

This error may be due to some issues in configuration.

Please try the following steps and see if it solves the problem:

> make defconfig #Creates a default config based on your machine architecture
> make

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...