0% found this document useful (0 votes)
60 views

System Call Parameter Passing

Uploaded by

shalini.26it
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

System Call Parameter Passing

Uploaded by

shalini.26it
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

System Call Parameter Passing

▪ Often, more information is required than simply identity of desired system call
• Exact type and amount of information vary according to OS and call
▪ Three general methods used to pass parameters to the OS
• Simplest: pass the parameters in registers
In some cases, may be more parameters than registers
• Parameters stored in a block, or table, in memory, and address of block
passed as a parameter in a register
This approach taken by Linux and Solaris
• Parameters placed, or pushed, onto the stack by the program and
popped off the stack by the operating system
• Block and stack methods do not limit the number or length of parameters
being passed
Parameter Passing via Table
Types of System Calls
▪ Process control
• create process, terminate process
• end, abort
• load, execute
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
• Dump memory if error
• Debugger for determining bugs, single step execution
• Locks for managing access to shared data between processes
Types of System Calls (Cont.)
▪ File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
▪ Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Types of System Calls (Cont.)
▪ Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
▪ Communications
• create, delete communication connection
• send, receive messages if message passing model to host name or
process name
 From client to server
• Shared-memory model create and gain access to memory regions
• transfer status information
• attach and detach remote devices
Types of System Calls (Cont.)
▪ Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
Standard C Library Example
C program invoking
printf() library call,
which calls write()
system call
System Programs
▪ System programs provide a convenient environment for program development
and execution. They can be divided into:
• File manipulation
• Status information sometimes stored in a file
• Programming language support
• Program loading and execution
• Communications
• Background services
• Application programs
▪ Most users’ view of the operating system is defined by system programs, not
the actual system calls
System Programs(Cont…)
▪ Provide a convenient environment for program development and execution
• Some of them are simply user interfaces to system calls; others are
considerably more complex

▪ File management - Create, delete, copy, rename, print, dump, list, and
generally manipulate files and directories

▪ Status information
• Some ask the system for info - date, time, amount of available memory, disk
space, number of users
• Others provide detailed performance, logging, and debugging information
• Typically, these programs format and print the output to the terminal or other
output devices
• Some systems implement a registry - used to store and retrieve
configuration information
System Programs (Cont.)
▪ File modification
• Text editors to create and modify files
• Special commands to search contents of files or perform transformations of
the text
▪ Programming-language support - Compilers, assemblers, debuggers and
interpreters sometimes provided
▪ Program loading and execution- Absolute loaders, relocatable loaders,
linkage editors, and overlay-loaders, debugging systems for higher-level and
machine language
▪ Communications - Provide the mechanism for creating virtual connections
among processes, users, and computer systems
• Allow users to send messages to one another’s screens, browse web
pages, send electronic-mail messages, log in remotely, transfer files from
one machine to another
System Programs (Cont.)
▪ Background Services
• Launch at boot time
 Some for system startup, then terminate
 Some from system boot to shutdown
• Provide facilities like disk checking, process scheduling, error logging,
printing
• Run in user context not kernel context
• Known as services, subsystems, daemons
▪ Application programs
• Don’t pertain to system
• Run by users
• Not typically considered part of OS
• Launched by command line, mouse click, finger poke
Design and Implementation
▪ Design and Implementation of OS is not “solvable”, but some approaches
have proven successful
▪ Internal structure of different Operating Systems can vary widely
▪ Start the design by defining goals and specifications
▪ Affected by choice of hardware, type of system
▪ User goals and System goals
• User goals – operating system should be convenient to use, easy to
learn, reliable, safe, and fast
• System goals – operating system should be easy to design, implement,
and maintain, as well as flexible, reliable, error-free, and efficient
▪ Specifying and designing an OS is highly creative task of software
engineering
Policy and Mechanism

▪ Policy: What needs to be done?


• Example: Interrupt after every 100 seconds
▪ Mechanism: How to do something?
• Example: timer
▪ Important principle: separate policy from mechanism
▪ The separation of policy from mechanism is a very important principle, it allows
maximum flexibility if policy decisions are to be changed later.
• Example: change 100 to 200
Implementation
▪ Much variation
• Early OSes in assembly language
• Then system programming languages like Algol, PL/1
• Now C, C++
▪ Actually usually a mix of languages
• Lowest levels in assembly
• Main body in C
• Systems programs in C, C++, scripting languages like PERL, Python, shell
scripts
▪ More high-level language easier to port to other hardware
• But slower
▪ Emulation can allow an OS to run on non-native hardware

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy