Operating system concepts

mustardpruneΔίκτυα και Επικοινωνίες

23 Οκτ 2013 (πριν από 4 χρόνια και 18 μέρες)

114 εμφανίσεις

Operating
system concepts

Lin Zhong

ELEC424, Fall 2010

Outline


What is operating system?



Important OS concepts



Embedded OS



2

What is OS?


Different ways of computing implementation

3

Data Input
(1100101000)

Output
(0101101010)

Fully
customized
circuit

Data Input
(1100101000)

Output
(0101101010)

Control Input
(1100101000)

Programmable
circuit
(Processor)

Program in high
-
level
language

Compilation

Program in high
-
level
language

Program in high
-
level
language

Executable/binary

What is OS? (Contd.)


A modern computer system

4

Output
(0101101010)

Control Input
(1100101000)

Programmable
circuit
(Processor)

Data Input
(1100101000)

Hard disk

BIOS

Precompiled
binaries

Basic I/O system to
jumpstart

What is OS?


“Software that manages the sharing of the
resources of a computer”
---
Wikipedia


Sharing by what?


Independent executables (programs)


What resources?


Time
-
shared resources: CPU and network


Space
-
shared resources: memory and disk


Exhaustible: energy



5

OS concepts


Scheduling (Process management)


Memory management


File system


Networking


Device drivers


Power management


6

Scheduling


Process


Wiki: An instance (execution) of a
computer
program
that is being sequentially executed


Wiki: a collection of instructions that describes a task,
or set of tasks, to be carried out by a computer


Running program???


Execution of a single control flow

7

be done

00000010 10000000 00000000 00000110

addcc

%r1,
-
4,%r1

10000010 10000000 01111111 11111100

addcc

%r1,%r2,%r4

10001000 10000000 01000000 00000010

ld

%r4,%r5

11001010 00000001 00000000 00000000

ba loop

00010000 10111111 11111111 11111011

addcc

%r3,%r5,%r3

10000110 10000000 11000000 00000101

Scheduling (Contd.)

8

Physical computer

Processes

OS creates the illusion that
every process can own the
whole computer

Scheduling (Contd.)

9


Time
-
sharing of CPU


Admission control


Long
-
term scheduling


Memory loading


Mid
-
term scheduling


Who gets the CPU


Short
-
term scheduling


Priority


Preemptive


Real
-
time

Ready

Run

Blocked

Process status

Thread vs. Process

10

Physical computer

Processes

OS creates the i l l usion that
every process can own the
whol e computer

Threads share the resources that is
designated to a single process

Process
:

execution

of

a

single

control

flow

Process
:

execution

of

multiple

control

flows

that

share

the

system

resource

Memory management


Storage hierarchy


Virtual memory


Extend main memory beyond RAM


Share memory space between
processes


Organized in “pages”


64KB


Page tables


Translation lookaside buffer (TLB)

11

CPU

Cache

Registers

Main memory
(RAM)

Hard disk

Memory management & scheduling

12

Ready

Run

Blocked

Process status

Binary in main
memory

Can get “swapped” out
to disk

File system


Organize the massive storage


Directories


Files


Flash file system


Block
-
wise erase


Finite # of erase
-
write cycles (100K
times)


Spread erase
-
write evenly (wear
levelling)


13

CPU

Cache

Registers

Main memory

Hard disk

File system cache

Application

Transport

Data link

Physical

Network

Networking

14

Application

Presentation

Session

Transport

Data link

Physical

Network

OSI reference model

Priority/Express/
Registration/Packages

Zip code, street address

Traffic regulation

How to drive a mail truck

Find the best route
(Google map)

TCP/IP model

IMAP, HTTP

TCP, UDP

CSMA

CDMA, TDMA

IP

USPS analogy

Device drivers


Hardware abstraction


Provide standard API for applications


Share peripheral devices



Even battery has a driver

15

No direct energy management


Energy accounting


How much energy has been consumed


Battery energy model


How much energy is left on battery


System energy model


How much energy is consumed by a component
or an activity


16

Power management


Advanced Configuration and Power Interface (ACPI)


Industrial standard

17

Tian et al, 2007

P
-
States


7 global states


G0
-
G3


G1: S1
-
S4


4 CPU states


C0
-
C3


Up to 16 Performance
states


Pn


4 device states


D0
-
D3

Real
-
time operating system (RTOS)


Guarantee meeting the hard deadlines


Linux, Windows, Unix,…. are
NOT
RTOS


Green Hills


INTEGRITY


Joint
-
strike fighter


Eurofighter Typhoon


Wind River


VxWork 653 (Boeing 787)


LynuxWorks


LynxOS (Boeing 777 cabin service system)


QNX


Automotives


18

Smartphone
Oses

19

Symbian

RIM

Windows
Mobile

OS X

Linux

Palm OS

Others

2007

Symbian

RIM

Windows
Mobile

OS X

Linux

Palm OS

Others

2008

Source: Gartner

46.9

3.9

19.9

14.4

8.7

6.1

2009

Symbian
Android
RIM
iOS
Windows
Others
40.1

17.7

17.5

15.4

4.7

4.7

2010

Symbian
Android
RIM
iOS
Windows
Others
Industrial profile

22

IC

System
integration/manufacture

Operating

system

Applications

Microsoft

Samsung, LG,
HTC, Moto,…

Nokia

Apple

TI,
ARM, MIPS (Digital),
Qualcom

Broadcom, Marvel (RF, Analog)

Verizon, Sprint, AT&T etc.

RIM
(Blackberry)

Services

Palm

Symbian


Owned by Nokia


ARM processors only



Target of multiple phone viruses



Moving toward open
-
source

23

Embedded Linux


Linux


Initiated by
Linus

Torvalds

(Swedish
Finnish) (but named after
Linus

Pauling, an American)


Google Android


Palm
WebOS


Meego

(Nokia/Intel)


MontaVista

Linux


Most older Motorola Linux phones



Trolltech

Greenphone

24

OS for small embedded systems

25


Often proprietary


In
-
house simple OS
-
like firmware



TinyOS

is big for networked sensors


Open source (http://www.tinyos.net/)


Runs on microcontrollers like MSP430


New development


All driven by more computing power

26

Executables

OS

Hardware

Executables

OS1

Hardware

Virtualization

OS2

Executables

Intermediates

OS1

Hardware

Virtualization

OS2

Intermediates

Run
-
time

Run
-
time