Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems...
Transcript of Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems...
![Page 1: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/1.jpg)
Operating systems
Lecture 1
Operating systems concepts
ProcessesSept.2018
Narcis ILISEI
![Page 2: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/2.jpg)
Welcome
⚫ Willkommen
⚫ Bienvenue
⚫ Bienvenidos
⚫ Velkommen
⚫ Baruch haba
⚫ Vítejte
⚫ Irashaimasu
⚫ Benvenuto
⚫ Huan yin
⚫ Bine ati venit
⚫ Esiet sveicinati
⚫ Sveiki
⚫ Dobrodoshli
⚫ Välkommen
Hos geldiniz
Kalos orisate
Isten hozta
Vitajte
Merhaba
Witaj
Dobro pozhalovat
Tere tulemast
Bem-vindo
Dobre doshal
Swaagatam
Dobrodošel
Hwangyong-hamnida
![Page 3: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/3.jpg)
Narcis ILISEI
⚫ Telecommunications Engineer
⚫ BSc in 1999, MSc, in 2000
⚫ Tech. Univ. Iasi, Romania
⚫ 1999-2000 - Teaching assistant
⚫ C++, VHDL
⚫ 2000-2010 - R&D Engineer
⚫ Agilent Technologies, Böblingen
⚫ Embedded Software
⚫ High Speed Measurement Instruments
⚫ Since 2010 - Software consulting, Inatech
![Page 4: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/4.jpg)
NI – cont.
⚫ Experience with various operating systems
Autosar, ThreadX, Windows(...), Linux (...),
VxWorks, pSOS, WindowsCE, eLinos,
eCOS, RTLinux, Android, iOS
![Page 5: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/5.jpg)
Course format
⚫ Lectures with
⚫ Theory
⚫ ... BREAKs
⚫ Practical examples, exercises
⚫ ...more Breaks
⚫ Questions ! Interactivity is important! ⚫ Small Homeworks
⚫ Final exam
![Page 6: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/6.jpg)
Further documentation
⚫ Recommended book:
⚫ „Modern operating systems“, 3rd or 4th editions
– Andrew S. Tanenbaum
⚫ Alternatives:
“Modern operating systems:Global Edition”
“Moderne Betriebssysteme”
⚫ Wikipedia
⚫ Microsoft MSDN
![Page 7: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/7.jpg)
![Page 8: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/8.jpg)
Summary
⚫ What is an OS ? Why study OSes?
⚫ Short OS history
⚫ OS reduce complexity
⚫ OS Concepts overview
⚫ Exercise: Install an OS
![Page 9: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/9.jpg)
What is an OS?
What does it do?
⚫ A layer of software that manages the
computer / machine
⚫ Offers an nice interface to users
⚫ Offers a simplified machine to programs
⚫ Reduces complexity for programmers
⚫ Manages the resource of the computer
![Page 10: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/10.jpg)
What has a computer to
manage
⚫ A modern computer consists of:
⚫ One or more processors
⚫ Main memory
⚫ Disks
⚫ Various input/output devices: (HID, lan, camera...)
⚫ Application Software
⚫ Managing all these components requires a
layer of software – the operating system
![Page 11: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/11.jpg)
OS turns ugly/complex HW
into a beautiful interface
Picture(c): “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 12: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/12.jpg)
Course summary
• OS concepts
– process, threads, locks, IPC
– IPC, Deadlocks
– Scheduling
– Memory management
– File systems
– I/O
• Example OSes:
– Linux, Android, iOS, RTA-OSEK, Windows
![Page 13: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/13.jpg)
Why OS special course?
⚫ OS offers a Virtual Machine to programmers
⚫ Using OS makes programmer’s life easy
⚫ Required knowledge for system design
⚫ The OS concepts are complex
⚫ OSes are great programming examples
⚫ Basic and Required knowledge for computer
science engineers
![Page 14: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/14.jpg)
Summary
⚫ What is an OS ? Why study OSes?
⚫ OS history
⚫ OS reduce complexity
⚫ OS Concepts overview
⚫ Install an OS
![Page 15: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/15.jpg)
History: Computer and OS
Generations
⚫ Computers:⚫ (1945–55) Vacuum Tubes
⚫ (1955–65) Transistors and Batch Systems
⚫ (1965–1980) ICs and Multiprogramming
⚫ (1980–Present) Personal Computers
⚫ (2000- Present) Mobile Computers
⚫ OSes:⚫ Phase 1: until 1970: HW expensive, no OS,
⚫ Phase 2: 70’s: Multiprogramming, complex OS needed
⚫ Phase 3:1980–present: many OSes that better fit specific needs
⚫ Phase 4: 90’s–present: Distributed systems
⚫ Phase 5: 2000–present: Mobile systems
![Page 16: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/16.jpg)
Why history ?
• Techniques change greatly over time but
principles are more resistant,
• Some old concepts reappear in newer form
later
⚫ In this course - more emphasis on key
concepts, less likely to change
![Page 17: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/17.jpg)
![Page 18: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/18.jpg)
Phase 1: until 1970
(a) Programmers bring cards to 1401.
(b)1401 reads batch of jobs onto tape. Operator carries input tape to 7094.
(d) 7094 does computing. (e) Operator carries output tape to 1401. (f) 1401 prints output
HW Expensive
⚫ ENIAC ⚫ 1945-1955, Eckerd and Mauchly
⚫ One room, 30 tonns, x100 KWH
⚫ Batches of work⚫ complexity increased, protection needed
Picture(c): “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 19: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/19.jpg)
Batch Jobs on cards
Structure of a typical job.
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 20: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/20.jpg)
Phase2: ‘70s
HW expensive => Multiuser
⚫ MULTICS – OS (released in 1969)
⚫ OS 360 released
⚫ Disk drives, 140MB ~”washing machine”
⚫ 1.7 bytes/sq inch - 164 GB/sq inch today
![Page 21: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/21.jpg)
Phase 3: 1980 - today
HW Cheap – Multi computers / user
⚫ Humans expensive
⚫ OSes became simple (subroutine, single
user)
⚫ Late 90’s , 2000 – OS got big again
⚫ Abstraction / simplifications still needed ->
OSes
⚫ Today More than 1computer/human
![Page 22: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/22.jpg)
Some past and present OSes
⚫ Multics
⚫ Unix
⚫ DOS, MS-DOS
⚫ Unix: Linux (many), BSD, Sun OS, HPUX
⚫ Apple - OS X (based on BSD)
⚫ Windows (95, 98, 2000, XP, Vista, 7, 8.x, 10)
⚫ Mobile: Android (based on Linux), iOS, Windows, Linux
⚫ Embedded (many): RTA, VxWorks, WindowsCE, OSEK...
⚫ Real time: RTLinux, QNX
⚫ Smart card OSes
![Page 23: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/23.jpg)
Summary
⚫ What is an OS ? Why study OSes?
⚫ OS history
⚫ OS reduces complexity
⚫ OS Concepts overview
⚫ Install an OS
![Page 24: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/24.jpg)
OS is a solution against
complexity
⚫ We need to write a single program that
handles many independent activities ?
⚫ Every program needs to support different
types of HW?
⚫ Acceptable that a buggy program crashes the
system?
⚫ Should every program have access to
complete HW?
![Page 25: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/25.jpg)
Computer HW review
⚫ In the beginning it was a mechanical
computer
⚫ A long time after, electronic tubes
⚫ Then transistors
⚫ Performance governed by Moore‘s Law
⚫ ...8080, Z80, 8086, 286,386,Pentium,
...Core2
⚫ Today: multicore chips; low power devices
![Page 26: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/26.jpg)
⚫ CPUs
⚫ Memory
⚫ Peripherals
⚫ I/O, Monitor, Audio
⚫ Interfaces
HW structure
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 27: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/27.jpg)
HW StructureBecomes complex as one goes into details
![Page 28: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/28.jpg)
Example PC mainboard
⚫ CPU
⚫ Memory
⚫ Peripherals
![Page 29: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/29.jpg)
CPU – central processing unit
CPU’s tasks:
Fetch instruction from memory
Decode and execute instruction
Write results to Memory or to I/O
Pipeline: reduces idle times
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 30: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/30.jpg)
1. CPU is complex!
OS helps
⚫ Instruction decoder
⚫ ALU, Multiplicator,...
⚫ Memory access, Bus
⚫ Multi core, Hyperthreading
RISC
Pipeline, Superscalar
Reordering
Branch prediction, speculation
Dynamic compilation
Exception handling
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 31: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/31.jpg)
Various Memory Types Access time varies greatly!
Holds data and programs
Present at different levels in the HW structure
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 32: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/32.jpg)
2. Memories are complex
OS helps!
⚫ Registers – N* x64 bit
⚫ L1 Cache – N* MB
⚫ L2 Cache – N* MB
⚫ RAM (DRAM,SRAM...) – N* GB
⚫ Flash/ EEPROM
⚫ Hard Disk, Tape –N* TB
Cache hit/miss
Addressing, latency,
Protection,
Exception handling
Interleaving
Bus protocols
Network
RAID
![Page 33: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/33.jpg)
Peripherals
⚫ Buses: Cache, Memory, Bridges
⚫ PCI, PCIe, ..., ISA,
LPC...
⚫ USB, Firewire
⚫ RS232
⚫ Plug and Play
⚫ LAN, WLAN
⚫ Infrared
Bus protocols
![Page 34: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/34.jpg)
3. System HW is complex!
OS helps again!
⚫ CPU fetches instructions from Memory
⚫ Decodes, executes
⚫ Results to memory or peripherals
⚫ Many interrupts occur. Components compete
for CPU cycles
![Page 35: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/35.jpg)
4. Complex HW diversity
OS offers a simple interface
⚫ Different CPUs: pentium, ARM, PowerPC,...
⚫ Different memorys, disks
⚫ Types of Devices: mice, KB, Camera,
Fingerprint readers...
⚫ Networking environments: cable, DSL,
UMTS,Wireless
⚫ ...
![Page 36: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/36.jpg)
5. Complexity of requirements
OS helps here too!
⚫ Example Pathfinder
⚫ HW: 20MHz,128MBRam
⚫ Many instruments, batteries,
solar panel
⚫ Many programs, some
unstable
⚫ Reset button inaccessible
⚫ Critical:
⚫ Always able to receive cmds
from Earth + debug
⚫ Track Earth orbit
⚫ Stop before hit a rock...
![Page 37: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/37.jpg)
Conclusion:
OS helps against complexity
⚫ We need to write a single program that
handles many independent activities ?
⚫ Every program needs to support different
types of HW?
⚫ Acceptable that a buggy program crashes the
system?
⚫ Should every program have access to
complete HW?
![Page 38: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/38.jpg)
HW review
⚫ HW = CPU + Memory + Peripherals + Buses
⚫ HW complexity hidden inside OS
⚫ HW related problems solved by OS:
⚫ Support for HW access: “Device driver”
⚫ Memory protection against other processes
⚫ HW resource management for the benefit of SW.
![Page 39: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/39.jpg)
Summary
⚫ What is an OS ? Why study OSes?
⚫ OS history
⚫ OS reduce complexity
⚫ OS Concepts overview
⚫ Install an OS
![Page 40: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/40.jpg)
OS Concepts overview
⚫ OS Structure
⚫ Kernel / microkernel
⚫ Library
Process
⚫ Thread
⚫ Process table
⚫ Special process - Shell
⚫ Files
⚫ Directory, file descriptor
System call
I/O
IPC
Signal, Semaphore, queue,
events
Memory management
Virtual memory
Address space
Virtualisation
![Page 41: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/41.jpg)
OS structure
⚫ Monolithic systems – basic structure:
⚫ A main program that invokes the requested
service procedure.
⚫ A set of service procedures that carry out the
system calls.
⚫ A set of utility procedures that help the
service procedures.
![Page 42: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/42.jpg)
OS Structure
Monolithic kernel
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 43: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/43.jpg)
Microkernel
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 44: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/44.jpg)
Process
⚫ Process = One running program
⚫ Has its own memory space.
⚫ Events which cause process creation:
⚫ System initialization.
⚫ Execution of a process creation system call by a
running process.
⚫ A user request to create a new process.
![Page 45: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/45.jpg)
Process table
⚫ Process table administrative info
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 46: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/46.jpg)
Processes
A process tree. Process A created two child processes, B and C. Process B created three child processes, D, E, and F.
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 47: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/47.jpg)
Process management API
⚫ Unix
⚫ fork()
⚫ execve()
⚫ exit()
⚫ wait()
Windows
CreateProcess()
-
ExitProcess()
WaitForSingleObject()
![Page 48: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/48.jpg)
Some of the major POSIX system calls.
System Calls for Process Management
TRY this!
Source: “Modern operating systems” - A.Tannenbaum, 3rd edition, Pearson Prentice Hall
![Page 49: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/49.jpg)
Process exampleBackground Service
Main process
⚫ Start, init
⚫ Start child process in
background
⚫ End
⚫ Child process
⚫ Start
⚫ While(true)
⚫ Work()
Int close_console_window()
pid_t pid = fork();
if(pid < 0) return Err;
if (pid == 0) /* child */fclose(stdin);
fclose(stderr);
return RC_OK;
else /*parent*/
exit(0);
![Page 50: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/50.jpg)
Summary
⚫ What is an OS ? Why study OSes?
⚫ OS history
⚫ OS reduce complexity
⚫ OS Concepts overview
⚫ Install an OS
![Page 51: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/51.jpg)
Todo: Install an OS + prepare work environment
+ shell commands
⚫ OS installation
⚫ OS basic configuration
⚫ Basic command line work
⚫ C compiler
⚫ Debugger
⚫ Hello world
⚫ Basic OS commands
![Page 52: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/52.jpg)
Lab : „Hello World“
Linux, Android, Windows
⚫ Goal is to have one or several systems
suitable for tests and mini homeworks
⚫ Candidates:
⚫ Linux + command line gcc + gdb GUI
⚫ Windows + Visual Studio
⚫ Android + Eclipse IDE
![Page 53: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/53.jpg)
Basic Bash commands
⚫ man bash
⚫ mkdir, rm, ls, cp, mv, ln
⚫ chmod, chown
⚫ ps, kill, nice
⚫ cat, less, more
⚫ mount, umount
⚫ echo
⚫ exec
⚫ find
yes
pwd, date, export
Whoami
Grep
Df, du
Mkisofs
Ifconfig
Ping
....
![Page 54: Lecture 1 Operating systems conceptsilisei/OS -lecture_01 - Operating... Lecture 1 Operating systems concepts Processes ... Programmers bring cards to 1401. (b)1401 reads batch of](https://reader031.fdocuments.net/reader031/viewer/2022021911/5c4277fc93f3c338e133cee4/html5/thumbnails/54.jpg)
Summary
⚫ What is an OS ? Why study OSes?
⚫ OS history
⚫ OS reduce complexity
⚫ OS Concepts overview
⚫ Install Tools