diff options
author | Arturs Artamonovs <dos21h@gmail.com> | 2023-12-22 10:02:03 +0000 |
---|---|---|
committer | Arturs Artamonovs <dos21h@gmail.com> | 2023-12-22 10:02:03 +0000 |
commit | b4faa70d6f59d3c6d426ae052f2a53ef12648ce9 (patch) | |
tree | 22893c1fb68bfd8246c63efdb293d9d5120feec0 /md/notes/kernel/irq_handler.md | |
parent | 660438d0f123d87c04dea1eef26a4167123e3390 (diff) | |
download | md-content-b4faa70d6f59d3c6d426ae052f2a53ef12648ce9.tar.gz md-content-b4faa70d6f59d3c6d426ae052f2a53ef12648ce9.zip |
New topic order, add few not finished posts
Diffstat (limited to 'md/notes/kernel/irq_handler.md')
-rw-r--r-- | md/notes/kernel/irq_handler.md | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/md/notes/kernel/irq_handler.md b/md/notes/kernel/irq_handler.md new file mode 100644 index 0000000..a4ce3cd --- /dev/null +++ b/md/notes/kernel/irq_handler.md @@ -0,0 +1,64 @@ +title:IRQ handler +keywords:kernel,linux,irq + +# IRQ handler + +Lets extend hello world driver. + +## Starting point + +__Makefile__ +```Makefile +obj-m += procfs_entry.o + +KDIR ?= /lib/modules/$(shell uname -r)/build + +all: + make -C $(KDIR) M=$(PWD) modules + +clean: + make -C $(KDIR) M=$(PWD) clean +``` + +__procfs_entry.c__ +```c +#include <linux/module.h> /* Needed by all modules */ +#include <linux/kernel.h> + +int procfs_entry_init( void ) +{ + printk(KERN_DEBUG "Hello Procfs!\n"); + return 0; +} + +void procfs_entry_exit( void ) +{ + printk(KERN_DEBUG "Exit Procfs!\n"); +} + +module_init( procfs_entry_init ); +module_exit( procfs_entry_exit ); + +MODULE_LICENSE("GPL"); +``` + + + +## List of procfs functions used + +| Function name | Note | +|---|---| +| proc_mkdir | Create procfs directory | +| proc_create | Create procfs file | +| proc_remove | Remove procfs entry | + +## Final result + + + +## Links + + + + + |