Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: I need some information about .ko files compilation
PostPosted: Tue Feb 08, 2011 2:41 pm 
Offline

Joined: Wed Jan 26, 2011 2:42 pm
Posts: 5
Hi, I'm student and I don't have experience in embedded systems. I'm working with a
M-501 SoM board with ARM-Linux version 2.6.14-M5. I would like to compile this kernel's
module example code for my board. The kernel's module example code is:

===============================================================================
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <asm/current.h>
#include <linux/sched.h>

static int hola(void)
{
printk(KERN_INFO "Hi! the module had been load\n");
printk(KERN_INFO "The user space process is %s\n", current->comm);
printk(KERN_INFO "The PID is %i \n", current->pid);
return 0;
}

static void adios(void)
{
printk(KERN_INFO "Bye, the module kernel has been unload.\n");
}
module_init(hola);
module_exit(adios);
MODULE_AUTHOR("author's name");
MODULE_LICENSE("Licence's type");
MODULE_DESCRIPTION("Module Description");
===============================================================================

I used this makefile:

===============================================================================
ifeq ($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
.PHONY: build clean

build:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules #$(CC)
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c Mod* mod*
else
$(It is created with = ${KERNELRELEASE})
obj-m := hola.o

endif
===============================================================================

When I used this makefile, I can create and load in my Linux's PC the "hola.ok" file
without problems.

I downloaded the ARM-linux kernel's code from this site:
ftp://ftp.artila.com/Matrix5xx/Sources/kernel/m501_som/

I modified the makefile file for adapted it to ARM-Linux.
===============================================================================
ifeq ($(KERNELRELEASE),)
KERNELDIR ?=/home/jyrios/Documentos/Kernels-arm-linux/linux-2.6.x # (path to ARM-linux kernel's code in my PC)
PWD :=$(shell pwd)
.PHONY: build clean

build:
$(MAKE) -C $(KERNELDIR) ARCH=arm CROSS_COMPILE=arm-linux- STRIP=arm-linux-strip -W -Wall M=$(PWD) modules #$(CC)
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c Mod* mod*
else

$(It is created with = ${KERNELRELEASE})
obj-m := hola.o
endif
===============================================================================

But, When I try to compile for the ARM-Linux, I got 2 errors compilation:

1. "the Module.symvers file is missing". What's the function for this file?
I looking for the "Module.symvers" file in /home/jyrios/Documentos/Kernels-arm-linux/linux-2.6.x
path and I don't find it!

2. Thousands and thousands of errors and warnings like:
a) include/linux/elf.h:19: warning: type defaults to `int' in declaration of `Elf32_Sword'
b) include/linux/elf.h:19: warning: data definition has no type or storage class
c) include/linux/elf.h:20: error: parse error before "Elf32_Word"


What is it I made wrong? I would appreciate a tutorial or a link to teach me about this.

Thanks!

P.D. I'm sorry for my english!!


Top
 Profile  
 
 Post subject: Re: I need some information about .ko files compilation
PostPosted: Tue Feb 08, 2011 6:58 pm 
Offline

Joined: Wed Jan 26, 2011 2:42 pm
Posts: 5
A classmate said to me that my problem is not the "Module.symvers" file, my real problem is that i don't have the config file, and I don't have compile the linux kernel.

In this site explain how to compile the kernel linux for ARM plataform.:
http://www.arm.linux.org.uk/docs/kerncomp.php

I don't do it yet.... and I don't know if this working.... but I will try and write wherever if I could solve it or not.


Top
 Profile  
 
 Post subject: Re: I need some information about .ko files compilation
PostPosted: Mon Feb 14, 2011 8:30 pm 
Offline

Joined: Wed Jan 26, 2011 2:42 pm
Posts: 5
I'm reading some pages... and I see that my arm-linux toolchain is very old... I'll try to update and I'll try to compile again...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: