linux/module.h No such file or Directory

前端 未结 2 1985
天命终不由人
天命终不由人 2021-01-13 15:35

For my thesis I am creating a Manet using the protocol ARAN. To install the protocol I\'m using this manual, but the first step, the creation of trace_route, I received erro

2条回答
  •  不思量自难忘°
    2021-01-13 15:58

    **/*source file name is basic.c */**
    
    #include 
    #include 
    /*MODULE_LICENSE("Dual BSD/GPL");*/
    static int hello_init(void)
    {
        printk(KERN_ALERT "Hello, world\n");
        return 0;
    }
    static void hello_exit(void)
    {
        printk(KERN_ALERT "Goodbye, cruel world\n");
    }
    module_init(hello_init);
    module_exit(hello_exit);
    

    =====================================

    now make file for ubuntu

    /*at first type on ur terminal that $(uname -r) then u will get the version.. that is using on ur system */

    obj-m +=basic.o
    
    KDIR =//usr/src/linux-headers-3.13.0-44-generic
    
    all:
     $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
    clean:
     rm -rf *.o *.ko *.mod.* *.symvers *.order
    

    ================================================

    To run the code

    $sudo insmode basic.ko
    $dmesg
    u will get the output
    $sudo rmmod basic.ko
    $dmesg
    

提交回复
热议问题