1.3 System Call. System Call System calls provide the interface between a running program and the operating system. System call is a method by which a.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
EEE 435 Principles of Operating Systems Operating System Concepts (Modern Operating Systems 1.5)
Operating system services Program execution I/O operations File-system manipulation Communications Error detection Resource allocation Accounting Protection.
Chap 2 System Structures.
Operating-System Structures
Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
6/9/2015B.Ramamurthy1 Process Description and Control B.Ramamurthy.
Process Description and Control
Structure of Processes
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Introduction to Kernel
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Linux+ Guide to Linux Certification, Second Edition
CSCE 351: Operating System Kernels
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
1 CSC 2405: Computer Systems II Spring 2012 Dr. Tom Way.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
System Calls 1.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Linux+ Guide to Linux Certification, Second Edition
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Processes Introduction to Operating Systems: Module 3.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Getting Started UNIX InKwan Yu Topics Unix Commands Unix System calls C function calls.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
What is a Process ? A program in execution.
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
System Components Operating System Services System Calls.
Operating System Structure Lecture: - Operating System Concepts Lecturer: - Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Introduction to Kernel
MICROPROCESSOR BASED SYSTEM DESIGN
Microprocessor and Assembly Language
Avani R.Vasant V.V.P. Engineering College
Protection of System Resources
Chapter 3 – Process Concepts
CS 3305 System Calls Lecture 7.
Processes A process is a running program.
Structure of Processes
OPERATING SYSTEMS DESIGN AND IMPLEMENTATION Third Edition ANDREW S
Module 2.2 COP4600 – Operating Systems Richard Newman
Process Description and Control
Process Description and Control
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Process Description and Control
Process Description and Control
Process Description and Control
Processes in Unix and Windows
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Chapter 2: Operating-System Structures
Presentation transcript:

1.3 System Call

System Call System calls provide the interface between a running program and the operating system. System call is a method by which a program make a request to the OS Generally system calls available as assembly-language instructions System call will use by executing a software interrupt instruction.

Cont.. Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C, C++). Three general methods are used to pass parameters between a running program and the operating system: – Pass parameters in registers. – Store the parameters in a table in memory, and the table address is passed as a parameter in a register. – Push (store) the parameters onto the stack by the program, and pop off the stack by operating system.

System Call Working under Process Management Calls involve in Process Management – FORK : is used to create a new process. – WAITPID : is used to terminate the process. – PTRACE : is used for debugging – SETSID : create a new session and return its process group id. – BRK : is used to set the size of data segment System call related to process creation termination

System Call Working under Signaling Although most interprocess communication are planned, situations exist in which unexpected communication needed.

System Call Working under Signaling Eg: – when user accidently tell a text editor to list the entire content of long text and then realize the error, some way is needed to interrupt the editor. – User can hit the DEL key on keyboard which send a signal and stop the print – out. Signal also can be used to report certain trap detected by hardware. – When signal is sent to process that has not announced its willingness to accept the signal, the process is simply killed.

System Call Working under Signaling The calls in Signaling: – SIGACTION: define action to take on signal – SIGRETURN: return from signal – SIGPENDING: get the set of blocked signal – SIGSUSPEND : replace the signal mask and suspend the process The purpose of SC in signaling is handle the signal

System Call Working under File Management System call operate on individual files. Calls in File Management – CREAT : to create a new file fd= creat(“abc”,0751) ; create a file call abc with mode 0751 octal..specify the rwx for the owner In C, a leading by zero means that a constant is in octal Owner :7 means read- write- execute permission) Group :5 means read-execute Others :1 means execute only

System Call Working under File Management – OPEN: Open a file for reading, writing or both – CLOSE : Close an open file – WRITE : Write data from a buffer into a class – RENAME: Give a file a new name The purpose of SC in File Management is reading and writing file

System Call Working under Directory Management Example of calls involve in this section are – MKDIR : create empty directories – RMDIR : delete directories – LINK : allow the same file to appear under two or more names, often in different directory. (Eg: Allow several members of the same programming team to share common file, which each of them having the file appear in his own directory) – UNLINK : remove the directory entry The purpose is to manage the directory

System Call Working under Protection In MINIX every file has an 11-bit used for protection. These bit are read-write-execute bit for owner, group and others. CHMOD system call is used to change the mode of a file To a file read-only by everyone except the owner, could execute : chmod(“filename”, 0644)

System Call Working under Protection The other two protection bits: – : SETUID : set-user-id When any user execute a program with the SETUID bit on, for duration of that process the user’s effective uid is change to that file’s owner. – : SETGID : set –group-id When a programs execute, the gid is change to the current gid. The purpose of system call in protection is to protect information

System Call Working under Time Management Example, MINIX has 4 system call that involve the time-of-day clock – :Get elapsed time (return the current time in sec :only display the starting time eg: Feb. 2, 2010) – :Set elapsed time (to allow it to be read later: ) – :Set a file’s “last access time ”.(to allow owner of the file to change the time stored) – :Get the user and system times used so far (to know total user and system time used) The purpose of time Management is keeping track of time

Summary The heart of any operating system is the set of system call that it can handle Example for MINIX, these call can be divided into sixth group. Which are – System call related to process creation termination – Handle signal – Reading and writing files – Directory management – Protect information – Keeping track of time