Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views11 pages

Lecture 1 - Fundamentals of Operating Systems - Overview

Uploaded by

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

Lecture 1 - Fundamentals of Operating Systems - Overview

Uploaded by

vincentngisa11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

BCIT 2230 – ADVANCED OPERATING SYSTEMS

Lecture 1: Operating Systems - Fundamentals and Introduction to Advanced Topics

1.1 Introduction to Operating Systems

• What is an Operating System (OS)?

o A program that acts as an intermediary between a user of a computer and


the computer hardware.

o Goals:

▪ Convenience: Make the computer easy to use.

▪ Efficiency: Manage hardware resources effectively.

▪ Extensibility: Allow for the evolution and addition of new


functionalities.

• Computer System Organization:

o Hardware: Provides basic computing resources (CPU, memory, I/O


devices).

o Operating System: Controls and coordinates the use of hardware among


various application programs and users.

o Application Programs: Solve the computing problems of the users


(compilers, databases, games, etc.).

o Users: People, machines, or other computers interacting with the system.

• Operating System Structure:

o Kernel: The core of the OS, responsible for managing the system's
resources. It runs in kernel mode (privileged).

o System Calls: Interface between user-level applications and the kernel.


Allow user programs to request services from the OS.

o System Programs (Utilities): Programs associated with the OS but are not
part of the kernel. They provide a convenient environment for program
development and execution (e.g., file managers, command interpreters).

• Operating System Operations:

o Resource Management: Allocating and managing computer resources


(CPU time, memory space, I/O devices).

o Process Management: Creating, scheduling, and terminating processes.

o Memory Management: Allocating and deallocating memory space.


BCIT 2230 – ADVANCED OPERATING SYSTEMS

o File Management: Creating, deleting, reading, writing, and managing files


and directories.

o I/O Management: Controlling and coordinating input and output devices.

o Protection and Security: Ensuring system resources are accessed in a


controlled manner and protecting against unauthorized access.

o Networking: Providing communication capabilities between computers.

• Protection and Security: Mechanisms to control access to system resources and


protect information.

• Distributed Systems: A collection of physically separate, possibly


heterogeneous, computer systems that are networked to provide the user with
access to the various resources the system maintains.

• Special-Purpose Systems: Real-time embedded systems, multimedia systems,


handheld systems, etc., with specific requirements.

• Computing Environments: Traditional, client-server, peer-to-peer, cloud


computing, etc.

• Open-Source Operating Systems: Linux, BSD, etc., where the source code is
publicly available.

1.2 Operating-System Structures

• Operating System Services: Functions provided by the OS to users and


applications:

o User Interface: Provides a means for users to interact with the OS (CLI,
GUI).

o Program Execution: Loading and running programs.

o I/O Operations: Providing access to I/O devices.

o File-System Manipulation: Creating, deleting, reading, writing, etc., files


and directories.

o Communications: Enabling communication between processes on the


same or different computers.

o Error Detection: Detecting and handling errors.

o Resource Allocation: Managing system resources.

o Accounting: Tracking resource usage.


BCIT 2230 – ADVANCED OPERATING SYSTEMS

o Protection and Security: Controlling access to resources.

• User Operating System Interface:

o Command-Line Interface (CLI): User interacts by typing commands.

o Graphical User Interface (GUI): User interacts through visual elements


like windows, icons, and menus.

• System Calls: The programming interface to the operating system kernel.


Typically written in C or C++.

o Provide the mechanism for user processes to request services from the
OS.

o Examples: fork(), exec(), read(), write(), open(), close().

• Types of System Calls:

o Process control

o File manipulation

o Device manipulation

o Information maintenance

o Communications

o Protection

• System Programs: System utilities that perform common tasks and are not part
of the kernel.

o File management, status information, file modification, programming


language support, program loading and execution, communications,
background services.

• Operating System Design and Implementation:

o Design Goals: User goals (easy to use, reliable, safe, fast) and system
goals (easy to design, implement, maintain, flexible, reliable, efficient).

o Implementation: Traditionally written in assembly language, now mostly


in higher-level languages like C and C++.

• Operating System Structure:

o Monolithic Structure: All OS components reside in the kernel. Simple but


can be difficult to manage and extend. (e.g., early versions of Unix).
BCIT 2230 – ADVANCED OPERATING SYSTEMS

o Layered Structure: OS is organized in layers, with each layer using the


services of lower-level layers. Simplifies design and debugging but can
have performance overhead.

o Microkernel Structure: Minimal kernel containing only essential functions


(process management, memory management, inter-process
communication). Other services are implemented as user-level
processes. Easier to extend and more secure but can have performance
overhead due to system calls.

o Hybrid Structure: Combines aspects of different structures (e.g., most


modern OS like Windows and Linux).

• Virtual Machines: Create an abstraction of the hardware, allowing multiple


operating systems to run concurrently on the same physical machine.

• Operating System Generation (Sysgen): The process of configuring and building


an OS tailored to specific hardware and user needs.

• System Boot: The process of starting a computer by loading the kernel into
memory and initializing the system.

1.3 Processes

• Process Concept: A program in execution. An active entity with a program


counter, a stack, and a data section.

• Process State: The current activity of a process:

o New: The process is being created.

o Running: Instructions are being executed.

o Waiting: The process is waiting for some event to occur (e.g., I/O
completion).

o Ready: The process is waiting to be assigned to a processor.

o Terminated: The process has finished execution.

• Process Control Block (PCB): A data structure maintained by the OS for each
process, containing information about the process:

o Process state

o Program counter

o CPU registers
BCIT 2230 – ADVANCED OPERATING SYSTEMS

o CPU scheduling information

o Memory management information

o Accounting information

o I/O status information

• Process Scheduling: The activity of managing the running and ready processes
and deciding which process gets the CPU.

o Process Scheduler (Short-term scheduler): Selects a process from the


ready queue to be executed.

o Job Scheduler (Long-term scheduler): Selects processes from the pool


of new processes and loads them into memory for execution.

• Operations on Processes:

o Process Creation: A parent process can create child processes using


system calls like fork().

o Process Termination: A process can terminate itself or be terminated by


its parent or the OS.

• Interprocess Communication (IPC): Mechanisms that allow processes to


communicate and synchronize their actions.

o Shared Memory: A region of memory that is shared between cooperating


processes. Requires synchronization mechanisms to avoid race
conditions.

o Message Passing: Processes communicate by exchanging messages. Can


be synchronous or asynchronous.

• Examples of IPC Systems: Pipes, message queues, sockets.

• Client-Server Communication: A common model where a server process


provides services to client processes.

1.4 Threads & Concurrency

• Overview of Threads: A lightweight unit of execution within a process. Multiple


threads can exist within a single process, sharing the same code section, data
section, and OS resources.

• Benefits of Threads:
BCIT 2230 – ADVANCED OPERATING SYSTEMS

o Responsiveness: Allows a program to continue running even if part of it is


blocked.

o Resource Sharing: Threads within the same process share resources,


reducing overhead.

o Economy: Creating and managing threads is generally faster than


processes.

o Utilization of Multiprocessor Architectures: Multiple threads can run in


parallel on different processors.

• User Threads vs. Kernel Threads:

o User Threads: Managed by a user-level threads library. The kernel is not


aware of their existence.

o Kernel Threads: Supported directly by the operating system. The kernel


manages and schedules kernel threads.

• Multithreading Models:

o Many-to-One: Many user threads are mapped to a single kernel thread.


Can have blocking issues.

o One-to-One: Each user thread is mapped to a separate kernel thread.


Provides better concurrency but can have overhead.

o Many-to-Many: Many user threads are mapped to a smaller or equal


number of kernel threads. Offers flexibility and good performance.

• Thread Libraries: Provide APIs for creating and managing threads (e.g., Pthreads,
Java threads).

• Implicit Threading: Thread creation and management are handled by compilers


and runtime libraries rather than explicit programming (e.g., thread pools, fork-
join).

• Threading Issues:

o fork() and exec() system calls: How they interact with multithreaded
processes.

