Operating system: Difference between revisions

From Computer Science Wiki
No edit summary
No edit summary
 
(28 intermediate revisions by the same user not shown)
Line 3: Line 3:
An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. All computer programs, excluding firmware, require an operating system to function.<ref>https://en.wikipedia.org/wiki/Operating_system</ref>
An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. All computer programs, excluding firmware, require an operating system to function.<ref>https://en.wikipedia.org/wiki/Operating_system</ref>


managing memory, peripherals and hardware interfaces.
For example, allocating storage and keeping track of programs
in memory, swapping between programs on time-slicing, priority or when one is waiting for input.


== Explain the role of an operating system ==


An operating system (OS) is the most crucial software that runs on a computer, as it manages and controls the entire system's resources and activities. In terms of managing memory, peripherals, and hardware interfaces, the OS has several key responsibilities:
=== Memory management ===
The OS is responsible for allocating and tracking memory usage by different programs and processes. This involves:
a. Allocation: The OS divides memory into segments and allocates them to various applications and processes as needed. This ensures that each program has enough memory to execute properly.
b. Protection: The OS ensures that one application or process cannot access another's memory space without proper authorization, thereby preventing data corruption or system crashes.
c. Virtual memory: The OS can extend the available memory by creating a virtual memory space, which is a portion of the hard disk used as if it were physical memory (RAM). This enables the computer to run larger applications or processes even when the physical memory is limited.
d. Paging and swapping: The OS can move data between RAM and secondary storage (e.g., hard disk) to optimize the use of available memory. Paging refers to the process of transferring fixed-sized memory blocks (pages) between RAM and the hard disk, while swapping refers to transferring entire processes.
=== Peripheral management ===
The OS is responsible for managing peripheral devices (e.g., keyboards, mice, printers, and storage devices) by:
a. Device drivers: The OS uses device drivers, which are software components that enable communication between the OS and peripheral devices. Drivers translate the OS's instructions into a language that the specific device can understand.
b. Input/output (I/O) scheduling: The OS schedules and prioritizes I/O operations for various devices to ensure efficient data transfer and to avoid conflicts between devices.
c. Buffering and caching: The OS uses buffers and caches to temporarily store data in memory during I/O operations. This allows the system to handle data transfers at varying speeds and minimizes the impact on performance.
=== Hardware interface management ===
The OS is responsible for interfacing with the underlying hardware components (e.g., CPU, GPU, RAM, and storage devices) and ensuring that they work together smoothly. This involves:
a. Processor management: The OS allocates CPU time to various processes and threads, ensuring that all applications receive an appropriate amount of computing resources. It also handles process scheduling, prioritization, and context switching.
b. Interrupt handling: The OS manages hardware interrupts, which are signals generated by hardware devices (e.g., keyboard, mouse, or network card) to notify the OS of an event that requires immediate attention. The OS processes these interrupts and takes appropriate action, such as updating the display or saving data to disk.
c. Power management: The OS optimizes the use of hardware resources to minimize power consumption, especially in battery-powered devices like laptops and smartphones. This involves techniques like adjusting CPU frequency, turning off unused devices, and managing sleep states.
In summary, the operating system plays a crucial role in managing memory, peripherals, and hardware interfaces. By efficiently allocating resources, ensuring data protection, and providing a stable platform for applications to run, the OS enables a seamless user experience and optimal system performance.


== Different operating systems ==  
== Different operating systems ==  
Line 13: Line 43:
# Linux
# Linux
# OS X  
# OS X  
# WIndows
# Windows
# iOS  
# iOS  
# Android OS  
# Android OS  
# Google chrome OS (Based on Linux)
# Google chrome OS (Based on Linux)
# Playstation OS (Orbis)
# Blackberry
# Nokia


== A good video about operating systems ==  
== A good video about operating systems ==  
Line 31: Line 64:
</html>
</html>


== Linux tools to view internal management of resources ==  
== Virtual memory ==
 
As we discuss the ways in which an operating system manages resources, we start to learn about virtual memory. A superb video can be found below to help you understand this:
 
<html>
<iframe width="560" height="315" src="https://www.youtube.com/embed/qlH4-oHnBb8" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>
</html>
 
== Tools to view internal management of resources ==  
An operating system also provides tools for managing the operating system. These are often called '''utilities''' or '''system tools'''. [[Media:Linux observability tools.png | Click here for a brilliant graphic showing the different types of tools you can use to view inside the Linux operating system]]. These tools give you insight and information for how the operating system is managing different resources. Below is a table with resources and tools to help you view how the OS is managing a particular resource.  
An operating system also provides tools for managing the operating system. These are often called '''utilities''' or '''system tools'''. [[Media:Linux observability tools.png | Click here for a brilliant graphic showing the different types of tools you can use to view inside the Linux operating system]]. These tools give you insight and information for how the operating system is managing different resources. Below is a table with resources and tools to help you view how the OS is managing a particular resource.  
<br />
<br />
Line 37: Line 78:
{| class="wikitable"
{| class="wikitable"
|-
|-
! Resource !!  Linux tools you can use to understand what is going on
! The OS manages !!  Linux tools you can use || OS X tools you can use
|-
| Memory || top, htop, free, vmstat
|-
|-
| Processes || top
| Memory || top, htop, free, vmstat || top, vm_stat, (gui) Activity monitor
|-
|-
| Files || File system, df, du, mount, lsof
| Processes || top || top, (gui) activity monitor
|-
|-
| Security || fstab
| Files || File system, df, du, mount, lsof  || lsof, (gui) activity monitor, mount, df -h
|-
|-
| CPU Scheduling || perf
| Security || fstab, last, who, /var/log/auth.log || last, who, (gui) console, ls -altr, groups
|-
|-
| Devices, Device I/O|| iotop, iostat
| CPU Scheduling || perf || (gui) Activity monitor
|-
|-
| Interrupts || perf
| Devices, Device I/O|| iotop, iostat || (gui) activity monitor
|-
|-
| The user interface, most often a [[GUI]] but also a [[CLI]] || we dont really monitor this
| Interrupts || perf || ??
|-
|-
| Networks || netstat, top, tcpdump, iptraf, iftop, nmon
| Networks || netstat, top, tcpdump, iptraf, iftop, nmon || netstat, lsof -i 4tcp
|}
|}


