0% found this document useful (0 votes)
8 views14 pages

Introduction to Operating Systems Overview

Uploaded by

rofpitchayuth
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views14 pages

Introduction to Operating Systems Overview

Uploaded by

rofpitchayuth
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Lecture 1

Introduction to Operating System


From previous semester …
• Every second:
– Millions instructions are fetched by a processor (from a
memory),
– then decoded (processor figure out what instruction it is),
– then executed (and maybe write)
• In this class, we will learn that while a program is run, a lot
of other things are going on…and
• There is a body of software that is responsible for
– making programs run
– Allowing programs to share memory
– Enabling programs to interact with devices
–Operating
Etc. System is in charge of making sure that the system operates
correctly and efficiently in an easy-to-use manner
Things covered in this course
Lectures Mini Projects
• Introduction to OS (1 wk) • Project 1 – Compile and
• Part I – Virtualization (5 wks) build an OS
– Processor
– Memory
• Project 2 – Study and
• Part II – Concurrency (4 wks) present in details, a few key
– Thread API components of an OS
– Locks and Semaphores • Project 3 – Modify some
– Deadlock
modules in the kernel
• Part III – Persistence (2 wks)
– I/O System
– File System
– Storage and Mass-Storage
Management
Virtualization
• OS takes a physical resources (processor, memory,
disk, etc) and transform it into a more general,
powerful virtual form of itself.
– Ex OS can turn a single CPU into a seemingly infinite
number of CPUs – virtualizing the CPU
• Sometime, we refer to OS as a virtual machine
• OS allows CPUs, memory, I/O to be shared, thus it
can also be called a resource manager.
• OS provides APIs (system calls) to applications in
order to access resources.
Processor
• Q: If two programs want to run at the same
time, then what ?
• Q: Who (which program) gets what (which
resources), and when ?
– Policies, many and many of them
– APIs for user programs to communicate desired
activities to the OS.
Memory (1)
• Is accessed all the time when a program is
running.
– Programs keep all data in memory, and accesses
them through various instructions (lw, sw)
– Programs’ instructions are also stored in the
memory
P1 P2
main () main ()
{ {
int *p= malloc (sizeof(int))l int *p= malloc (sizeof(int))l
*p = 0; *p = 0;
} }
Memory (2)

• Q: when P1 and P2 are running their program, it


always appear that the value can be updated
independently, why ?
– Each running program has its own private memory
(private address space), which can be mapped onto
the physical memory
– A memory reference within one program does not
affect address space of others.
– OS is virtualizing memory
It’s all about ‘Concurrency’
• OS has to juggle many things at once, which leads
to some interesting problems.
• Ultimate Goal: how to make all programs execute
with correct conditions
– What techniques are needed from the OS
– What mechanisms should be provided by the hardware
– How can we use them to solve the problems
• Multi-threaded programs also exhibit the same
problems
– Solutions are different from OS-level concurrency as
threads share same address space.
Persistence
• In memory, data can be easily lost, as DRAM is
volatile.
– Power out -> data lost
– System crash -> data lost
• We need a disk drive for long-lived information.
• Thus, OS must manage the disk(s) in addition to
other things. This is called a file system.
• The file system stores files in a reliable and
efficient manner on the disk(s)
• No abstraction here, OS does not create a private,
virtualized disk for each application, why ?
Building an OS, we must consider ..
• Abstractions: make it convenient and easy to use through
virtualization
• High performances: minimizing overheads (extra time, extra
space)
• Isolation: protection schemes between applications (malicious
or accidental bad behavior of one does not harm others)
• Reliability: OS runs non-stop. However, when it fails, all
applications fail as well. Millions lines of code are dedicated
to reliability.
• Energy-efficiency: green world, longer battery usage time
• Security: against malicious applications
• Mobility: for smaller devices
Operating system takes physical resources and
virtualizes them. It also handles concurrency
and persistence issues as well as others

Now… let’s look at the history of OS