o Signal Handling: How signals are delivered to threads.

o Thread Cancellation: Terminating a thread before it has completed.

o Thread-Local Storage: Allowing each thread to have its own copy of


certain data.
BCIT 2230 – ADVANCED OPERATING SYSTEMS

• Operating System Examples: How different OS handle threads (e.g., Windows,


Linux).

1.5 Memory Management (Brief Review)

• Basic Memory Management Requirements:

o Relocation: Ability to load and execute a process at different memory


locations.

o Protection: Preventing one process from accessing the memory of another


process.

o Sharing: Allowing multiple processes to access the same region of


memory.

o Logical Organization: How memory is viewed by the user (in terms of


segments, pages).

o Physical Organization: How memory is actually arranged in hardware.

• Contiguous Memory Allocation: Allocating a single contiguous block of memory


to a process.

o Fixed-Partition: Memory is divided into fixed-size partitions. Can lead to


internal fragmentation.

o Variable-Partition: Memory is allocated in variable-size partitions. Can


lead to external fragmentation.

• Paging: Dividing both logical and physical memory into fixed-size blocks called
pages and frames, respectively. Allows non-contiguous allocation.

• Segmentation: Dividing logical memory into variable-size segments, each


representing a logical unit (e.g., code, data, stack).

1.6 File Systems (Brief Review)

• File Concept: A named collection of related information recorded on secondary


storage.

• File Attributes: Name, type, size, location, protection, creation time, etc.

• File Operations: Creating, deleting, reading, writing, appending, renaming, etc.

• File Types: Executable, data, source code, object code, etc.

• File System Structure: How files and directories are organized on disk.

• Directory Structure: Organizing files into a hierarchical structure (tree-like).


BCIT 2230 – ADVANCED OPERATING SYSTEMS

1.7 I/O (Brief Review)

• I/O Devices: Peripherals used for input and output (keyboard, mouse, monitor,
disk drives, etc.).

• Device Controllers: Electronic circuits that control the operation of I/O devices.

• Direct Memory Access (DMA): Allows I/O devices to transfer data directly to or
from memory without CPU intervention.

• I/O Buffering: Temporarily storing data being transferred between an I/O device
and memory.

• Device Drivers: Software modules that provide an interface between the


operating system and specific hardware devices.

2. Introduction to Advanced Topics

Building upon these fundamental concepts, advanced operating system topics delve
deeper into the complexities of managing computer resources and providing
sophisticated functionalities. Here's a glimpse into some of these areas:

• Advanced Memory Management:

o Virtual Memory: Allowing processes to execute even if they are not entirely
in memory.

o Demand Paging: Loading pages into memory only when they are needed.

o Page Replacement Algorithms: Strategies for deciding which page to


remove from memory when a new page needs to be loaded (e.g., FIFO,
LRU, Optimal).

o Thrashing: A condition where the system spends most of its time swapping
pages, leading to poor performance.

• Advanced Process Management:

o Process Synchronization: Mechanisms to coordinate the execution of


multiple processes that share resources (e.g., semaphores, mutexes,
monitors).

o Deadlocks: A situation where two or more processes are blocked


indefinitely, waiting for each other to release resources.

o CPU Scheduling Algorithms: More complex algorithms for deciding which


process should run on the CPU (e.g., priority scheduling, round-robin,
multi-level queues).
BCIT 2230 – ADVANCED OPERATING SYSTEMS

• Advanced File Systems:

o File System Implementation: Details of how file systems are


implemented on disk (e.g., disk layout, metadata management).

o Directory Implementation: Techniques for organizing and managing


directories.

o Allocation Methods: Strategies for allocating disk space to files (e.g.,


contiguous, linked, indexed).

o Efficiency and Performance: Techniques for improving file system


performance (e.g., caching, buffering).

o Recovery: Mechanisms for restoring file system consistency after a crash.

• Distributed Operating Systems:

o Network Structures: Different ways to connect computers in a distributed


system.

o Distributed Coordination: Techniques for synchronizing and coordinating


processes across multiple machines.

