260 likes | 404 Views
Operating system concepts. Lin Zhong ELEC424, Fall 2010. Outline. What is operating system? Important OS concepts Embedded OS. What is OS?. Different ways of computing implementation. Data Input (1100101000). Output (0101101010). Fully customized circuit.
E N D
Operating system concepts Lin Zhong ELEC424, Fall 2010
Outline • What is operating system? • Important OS concepts • Embedded OS
What is OS? • Different ways of computing implementation Data Input (1100101000) Output (0101101010) Fully customized circuit Programmable circuit (Processor) Program in high-level language Program in high-level language Data Input (1100101000) Output (0101101010) Compilation Control Input (1100101000) Executable/binary Program in high-level language
What is OS? (Contd.) • A modern computer system Hard disk Data Input (1100101000) Programmable circuit (Processor) Output (0101101010) Precompiled binaries Control Input (1100101000) BIOS 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
OS concepts • Scheduling (Process management) • Memory management • File system • Networking • Device drivers • Power management
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
Scheduling (Contd.) Processes OS creates the illusion that every process can own the whole computer Physical computer
Scheduling (Contd.) • 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 Blocked Run Process status
Thread vs. Process Processes OS creates the illusion that every process can own the whole computer Process: execution of a single control flow Physical computer Threads share the resources that is designated to a single process Process: execution of multiple control flows that share the system resource
Memory management CPU Registers • Storage hierarchy • Virtual memory • Extend main memory beyond RAM • Share memory space between processes • Organized in “pages” • 64KB • Page tables • Translation lookaside buffer (TLB) Cache Main memory (RAM) Hard disk
Memory management & scheduling Ready Can get “swapped” out to disk Blocked Binary in main memory Run Process status
File system CPU Registers • 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) Cache Main memory File system cache Hard disk
Networking Application Application Priority/Express/ Registration/Packages IMAP, HTTP Presentation Transport TCP, UDP Zip code, street address Session IP Find the best route (Google map) Network Transport CSMA Data link Traffic regulation Network Physical CDMA, TDMA How to drive a mail truck Data link Physical TCP/IP model USPS analogy OSI reference model
Device drivers • Hardware abstraction • Provide standard API for applications • Share peripheral devices • Even battery has a driver
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
Power management • Advanced Configuration and Power Interface (ACPI) • Industrial standard • 7 global states • G0-G3 • G1: S1-S4 • 4 CPU states • C0-C3 • Up to 16 Performance states • Pn • 4 device states • D0-D3 P-States Tian et al, 2007
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
Smartphone Oses Source: Gartner
Industrial profile Services Verizon, Sprint, AT&T etc. Applications Nokia Apple RIM (Blackberry) Microsoft Operating system Samsung, LG, HTC, Moto,… Palm System integration/manufacture IC TI, ARM, MIPS (Digital), Qualcom • Broadcom, Marvel (RF, Analog)
Symbian • Owned by Nokia • ARM processors only • Target of multiple phone viruses • Moving toward open-source
Embedded Linux • Linux • Initiated by LinusTorvalds (Swedish Finnish) (but named after Linus Pauling, an American) • Google Android • Palm WebOS • Meego(Nokia/Intel) • MontaVista Linux • Most older Motorola Linux phones • TrolltechGreenphone
OS for small embedded systems • 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 Intermediates Intermediates Executables Executables Executables Run-time Run-time OS1 OS2 OS1 OS2 OS Virtualization Virtualization Hardware Hardware Hardware