Typically written in a high-level language (C or C++) Mostly accessed by programs via a high-level Application Programming Interface ( API ) rather than direct system call use Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM) Note that the system-call names used throughout this text are generic
System Call Implementation Typically, a number associated with each system call System-call interface maintains a table indexed according to these numbers The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values The caller need know nothing about how the system call is implemented Just needs to obey API and understand what OS will do as a result call Most details of OS interface hidden from programmer by API Managed by run-time support library (set of functions built into libraries included with compiler)
API – System Call – OS Relationship
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
Examples of Windows and Unix System Calls
Standard C Library Example C program invoking printf() library call, which calls write() system call
Communication Models Message Passing Shared Memory Communication may take place using either message passing or shared memory.
Operating System Structures (reading assignment) General-purpose OS is very large program Various ways to structure ones Simple structure – MS-DOS More complex -- UNIX Layered – an abstrcation Microkernel -Mach
Simple Structure -- MS-DOS MS-DOS – written to provide the most functionality in the least space Not divided into modules Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated
Non Simple Structure -- UNIX UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts Systems programs The kernel Consists of everything below the system-call interface and above the physical hardware Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level
Traditional UNIX System Structure Beyond simple but not fully layered
You've reached the end of your free preview.
Want to read all 40 pages?
- Fall '19