Operating Systems
Lecture 1
Compiler vs. Interpreter
Compiler
Translates the program as a whole into machine code
Takes more time to analyse the code and compile but overall execution is faster
Linking (=process of collecting pieces of code into a single file that can be loaded (.exe).
Examples: C & C++.
Interpreter
Translates program one statement at a time
Takes less time to analyse, execution time is slower.
No object code is generated therefore memory efficient
Examples: Python & Ruby
Assembly- vs. machine code
Machine
Consists of binaries that can be directly executed by a
computer.
Assembly
Low-level programming language that requires a software
called an assembler to convert into machine code.
What is an OS
Informal definition:
A device that only translates a basic input in one action has/is not an OS.
If there is some sort of managing by itself or it acts as something between the user and the
device (hardware) we can speak about an operating system.
Formal definition:
“If there is a body of software, in fact, that is responsible for making it easy to run
programs. That body of software is called the operating system, as it is in charge of making
sure the system operates correctly and efficiently in an easy-to-use manner.”
Summarized
What is an operating system?
o It’s a program
o Set of programs
What is the function of an operating system?
o Management of hardware, to improve operations of the system
o Communicates with the user to hide complexity of the system
1 Operating Systems 2022-2023
,Types of OS’s
There are different type of OS’s. it all comes back to:
The POV of the user
User friendly
Not technical
Customization
The POV of the system
Efficiency
Management of data and/or data
Former times: POV of the system
Modern times: POV of the user
Different categories of OS’s
Single user OS
Multi-tasking
Batch processing
Multi-processing
Multi-programming
Real time operating system
Distributed data processing
Goal of the OS
The goal of the OS is to be the manager.
Some functions:
Booting
Memory management
Loading & Execution
Data security
Disk/ device management
Process management
The kernel
Kernelspace = system-, privileged-, supervisor-, secure-, unrestricted mode
Userspace = ordinary-, user-, restricted mode
The kernel is the essential foundation of a computer's operating system (OS). It is the core that
provides basic services for all other parts of the OS. Kernel has complete control and handles
everything.
System calls
In computing a system call is the programmatic way in which a
computer program requests a service from the kernel of the
operating system on which it is executed.
2 Operating Systems 2022-2023
,History of computers
Computer needed to automate math (counting)
First the hand & fingers
Chinese abacus
Pascal’s calculator (1642)
Leibniz calculating machine (started in 1671 – finished in 1694)
First “computer” (1822) – Charles Babbage (steam-powered)
o Ada Lovelace (Bryon)
Credited as world’s first computer programmer
Helped Babbage with the analytical engine/machine
“Ada” programming language
Jacquard’s Loom (1804)
o Punch Card = “program” = “set of instructions”
Tabulating Machine
o 1890 ~IBM
First programmable computer (1936-1938) – Konrad Zuse
o Considered to be the first electromechanical binary programmable computer and the
first really functional modern computer.
Alan Turing did crack the Enigma code where the Nazi’s made use of to encrypt secret
messages to communicate. (1936)
Beards
Ken Thompson
Kenneth Lane Thompson (born February 4, 1943) is an American pioneer of computer science.
Thompson worked at Bell Labs for most of his career where he designed and implemented the
original Unix operating system.
Invented UNIX for PDP-7: Ken Thompson invented Unix, it is a modular OS made up of a
number of essential components, including the kernel, shell, file system and a core set of
utilities or programs.
Invented B programming language: B is a programming language that was developed by Bell
Labs. The language is rarely used because it is replaced with the language C.
Google GO Language: GO is an open source programming language used for general
purpose. Go was developed by Google engineers to create dependable and efficient
software.
UTF-8 : Is only one of the possible ways of encoding Unicode characters.
Dennis Ritchie
Dennis MacAlistair Ritchie was an American computer scientist.[1] He is most well-known for
creating the C programming language and, with long-time colleague Ken Thompson,
Invented C language: C programming language is a machine-independent programming
language that is mainly used to create many types of applications and operating systems
such as Windows, and other complicated programs such as the Oracle database, Git, Python
interpreter, and games
3 Operating Systems 2022-2023
, The UNIX philosophy (Ken Thompson)
The Unix philosophy emphasizes building simple, compact, clear, modular, and extensible code
that can be easily maintained and repurposed by developers other than its creators.
4 core principles
1. Make each program do one thing well. To do a new job, build a fresh rather than
complicate old programs by adding new features.
2. Expect the output of every program to become the input to another, as yet unknown,
program. Don’t clutter output with extraneous information. Avoid stringently columnar or
binary input formats. Don’t insist on interactive input.
3. Design and build software, even operating systems, to be tried early, ideally within weeks.
Don’t hesitate to throw away the clumsy parts and rebuild them.
4. Use tools in preference to unskilled help to lighten a programming task, even if you have to
detour to build the tools and expect to throw some of them out after you’ve finished using
them.
Based on the first UNIX developers
Cultural & ethical approaches
Minimalist and modular software development
Monolithic Kernel
A monolithic kernel is an operating system software framework that holds all privileges to access
input/output (I/O) devices, memory, hardware interrupts and the CPU stack.
Microkernel
is the near-minimum amount of software that can provide the mechanisms needed to implement
an operating system (OS).
A microkernel is a kernel type that implements an operating system by providing methods, including
low-level address space management, IPC, and thread management. On the other hand, a
monolithic kernel is a type of kernel in which the complete OS runs in the kernel space.
4 Operating Systems 2022-2023