Thursday, November 21, 2013

Mobile OS : Concepts




Mobile operating systems


A mobile operating system, also referred to as mobile OS, is the Operating System that operates a smart phone, tablet, PDA, or other digital mobile device. Modern mobile operating systems combine the features of a personal computer operating system with other features, including a touch screen, cellular, Bluetooth, WiFi, GPS mobile navigation, camera, video camera, speech recognition, voice recorder, music player, Near field communication and Infrared Blaster.
Mobile devices with mobile communications capabilities (eg smartphones) contain two mobile operating systems - the main user-facing software platform is supplemented by a second low-level proprietary real-time operating system which operates the radio and other hardware. Research has shown that these low-level systems may contain a range of security vulnerabilities permitting malicious base stations to gain high levels of control over the mobile device.[1]

History

Mobile operating system milestones mirror the development of mobile phones and smartphones:
Common software platforms

The most common mobile operating systems are:

Android

Android is from Google Inc. It is free and open source.Android's releases prior to 2.0 (1.0, 1.5, 1.6) were used exclusively on mobile phones. Most Android phones and some Android tablets, now use a 2.x release. Android 3.0 was a tablet-oriented release and does not officially run on mobile phones. The current Android version is 4.4. Android's releases are nicknamed after sweets or dessert items like Cupcake (1.5), Donut(2.0) Eclair(2.1) Frozen Yogurt ("Froyo") (2.2), Ginger Bread (2.3), Honeycomb (3.0), Ice Cream Sandwich (4.0), Jelly Bean (4.1),(4.2),(4.3) and Kit Kat (4.4). Most major mobile service providers carry an Android device. Since HTC Dream was introduced, there has been an explosion in the number of devices that carry Android OS. From Q2 of 2009 to the second quarter of 2010, Android's worldwide market share rose 850% from 1.8% to 17.2%. On November 15, 2011, Android reached 52.5% of the global smartphone market share.

Blackberry

BlackBerry 10 is from BlackBerry. It is closed source and proprietary. BlackBerry 10 (previously BlackBerry BBX) was the next generation platform for BlackBerry smartphones and tablets. One OS was planned for both Blackberry smartphones and tablets going forward.

iOS

iOS is from Apple Inc. It is closed source and proprietary and built on open source Darwin core OS. The Apple iPhone, iPod Touch, iPad and second-generation Apple TV all use an operating system called iOS, which is derived from Mac OS X. Native third party applications were not officially supported until the release of iOS 2.0 on July 11, 2008. Before this, "jailbreaking" allowed third party applications to be installed, and this method is still available. Currently all iOS devices are developed by Apple and manufactured by Foxconn or another of Apple's partners.

Windows Phone

Windows Phone is from Microsoft. It is closed source and proprietary. On February 15, 2010, Microsoft unveiled its next-generation mobile OS, Windows Phone. The new mobile OS includes a completely new over-hauled UI inspired by Microsoft's "Metro Design Language". It includes full integration of Microsoft services such as Microsoft SkyDrive and Office, Xbox Music, Xbox Video, Xbox Live games and Bing, but also integrates with many other non-Microsoft services such as Facebook and Google accounts. Windows Phone devices are made primarily by Nokia, along with HTC, Samsung, Huawei and other OEMs.


Other Platforms

S40
S40 (Series40) is from Nokia. It is closed source and proprietary. Nokia uses S40 OS in their feature phones. Over the years, more than 150 phone models have run S40 OS.[18] Since the introduction of S40 OS it has evolved from monochrome low resolution UI to a full touch 256k color UI.

Symbian OS

Symbian OS is from Nokia and Accenture.[5] It uses an open public license. Symbian has the largest smartphone share in most markets worldwide, but lags behind other companies in the relatively small but highly visible North American market.[20] This matches the success of Nokia in all markets except Japan. In Japan Symbian is strong due to a relationship with NTT DoCoMo, with only one of the 44 Symbian handsets released in Japan from Nokia.[21] It has been used by many major handset manufacturers, including BenQ, Fujitsu, LG, Mitsubishi, Motorola, Nokia, Samsung, Sharp and Sony Ericsson. Current Symbian-based devices are being made by Fujitsu, Nokia, Samsung, Sharp and Sony Ericsson. Prior to 2009 Symbian supported multiple user interfaces, i.e. UIQ from UIQ Technologies, S60 from Nokia and MOAP from NTT DOCOMO. As part of the formation of the Symbian OS in 2009 these three UIs were merged into a single OS which is now fully open source. Recently, though shipments of Symbian devices have increased, the operating system's worldwide market share has declined from over 50% to just over 40% from 2009 to 2010. Nokia handed the development of Symbian to Accenture, which will support the OS until 2016.[22]

webOS

webOS is from LG, although some parts are open source. webOS is a proprietary mobile operating system running on the Linux kernel, initially developed by Palm, which launched with the Palm Pre. After being acquired by HP, two phones (the Veer and the Pre 3) and a tablet (the TouchPad) running webOS were introduced in 2011. On August 18, 2011, HP announced that webOS hardware was to be discontinued[26] but would continue to support and update webOS software and develop the webOS ecosystem.[27] HP released webOS as open source under the name Open webOS, and plans to update it with additional features.[28] On February 25, 2013 HP announced the sale of WebOS to LG Electronics, who planned to use the operating system for its "smart" or Internet-connected TVs. However HP retained patents underlying WebOS as well as cloud-based services such as the App Catalog.