o Distributed File Systems: Allowing users to access files located on


remote machines.

• Real-Time Operating Systems (RTOS):

o Characteristics: Time-critical applications with strict deadlines.

o Scheduling in RTOS: Specialized scheduling algorithms to meet real-time


constraints.

• Security in Operating Systems:

o Authentication: Verifying the identity of users and processes.

o Access Control: Mechanisms for restricting access to system resources.

o Malware: Understanding and mitigating threats like viruses, worms, and


trojans.

• Virtualization and Cloud Computing:

o Concepts: Creating virtual versions of hardware and operating systems.

o Types of Virtualization: Hardware virtualization, OS virtualization,


application virtualization.
BCIT 2230 – ADVANCED OPERATING SYSTEMS

o Cloud Models: Infrastructure as a Service (IaaS), Platform as a Service


(PaaS), Software as a Service (SaaS).

• Mobile Operating Systems:

o Specific challenges and features of OS designed for mobile devices (e.g.,


power management, touch interfaces, app management).

3. Key Challenges in Modern Operating Systems

Operating system design and research continue to face significant challenges in the face
of rapidly evolving technology and user demands.

3.1 Managing Hardware Complexity:

• Multi-core and Many-core Processors: Efficiently utilizing the parallelism


offered by multi-core architectures remains a significant challenge. OS need
sophisticated scheduling algorithms and programming models to take full
advantage of these resources.

• Heterogeneous Architectures: Systems are increasingly incorporating


specialized hardware like GPUs, FPGAs, and accelerators. OS need to manage
and coordinate these diverse processing units effectively.

• Memory Hierarchy: Optimizing data locality and managing the complex memory
hierarchy (caches, NUMA) is crucial for performance.

3.2 Dealing with Scale and Distribution:

• Cloud Computing: Managing resources and providing services in massive,


distributed cloud environments presents unique challenges in terms of
scalability, elasticity, and reliability.

• Big Data: Operating systems need to efficiently handle and process massive
datasets, often distributed across multiple nodes.

• Internet of Things (IoT): Managing a vast number of diverse and resource-


constrained IoT devices requires lightweight and specialized operating systems.

3.3 Ensuring Security in a Hostile Environment:

• Sophisticated Malware and Attacks: The threat landscape is constantly


evolving, with increasingly sophisticated malware and targeted attacks. OS need
to implement robust security mechanisms to protect against these threats.
BCIT 2230 – ADVANCED OPERATING SYSTEMS

• Privacy Concerns: Operating systems handle vast amounts of user data, raising
significant privacy concerns. Designing OS that protect user privacy while
providing necessary functionality is a major challenge.

• Trusted Computing: Establishing trust in the hardware and software components


of a system is becoming increasingly important.

3.4 Optimizing for Performance and Efficiency:

• Energy Efficiency: With the proliferation of mobile devices and the environmental
impact of large data centers, optimizing energy consumption is a critical concern.

• Real-Time Requirements: Supporting the growing demand for real-time


applications in areas like autonomous vehicles and industrial control systems
requires specialized OS features and scheduling algorithms.

• Low Latency and High Throughput: Many modern applications demand low
latency and high throughput, requiring continuous optimization of OS
components.

3.5 Supporting New Programming Models and Applications:

• Concurrency and Parallelism: Operating systems need to effectively support


modern programming models that leverage concurrency and parallelism.

• Emerging Technologies: OS need to adapt to and support new technologies like


persistent memory, quantum computing, and neuromorphic hardware.

• User Interface Evolution: Supporting diverse user interfaces, including


touchscreens, voice commands, and augmented/virtual reality, requires ongoing
OS development.

Conclusion:

Advanced Operating Systems is a dynamic and challenging field that continues to be at


the forefront of computing innovation. By understanding the fundamental concepts,
tracing the evolution of OS, and recognizing the key challenges facing modern systems,
we can gain a deeper appreciation for the complexities involved in managing the
resources of increasingly powerful and interconnected computing environments. This
course will equip you with the knowledge and critical thinking skills to analyze, design,
and contribute to the future of operating systems.

You might also like