Search Results

Search found 6 results on 1 pages for 'sb2367'.

Page 1/1 | 1 

  • Kernel module for /proc

    - by sb2367
    How to write a kernel module that creates a directory in /proc named mymod and a file in it name is mymodfile. This file should accept a number ranged from 1 to 3 when written into it and return the following messages when read based on the number already written into it: • 1: Current system time (in microseconds precision) • 2: System uptime • 3: Number of processes currently in the system “The Output” root@Paradise# echo 1 > /proc/mymod/mymodfile root@Paradise# cat /proc/mymod/mymodfile 08:30:24 342us root@Paradise# echo 2 > /proc/mymod/mymodfile root@Paradise# cat /proc/mymod/mymodfile up 1 day, 8 min root@Paradise# echo 3 > /proc/mymod/mymodfile root@Paradise# cat /proc/mymod/mymodfile process count: 48 please give me some hint how to write a kernel modules and how to compile and install it .

    Read the article

  • What is the problem with this code? How to solve it? (fork)

    - by sb2367
    What is the problem with this code? How to solve it? Parent processes goto in if or child process? first code produce zombie process or second code or both or non ? #include <signal.h> #include <sys/wait.h> main() { for (;;) { if (!fork()) { exit(0); } sleep(1); } } what about this code : #include <signal.h> #include <sys/wait.h> main() { for (;;) { if (fork()) { exit(0); } sleep(1); } }

    Read the article

1