UNIT 1-21CSC202J - Operating System
UNIT 1-21CSC202J - Operating System
UNIT I
Introduction
• What Operating Systems Do
• Computer-System Organization
• Computer-System Architecture
• Operating-System Structure
• Operating-System Operations
• Process Management
• Memory Management
• Storage Management
• Protection and Security
• Kernel Data Structures
• Computing Environments
• Open-Source Operating Systems
• OS is a resource allocator
– Manages all resources
– Decides between conflicting requests for efficient and
fair resource use
• OS is a control program
– Controls execution of programs to prevent errors and
improper use of the computer
Computer manufacturers often round off these numbers and say that a
megabyte is 1 million bytes and a gigabyte is 1 billion bytes. Networking
measurements are an exception to this general rule; they are given in bits
(because networks move data a bit at a time).
21CSC202J Operating Systems
12/28/23 17
UNIT 1
Storage Structure
• Main memory – only large storage media that the CPU can access directly
– Random access
– Typically volatile
• Secondary storage – extension of main memory that provides large
nonvolatile storage capacity
• Hard disks – rigid metal or glass platters covered with magnetic recording
material
– Disk surface is logically divided into tracks, which are subdivided
into sectors
– The disk controller determines the logical interaction between the
device and the computer
• Solid-state disks – faster than hard disks, nonvolatile
– Various technologies
– Becoming more popular
• File-System management
– Files usually organized into directories
– Access control on most systems to determine who can access what
– OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
• Use cases involve laptops and desktops running multiple OSes for
exploration or compatibility
– Apple laptop running Mac OS X host, Windows as a guest
– Developing apps for multiple OSes without having multiple
systems
– QA testing applications without having multiple systems
– Executing and managing compute environments within data
centers
• VMM can run natively, in which case they are also the host
– There is no general purpose host then (VMware ESX and Citrix
XenServer)
Touchscreen devices
require new
interfaces
Mouse not possible or not desired
Actions and selection based on
gestures
Virtual keyboard for text entry
Voice commands.
• Three most common APIs are Win32 API for Windows, POSIX API for
POSIX-based systems (including virtually all versions of UNIX, Linux, and
Mac OS X), and Java API for the Java virtual machine (JVM)
• File management
– create file, delete file
– open, close file
– read, write, reposition
– get and set file attributes
• Device management
– request device, release device
– read, write, reposition
– get device attributes, set device attributes
– logically attach or detach devices
21CSC202J Operating Systems
12/28/23 77
UNIT 1
Types of System Calls (Cont.)
• Information maintenance
– get time or date, set time or date
– get system data, set system data
– get and set process, file, or device attributes
• Communications
– create, delete communication connection
– send, receive messages if message passing model to host name
or process name
• From client to server
– Shared-memory model create and gain access to memory
regions
– transfer status information
– attach and detach remote devices
• Protection
– Control access to resources
– Get and set permissions
– Allow and deny user access
• Status information
– Some ask the system for info - date, time, amount of available
memory, disk space, number of users
– Others provide detailed performance, logging, and debugging
information
– Typically, these programs format and print the output to the
terminal or other output devices
– Some systems implement a registry - used to store and retrieve
configuration information
21CSC202J Operating Systems
12/28/23 85
UNIT 1
System Programs (Cont.)
• File modification
– Text editors to create and modify files
– Special commands to search contents of files or perform
transformations of the text
• Application programs
– Don’t pertain to system
– Run by users
– Not typically considered part of OS
– Launched by command line, mouse click, finger poke
21CSC202J Operating Systems
12/28/23 87
UNIT 1
Operating System Design and
Implementation
• Design and Implementation of OS not “solvable”, but some
approaches have proven successful
• Internal structure of different Operating Systems can vary widely
• Start the design by defining goals and specifications
• Affected by choice of hardware, type of system
• Improve performance by
removing bottlenecks
Example of following
XEventsQueued system call
move from libc library to
kernel and back
21CSC202J Operating Systems
12/28/23 107
UNIT 1
Dtrace (Cont.)