Module 2.1 OS Principles
Module 2.1 OS Principles
Module – 2
Interrupts
Polling
DMA
(Devices include I/O and Disks)
Process is an entity
A thing with distinct and independent existence
Data Region
Stores variables and dynamically allocated memory that
the process uses during execution.
Stack Region
Stores instruction and local variables for active procedure
calls
Process Table:
Pointer to per-user process table to access PCB
quickly
Destroying process
Suspending process
Resuming process
Enable IPC
INIT
bash
vi mypgm
Int main(void)
{
printf("hello world from process ID %d\n",
getpid());
exit(0);
}
fork()
exec()
waitpid()
execl
execle
execlp
execv
execvp
execve
exit()
Performs a clean shutdown of the standard I/O
library
fclose function is called for all open streams
This causes all buffered output data to be flushed
if (atexit(my_exit1) != 0)
err_sys("can't register my_exit1");
if (atexit(my_exit1) != 0)
err_sys("can't register my_exit1");
printf("main is done\n");
return(0);
}