LINUX HOME
Logo Image

Linux Samples

These samples were written and tested on Linux 2.4 kernel and made to be compatible with Linux 2.2 and 2.6 kernel. These samples do not use a kernel module but require root or su mode for proper execution. They're designed as basic programs for accessing data.

1) Copy the sample0 folder to any directory such as /home/ad12-8/sample0

2) Open a terminal window and change directory to the sample0 folder. On the command line type "uname -a" to find your linux kernel version.

3) Now type:

g++ -I /usr/src/linux kernel version/include -O -Wall -o sample0 sample0.c

This will compile a program called 'sample0'

4) Switch to su or root mode and type "./sample0" in the command line to run sample0. This sample will not work in non-root mode due to calling the function ioperm.