OS Components: Process Management
OS Components: Process Management
OS Components: Process Management
• Command-Interpreter
– The most important aspect of the operating system.
• This is the interface between the user and the operating
system itself so the users can make their wishes known.
– In some operating systems, this is built into the kernel.
– In others, such as MS-DOS (command.com) and UNIX (bash),
this is a special process that runs when the system starts up or
the user logs in.
– Recently, command interpreters have become very complex and
powerful
• The UNIX shell has a programming language built into it.
• The OS X interpreter is the windowing system.
– To an extent, the same can be said of the Windows
explorer.
OS Services
• There are some services that operating systems may provide to the
programmer.
– These provide a convenient way to access resources
– It also allows the operating system to provide guarantees about
the resources
• Protection
• Efficiency
• These services are categorized into two broad groups:
– User services
– System services
OS Services
AX: 120DA8F9
BX: 120DA8F9
SP: 120DA8F9
PC: 120DA8F9
• Process Control
– End or Abort a process
• Passing control back to the shell
• Or handling special abort conditions
• Reporting errors
– Create a process / submit job; Load and Execute a program
• Not as simple as just having the shell execute a program – as
there must be a mechanism for any process to load and
execute a program.
• Fork() system call in Unix is a method to create a new
process.
• Exec() system call in Unix is a method to cause the current
process to begin executing another program
• In batch systems, there must also be a way to submit the job
for processing.
System Calls
• Process Control
– Get and Set process attributes
• Such as priority of the process or maximum allowable
execution time.
– Wait for time, event or signal (OS must decide who gets the
signal)
• Timeouts on network connections
• Hardware event such as a mouse-click
• Software signal from a concurrent process.
– Trace and Dump
• Used for debugging purposes. These allow the system to
trace the current execution of a program; and dump the
contents of memory (and the process state).
System Calls
• File manipulation
– Create and delete a file
– Open and close a file
– Read, write and reposition the file pointer
– Get and Set file attributes
System Calls
• Device manipulation
– Request and release device
– Read, write and reposition
– Get and Set device attributes
– Attach and Detach devices
• USB
• Floppy
• Cdrom
System Calls
• Information maintenance
– Get and Set date / time
– Get and Set system data
– Get process, file or device attributes
– Set process, file or device attributes
System Calls
• Communications
– Create and delete communications channel
– Send and receive messages
– Transfer status information
– Attach or detach remote devices
System Programs
• Simple structure
– MS-DOS was an operating system with a simple structure.
• No separation between interfaces and levels of functionality.
– A program can access the hardware (RAM, Video Ram,
hard disk, etc. directly with its own machine code.
» No security
» DOS was unstable because of this
System Structure
• Layered Approach
– Most modern operating systems utilize a layered approach.
• Within each layer, there may also be several subsystems
• In theory, each layer can only access the layer above or below
it.
– User Programs
– Language API
– System Calls
– Hardware
• Each level provides some core service to the layer above it.
• DirectX provides a consistent API to game developer. It
consists of several subsystems (DirectPlay, DirectSound)