This file contains 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<stdio.h> | |
#include<string.h> | |
int main(){ | |
FILE *fp; | |
int v=0; | |
int val; | |
char s[20],ch; | |
fp = fopen("/proc/mtest","w+"); |
This file contains 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/string.h> | |
#include<linux/vmalloc.h> | |
#include<linux/mm.h> | |
#include<linux/init.h> | |
#include<linux/proc_fs.h> | |
#include<linux/sched.h> | |
#include<linux/uaccess.h> | |
#include<linux/fs.h> |
This file contains 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
/* | |
# | |
# Makefile for the linux RomFS filesystem routines. | |
# | |
obj-m := romfs.o | |
romfs-y := storage.o super.o | |
all: | |
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules | |
clean: | |
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean |
This file contains 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/sched.h | |
struct task_struct { | |
int ctx; | |
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | |
void *stack; | |
atomic_t usage; | |
unsigned int flags; /* per process flags, defined below */ | |
unsigned int ptrace; | |
//... |
This file contains 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/init.h> | |
#include<linux/proc_fs.h> | |
#include<linux/sched.h> | |
#include<linux/uaccess.h> | |
#include<linux/fs.h> | |
#include<linux/seq_file.h> | |
#include<linux/slab.h> | |
static char *str = NULL; |