i am new with kernel modules development and have decided to write my first kernel module today.
my module is supposed to receive 2 numbers as input, seperated by a whitespace and have those numbers added together.
the kernel module communicates via a proc entry named calc (/proc/calc), so reading from the file will be there returned output and writing to that file would be giving new input (2 numbers seperated by a whitespace)
when loading the module (insmod) my shell gets stuck, when interrupting it and looking at dmesg i see a kernel BUG line, here is the trace.
i am not sure if that is a bug in my code, or is it an actual bug at the linux kernel, and would love to understand what i've done wrong and how can i start debugging my module with the given dmesg log.
here is the source code of my module.
my makefile is the very standard one,
obj-m += calc.o
KDIR := /lib/modules/$(shell uname -r)/build
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
Many many thanks in advance!
EDIT: i am using ubuntu 16.04.02, release 4.10.0-28, quite standard.