Mobile Operating System Structure 


Applications
OS Libraries
Device Operating System Base, Kernel
Low level Hardware, Device Drivers




Ref: From Wikipedia, the free encyclopedia

Thursday, October 17, 2013

OS: Scheduling Algorithms

Scheduling Algorithms

First-Come, First-Served (FCFS) Scheduling
       
         Process          Burst Time
          P1                                24
          P2                                  3
          P3                                  3

Suppose that the processes arrive in the order: P1 P2 P3

The Gantt Chart for the schedule is:
        
  
P1
P2
P3
0                                                  24                                    27                                                       30

  Waiting time for P1 = 0; P2 = 24; P3 = 27
  Average waiting time: (0 + 24 + 27)/3 = 17

  Suppose that the processes arrive in the order
  P2 P3 P1 .

The Gantt chart for the schedule is:

P2
P3
P1
0                                                      3                                           6                                               30

  Waiting time for P1 = 6; P2 = 0; P3 = 3
  Average waiting time: (6 + 0 + 3)/3 = 3
  
Much better than previous case.

 Convoy effect short process behind long process
  
Shortest-Job-First (SJF) Scheduling

Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time.

Two schemes:

1. Non pre- emptive – once CPU given to the process it cannot be preempted until completes its CPU burst.

2. Preemptive – Preemption takes place when a new process arrives with CPU burst length less than remaining time of current executing process. This scheme is also known as the Shortest-Remaining-Time-Next (SRTN) Scheduling.

SJF is optimal – gives minimum average waiting time for a given set of processes.

                Process          Arrival Time     Burst Time
                    P1                    0.0                         7
                    P2                    2.0                         4
                    P3                    4.0                         1
                    P4                    5.0                         4

SJF (non-preemptive)

P1
P3
P2
P4
0                                  7                               8                         12                                     16

Average waiting time = [0 +(8-2)+(7-4) +(12-5)] /4 =4

Example of Preemptive SJF

Proces                        Arrival  Time               Burst Time
P1                                    0.0                               7
P2                                    2.0                               4
P3                                    4.0                               1
P4                                     5.0                              4

SJF (preemptive)

P1
P2
P3
P2
P4
P1
0                   2                       4                     5                         7                      11               16

        Average waiting time = (9 + 1 + 0 +2)/4 =3
       

Determining length of cpu burst is possiblee by using the length of previous CPU bursts, using exponential averaging though it's a very complex calculation to carry out.



Priority Scheduling

A priority number (integer) is associated with each process
The CPU is allocated to the process with the highest priority (smallest integer ≡ highest priority).
       1. Preemptive
       2. nonpreemptive
SJF is a priority scheduling where priority is the predicted next CPU burst time.
Problem ≡ Starvation – low priority processes may never execute.
Solution ≡ Aging – as time progresses increase the priority of the process.

Round Robin (RR)

Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time  has elapsed, the process is preempted and added to the end of the ready queue.
If there are processes in the ready queue and the time quantum is q, then each process gets 1/of the
CPU time in chunks of at most time units at once. No process waits more than (n-1)time units.
Performance
        1. large FIFO
        2. small must be large with respect to context switch, otherwise overhead is too high.
Example of RR with Time Quantum = 4

                        Process    Burst Time
                            P1                    24
                            P2                     3
                            P3                     3

The Gantt chart is:
P1
P2
P3
P1
P1
P1
P1
P1
0          4               7              10            14            18             22          26            30

Average waiting time =    ((30-24)+4+7)/3  = 17/3 =5.66
     
Multilevel Queue

Ready queue is partitioned into separate queues:
foreground (interactive)
background (batch)
Each queue has its own scheduling algorithm,
foreground – RR
background – FCFS
Scheduling must be done between the queues.
  1. Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation.
  2. Time slice – each queue gets a certain amount of CPU time
which it can schedule amongst its processes; i.e., 80% to foreground in RR
1. 20% to background in FCFS

Multilevel Queue Scheduling

      

Multilevel Feedback Queue

A process can move between the various queues; aging can be implemented this way.
Multilevel-feedback-queue scheduler defined by the following parameters:
   1. number of queues
   2. scheduling algorithms for each queue
   3. method used to determine when to upgrade a process
   4. method used to determine when to degrade a process
   5. method used to determine which queue a process will enter  when that process needs service



          


Three queues:
    1. Q0 – time quantum 8 milliseconds
    2. Q1 – time quantum 16 milliseconds
    3. Q2 – FCFS
Scheduling
    1. A new job enters queue Q0 which is served FCFS . When it gains CPU, job receives 8 milliseconds.
        If it does not finish in 8 milliseconds, job is moved to queue Q1.
    2. At Q1 job is again served FCFS and receives 16 additional milliseconds. If it still does not complete,
         it is preempted and moved to queue Q2.