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 for
mov'
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 for
mov'
arch/i386/kernel/process.c:583: Error: operand type mismatch for mov'
arch/i386/kernel/process.c:584: Error: operand type mismatch for
mov'
arch/i386/kernel/process.c:591: Error: operand type mismatch for mov'
arch/i386/kernel/process.c:592: Error: operand type mismatch for
mov'
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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…