Goals of OS
1. Facilitating easy sharing of resources as per schedule and allocations
Resources means processor(s), memory, I/Os, devices, virtual devices, system timer, keyboard, displays, printer, and other such resources, which processes (tasks or threads) request from the OS. No processing task or thread uses any resource until it has been allocated by the OS at a given instance.
2. Facilitating easy implementations
Facilitating easy implementation the application program with the given system hardware. An application programmer for a system can use the OS functions that are provided in given OS without having to write the codes for the services (functions) that follow.
3. Optimally scheduling
Optimally scheduling the process on one (or more CPUs if available) and providing an appropriate context-switching mechanism.
4. Maximizing the system performance
Maximizing the system performance to let different processes (tasks or threads) share the resources most efficiently with protection and without any security breach. Examples of security breach are processes obtaining illegal access to other task-data directly without system calls, overflow of the stacks into memory and overlaying of PCBs at the memory.
5. Providing management functions
Providing management functions for the processes, memory, devices, and I/Os and other functions.
6. Providing management and organization
Provides functions for the devices, files and virtual devices and I/Os.
7. Providing easy interfacing
For the network protocols and networking.
8. Providing interoperability of application on different networks.
User and supervisory mode structure
When using an OS, the processor in the system runs in two modes. There is clock, called system clock. At every tick of the clock, there is an interrupt. On interrupt, the system time updates, the system context switches to the supervisory mode from the user mode. After completing the supervisory (kernel-space) functions, the system context switches back to the user mode.
User mode
The user is permitted to run and use only a subset of functions and instructions in OS. This is done in the user mode either by sending a message to a waiting process associated with the OS kernel or by initiating a system call (call by an OS function). The use of hardware resources including memory is not permitted without making the call to the OS functions. The OS calls the resources by system call. Users function call is distinct from a system call, and is not permitted to read and write into the protected memory allotted to the OS functions, data, stack and heap. This protected memory space is also called kernel space. Hence execution of user functions calls is slower than the execution of the OS functions (which run on system call). This is because of the protected access to the memory by the functions running in the user space.
Supervisory mode
The OS runs the privileged functions and instructions in the protected mode and the OS (more specifically, the kernel) only accesses the hardware resources and the protected area memory. In the supervisory mode the kernel codes run in protected mode. Only a system-call is permitted to read and write into the protected memory allotted to the OS functions, data, stack and heap. The kernel space functions execute faster than the user-space functions.
Layers in the system
Application software
Executes as per the applications, run on the given system hardware using the interfaces and the system software.
Application Program Interface (API)
Provides the interface (for inputs and outputs) between the application software and system software so that it is able to run on the processor using the given system software.
System software other than one provided at the OS
The OS may not have the functions, for example, for the specific network and certain device drivers, such as multimedia device. This layer gives the system software services other than those provided by the OS service functions.
OS Interface
Interface (for inputs and outputs) between the above and OS.
OS
Kernel supervisory mode services, file management and other functions such as the user-mode processing devices.
Hardware-OS interface
Interfaces to let the functions be executed on the given hardware (processor, memory, ports and devices) of the system.
Hardware
Processors, memories, buses, interfacing circuits, ports, physical devices, timers and buses for device networking.
Kernel
The OS is the middle layer between the application software and system hardware. An OS includes some or all of the following structural units:
1. Kernel with file management and device management as part of the kernel in the given OS.
2. Kernel without file management and device management as part of the kernel in the given OS and any other needed functions not provided for at the kernel.
The kernel is the basic structural unit of any OS in which the memory space of the functions, data and stack are protected from access by any call other than the system-call. It can be defined as a secured unit of an OS that operates in the supervisory mode while the remaining part and the application software operates in the user mode.
The kernel has management functions for processes, resources, ISRs, ISTs, files, device drivers and I/O subsystems and network subsystems. The memory or device and file management functions may be outside the kernel in a given OS especially in an embedded system.
Kernel services in an operating system (OS)
Process management: creation to deletion
· Enables process creation
· Activation
· Running
· Blocking
· Resumption (Restart)
· Deactivation and deletion and maintains process structure at a PCB.
Process management: process structure maintenance
Enables process structure maintenance and its information at PCB.
Process management: processing resource requests
Processing resource requests by process made either by making calls that are known as system calls or by sending message(s).
Process management: interprocess communication (IPC) (communication between tasks, ISRs, OS functions)
Process synchronizing by sending data as messages from one task to another. The OS effectively manages shared memory access by using the IPC signals, exception (error) handling signals, semaphores queues, mailboxes, pipes and sockets.
Services memory management allocation and de-allocation
Memory allocation, de-allocation and management. It also restricts the memory access region for a task.
File management
File management provides management of the creation, deletion, read(), write() to the files on the secondary memory disk. A file in the embedded system (disk-free system) can be in RAM, where the operations are done in RAM memory in a way identical to the file on disk.
Device management
A physical device management is such that it is accessible to one task or process only at an instant. Device manager components are:
· Device drivers and device ISRs (device interrupt handlers)
· Resource managers for the devices
Besides physical devices, the management of virtual device like pipe or socket is also provided. Virtual devices emulate a hardware device and the virtual device driver send signals similar to the ISR calls by the physical device.
Device drivers
Facilitates the use of number of physical devices like keyboard, display systems, disk, parallel port, network interfaces cards, network devices and virtual devices.
I/O management
Character or block I/O management. For example, to ensure actions such that a parallel port or serial port is accessible to only one task at a time.
Interrupts control mechanism
Facilitate running of the ISRs and ISTs.
Input Output Subsystem
The embedded system has application which can be executed using input-output subsystem. The hierarchy of I/O system is:
· Application – This is a sub layer between motherboard and the application software.
· I/O basic function – This are device independent OS functions. The task to be performed and the operation to read or write are present.
· I/O device driver function – It consists of diverse functions which perform varied tasks.
· Device H/W or Port – The actual device which perform the task.
Network Subsystem
It is an operating system that has the standard protocol plus network device drivers. It provides the remote login, file transfer and through network devices. The kernel of an OS handles the address resolution, packet collection, identification and dispatching to a particular devices. Server and router are the example of Network OS.
Real-Time OS
It is a computing environment that gives the response to an input within a specific time period. A real-time deadline can be so small that system reaction appears instantaneous.
Methods
· It ensures that the tasks will be executed before the deadline.
· It reduces certain functions when they cannot be executed within the time constraints.
· It checks the input consistently and in a timely manner.
· It checks the resources and can interrupt background processes as needed to ensure real-time execution.
· It keeps the track about resources used by diverse (various) resources to perform their tasks.
Objectives
An RTOS must respond in a timely manner to changes, but does not necessarily mean that an RTOS can handle a large throughput of data. In essence: an RTOS is an operating system designed to meet strict deadlines. An RTOS may be either event-driven or time-sharing. An event-driven RTOS is a system that changes state only in response to an incoming event. A time-sharing RTOS is a system that changes state as a function as a function of time.
Services provided by RTOS:
· Basic OS functions - Process management, resource management, device management, I/O devices subsystems and network devices and subsystems management.
· Main functions – Real time task scheduling, use of timer and system clock.
· Time management – Time allocation and de-allocation for a particular process.
· Predictability – Predicting the behavior of the system and executing the decisions.
· Priority management – Priority allocation and execution.
· IPC Synchronization – Synchronization of tasks in case of interrupts.
· Hard and Soft real time operability – Hard real-time means all the rules and regulations are present before the execution. Soft real time means no rules and regulation available depending upon the predictability the system should operate.
Resources Used:
1. Rajakamal
2. Black Book
Compiled By: Chaudhary Amit V.
Comments
Post a Comment