Professional Documents
Culture Documents
Class Notes
Class Notes
=> "If you are expert in C, you can become expert in any
porgramming language" by D. Ritchie.
Q. What is an OS?
- An OS is a "system software" (i.e. collection of system
programs) which acts as an interface between user and
hardware.
- to compile a program
$gcc program.c -> terminal
"stdio.h"
printf()
scanf()
Scenarion-1:
Machine-1: Windows -> program.c
Machine-2: Linux -> program.c -> compile + execute => YES
Scenarion-2:
Machine-1: Linux -> program.c -> program (executable
code)
Machine-2: Windows -> program.out (executable code) => NO
int g_var=99;
static int i=1000;
sum(11,22);
res = n1 + n2;
return sum;
}
What is a Process?
- Program in execution is called as a process
- Running program is also called a process
- Running instance of a program is called as a process
# DAY-02:
DS :
slll.c => porgram
functions:
main() -> calling function => client function
services:
create_node()
add_last()
add_first()
add_at_pos()
delete_first()
delete_last()
delete_at_pos()
display_list()
Kernel => Program
System Calls => Functions
e.g.
- In UNIX, fork() sys call is used to create a new
process/child process.
- In Linux, fork() & clone() sys call used to create a
new process/child process.
- In Windows, CreateProcess() sys call is used to create
a new process/child process.
- Irespective of any OS there are 6 catagories of system
calls:
int main(void)
{
//local vars definition
int n1, n2, res;
//executable instructions
printf("enter n1 & n2 : ");//write() sys call -
system defined code
scanf("%d %d", &n1, &n2);//read() sys call - system
defined code
res = n1 + n2;
Q. What is an Interrupt?
- An interrupt is a signal recieved by the CPU from an IO
device due to which it stops an execution of one
job/process and start executing another job/process.
- interrupts which are sent by an IO devices to the CPU
are referred as hardware interrupts.
Process Management:
upon process submission => PCB for that gets created into
main memory inside kernel space.
+ Features of an OS:
1. multi-programming
2. multi-tasking
3. multi-threading
4. multi-processor
5. multi-user
# day-01:
step-1: start ingination
step-2: start bike either by kick or click
step-3: need to press cluch fully
step-4: change gear from neutral to 1st
.
.
.
# day-20:
step-1: start ingination
step-2: start bike either by kick or click
step-3: need to press cluch fully
step-4: change gear from neutral to 1st
.
.
.
"responsiveness to stimuli":
reaction time given by the brain to all your actions is
so quick
waiting time
response time
turn-around-time
P9 - larger process
- larger process has got lowest priority
common bike -
own bikes -
1 - ground floor
2 - 5th floor
1 missed call
2 missed calls
3 misssed calls
.
.
+ "Memory Management":
Main Memory => RAM
SunBeam => Krishna Hall -> "225" Seats => 1-225 =>
Physical Seat Numbers
batch-1: 1-200 - 6 TO 8
batch-2: 201-400 - 8 TO 10
batch-3: 401-600 - 10 TO 12
batch-4: 601-800 - 12 TO 2
batch-5: 801-1000 - 2 TO 4
# day-02:
batch-1:
Process P9 => 6 GB
+ "File Management":
Q. What is a File ?
User point view:
- File is a named collection of logically related
data/information.
- File is basic storage unit
- File is like a container which contains logically
related data/information/records.
e.g.
Windows => NTFS(New Technology FileSystem),
FAT/FAT16/FAT32/ (File Allocation Table)