Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.

Similar presentations


Presentation on theme: "Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432."— Presentation transcript:

1 Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432

2 Operating System Services An operating system provides services to its users: Program execution Load programs into memory, run/suspend/halt programs, handle/display errors I/O operations Seamlessly interact with I/O devices, including disks, networks connection, etc. Filesystem manipulation Read/write/traverse filesystem directories, read/write files, enforce permissions, search for files, etc.

3 Operating System Services Other services an operating system provides: Inter-Process Communications (IPC) Processes exchange information via shared memory, message passing, sockets, pipes, files, etc. Might span multiple computer systems Error detection and recovery Errors arise in CPU, memory, I/O devices, processes, etc. Operating system should detect and recover from errors, ensuring correct and consistent operations

4 Operating System Structure Using a layered approach, the operating system is divided into N levels or layers Layer 0 is the hardware Layer N is the top-level user interface Each layer uses functions and services of lower layers Layer 1 often is the kernel

5 Operating System Structure

6 Operating System Kernel The core program running in an operating system is the kernel When a computer is switched on, a bootstrap program executes from ROM Bootstrap program initializes all aspects of the system, then loads the operating system kernel and starts its execution

7 User and Kernel Modes Dual-mode operation provides a user mode and a kernel mode of operation Allows the operating system to protect itself and other system components

8 User and Kernel Modes Kernel relinquishes control to a user process, but may set a timer to ensure a process does not run beyond its allotted time Avoid infinite loops, memory leaks, memory hogs, etc. Not entirely effective in practice? How many times have you fought to stop a runaway process? Kernel also provides security via privileged instructions

9 System Calls via APIs Operating system services available to users via GUI and CLI, which are just software programs System calls are made via programming interface called an Application Program Interface (API) Common operating system APIs: Win32 API for Windows POSIX API for POSIX-based systems, including UNIX, Linux, Mac OS X Java API for Java Virtual Machine C++ Standard Library

10 System Calls via APIs Types of system calls include: Process control (e.g. start/suspend/stop a process) Debugging information, too File management Device management Information retrieval and maintenance Current date/time, number of current users, OS version, amount of free memory, process information, etc. Communications (e.g. IPC, network)

11 System Calls via APIs System call sequence for a file copy program:

12 System Calls via APIs An API successfully hides the implementation details of the operating system Programmers just need to abide by the API specifications Change the operating system, but maintain the API such that it is backwards compatible Deprecate old behavior over long period of time  Why? hey, the dude abides, man

13 System Calls via APIs

14 Example using the printf() function from C One API may call another, which may call another, etc.

15 System Calls via APIs Pass parameters to the operating system via registers or a block of data in memory


Download ppt "Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432."

Similar presentations


Ads by Google