== Do you understand this topic? ==
== Families of Operating system ==
Thank you to Alex M. for finding this image!


* Describe the main functions of an operating system.
[[File:Os family tree.png|900px]]


== Do you have an advanced understanding about this topic? ==


* Describe '''how''' an operating system manages the functions you have just described above.


== Standards ==  
== Standards ==  

Latest revision as of 14:11, 21 March 2023

Operating system placement.svg.png

An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. All computer programs, excluding firmware, require an operating system to function.[1]


Explain the role of an operating system[edit]

An operating system (OS) is the most crucial software that runs on a computer, as it manages and controls the entire system's resources and activities. In terms of managing memory, peripherals, and hardware interfaces, the OS has several key responsibilities:

Memory management[edit]

The OS is responsible for allocating and tracking memory usage by different programs and processes. This involves:

a. Allocation: The OS divides memory into segments and allocates them to various applications and processes as needed. This ensures that each program has enough memory to execute properly.

b. Protection: The OS ensures that one application or process cannot access another's memory space without proper authorization, thereby preventing data corruption or system crashes.

c. Virtual memory: The OS can extend the available memory by creating a virtual memory space, which is a portion of the hard disk used as if it were physical memory (RAM). This enables the computer to run larger applications or processes even when the physical memory is limited.

d. Paging and swapping: The OS can move data between RAM and secondary storage (e.g., hard disk) to optimize the use of available memory. Paging refers to the process of transferring fixed-sized memory blocks (pages) between RAM and the hard disk, while swapping refers to transferring entire processes.

Peripheral management[edit]

The OS is responsible for managing peripheral devices (e.g., keyboards, mice, printers, and storage devices) by:

a. Device drivers: The OS uses device drivers, which are software components that enable communication between the OS and peripheral devices. Drivers translate the OS's instructions into a language that the specific device can understand.

b. Input/output (I/O) scheduling: The OS schedules and prioritizes I/O operations for various devices to ensure efficient data transfer and to avoid conflicts between devices.

c. Buffering and caching: The OS uses buffers and caches to temporarily store data in memory during I/O operations. This allows the system to handle data transfers at varying speeds and minimizes the impact on performance.

Hardware interface management[edit]

The OS is responsible for interfacing with the underlying hardware components (e.g., CPU, GPU, RAM, and storage devices) and ensuring that they work together smoothly. This involves:

a. Processor management: The OS allocates CPU time to various processes and threads, ensuring that all applications receive an appropriate amount of computing resources. It also handles process scheduling, prioritization, and context switching.

b. Interrupt handling: The OS manages hardware interrupts, which are signals generated by hardware devices (e.g., keyboard, mouse, or network card) to notify the OS of an event that requires immediate attention. The OS processes these interrupts and takes appropriate action, such as updating the display or saving data to disk.

c. Power management: The OS optimizes the use of hardware resources to minimize power consumption, especially in battery-powered devices like laptops and smartphones. This involves techniques like adjusting CPU frequency, turning off unused devices, and managing sleep states.

In summary, the operating system plays a crucial role in managing memory, peripherals, and hardware interfaces. By efficiently allocating resources, ensuring data protection, and providing a stable platform for applications to run, the OS enables a seamless user experience and optimal system performance.

Different operating systems[edit]

  1. Linux
  2. OS X
  3. Windows
  4. iOS
  5. Android OS
  6. Google chrome OS (Based on Linux)
  7. Playstation OS (Orbis)
  8. Blackberry
  9. Nokia

A good video about operating systems[edit]


An excellent video about operating systems[edit]

Virtual memory[edit]

As we discuss the ways in which an operating system manages resources, we start to learn about virtual memory. A superb video can be found below to help you understand this:

Tools to view internal management of resources[edit]

An operating system also provides tools for managing the operating system. These are often called utilities or system tools. Click here for a brilliant graphic showing the different types of tools you can use to view inside the Linux operating system. These tools give you insight and information for how the operating system is managing different resources. Below is a table with resources and tools to help you view how the OS is managing a particular resource.

The OS manages Linux tools you can use OS X tools you can use
Memory top, htop, free, vmstat top, vm_stat, (gui) Activity monitor
Processes top top, (gui) activity monitor
Files File system, df, du, mount, lsof lsof, (gui) activity monitor, mount, df -h
Security fstab, last, who, /var/log/auth.log last, who, (gui) console, ls -altr, groups
CPU Scheduling perf (gui) Activity monitor
Devices, Device I/O iotop, iostat (gui) activity monitor
Interrupts perf ??
Networks netstat, top, tcpdump, iptraf, iftop, nmon netstat, lsof -i 4tcp

Families of Operating system[edit]

Thank you to Alex M. for finding this image!

Os family tree.png


Standards[edit]

  • I can explain the role of the operating system in terms of managing memory, peripherals and hardware interfaces.

References[edit]