Operating System: Principles of
Operating System: Principles of
OPERATING
SYSTEM
GROUP 4
1. Purpose
What is the operating
system's PURPOSE?
A. IT ABSTRACTS COMPLEX B. IT PROVIDES HARDWARE C. IT PROTECTS THE
COMPUTER RESOURCES. COMPATIBILITY. SYSTEM.
I. EVERYONE IS
AWARE OF THE
- In Unix-based systems, a
process can interact with files
through file descriptors, integer
identifiers of files that the
process has open.
Reading and writing files in This takes three parameters: first the file descriptor
linux is simple, you just use (an int), then a pointer to an array of bytes (a
char*), and finally an integer saying how long the
the standard utilities for array is. It returns an int representing the number of
reading files such as cat, bytes read from the file, 0 if it has reached the file's
end, or a negative integer in the case of an error.
grep, tail, head, awk etc..
And you primarily use the The write system call is quite similar.
IN CONTEXT SWITCHING, PROCESSES ARE SWITCHED SO QUICKLY THAT THE USER GETS THE MYTH
THAT ALL PROCESSES ARE RUNNING SIMULTANEOUSLY.
BUT IN THE PROCESS OF CONTEXT SWITCHING, THERE ARE LOTS OF STEPS THAT WE NEED TO
FOLLOW. WE CANNOT DIRECTLY CHANGE OR SWITCH THE PROCESS FROM RUNNING STATE TO READY
STATE. IT IS MANDATORY TO SAVE THE CONTEXT OF THAT PROCESS.
Context Switching
Triggers
THE CONTEXT SWITCHING TRIGGERS ARE:
1. INTERRUPTS
2. MULTITASKING
3. KERNEL/USER SWITCH
4.3. Preemption
FROM THE RUNNING STATE TO THE READY STATE
IN THE STATE DIAGRAM.
PRINTF("HELLO\N");
RETURN 0;
}
5.2 Running programs
USE THE EXECVP SYSTEM CALL WHEN RUNNING AN ENTIRELY DIFFERENT
PROGRAM
WHEN THE SYSTEM EXECUTES THE EXECVP SYSTEM CALL, IT REPLACES THE
PROGRAM RUN BY THE CURRENT PROCESS WITH THE REQUESTED PROGRAM. THUS,
EXECVP, WHEN IT IS WORKING CORRECTLY, DOES NOT RETURN. INSTEAD, THE
PROCESS'S EXECUTION THREAD IS TRANSFERRED TO THE BEGINNING OF THE
REQUESTED PROGRAM.
ASHLY JOHN GALAGNARA
References: INTONG JPATRICK
JEGER C. LOOR
http://www.cburch.com/books/os/inde JESSE GEMS MARC SALCEDO
x.html#s5
PRINCES KIERRA ALVARADO SARVEDA
http://www.tutorialsspace.com/
https://www.tutorialspoint.com/opera ABEGAIL ABRAGAN TRANI
ting_system/os_processes.htm
JAMES RYAN TANTOY
https://www.techopedia.com/definitio
n/22400/supervisor-
mode#:~:text=Supervisor%20mode%20is
%20a%20mode,usually%20operates%20in
%20this%20mode.
GROUP 4 PRESENTERS