Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

compile yocto to generate .ko file

$
0
0

Dear sir/madam

I have build yocto sdk and trying to compile below program 

#include <linux/module.h>     /* Needed by all modules */
#include <linux/kernel.h>     /* Needed for KERN_INFO */
#include <linux/init.h>       /* Needed for the macros */
  
///< The license type -- this affects runtime behavior
MODULE_LICENSE("GPL");
  
///< The author -- visible when you use modinfo
MODULE_AUTHOR("Akshat Sinha");
  
///< The description -- see modinfo
MODULE_DESCRIPTION("A simple Hello world LKM!");
  
///< The version of the module
MODULE_VERSION("0.1");
  
staticint__init hello_start(void)
{
    printk(KERN_INFO "Loading hello module...\n");
    printk(KERN_INFO "Hello world\n");
    return0;
}
  
staticvoid__exit hello_end(void)
{
    printk(KERN_INFO "Goodbye Mr.\n");
}
  
module_init(hello_start);
module_exit(hello_end);
This is my makefile
CC=aarch64-poky-linux-gcc
obj-m = hello.o
all:
make -C /home/tushar/tushar_1/build/tmp/work-shared/smarc-rzg2l/kernel-source M=$(PWD) modules
clean:
make -C /home/tushar/tushar_1/build/tmp/work-shared/smarc-rzg2l/kernel-source M=$(PWD) clean
when i give make command it gives me this error 
./include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
#include <asm/types.h>
kernel configuration error :#include<generated/auto.conf> not included 
 

Regards

Tushar


Viewing all articles
Browse latest Browse all 1583

Trending Articles