Early days of Mainframe
• Early OS: just libraries of commonly used functions such
as I/O manipulations
– One program at a time, controlled by a human (human-
scheduler).
• Libraries with Protection: code run on behalf of OS is
special; it should be treated differently from others
– Cannot allow any program to access anywhere on the disk
(privacy).
– Modes of execution is added: user and kernel
– In contrast to a procedure call, a system call transfers control
into the OS, raising the hardware privilege level. This allow full
access to hardware of the system.
• Initiate I/O requests
• Make more memory available to a program
Multiprogramming on Minicomputer
• To make better use of machine resources, people pay
lots of attention to multiprogramming.
• Instead of running one job at a time, OS load a number
of jobs into memory and swatch between them,
improving CPU utilization.
• I/O is slow, doing this CPU does not have to wait.
• Issues arise:
– Memory protection
– Interrupts (must make sure OS is working correctly)
• Leads to the introduction of UNIX and with it the C
language !
The Modern Era of PCs
The concept: “one machine per desktop instead of
a shared minicomputer per workgroup”.
• People forgot to look at what’re good in the
minicomputer OS. So…..
• DOS: memory protection is absent
• Mac OS (1st gen): poor job scheduling
After some years of trying
• Windows NT incorporated features from
minicomputer OS
• Mac OS X had UNIX at its core

Common questions

Powered by AI

Concurrency in operating systems presents challenges such as ensuring that multiple programs execute under correct conditions, preventing race conditions, deadlocks, and ensuring proper synchronization between processes . Strategies to manage these challenges include implementing thread APIs, using locks and semaphores, and utilizing deadlock prevention mechanisms . The OS must also provide hardware-mechanisms that facilitate solutions to concurrency issues .

Virtualization in modern operating systems facilitates resource sharing and management by creating virtual instances of physical resources like CPUs, memory, and I/O systems . This allows multiple applications to operate concurrently on shared hardware, optimizing resource utilization and enabling efficient computing . Additionally, virtualization provides a controlled environment that enhances security and isolation between different programs .

Modern multi-tasking operating systems evolved from early OS efforts to improve machine resource usage. Initially, operating systems were just libraries facilitating I/O operations, with one program running at a time . The introduction of multiprogramming allowed multiple jobs in memory, switching between them to enhance CPU utilization . This necessitated features like memory protection and system interrupts to ensure OS correctness and efficiency, leading to the development of UNIX, which influenced subsequent systems like Windows NT and Mac OS X that incorporated these multiprogramming principles .

An Operating System achieves process virtualization by transforming physical resources like CPU and memory into general, powerful virtual forms. This allows a single physical CPU to appear as many virtual CPUs, enabling multiple programs to run concurrently as if each has its own processor . The benefits include resource sharing, increased CPU utilization, and efficient execution of programs due to virtualized resources being more flexible and better managed .

Historical advancements in operating systems, particularly the shift towards multi-tasking and memory protection, facilitated the introduction of UNIX . UNIX integrated a robust C language for system programming, laying a foundation for more advanced operating systems. It influenced subsequent systems by providing principles of process synchronization, efficient resource management, and an architecture that supported complex applications. These features profoundly shaped modern systems like Windows NT and macOS, embedding UNIX core elements within them .

Multi-threading is problematic due to the shared address space among threads, which can lead to race conditions and require precise synchronization to prevent errors . This differs from other concurrency management forms, such as process-level concurrency, where each process has its private memory space, reducing the risk of interference but requiring more complex inter-process communication mechanisms . The OS must differentiate and handle these concurrency types to maintain stability and performance.

Early personal computer operating systems like DOS lacked features such as memory protection and efficient job scheduling, which negatively impacted their performance compared to minicomputer OSes that emphasized these features for better resource management . The absence of such features in DOS led to poor system stability, whereas minicomputers utilized UNIX principles for better performance .

Memory virtualization allows each running program to have its own private memory, or private address space, mapped onto the physical memory . This ensures that memory references within one program do not affect the address space of others, thereby guaranteeing isolation and preventing one program's memory operations from interfering with another's .

The primary responsibilities concerning data persistence include managing the file system to store files reliably on disk, which is crucial because memory, such as DRAM, is volatile and data can be lost after a power outage or system crash . The OS needs to ensure efficient and reliable long-term storage of data despite hardware failures .

When building an operating system, considerations include providing reliable abstractions, minimizing overheads for performance, implementing isolation to protect against faulty or malicious applications, ensuring the OS runs non-stop with extensive efforts toward reliability, and maintaining security against attacks . Additionally, features like energy efficiency and mobility might also be considered, especially for systems used on portable devices .

You might also like