This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <linux/module.h> | |
| #include <linux/kernel.h> | |
| #include<linux/sched.h> | |
| int pint=-1; | |
| static __init int getargs(char *str){ | |
| int ret; | |
| ret=get_option(&str,&pint); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ifneq ($(KERNELRELEASE),) | |
| obj-m := proc_read_fifo1.o | |
| else | |
| KERNELDIR ?= /lib/modules/$(shell uname -r)/build | |
| PWD := $(shell pwd) | |
| default: | |
| $(MAKE) -C $(KERNELDIR) M=$(PWD) modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <linux/module.h> | |
| #include <linux/kernel.h> | |
| #include <linux/proc_fs.h> | |
| #include<linux/sched.h> | |
| #include <asm/uaccess.h> | |
| #include<linux/slab.h> | |
| #include<linux/kfifo.h> | |
| #define FIFO_SIZE 32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Tested on kernel 5.3*/ | |
| #include <linux/module.h> | |
| #include <linux/kernel.h> | |
| #include <linux/proc_fs.h> | |
| #include<linux/sched.h> | |
| #include <asm/uaccess.h> | |
| #include<linux/sched/clock.h> | |
| #include<linux/slab.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Code to show usage of hllist . Tested in kernel 5.3*/ | |
| #include<linux/kernel.h> | |
| #include<linux/module.h> | |
| #include<linux/list.h> | |
| #include<linux/slab.h> | |
| struct k_list { | |
| struct hlist_node test_list; | |
| int temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import curses as cur | |
| from curses import wrapper | |
| import locale | |
| import sys, termios, atexit | |
| from select import select | |
| import curses as cur | |
| from curses import wrapper | |
| import time | |
| import datetime | |
| import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Code to show usage of list_is_first . Tested in kernel 5.3*/ | |
| #include<linux/kernel.h> | |
| #include<linux/module.h> | |
| #include<linux/list.h> | |
| #include<linux/slab.h> | |
| struct k_list { | |
| struct list_head test_list; | |
| int temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Code to show usage of list_del . Tested in kernel 5.3*/ | |
| #include<linux/kernel.h> | |
| #include<linux/module.h> | |
| #include<linux/list.h> | |
| #include<linux/slab.h> | |
| struct k_list { | |
| struct list_head test_list; | |
| int temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys, termios, atexit | |
| from select import select | |
| import curses as cur | |
| from curses import wrapper | |
| import time | |
| import datetime | |
| import random | |
| # save the terminal settings | |
| fd = sys.stdin.fileno() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.