(0) System Structure


  • Simple Structure

-any part of the system may use the functionality of the rest ofthe system

-MS-DOS (user programs can call low level I/O routines)View the OS as a series of levels

–Each level performs a related subset of functions

–Each level relies on the next lower level to perform more primitive functions

–This decomposes a problem into a number of more manageable subproblems

  • Layered Approach

    The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface.

    With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers

---Properties

 Simplicity of construction
 Simplicity of Debugging
 Problems
 Precise definition of layers
 Example: Memory manager requires device driver of backing store (due to virtual memory)
 The device driver requires CPU scheduler (since if the driver waits for IO, another task should be scheduled)
 CPU scheduler may require virtual memory for large amount of information of some processes
 Less efficiency: due to the number of layers a request should pass

(0) System Calls

System calls provide the interface between a running program and the operating system
Generally available as assembly-language instructions
Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C, C++)
Types of System Calls
  • Process control

create/terminate a process (including self)

  • File management
    Also referred to as simply a file system or filesystem. The system that an operating system or program uses to organize and keep track of files. For example, a hierarchical file system is one that uses directories to organize files into a tree structure.Although the operating system provides its own file management system, you can buy separate file management systems. These systems interact smoothly with the operating system but provide more features, such as improved backup procedures and stricter file protection.

--->>Device management

Device Management is a set of technologies, protocols and standards used to allow the remote management of mobile devices, often involving updates of firmware over the air (FOTA). The network operator, handset OEM or in some cases even the end-user (usually via a web portal) can use Device Management, also known as Mobile Device Management, or MDM, to update the handset firmware/OS, install applications and fix bugs, all over the air. Thus, large numbers of devices can be managed with single commands and the end-user is freed from the requirement to take the phone to a shop or service center to refresh or update.

  • Information maintenance get time

–set system data (OS parameters)

– get process information (id, time used)

  • Communications

– establish a connection

– send, receive messages

– terminate a connectionlProcess control

– create/terminate a process (including self)

(0)Operating System Services

  1. Program execution – system capability to load a program into memory and to run it
  2. I/O operationssince user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/On
  3. File-system manipulationprogram capability to read, write, create, and delete files
  4. Communicationsexchange of information between processes executing either on the same computer or on different systems tied together by a network. Implemented via shared memory or message passing
  5. Error detectionensure correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs

(0) System Components

  • Operating System Process Management

A process is a program in execution

A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task.

The operating system is responsible for the following activities in connection with process management

  1. Process creation and deletion
  2. Process suspension and resumption
  3. Provision of mechanisms for:
  • process synchronization
  • process communication

  • Main memory Management

1.Memory is a large array of words or bytes, each with its own address

() It is a repository of quickly accessible data shared by the CPU and I/O devices

2. Main memory is a volatile storage device. It loses its contents in the case of system failure

3. The operating system is responsible for the following activities in connections with memory managementl

  • Keep track of which parts of memory are currently being used and by whoml
  • Decide which processes to load when memory space becomes availablel
  • Allocate and deallocate memory space as needed

Memory management is the act of managing computer memory. In its simpler forms, this involves providing ways to allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. The management of main memory is critical to the computer system.

  • File management

A file is a collection of related information defined by its creatorl Commonly, files represent programs (both source and object forms) and data

The operating system is responsible for the following activities in connections with file management:

  • File creation and deletion
  • Directory creation and deletion
  • Support of primitives for manipulating files and directories
  • Mapping files onto secondary storage
  • File backup on stable (nonvolatile) storage media

A file object provides a representation of a resource (either a physical device or a resource located on a physical device) that can be managed by the I/O system. Like other objects, they enable sharing of the resource, they have names, they are protected by object-based security, and they support synchronization. The I/O system also enables reading from or writing to the resource.

  • I/O System management

The I/O system consists of:

>A buffer-caching system

>A general device-driver interface

>Drivers for specific hardware devices

  • Secondary Storage Management

Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory

Most modern computer systems use disks as the principle on-line storage medium, for both programs and datan

The operating system is responsible for the following activities in connection with disk management:

>> Free space managementl Storage allocationl

>>Disk scheduling

The I/O management subsystem controls all the input andoutput of the computer system. For the enforcement ofsecurity, the most important things that the I/O managementsubsystem does are· Managing the transfer of data.· Enforcing access controls (the DAC mechanisms) on datawhile it is being transferred. See “Discretionary access control(DAC)” for more information on DAC.During the transfer of blocks or streams of data, and duringcharacter I/O operation, each I/O transaction is completelyseparate from all others. It follows a well-known and well-defined path; therefore, the integrity of all data is maintainedduring data transactions.

  • Protection System

Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resourcesn

The protection mechanism must:

  1. distinguish between authorized and unauthorized usagel specify the controls to be imposedl
  2. provide a means of enforcement
  • Command-Interpreter system

Many commands are given to the operating system by control statements which deal with:

  1. Process creation and management
  2. I/O handling
  3. Secondary-storage management
  4. Main-memory management
  5. File-system access
  6. Protection
  7. Networking

A command interpreter is the part of a computer operating system that understands and executes commands that are entered interactively by a human being or from a program. In some operating systems, the command interpreter is called the shell.