Typically written in a high level language C or C Mostly accessed by programs

Typically written in a high level language c or c

This preview shows page 18 - 30 out of 40 pages.

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
Image of page 18
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)
Image of page 19
API – System Call – OS Relationship
Image of page 20
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
Image of page 21
Parameter Passing via Table
Image of page 22
Examples of Windows and Unix System Calls
Image of page 23
Standard C Library Example C program invoking printf() library call, which calls write() system call
Image of page 24
Communication Models Message Passing Shared Memory Communication may take place using either message passing or shared memory.
Image of page 25
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
Image of page 26
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
Image of page 27
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
Image of page 28
Traditional UNIX System Structure Beyond simple but not fully layered
Image of page 29
Image of page 30

You've reached the end of your free preview.

Want to read all 40 pages?

  • Fall '19

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes