View snipet of reg.h of UNIX V6
/*
* Location of the users' stored
* registers relative to R0.
* Usage is u.u_ar0[XX].
*/
#define R0 (0)
#define R1 (-2)
#define R2 (-9)
#define R3 (-8)
#define R4 (-7)
View user_h_snippet.c
/*
* The user structure.
* One allocated per process.
* Contains all per process data
* that doesn't need to be referenced
* while the process is swapped.
* The user block is USIZE*64 bytes
* long; resides at virtual kernel
* loc 140000; contains the system
* stack per user; is cross referenced
View proc_h_snippet.c
/*
* One structure allocated per active
* process. It contains all data needed
* about the process while the
* process may be swapped out.
* Other per process data (user.h)
* is swapped with the process.
*/
struct proc
{
View sys1_fork_snipet.c
/*
* fork system call.
*/
fork()
{
register struct proc *p1, *p2;
p1 = u.u_procp;
for(p2 = &proc[0]; p2 < &proc[NPROC]; p2++)
if(p2->p_stat == NULL)
View explot.c
/* UBUNTU 14.04 :KERNEL 4.2.0-18-GENERIC */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <keyutils.h>
#include <unistd.h>
#include <time.h>
#include <unistd.h>