E2011: Theoretical fundamentals of computer science Basic concepts about operating systems Vlad Popovici, Ph.D. Fac. of Science - RECETOX Outline 1 Operatings systems 2 Kernel 3 Shell Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste2 / 16 Physics: electrons Transistors, diodes - devices Analog circuits: amplifiers, filters Logic: adders, memory Digital circuits: gates Microarchitecture: data paths, controllers Architecture: instructions, registers Operating system: device drivers, kernels Application software: programs Abstraction Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste3 / 16 Operating systems Why? acts as an interface between user/applications and hardware resource manager: manages I/O and peripherals provide a virtual perspective on the underlying hardware manage programs Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste4 / 16 Main roles of the OS: resource sharing: ▶ allocate resources for all activities; separate the resources between activities ▶ isolation of activties ▶ communication between processes/activities virtualization provide standard services: process management, file systems, network services, etc Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste5 / 16 OS over time early OS: set of routines for common procedures; single-user OS multi-user OS: → batch processing → multi-tasking → virtual machines time-sharing OS: interactive use modern OS: usually a kernel+GUI; desktop-level (MacOS, Linux, Windows, etc); smart appliances (Android, iOS, Symbian, etc); server-level: GUI is optional (UNIX-based OSes, etc); etc Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste6 / 16 Batch OS intially, a system in which jobs are run sequentially a job monitor supervises execution and manages the job queue modern OSes have their own job scheduler(s) allowing for non-interactive, eventually synchronized, execution of jobs CPU batch 1 batch N job 1 job 1 OS Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste7 / 16 Multitasking ”concurrent” exectution of processes (tasks) does not imply parallel execution multiprogramming OSes: allow context switching between processes cooperative multitasking: processes voluntarily ceed time to OS/other process: ealry Windows and MacOS preemptive multitasking: OS decides to switch between executing tasks real time systems multi-threaded systems Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste8 / 16 OS Kernel kernel: the core of the OS that provides services to all other components of OS talks directly to hardware usual start=up sequence: power-on → BIOS (Basic I/O System) → kernel loaded into a protected memory space Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste9 / 16 OS Kernel - main functions loading and managing less-critical OS components, such as device drivers managing exectution threads and various processes spawned by running applications scheduling applications memory management managing and optimizing hardware resources and dependencies managing and accessing I/O devices (keyboards, mice, disk drives, USB ports, network adapters and display,...) handling device and application system calls using various mechanisms such as hardware interrupts or device drivers Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste10 / 16 CPU modes to support kernel: kernel mode: code has unrestricted access to hardware; it is loaded in protected memory space and operates with highest privileges user mode: applications run with lower privileges; access to resources is made via system calls to kernel Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste11 / 16 Types of kernels: microkernel: delegates user services and processes in different address space; uses message-passing for communication; more flexibility and security (e.g. QNX - UNIX-based, real-time) monolithic: implements services in the same address space (e.g. most of UNIX-based kernels, Windows 9x) hybrid: tries to combine both (e.g. Windows 10, 11) Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste12 / 16 Figure: Comparison of three different kernel types (from Wikipedia) Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste13 / 16 Shells a program that allows users and programs to interact with OS services two modes: command line interface (CLI) and graphical user interface (GUI) CLI it has a specific language allowing the on line or scripted interaction with OS examples of CLI: Windows’ Power Shell or UNIX’s bash, tcsh, etc Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste14 / 16 Shells Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste15 / 16 Questions? Vlad Popovici, Ph.D. (Fac. of Science - RECETOX)E2011: Theoretical fundamentals of computer science Basic concepts about operating syste16 / 16