Hi everyone .
Sorry for the inconvenience , ...

I want to know how to load my kernel module, run it see these traces using dmesg and debug it.

So , i have read this part of the  (manual) , but i don't know how to use it :

| What you may have noticed is that, unlike other package infrastructures, we | explicitly invoke a second infrastructure. This allows a package to build a kernel | module, but also, if needed, use any one of other package infrastructures to | build normal userland components (libraries, executables…). Using the kernel-module infrastructure on its own is not sufficient; another package infrastructure must be used.

but in my way , i have try something :

- Config.in
config BR2_PACKAGE_KERNEL_MODULE
        bool "kernel_module"
        depends on BR2_LINUX_KERNEL
        help
                Linux Kernel Module Cheat.
- external.mk

KERNEL_MODULE_VERSION = 1.0
KERNEL_MODULE_SITE = $(BR2_EXTERNAL_KERNEL_MODULE_PATH)
KERNEL_MODULE_SITE_METHOD = local
$(eval $(kernel-module))
$(eval $(generic-package))

- Makefile

obj-m += $(addsuffix .o, $(notdir $(basename $(wildcard $(BR2_EXTERNAL_KERNEL_MODULE_PATH)/*.c)))) ccflags-y := -DDEBUG -g -std=gnu99 -Wno-declaration-after-statement .PHONY: all clean all: $(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' modules clean: $(MAKE) -C '$(LINUX_DIR)' M='$(PWD)' clean

- hello.c

#include <linux/module.h> #include <linux/kernel.h> MODULE_LICENSE("GPL"); static int myinit(void) { printk(KERN_INFO "hello init\n"); return 0; } static void myexit(void) { printk(KERN_INFO "hello exit\n"); } module_init(myinit) module_exit(myexit)

And in the terminal :
make BR2_EXTERNAL="$(pwd)/../kernel_module" qemu_x86_64_defconfig
echo 'BR2_PACKAGE_KERNEL_MODULE=y' >> .config
make BR2_JLEVEL="$(($(nproc) - 2))" all
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append root=/dev/vda -net nic,model=virtio -net user


On qemu :
modprobe hello
modprobe: module hello not found in modules.dep

how can i solve it ??
please i need your help