Compiling modules?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
Liboicl
Posts: 90
Joined: Tue 16 Feb 2010, 01:49

Compiling modules?

#1 Post by Liboicl »

I am trying to make a test Hello World program as a module, but puppy won't load it.
This is all on 4.3.1.
# insmod hello.ko
insmod: error inserting 'hello.ko': -1 Invalid module format
# dmesg
hello: no sybmol version for module_layout

Code: Select all

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

MODULE_LICENSE("Dell Keyboard");

static int hello_init(void) {
  printk("<1> Hello world!\n");
  return 0;
}

static void hello_exit(void) {
  printk("<1> Bye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);

Code: Select all

obj-m += hello.o

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

Post Reply