Jump to content

Recommended Posts

Posted

Я пытаюсь научится писать модули ядра написал, для проверки следующие

#include

static int module_init(void)

{

printk(KERN_INFO "Module on\n");

return 0;

}

static void module_off(void)

{

return;

}

module_init(module_init);

module_exit(module_off);

откампилил

пытаюсь подгрузить с помощью insmod

а н мне пишет следующие

insmod: error inserting 'module.o': -1 Invalid module format

компию из макфайла вот его код

.PHONY = clean

CC = gcc

CFLAGS = -O2 -Wall

MODFLAGS = -D__KERNEL__ -DMODULE -I/usr/src/linux/include

module.o: module.c

$(CC) $(CFLAGS) $(MODFLAGS) -c module.c

clean:

rm -f *.o

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...