Showing posts with label Operating System 3. Show all posts
Showing posts with label Operating System 3. Show all posts

1. What are the major activities of an Operating System with regards to Process Management?

The operating system is responsible for the following activities in connection with process management.
  • Process creation and deletion.
  • Process suspension (process is in I/O wait queue, or “swapped” out to disk, …) and resumption (move to ready queue or execution) – manage the state of the process.

  • Provision of mechanisms for:
  • Process synchronization - concurrent processing is supported thus the need for synchronization of processes or threads.
  • Process communication
  • Deadlock handling

2. What are the major activities of an Operating System with regards to Memory Management?

-Keep track of which parts of memory are currently being used and by whom.
-Decide which processes to load when memory space becomes available - long term or medium term scheduler.
-Mapping addresses in a process to absolute memory addresses - at load time or run time.
-Allocate and deallocate memory space as needed.
-Memory partitioning, allocation, paging (VM), address translation, defrag,
…Memory protection

3. What are the major activities of an Operating System with regards to Secondary-Storage Management?

--Free space management
--Storage allocation
--Disk scheduling – minimize seeks (arm movement … very slow operation)
--Disk as the media for mapping virtual memory space
--Disk caching for performance
--Disk utilities: defrag, recovery of lost clusters, etc.

4. What are the major activities of an Operating System with regards to File Management?

  • File creation and deletion - system calls or commands.
  • Directory creation and deletion - system calls or commands.
  • Support of primitives for manipulating files and directories in an efficient manner - system calls or commands.
  • Mapping files onto secondary storage.
  • File backup on stable (nonvolatile) storage media.

EX: File Allocation Table (FAT) for Windows/PC systems

5. What is the purpose of the command-interpreter?

The program that reads and interprets control statements is called variously:

·command-line interpreter (Control card interpreter in the “old batch days”)

·shell (in UNIX)Command.com for external commands in DOS Its function is to get and execute the next command statement.

(0) System Generation

(computer science) A process that creates a particular and uniquely specified operating system; it combines user-specified options and parameters with manufacturer-supplied general-purpose or nonspecialized program subsections to produce an operating system (or other complex software) of the desired form and capacity. Abbreviated sysgen.

(0) Virtual Machine

A virtual machine was originally defined by Popek and Goldberg as "an efficient, isolated duplicate of a real machine". Current use includes virtual machines which have no direct correspondence to any real hardware.[1]Virtual machines are separated into two major categories, based on their use and degree of correspondence to any real machine. A system virtual machine provides a complete system platform which supports the execution of a complete operating system (OS). In contrast, a process virtual machine is designed to run a single program, which means that it supports a single process. An essential characteristic of a virtual machine is that the software running inside is limited to the resources and abstractions provided by the virtual machine -- it cannot break out of its virtual world.
A virtual machine, simply put, is a virtual computer running on a physical computer. The virtual machine emulates a physical machine in software. This includes not only the processor but the instruction set, the memory bus, any BIOS commands and critical machine hardware such as the system clock and and DMA hardware. Depending upon the machine peripheral devices are generally virtualized including storage devices like floppy drives, hard drives and CD drives. Video, keyboard and mouse support are also common. A virtual machine must look and act just like the real thing so standard software, like operating systems and applications, can run without modification.


  • Implementation


Modes:
>>virtual user mode and virtual monitor mode,
>>Actual user mode and actual monitor mode
Time
>>Whereas the real I/O might have taken 100 milliseconds, the virtual I/O might take less time (because it is spooled) or more time (because it is interpreted.)
>>The CPU is being multi-programmed among many virtual machines, further slowing down the virtual machines in unpredictable ways.

  • benefits

For testers it is important that they test software against the various supported operating systems that an application runs against. The traditional approach is to run multiple physical machines, each with a different operating system. This is bad for several reasons. Space, maintenance, power and feasibility come to mind. Deployment of the software to these various machines can also be an issue. Instead a tester can run multiple virtual machines on one physical machine. Each virtual machine could have a different operating system. The application can be deployed to the virtual machines and tested.

Another advantage of virtual machines is reproducibility. Build and test environments generally need to be well controlled. It would be undo work to have to wipe out a machine and rebuild it after each build or test run. A virtual machine allows the environment to be set up once. The environment is then captured. Any changes made after the capture can then be thrown away after the build or test run. Most emulation software packages offer this in some form or another


Two advantages
>>To provide a robust level of security
>>no direct sharing of resources.
Two solutions
>>To allow system development to be done easily
>>A perfect vehicle for OS research and development.
>>difficult to implement due to the effort required to provide an exact duplicate to the underlying machine.
>>Wine for Linux


  • Examples

A program written in Java receives services from the Java Runtime Environment (JRE) software by issuing commands to, and receiving the expected results from, the Java software. By providing these services to the program, the Java software is acting as a "virtual machine", taking the place of the operating system or hardware for which the program would ordinarily be tailored.

(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.