ChandrakantDivate1
289 views
137 slides
May 09, 2024
Slide 1 of 137
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
About This Presentation
Overview Of Operating System and its Basics
Size: 2.72 MB
Language: en
Added: May 09, 2024
Slides: 137 pages
Slide Content
Mr. C.P.Divate Overview Of Operating System
Operating system Definition An Operating System ( OS ) i s system software that manages computer hardware, software resources, and provides common services for computer programs. An Operating System is a program that acts as an interface between the software and the computer hardware. An Operating System is system software which may be viewed as an organized collection of software consisting of procedures for operating a computer and providing an environment for execution of programs.
Basic Elements Of Operating Sys t em s Processor Main memor y I/O modules System bus
Objectives Of Operating Systems Convenience: It makes a computer more suitable to use. Efficiency: It provides the computer system resources with efficiency and in easy to use format. Ability to develop: It should be built in such a way that it permits the efficient development, testing, and installation of new system functions without interfering with service. Protection: Protect Data from unauthorized access. Communication: Make communication in Network.
Services Of Operating Systems An Operating System supplies different kinds of services to both the users and programs . Here is a list of common services offered by all operating systems: User Interface Program Execution File system manipulation Input / Output Operations Inter process Communication Resource Allocation Error Detection Accounting Security and protection
1. User Interface in Operating Sys t e m Usually Operating system comes in three forms or types. Depending on the interface their types have been further subdivided. These are: Command line interface (C L I ) Batch based interface ( B I ) Graphical User Interface ( G U I ) The command line interface (CLI) usually deals with using text commands and a technique for entering those commands. The Batch interface (BI): commands and directives are used to manage those commands that are entered into files and those files get executed. Graphical User Interface (GUI): which is a window system with a pointing device (like mouse or trackball) to point to the I/O, choose from menus driven interface and to make choices viewing from a number of lists and a
2. Program Execution Operating System The operating system must have the capability to load a program into memory and execute that program. Furthermore, the program must be able to end its execution, either normally or abnormally / forcefully.
3. File system manipulation in Operating System Programs need has to be read and then write them as files and directories. File handling portion of operating system also allows users to create and delete files by specific name along with extension, search for a given file and / or list file information. Some programs comprise of permissions management for allowing or denying access to files or directories based on file ownership.
4. I/O operations in Operating System A program which is currently executing may require I/O, which may involve file or other I/O device. For efficiency and protection, users cannot directly govern the I/O devices. So, the OS provide a means to do I/O Input / Output operation which means read or write operation with any file.
5. Inter process Communication in operating S ys t em Process needs to swap over information with other process. Processes executing on same computer system or on different computer systems can communicate using operating system support. Communication between two processes can be done using shared memory or via message passing.
6. Resource Allocation of Operating System When multiple jobs running concurrently, resources must need to be allocated to each of them. Resources can be CPU cycles, main memory storage, file storage and I/O devices. CPU scheduling routines are used here to establish how best the CPU can be used.
7. Error Detection with Operating System Errors may occur within CPU, memory hardware, I/O devices and in the user program. For each type of error, the OS takes adequate action for ensuring correct and consistent computing.
8. Accounting in Operating System This service of the operating system keeps track of which users are using how much and what kinds of computer resources have been used for accounting or simply to accumulate usage statistics.
9. Protection and Security Operating System P r o tect io n i nclude s i n ensurin g al l acces s t o sys t e m resources in a controlled manner. For making a system secure , the user needs to authenticate him or her to the system before using (usually via login ID and password).
Type Of Operating Systems Single Processor Operating Systems Batch Processing Operating Systems Multiprocessing Operating System Multiprogramming / Multitasking Operating System Time Sharing Operating System Distributed Operating System Mobile Operating systems
1. S ingle P rocessor O pera t ing S ys t ems Most systems at least contain a single processor. The variation of single-processor systems may be unexpected, but since these systems can range from PDA's to mainframe computers. On a single-processor system, there is one main CPU able to execute a general-purpose instruction layout, including different instructions from users and then process them. Almost every system has special-purpose processors within them. They may come in the appearance of device-specific processors, such as disks, keyboards, graphics controllers, etc.; or on mainframes, they may come in the form of more general-purpose processors.
2. Batch Processing Operating Systems Definition – Batch processing system works as an operating S ystem . Batch processing system means to grab all types of programs and data in the batch form then proceed to process. Main motive of using batch processing system is to decrease the set up time while submitting the similar jobs to CPU. Batch processing techniques was implemented in the hard disk and card readers as well. In this, all jobs are saved on the hard disk for making the pool of jobs for their execution as a batch form.
2. Batch Processing Operating Systems benefits and characteristics such as: In batch system all jobs are performed in repeating form without user’s permission. Can be feed input data in the batch processing system without using extra hardware components . Small scale business can use batch processing system for executing small tasks to their benefits. For giving rest to system’s processors, your batch system is capable to work in off-line mode. Batch processing system consumes less time for executing the all jobs. Batch system is shareable nature, so it can be shared for couples of users, if needed. When batch processing system executes their jobs then its idle time is very low. Batch processing system has more capable to handle huge repeated task smoothly
2. Batch Processing Operating Systems limitations of batch processing operating system Provide well education to computer handler for operating the batch processing system. It takes more time for debugging the batch processing system. Some time it may be more costly. It has more turnaround time. It has Non linear behavior. Model inaccuracies. Batch processing system’s online sensors is often not available. Include constrained operation. Unmeasured disturbances. Irreversible behavior. Time-varying process characteristics. If any one job halts, then increase workload for predicting time. Due to any mistake, any job can enter into infinite loop. If your protection system is not well then, any one job can
2. Batch Processing Operating Systems Examples of Batch Processing Operating System Payroll System Bank Invoice System Transactions Process Daily Report Research Segment Billing System
3. Multiprocessing Operating System A multiprocessing operating system (OS) is one in which two or more central processing units (CPUs) control the functions of the computer. Each CPU contains a copy of the OS, and these copies communicate with one another to coordinate operations. The use of multiple processors allows the computer to perform calculations faster, since tasks can be divided up between processors.
3. Multiprocessing Architecture
Single Processor / Multiprocessing Operating System Multiprocessing operating systems performs quick tasks, as each CPU is available to access the shared memory to complete the task.
Advantages of Multiprocessor Operating System More reliable Systems: Ability to continue working despite hardware failure. Enhanced Throughput: number of processes getting executed per unit of time increase. More Economic Systems: Multiprocessor systems are cheaper than single processor systems in the long run because they share the data storage, peripheral devices, power supplies etc.
Disadvantages of Multiprocessor Operating System Increased Expense: Even though multiprocessor systems are cheaper in the long run than using multiple computer systems, still they are quite expensive. Complicated Operating System Required: There are multiple processors in a multiprocessor system that share peripherals, memory etc. So, it is much more complicated to schedule processes and impart resources to processes. than in single processor systems. Hence, a more complex and complicated operating system is required in multiprocessor systems. Large Main Memory Required: All the processors in the multiprocessor system share the memory.
4. Multiprogramming in Operating System In a modern computing system, there are usually several concurrent application processes which want to execute. Now it is the responsibility of the Operating System to manage all the processes effectively and efficiently. One of the most important aspects of an Operating System is to multi program. In a computer system, there are multiple processes waiting to be executed, i.e. they are waiting when the CPU will be allocated to them and they begin their execution. These processes are also known as jobs. Now the main memory is too small to accommodate all of these processes or jobs into it.
4. Multiprogramming in Operating System Thus, these processes are initially kept in an area called job pool. This job pool consists of all those processes awaiting allocation of main memory and CPU. CPU selects one job out of all these waiting jobs, brings it from the job pool to main memory and starts executing it. The processor executes one job until it is interrupted by some external factor or it goes for an I/O task.
4. Multiprogramming in Operating System Non-multi programmed system’s working – In a non multi programmed system, As soon as one job leaves the CPU and goes for some other task (say I/O ), the CPU becomes idle. The CPU keeps waiting and waiting until this job (which was executing earlier) comes back and resumes its execution with the CPU. So CPU remains free for all this while. Now it has a drawback that the CPU remains idle for a very long period of time. Also, other jobs which are waiting to be executed might not get a chance to execute because the CPU is still allocated to the earlier job. This poses a very serious problem that even though other jobs are ready to execute, CPU is not allocated to them as the CPU is allocated to a job which is not even utilizing it (as it is busy in I/O tasks). It cannot happen that one job is using the CPU for say 1 hour
4. Multiprogramming in Operating System Multi programmed system’s working – In a multi-programmed system, as soon as one job goes for an I/O task, the Operating System interrupts that job, chooses another job from the job pool (waiting queue), gives CPU to this new job and starts its execution. The previous job keeps doing its I/O operation while this new job does CPU bound tasks. Now say the second job also goes for an I/O task, the CPU chooses a third job and starts executing it. As soon as a job completes its I/O operation and comes back for CPU tasks, the CPU is allocated to it. In this way, no CPU time is wasted by the system waiting for the I/O task to be completed. Therefore, the ultimate goal of multi programming is to keep the CPU busy as long as there are processes ready to execute. This way, multiple programs can be executed on a single processor by executing a part of a program at one time,
4. Multiprogramming in Operating System program A runs for some time and then goes to waiting state. In the mean time program B begins its execution. So the CPU does not waste its resources and gives program B an opportunity to run.
5. Multitasking in Operating System Multitasking is a logical extension of a multiprogramming system that supports multiple programs to run concurrently. In a multitasking operating system , more than one task is executed at the same time. In this technique, multiple tasks, also known as processes, share common processing resources such as a CPU.
5. Multitasking in Operating System Definition – Multitasking operating system provides the interface for executing the multiple program tasks by single user at a same time on the one computer system. For example, any editing task can be performed while other programs are executing concurrently. Other example, user can open Gmail and Power Point same time.
5. Multitasking in Operating System Types of Multitasking Operating System True Multitasking: True multitasking is the capable for executing and process multiple tasks concurrently without taking delay instead of switching tasks from one processor to other processor. It can perform couple of tasks in parallel with underlying the H/W or S/W. Preemptive Multitasking: Pre-emptive multitasking is special task that is assigned to computer operating system , in which it takes decision that how much time spent by one task before assigning other task for using the operating system. Operating system has control for completing this entire process, so it is known as “Pre-emptive”. Cooperative Multitasking Cooperative multitasking is known as “Non-Preemptive Multitasking”. Main goal of Cooperative multitasking is to run currently task, and to release the CPU to allow another task run. This task is performed by calling task YIELD().Context-switch is executed when this function is called.
5. Multitasking in Operating System Advantages of Multitasking Operating System Time Shareable: In which, all tasks are allocated specific piece of time, so they do not need for waiting time for CPU. Manage Several Users: This operating system is more comfort for handling the multiple users concurrently, and several programs can run smoothly without degradation of system’s performance. Secured Memory: Multitasking operating system has well defined memory management, because this operating system does not provide any types of permissions of unwanted programs to wasting the memory. Great Virtual Memory: Multitasking operating system contains the best virtual memory system. Due to virtual memory, any program do not need long waiting time for completion their tasks, if this problem is occurred then those programs are transferred to virtual memory . Background Processing: Multitasking operating system creates the better environment to execute the background programs. These background programs are not transparent for normal users, but there programs help to other programs to run smoothly like firewall, antivirus etc.
Distributed Operating Systems Topics Advantages of Distributed Systems Types of Network-Based Operating Systems Network Structure Communication Structure Communication Protocols An Example: TCP/IP Robustness Design Issues Distributed File System
Distributed OS Objectives To provide a high-level overview of distributed systems and the networks that interconnect them To discuss the general structure of distributed operating systems To explain general communication structure and communication protocols To describe issues concerning the design of distributed systems
Overview Distributed system is collection of loosely coupled processors interconnected by a communications network Processors variously called nodes, computers, machines, hosts Site is location of the processor Generally a server has a resource a client node at a different site wants to use
Reasons for Distributed Systems Reasons for distributed systems Resource sharing Sharing and printing files at remote sites Processing information in a distributed database Using remote specialized hardware devices Computation speedup – load sharing or job migration Reliability – detect and recover from site failure, function transfer, reintegrate failed site Communication – message passing All higher-level functions of a standalone system can be expanded to encompass a distributed system Computers can be downsized, more flexibility, better user interfaces and easier maintenance by moving from large system to multiple smaller systems performing distributed computing
Types of Distributed Operating Systems Network Operating Systems Distributed Operating Systems
Network-Operating Systems Users are aware of multiplicity of machines Access to resources of various machines is done explicitly by: Remote logging into the appropriate remote machine (telnet, ssh) Remote Desktop (Microsoft Windows) Transferring data from remote machines to local machines, via the File Transfer Protocol (FTP) mechanism Users must change paradigms – establish a session , give network-based commands More difficult for users
Distributed-Operating Systems Users not aware of multiplicity of machines Access to remote resources similar to access to local resources Data Migration – transfer data by transferring entire file, or transferring only those portions of the file necessary for the immediate task Computation Migration – transfer the computation, rather than the data, across the system Via remote procedure calls (RPCs) or via messaging system
Distributed-Operating Systems (Cont.) Process Migration – execute an entire process, or parts of it, at different sites Load balancing – distribute processes across network to even the workload Computation speedup – subprocesses can run concurrently on different sites Hardware preference – process execution may require specialized processor Software preference – required software may be available at only a particular site Data access – run process remotely, rather than transfer all data locally Consider the World Wide Web
Network Structure Local-Area Network ( LAN ) – designed to cover small geographical area Multiple topologies like star or ring Speeds from 1Mb per second (Appletalk, bluetooth) to 40 Gbps for fastest Ethernet over twisted pair copper or optical fibre Consists of multiple computers (mainframes through mobile devices), peripherals (printers, storage arrays), routers (specialized network communication processors) providing access to other networks Ethernet most common way to construct LANs Multiaccess bus-based Defined by standard IEEE 802.3 Wireless spectrum ( WiFi ) increasingly used for networking I.e. IEEE 802.11g standard implemented at 54 Mbps
Local-area Network
Network Types (Cont.) Wide-Area Network ( WAN ) – links geographically separated sites Point-to-point connections over long-haul lines (often leased from a phone company) Implemented via connection processors known as routers Internet WAN enables hosts world wide to communicate Hosts differ in all dimensions but WAN allows communications Speeds T1 link is 1.544 Megabits per second T3 is 28 x T1s = 45 Mbps OC-12 is 622 Mbps WANs and LANs interconnect, similar to cell phone network: Cell phones use radio waves to cell towers Towers connect to other towers and hubs
Communication Processors in a Wide-Area Network
Communication Structure Naming and name resolution - How do two processes locate each other to communicate? Routing strategies - How are messages sent through the network? Connection strategies - How do two processes send a sequence of messages? Contention - The network is a shared resource, so how do we resolve conflicting demands for its use? The design of a communication network must address four basic issues:
Naming and Name Resolution Name systems in the network Address messages with the process-id Identify processes on remote systems by < host-name , identifier > pair Domain name system ( DNS ) – specifies the naming structure of the hosts, as well as name to address resolution (Internet)
Routing Strategies Fixed routing - A path from A to B is specified in advance; path changes only if a hardware failure disables it Since the shortest path is usually chosen, communication costs are minimized Fixed routing cannot adapt to load changes Ensures that messages will be delivered in the order in which they were sent Virtual routing - A path from A to B is fixed for the duration of one session. Different sessions involving messages from A to B may have different paths Partial remedy to adapting to load changes Ensures that messages will be delivered in the order in which they were sent
Routing Strategies (Cont.) Dynamic routing - The path used to send a message form site A to site B is chosen only when a message is sent Usually a site sends a message to another site on the link least used at that particular time Adapts to load changes by avoiding routing messages on heavily used path Messages may arrive out of order This problem can be remedied by appending a sequence number to each message Most complex to set up Tradeoffs mean all methods are used UNIX provides ability to mix fixed and dynamic Hosts may have fixed routes and gateways connecting networks together may have dynamic routes
Routing Strategies (Cont.) Router is communications processor responsible for routing messages Must have at least 2 network connections Maybe special purpose or just function running on host Checks its tables to determine where destination host is, where to send messages Static routing – table only changed manually Dynamic routing – table changed via routing protocol
Routing Strategies (Cont.) More recently, routing managed by intelligent software more intelligently than routing protocols OpenFlow is device-independent, allowing developers to introduce network efficiencies by decoupling data-routing decisions from underlying network devices Messages vary in length – simplified design breaks them into packets (or frames , or datagrams ) Connectionless message is just one packet Otherwise need a connection to get a multi-packet message from source to destination
Connection Strategies Circuit switching - A permanent physical link is established for the duration of the communication (i.e., telephone system) Message switching - A temporary link is established for the duration of one message transfer (i.e., post-office mailing system) Packet switching - Messages of variable length are divided into fixed-length packets which are sent to the destination Each packet may take a different path through the network The packets must be reassembled into messages as they arrive Circuit switching requires setup time, but incurs less overhead for shipping each message, and may waste network bandwidth Message and packet switching require less setup time, but incur more overhead per message
Communication Protocol Layer 1: Physical layer – handles the mechanical and electrical details of the physical transmission of a bit stream Layer 2: Data-link layer – handles the frames , or fixed-length parts of packets, including any error detection and recovery that occurred in the physical layer Layer 3: Network layer – provides connections and routes packets in the communication network, including handling the address of outgoing packets, decoding the address of incoming packets, and maintaining routing information for proper response to changing load levels The communication network is partitioned into the following multiple layers:
Communication Protocol (Cont.) Layer 4: Transport layer – responsible for low-level network access and for message transfer between clients, including partitioning messages into packets, maintaining packet order, controlling flow, and generating physical addresses Layer 5: Session layer – implements sessions, or process-to-process communications protocols Layer 6: Presentation layer – resolves the differences in formats among the various sites in the network, including character conversions, and half duplex/full duplex (echoing) Layer 7: Application layer – interacts directly with the users, deals with file transfer, remote-login protocols and electronic mail, as well as schemas for distributed databases
Communication Via ISO Network Model
The ISO Protocol Layer
The ISO Network Message
The TCP/IP Protocol Layers
Example: TCP/IP The transmission of a network packet between hosts on an Ethernet network Every host has a unique IP address and a corresponding Ethernet Media Access Control ( MAC ) address Communication requires both addresses Domain Name Service ( DNS ) can be used to acquire IP addresses Address Resolution Protocol ( ARP ) is used to map MAC addresses to IP addresses Broadcast to all other systems on the Ethernet network If the hosts are on the same network, ARP can be used If the hosts are on different networks, the sending host will send the packet to a router which routes the packet to the destination network
An Ethernet Packet
Robustness Failure detection Reconfiguration
Failure Detection Detecting hardware failure is difficult To detect a link failure, a heartbeat protocol can be used Assume Site A and Site B have established a link At fixed intervals, each site will exchange an I-am-up message indicating that they are up and running If Site A does not receive a message within the fixed interval, it assumes either (a) the other site is not up or (b) the message was lost Site A can now send an Are-you-up? message to Site B If Site A does not receive a reply, it can repeat the message or try an alternate route to Site B
Failure Detection (Cont.) If Site A does not ultimately receive a reply from Site B, it concludes some type of failure has occurred Types of failures: - Site B is down - The direct link between A and B is down - The alternate link from A to B is down - The message has been lost However, Site A cannot determine exactly why the failure has occurred
Reconfiguration When Site A determines a failure has occurred, it must reconfigure the system: If the link from A to B has failed, this must be broadcast to every site in the system If a site has failed, every other site must also be notified indicating that the services offered by the failed site are no longer available When the link or the site becomes available again, this information must again be broadcast to all other sites
Design Issues Transparency – the distributed system should appear as a conventional, centralized system to the user Fault tolerance – the distributed system should continue to function in the face of failure Scalability – as demands increase, the system should easily accept the addition of new resources to accommodate the increased demand Consider Hadoop open source programming framework for processing large datasets in distributed environments (based on Google search indexing) Clusters – a collection of semi-autonomous machines that acts as a single system
Real Time System A system is said to be Real Time if it is required to complete it’s work & deliver it’s services on time. Example – Flight Control System All tasks in that system must execute on time. Non Example – PC system
How RTOS is different from OS The key difference between general-computing operating systems and real-time operating systems is the need for "deterministic" timing behavior, general-computing. non-real-time operating systems are often quite non- deterministicII .
Real-time operating systems are often uses in embedded solutions, that is, computing platforms that are within another device. While real-time operating systems are typically designed for and used with embedded systems.
Hard and Soft Real Time Systems Hard Real Time System Failure to meet deadlines is fatal example : Flight Control System Soft Real Time System Late completion of jobs is undesirable but not fatal. System performance degrades as more & more jobs miss deadlines Online Databases
Classification of RTOS Kernels RT kernels vs modified kernels of standard OS Fast proprietary kernels: may be inadequate for complex systems, because they are designed to be fast rather than to be predictable in every respect, e.g., QNX, PDOS, VCOS, VTRX32, VxWORKS RT extensions to standard OS: RT-kernel runs all RT-tasks and standard-OS executed as one task on it General RTOS vs RTOS for specific domains Standard APIs vs proprietary APIs e.g. POSIX RT-Extension of Unix, ITRON, OSEK)
INTRODUCTION TO RTOS Tasks and Task States A task – a simple subroutine ES application makes calls to the RTOS functions to start tasks, passing to the OS, start address, stack pointers, etc. of the tasks Task States: Running Ready (possibly: suspended, pended) Blocked (possibly: waiting, dormant, delayed) [Exit] Scheduler – schedules/shuffles tasks between Running and Ready states Blocking is self-blocking by tasks, and moved to Running state via other tasks’ interrupt signaling (when block-factor is removed/satisfied) When a task is unblocked with a higher priority over the ‘running’ task, the scheduler ‘switches’ context immediately (for all pre-emptive RTOSs)
A Sample Real Time System (1)
Features of RTOS’s Scheduling. Resource Allocation. Interrupt Handling. Other issues like kernel size.
Why Use an RTOS? Can use drivers that are available with an RTOS Can focus on developing application code, not on creating or maintaining a scheduling system Multi-thread support with synchronization Portability of application code to other CPUs Resource handling by RTOS Add new features without affecting higher priority functions Support for upper layer protocols such as: TCP/IP, USB, Flash Systems, Web Servers, CAN protocols, Embedded GUI, SSL, SNMP
Characteristics of Embedded OS Device drivers often not integrated into kernel Embedded systems often application-specific specific devices move device out of OS to tasks For desktop OS, many devices are implicitly assumed to be presented, e.g., disk, network, audio, etc. they need to be integrated to low-level SW stack Embedded OS Standard OS kernel
Characteristics of Embedded OS Real-time capability Many embedded systems are real-time (RT) systems and, hence, the OS used in these systems must be real-time operating systems (RTOSs) Features of a RTOS: Allows multi-tasking Scheduling of the tasks with priorities Synchronization of the resource access Inter-task communication Time predictable Interrupt handling
Requirements for RTOS Predictability of timing The timing behavior of the OS must be predictable For all services of the OS, there is an upper bound on the execution time Scheduling policy must be deterministic The period during which interrupts are disabled must be short (to avoid unpredictable delays in the processing of critical events)
Requirements for RTOS OS should manage timing and scheduling OS possibly has to be aware of task deadlines; (unless scheduling is done off-line). Frequently, the OS should provide precise time services with high resolution. Important if internal processing of the embedded system is linked to an absolute time in the physical environment Speed: The OS must be fast
Programming languages Used C is most widely used in RTOS programming C++ and Ada are the next more popular for large projects. Assembly languages for increasing efficiency and reusing the previous code Java may also be a choice for some applications
Which is the Best? It is always very difficult to judge which RTOS is the best and which is the worst. It depends on the application and interests of the user. Among the above, Linux is royalty free but it has serious drawbacks if it comes to real-time behavior. The VxWorks is a very old and stable RTOS. Similarly Windows CE 5.0 version RTOS is a robust and stable regarding the real-time behavior.
Functionality of RTOS Kernel Processor management Memory management Timer management Task management (resume, wait etc) Inter-task communication and synchronization resource management
RTOS Kernel Functions
RTOS Kernel RTOS Kernel provides an Abstraction layer that hides from application software the hardware details of the processor / set of processors upon which the application software shall run. Application Software RTOS Hardware
Type of RTOS kernel Monolithic kernel – less run-time overhead but not extensible Microkernel – high run-time overhead but highly extensible
MQX Facilities Required Optional MQX, RTCS, etc are structured as a set of C files built by the user into a library that is linked into the same code space as the application. Libraries contain all functions but only called functions are included with the image.
Message passing in RTOS In RTOS, the OS copies a pointer to the message, delivers the pointer to the message-receiver task, and then deletes the copy of the pointer with message-sender task. Message Sender Task RAM Message Receiver Task RTOS msg_ptr msg_ptr Message Message
Task Management Set of services used to allow application software developers to design their software as a number of separate chunks of software each handling a distinct topic, a distinct goal, and sometimes its own real-time deadline. Main service offered is Task Scheduling controls the execution of application software tasks can make them run in a very timely and responsive fashion.
Task Scheduling Non Real -time systems usually use Non-preemptive Scheduling Once a task starts executing, it completes its full execution Most RTOS perform priority-based preemptive task scheduling. Basic rules for priority based preemptive task scheduling The Highest Priority Task that is Ready to Run, will be the Task that Must be Running.
Scheduling in RTOS Running (executing on the CPU); Ready (ready to be executed); Blocked (waiting for an event, I/O for example)
Scheduling Algorithms in RTOS Clock Driven Scheduling Weighted Round Robin Scheduling Priority Scheduling (Greedy / List / Event Driven) Cooperative scheduling Preemptive scheduling Rate-monotonic scheduling
Fixed priority pre-emptive scheduling, an implementation of preemptive time slicing Fixed-Priority Scheduling with Deferred Preemption Fixed-Priority Non-preemptive Scheduling Critical section preemptive scheduling Static time scheduling Earliest Deadline First approach Stochastic digraphs with multi-threaded graph traversal
Scheduling Algorithms in RTOS Clock Driven All parameters about jobs (release time/ execution time/deadline) known in advance. Schedule can be computed offline or at some regular time instances. Minimal runtime overhead. Not suitable for many applications.
Peripheral devices and protocols Interfacing Serial/parallel ports, USB, I2C, PCMCIA, IDE Communication Serial, Ethernet, Low bandwidth radio, IrDA, 802.11b based devices User Interface LCD, Keyboard, Touch sensors, Sound, Digital pads, Webcams Sensors A variety of sensors using fire, temperature, pressure, water level, seismic, sound, vision
D ynamic M emory A llocation in RTOS RTOS does it by a mechanism known as Pools. Pools memory allocation mechanism allows application software to allocate chunks of memory of 4 to 8 different buffer sizes per pool. Pools avoid external memory fragmentation, by not permitting a buffer that is returned to the pool to be broken into smaller buffers in the future. When a buffer is returned the pool, it is put onto a free buffer list of buffers of its own size that are available for future re-use at their original buffer size
Process & Program A process invokes or initiates a program. It is an instance of a program that can be multiple and running the same application. Example:- Notepad is one program and can be opened twice.
Mobile Operating Systems
Over v iew http://cmer.cis.uoguelph.ca Introduction Mobile Operating System Structure Mobile Operating System Platforms Java ME Platform Palm OS Symbian OS Linux OS Windows Mobile OS BlackBerry OS iPhone OS Google Android Platform
OS Features http://cmer.cis.uoguelph.ca Features Multitasking Scheduling Memory Allocation File System Interface Keypad Interface I/O Interface Protection and Security Multimedia features
Introdu c tion http://cmer.cis.uoguelph.ca Design and capabilities of a Mobile OS (Operating System) is very different than a general purpose OS running on desktop machines: – mobile devices have constraints and restrictions on as sc r een si z e, co m mu n icat i on their physical characteristic such memory, processing power and etc. Scarce availability of battery power Limited a mo u nt o f co m p u ti n g and capabilities
Introduction (Cont.) http://cmer.cis.uoguelph.ca Thus, they need different types of operating systems depending on the capabilities they support. e.g. a PDA OS is different from a Smartphone OS. Operating System is a piece of software responsible for management of operations, control, coordinate the use of the hardware among the various application programs, and sharing the resources of a device.
Operating System Structure http://cmer.cis.uoguelph.ca A mobile OS is a software platform on top of which other programs called application programs, can run on mobile devices such as PDA, cellular phones, smartphone and etc. Low-Level Hardware, Manufacturer Device Drivers Device Operating System Base, Kernel OS Libraries Applications
Mobile Operating System Platforms http://cmer.cis.uoguelph.ca There are ma n y mo b ile o p erati n g s ystem s . The followings demonstrate the most important ones: Java ME Platform Palm OS Symbian OS Linux OS Windows Mobile OS BlackBerry OS iPhone OS Google Android Platform
Java ME Platform http://cmer.cis.uoguelph.ca J2ME platform is a set of technologies, specifications and libraries developed for small devices like mobile phones, pagers, and personal organizers. Java M E w as designed b y S un Mic r o s y s tem s . It is licensed under GNU General Public License
Java ME Architecture Java M E pla t forms are composed o f t he fol l o w ing elements: Device/ Hardware Native Operating System Configuration Profile Optional P a cka g e s Vendor specific classes - OEM Application http://cmer.cis.uoguelph.ca
Java ME Main Components http://cmer.cis.uoguelph.ca Configuration: it defines a minimum platform including the java language, virtual machine features and minimum class libraries for a grouping of devices. E.g. CLDC Profile: it supports higher-level services common to a more specific class of devices. A profile builds on a configuration but adds more specific APIs to make a complete environment for building applications. E.g. MIDP
Java ME http://cmer.cis.uoguelph.ca Optional Package: it provides specialized service or functionality that may not be associated with a specific configuration or profile. The following table lists some of the available packages: Packages Description JSR 75 - PIM PDA Package JSR 82 - BTAPI Java APIs for Bluetooth JSR 120 - WMA Wireless Messaging API JSR 172 J2ME Web Service JSR 179 Location API for J2ME
Java ME Platforms It includes two kinds of platforms: – High-end platform for high-end consumer devices. E.g. TV set-top boxes, Internet TVs, auto-mobile navigation systems – Low-end platform for low-end consumer devices. E.g. cell phones, and pagers Platforms Device Characteristics “High-End” consumer devices a large range of user interface capabilities total memory budgets starting from about two to four megabytes persistent, high-bandwidth network connections, often using TCP/IP “Low-end” consumer devices simple user interfaces minimum memory budgets starting from about 128–256 kilobytes low bandwidth, intermittent network connections that is often not based on the TCP/IP protocol suite. most of these devices are battery-operated http://cmer.cis.uoguelph.ca
Java ME Platforms (Cont.) The following figures demonstrate the elements of these two types of platforms: KVM CLDC MIDP JVM Foundation Profile Personal Profile Fig.1- Low-end consumer device platform architecture Fig.2- High-end consumer device platform architecture CDC http://cmer.cis.uoguelph.ca
Java ME CLDC http://cmer.cis.uoguelph.ca We focus on “Low-end” consumer devices: CLDC configuration address the following areas: Java language and virtual machine features Core Java libraries CLDC Specific Libraries (Input/output & Networking) Internationalization: There is a limited support for converting Unicode characters to and from a sequence of bytes. Security: CLDC addresses the following topics to security At the low-level the virtual machine security is achieved by requiring downloaded Java classes to pass a class file verification step. Applications are protected from each other by being run in a closed “sandbox” environment. Classes in protected system packages cannot be overridden by applications.
Java ME CLDC (Cont.) http://cmer.cis.uoguelph.ca The entire CLDC implementation (static size of the K virtual machine + class libraries) should fit in less than 128 kilobytes. It guarantee portability and interoperability of profile- level code between the various kinds of mobile (CLDC) devices
Palm OS http://cmer.cis.uoguelph.ca Palm OS [1] is an embedded operating system designed for ease of use with a touchscreen-based graphical user interface. It has been implemented on a wide variety of mobile devices such as smart phones, barcode readers, and GPS devices. It is run on Arm architecture-based processors. It is designed as a 32-bit architecture.
Palm OS Features http://cmer.cis.uoguelph.ca [1,2,3] are: The key features of Palm OS – A single-tasking OS: Palm OS Garnet (5.x) uses a kernel developed at Palm, but it does not expose tasks or threads to user applications. In fact, it is built with a set of threads that can not be changed at runtime. Palm OS Cobalt (6.0 or higher) does support multiple threads but does not support creating additional processes by user applications. Palm OS has a preemptive multitasking kernel that provides basic tasks but it does not expose this feature to user applications .
Palm OS Features (Cont.) http://cmer.cis.uoguelph.ca Memory Management: The Memory, RAM and ROM, for each Palm resides on a memory module known as card. In other words, each memory card contains RAM, ROM or both. Palms can have no card, one card or multiple cards. Expansion support [3] : This capability not only augments the memory and I/O , but also it facilitates data interchanges with other Palm devices and with other non-Palm devices such as digital cameras, and digital audio players. Handwriting recognition input called Graffiti 2
Palm OS Features (Cont.) http://cmer.cis.uoguelph.ca HotSync technology for synchronization with PC computers Sound playback and record capabilities TCP/IP network access Support of serial port, USB, Infrared, Bluetooth and Wi-Fi connections Defined standard data format for PIM (Personal Information Management) applications to store calendar, address, task and note entries, accessible by third-party applications
Palm OS Features (Cont.) http://cmer.cis.uoguelph.ca Security model: Device can be locked by password, arbitrary application records can be made private [2] Palm OS Cobalt include a certificate manager. The Certificate Manager handles X.509 certificates [3] .
Symbian OS http://cmer.cis.uoguelph.ca Symbian OS is 32 bit, little-endian operating system, running on different flavors of ARM architecture [4] . It is a multi t as k i n g operat i ng s y s tem and v e r y l e ss dependence on peripherals. Kernel r u n s in t he privileg e d mo d e a n d ex p o r ts i ts service to user applications via user libraries.
Symbian OS Structure http://cmer.cis.uoguelph.ca User libra r ies incl u de net w orki n g, co m m u nicat i on, I / O interfaces and etc. Access to these services and resources is coordinated through a client-server framework. Clients use th e servi c e APIs ex p osed b y t h e server to communicate with the server. The cli e n t - server c o mmuni c at i on is c o n du c ted b y the kernel.
Symbian OS Structure (Cont.) The following demonstrates the Symbian OS architecture [5] : Symbian OS Libraries KVM Application Engines Servers Symbian OS Base- Kernel Hardware http://cmer.cis.uoguelph.ca
Symbian OS Features http://cmer.cis.uoguelph.ca Real-time: it has a real-time, multithreaded kernel. Data Caging [6] : it allows applications to have their own private data partition. This feature allows for applications to guarantee a secure data store. It can be used for e- commerce applications, location aware applications and etc. M ulti m edi a : it s u p p orts aud i o, vid e o record i n g , pl a y ba c k and streaming, and Image conversion.
Symbian OS Features (Cont.) http://cmer.cis.uoguelph.ca Platform Security [6] : Symbian provides a security mechanism against malware. It allows sensitive operations can be accessed by applications which have been certified by a signing authority. In addition, it supports full encryption and certificate management, secure protocols ( HTTPS, TLS and SSL) and WIM framework.
Symbian OS Features (Cont.) http://cmer.cis.uoguelph.ca it supports Unicode Intern a ti o n ali z ation su p por t : standard. [6] : Fully object-oriented and component- based Optimized memory management Clien t - se r ver ar c h i t e c t ure de s crib e d in prev i o u s slides, it provides simple and high-efficient inter-process communication. This feature also eases porting of code written for other platforms to Symbian OS.
Symbian OS Features (Cont.) http://cmer.cis.uoguelph.ca A Hardware Abstraction Layer (HAL): This layer provides a consistent interface to hardware and supports device- independency Kernel o f f e rs hard r e a l -time g u arantees t o ker n el a nd user mode threads.
Embedded Linux OS http://cmer.cis.uoguelph.ca It is known as Embedded Linux which is used in embedded computer systems such as mobile phones, Personal Digital Assistants, media players and other consumer devices. In spite of Linux operating system designed for Servers and desktops, the Embedded Linux is designed for devices which have relatively limited resources such as small size of RAM, storage, screen, limited power and etc. Then, they should have an optimized kernel.
Embedded Linux OS http://cmer.cis.uoguelph.ca It is a Real-Time Operating System (RTOS). It meets deadlines and switch context It has relatively a small footprint. Today, mobile phones can ship with a small memory. Thus, OS must not seek to occupy a large amount of available storage. It should have a small foot print. Theoretically, they deploy in a footprint of 1MB or less. It is open source. It has no cost for licensing. Examples: Motorola Mobile phones such as RAZR V8, RAZR V9, A1200 are based on MontaVista Linux.
Embedded Linux OS http://cmer.cis.uoguelph.ca A R M and M IPS struc t ures [7] : E m be d ded C PU archite c tu r es like AR M a n d MIPS o f fer s m all in s tru ct ion that sp e cial ex e cuti o n mo d es size and cons e qu e nt l y g en er ates s h rinks small e r sets and applic a ti o n code.
Windows Mobile OS http://cmer.cis.uoguelph.ca Windows Mobile is a compact operating system designed for mobile devices and based on Microsoft Win32. It is run on Pocket PCs, Smartphones and Portable media centers. It provides ultimate interoperability. Users with various requirements are able to manipulate their data.
Google Android Platform http://cmer.cis.uoguelph.ca It is a pl a tform a n d an o pera t ing s y s t e m for m o bile devices based on the Linux operating system. It all o w s developers de s i g n ap p lic a ti o ns in a jav a -like language using Google-developed java libraries. It supports a wide variety of connectivity such as GSM, WiFi, 3G, … The Op e r a ting s y s t e m has not been imp l emented yet (Feb, 2008). Several prototypes have been proposed.
Google Android Platform Android architecture: http://c o de.go o gle.com/ a ndro i d/ w ha t -i s -a n dro i d. h tml http://cmer.cis.uoguelph.ca
Google Android Platform http://cmer.cis.uoguelph.ca As demonstrated in the previous slide, the Android platform contains the following layers: Linux Kernel: Android relies on Linux for core system services such as security, memory management, process management and etc. Android [7] Runtime: it provides a set of core libraries which supports most of the functionality in the core libraries of Java. The Android Virtual Machine known as Dalvik VM relies on the linux kernel for some underlying functionality such as threading,…
Google Android Platform http://cmer.cis.uoguelph.ca Libraries: Android includes a set of C/C++ libraries. These libraries are exposed to developers through the Android application framework. They include media libraries, system C libraries, surface manager, 3D libraries, SQLite and etc. For more details, please visit the following link: http://code.google.com/android/what-is-android.html Application Framework: it provides an access layer to the framework APIs used by the core applications. It allows components to be used by the developers.
iPhone OS http://cmer.cis.uoguelph.ca iPhone O S is an op e rating s y s t em run o n iPh o ne a n d iPod. It is based on Mach Kernel and Drawin core as Mac OS X. The Mac OS X kernel includes the following component: Mach Kernel BSD I/O component File Systems Networking components
iPhone OS The following is Mac OS X Architecture [8] : Kernel Environment Core Services Application Services QuickTime Classic Carbon Cocoa JDK BSD http://cmer.cis.uoguelph.ca
iPhone OS http://cmer.cis.uoguelph.ca Mac OS X has a preemptive multitasking environment. Preempting is the act of taking the control of operating system from one task and giving it to another task. It supports real-time behavior. In Mac OS X, each application has access to its own 4 GB address space.
iPhone OS http://cmer.cis.uoguelph.ca Not any application can directly modify the memory of the kernel. It has a strong mechanism for memory protection. For more details about kernel architecture, please visit the following link: http://d e veloper.apple . co m / d ocum e n tat i on / Dar w in/C o nce ptual/KernelProgramming/Architecture/Architecture.html