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.
Question and Answer
Labels: OS 3
System Boot
~ Operating system must be made available to hardware so hardware can start it
~ Small piece of code – bootstrap loader, locates the kernel, loads it into memory, and starts it
~Sometimes two-step process where boot block at fixed location loads bootstrap loader
When power initialized on system, execution starts at a fixed memory location
~Firmware used to hold initial boot code
Labels: OS 3
Virtual Machine
=> A virtual machine is a tightly isolated software container that can run its own operating systems and applications as if it were a physical computer. A virtual machine behaves exactly like a physical computer and contains it own virtual (ie, software-based) CPU, RAM hard disk and network interface card (NIC).
An operating system can’t tell the difference between a virtual machine and a physical machine, nor can applications or other computers on a network. Even the virtual machine thinks it is a “real” computer. Nevertheless, a virtual machine is composed entirely of software and contains no hardware components whatsoever. As a result, virtual machines offer a number of distinct advantages over physical hardware.
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
In general, VMware virtual machines possess four key characteristics that benefit the user:
Compatibility: Virtual machines are compatible with all standard x86 computers
Isolation: Virtual machines are isolated from each other as if physically separated
Encapsulation: Virtual machines encapsulate a complete computing environment
Hardware independence: Virtual machines run independently of underlying hardware
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
~ Compiled Java programs are platform-neutral bytecodes executed by a Java Virtual Machine (JVM).
~ JVM consists of
- class loader
- class verifier
- runtime interpreter
~ Just-In-Time (JIT) compilers increase performance
Labels: OS 3
System Generation (SYSGEN)
~ Operating systems are designed to run on any of a class
of machines; the system must be configured for each
specific computer site.
~ SYSGEN program obtains information concerning the
specific configuration of the hardware system.
~ Booting – starting a computer by loading the kernel.
~ Bootstrap program – code stored in ROM that is able to
locate the kernel, load it into memory, and start its
execution.
~ How to generate a system?
- Recompile
- Cause the creation of tables and selection of modules from a precompiled library
Link modules together to form the generated OS
SYSGEN is faster, but the generated OS may be overly general
- Completed table driven
All the code is always part of the system, and selection occurs at execution time
Most modern OS are constructed in this manner
~ Size and generality of the generated system and the ease of modification as the hardware configuration changes
Labels: OS 3
System Structure
• Simple Structure
• 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
Labels: OS 3
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)
Labels: OS 3
Sytem Components
OPERATING SYSTEMS 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.
> Process creation and deletion.
> process suspension and resumption.
> Provision of mechanisms for:
-> process synchronization
-> process communication
MAIN MEMORY MANAGEMENT
~ 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.
~ Main memory is a volatile storage device. It loses its
contents in the case of system failure.
~ The operating system is responsible for the following
activities in connections with 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.
> Allocate and deallocate memory space as needed.
FILE MANAGEMENT
~ A file is a collection of related information defined by its
creator. 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.
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
data.
~ The operating system is responsible for the following
activities in connection with disk management:
> Free space management
> Storage allocation
> Disk scheduling
PROTECTION SYSTEM
~ Protection refers to a mechanism for controlling access
by programs, processes, or users to both system and
user resources.
~ The protection mechanism must:
> distinguish between authorized and unauthorized usage.
> specify the controls to be imposed.
> provide a means of enforcement.
COMMAND INTERPRETER SYSTEM
~ Many commands are given to the operating system by
control statements which deal with:
> process creation and management
> I/O handling
> secondary-storage management
> main-memory management
> file-system access
> protection
> networking
Labels: OS 3
Operating System Services
1. Program execution – system capability to load a program into memory and to run it
2. I/O operations – since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/On
3. File-system manipulation – program capability to read, write, create, and delete files
4. Communications – exchange 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 detection – ensure correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user program
Labels: OS 3