SlideShare a Scribd company logo
I/O SYSTEM AND CASE STUDY
By
Hariharan.A
14BIT025
III B.Sc (IT)
 One of the important jobs of an Operating System is to manage various I/O
devices including mouse, keyboards, touch pad, disk drives, display adapters,
USB devices, Bit-mapped screen, LED, Analog-to-digital converter, On/off
switch, network connections, audio I/O, printers etc.
 An I/O system is required to take an application I/O request and send it to the
physical device, then take whatever response comes back from the device and
send it to the application. I/O devices can be divided into two categories −
 Block devices − A block device is one with which the driver communicates by
sending entire blocks of data. For example, Hard disks, USB cameras, Disk-
On-Key etc.
 Character devices − A character device is one with which the driver
communicates by sending and receiving single characters (bytes, octets). For
example, serial ports, parallel ports, sounds cards etc
DEVICE CONTROLLERS:
 Device drivers are software modules that can be plugged into an OS to handle a
particular device. Operating System takes help from device drivers to handle all
I/O devices.
 The Device Controller works like an interface between a device and a device
driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a
mechanical component and an electronic component where electronic
component is called the device controller.
 There is always a device controller and a device driver for each device to
communicate with the Operating Systems. A device controller may be able to
handle multiple devices. As an interface its main task is to convert serial bit
stream to block of bytes, perform error correction as necessary.
 Any device connected to the computer is connected by a plug and socket, and
the socket is connected to a device controller. Following is a model for
connecting the CPU, memory, controllers, and I/O devices where CPU and
device controllers all use a common bus for communication.
 Magnetic disks provide bulk of secondary storage of modern computers
 Drives rotate at 60 to 250 times per second
 Transfer rate is rate at which data flow between drive and computer
 Positioning time (random-access time) is time to move disk arm to
desired cylinder (seek time) and time for desired sector to rotate
under the disk head (rotational latency)
 Head crash results from disk head making contact with the disk
surface -- That’s bad
 Disks can be removable
 Drive attached to computer via I/O bus
 Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel,
SCSI, SAS, Firewire
 Host controller in computer uses bus to talk to disk controller built
into drive or storage array
OVERVIEW OF MASS STORAGE STRUCTURE
DIAGRAM:
 Can just attach disks, or arrays of disks
 Storage Array has controller(s), provides features to attached
host(s)
 Ports to connect hosts to array
 Memory, controlling software (sometimes NVRAM, etc)
 A few to thousands of disks
 RAID, hot spares, hot swap (discussed later)
 Shared storage -> more efficiency
 Features found in some file systems
 Snaphots, clones, thin provisioning, replication,
deduplication, etc
STORAGE ARRAY
MEMORY-MAPPED I/O
 When using memory-mapped I/O, the same address space is shared by memory and I/O devices. The device is
connected directly to certain main memory locations so that I/O device can transfer block of data to/from memory
without going through CPU.
 While using memory mapped IO, OS allocates buffer in memory and informs I/O device to use that buffer to send
data to the CPU. I/O device operates asynchronously with CPU, interrupts CPU when finished.
 The advantage to this method is that every instruction which can access memory can be used to manipulate an
I/O device. Memory mapped IO is used for most high-speed I/O devices like disks, communication interfaces.
Synchronous vs asynchronous I/O
Synchronous I/O − In this scheme CPU execution waits while I/O
proceeds
Asynchronous I/O − I/O proceeds concurrently with CPU execution
Communication to I/O Devices:
The CPU must have a way to pass information to and from an
I/O device. There are three approaches available to communicate with the
CPU and Device.
Special Instruction I/O
Memory-mapped I/O
Direct memory access (DMA)
Special Instruction I/O:
This uses CPU instructions that are specifically made for controlling I/O
devices. These instructions typically allow data to be sent to an I/O device
or read from an I/O device.
 Swap-space — Virtual memory uses disk space as an extension of main memory
 Less common now due to memory capacity increases
 Swap-space can be carved out of the normal file system, or, more commonly, it can
be in a separate disk partition (raw)
 Swap-space management
 4.3BSD allocates swap space when process starts; holds text segment (the
program) and data segment
 Kernel uses swap maps to track swap-space use
 Solaris 2 allocates swap space only when a dirty page is forced out of
physical memory, not when the virtual memory page is first created
 File data written to swap space until write to file system requested
 Other dirty pages go to swap space due to no other home
 Text segment pages thrown out and reread from the file system as
needed
 What if a system runs out of swap space?
 Some systems allow multiple swap spaces
SWAP-SPACE MANAGEMENT
DIRECT MEMORY ACCESS (DMA)
 Slow devices like keyboards will generate an interrupt to the main CPU
after each byte is transferred. If a fast device such as a disk generated an
interrupt for each byte, the operating system would spend most of its time
handling these interrupts. So a typical computer uses direct memory access
(DMA) hardware to reduce this overhead.
 Direct Memory Access (DMA) means CPU grants I/O module authority to
read from or write to memory without involvement. DMA module itself
controls exchange of data between main memory and the I/O device. CPU
is only involved at the beginning and end of the transfer and interrupted
only after entire block has been transferred.
 Direct Memory Access needs a special hardware called DMA controller
(DMAC) that manages the data transfers and arbitrates access to the system
bus. The controllers are programmed with source and destination pointers
(where to read/write the data), counters to track the number of transferred
bytes, and settings, which includes I/O and memory types, interrupts and
states for the CPU cycles.
DIAGRAM:
POLLING VS INTERRUPTS I/O
 A computer must have a way of detecting the arrival of any type of input. There
are two ways that this can happen, known as polling and interrupts. Both of
these techniques allow the processor to deal with events that can happen at any
time and that are not related to the process it is currently running.
 Polling I/O:
 Polling is the simplest way for an I/O device to communicate with the
processor the processor. The process of periodically checking status of the
device to see if it is time for the next I/O operation, is called polling.
 The I/O device simply puts the information in a Status register, and the
processor must come and get the information.
INTERRUPTS I/O
 An alternative scheme for dealing with I/O is the interrupt-driven method. An
interrupt is a signal to the microprocessor from a device that requires attention.
 A device controller puts an interrupt signal on the bus when it needs CPU’s
attention when CPU receives an interrupt, It saves its current state and invokes
the appropriate interrupt handler using the interrupt vector (addresses of OS
routines to handle various events). When the interrupting device has been dealt
with, the CPU continues with its original task as if it had never been interrupted.
BEGINNING OF WINDOWS
 In 1988, Microsoft decided to develop a “new
technology” (NT) portable operating system that
supported both the OS/2 and POSIX APIs
 Originally, NT was supposed to use the OS/2 API
as its native environment but during development
NT was changed to use the Win32 API, reflecting
the popularity of Windows 3.0.
ADVANTAGES OF WINDOWS
 Advantages over Windows
– It's almost free to relatively
inexpensive
– Source code is included
– Bugs are fixed quickly and help is
readily available through the vast
support in Internet
– Linux is more stable than Windows
– Linux is truly multi-user and multi-
tasking
– multiuser: OS that can simultaneously
serve a number of users
– multitasking: OS that can
simultaneously execute a number of
programs
– Linux runs on equipment that other
operating systems consider too
underpowered, e.g. 386 systems,
PDA, etc
 Microsoft has made several
advancements and changes that have
made it a much easier to use
Operating System, and although
arguably it may not be the easiest
Operating System
 Because of the large amount of
Microsoft Windows users, there is a
much larger selection of available
software programs, utilities, and
games for Windows.
DISADVANTAGES OF WINDOWS
Disadvantages of windows
 Although Microsoft Windows has made great
improvements in reliability over the last few versions of
Windows, it still cannot match the reliability ofLinux.
 to viruses and other attacks. Although Microsoft has made
great improvements over the years with security on their
Operating System,
their Operating System continues to be the most vulnerable
WINDOWS SYSTEM ARCHITECTURE
STATES OF PROCESS MANAGEMENT
 Running: A process will be in either running(current
process in system)or ready to run(waiting to be assigned
to system cpu)
 Waiting:The process is waiting for a resource or event.
Interputable waiting process can be interputable by
signals but are waiting directly on hardware conditions
and cannot be interpated
STATES OF PROCESS MANAGEMENT (CONTD)
 Stopped:The process can be stopped usually by
receiving a signal. A process that is being
debugged can be in a stopped state
 Zombie:This is a halted process which for some
reason still has task_struct data structure in task
vector.It is like a dead process
PROCESS MANAGEMENT IN WINDOWS
 A process contains its own independent virtual address
space with both code and data, protected from other
processes. Each process, in turn, contains one or more
independently executing threads. A thread running within a
process can execute application code, create new threads,
create new independent processes, and manage
communication and synchronization among the threads.
 By creating and managing processes, applications can have
multiple, concurrent tasks processing files, performing
computations, or communicating with other networked
systems. It is even possible to improve application
performance by exploiting multiple CPU processors
STATES OF PROCESS MANAGEMENT
 Ready:May be scheduled for execution. The microkernel dispatcher
keeps track of all ready threads and schedules them in priority order.
 Standby:A standby thread has been selected to run next on a particular
processor. The thread waits in this state until that processor is made
available. If the standby thread's priority is high enough, the running
thread on that processor may be preempted in favor of the standby
thread. Otherwise, the standby thread waits until the running thread
blocks orexhausts its time slice.
 Running:Once the microkernel performs a thread or process switch, the
standby thread enters the running state and begins execution and
continues execution until it is preempted, exhausts its time slice, blocks,
or terminates. In the first two cases, it goes back to the ready state
PROCESS MANAGEMENT WINDOWS
ADDRESS TYPES IN PHYSICAL MEMEORY
 The following is a list of address types used in Linux.
 User virtual addresses:These are the regular addresses seen by user-space programs. User addresses
are either 32 or 64 bits in length, depending on the underlying hardware architecture, and each
process has its own virtual address space.
 Physical addresses:The addresses used between the processor and the system's memory. Physical
addresses are 32- or 64-bit quantities; even 32-bit systems can use larger physical addresses in some
situations.
 Bus addresses:The addresses used between peripheral buses and memory. Often, they are the same
as the physical addresses used by the processor, but that is not necessarily the case. Some
architectures can provide an I/O memory management unit (IOMMU) that remaps addresses
between a bus and main memory. An IOMMU can make life easier in a number of ways (making a
buffer scattered in memory appear contiguous to the device, for example), but programming the
IOMMU is an extra step that must be performed when setting up DMA operations. Bus addresses
are highly architecture dependent, of course.
ADDRESS TYPES IN PHYSICAL MEMEORY
 Kernel logical addresses: These make up the normal address space of the kernel.
These addresses map some portion (perhaps all) of main memory and are often
treated as if they were physical addresses. On most architectures, logical addresses
and their associated physical addresses differ only by a constant offset. Logical
addresses use the hardware's native pointer size and, therefore, may be unable to
address all of physical memory on heavily equipped 32-bit systems. Logical
addresses are usually stored in variables of type unsigned long or void *. Memory
returned from kmalloc has a kernel logical address.
 Kernel virtual addresses: Kernel virtual addresses are similar to logical addresses in
that they are a mapping from a kernel-space address to a physical address. Kernel
virtual addresses do not necessarily have the linear, one-to-one mapping to physical
addresses that characterize the logical address space, however. All logical addresses
are kernel virtual addresses, but many kernel virtual addresses are not logical
addresses. For example, memory allocated by vmalloc has a virtual address (but no
direct physical mapping). The kmap function (described later in this chapter) also
returns virtual addresses. Virtual addresses are usually stored in pointer variables.
MEMORY MANAGEMENT IN WINDOWS
 Each process on 32-bit Microsoft Windows has its own virtual address space that enables
addressing up to 4 gigabytes of memory. Each process on 64-bit Windows has a virtual
address space of 8 terabytes. All threads of a process can access its virtual address space.
However, threads cannot access memory that belongs to another process, which protects
a process from being corrupted by another proces
 Virtual Address Space
 Memory Pools
 Memory Performance Information
 Virtual Memory Functions
 Heap Functions
 File Mapping
 Large Memory Support
 Global and Local Functions
 Standard C Library Functions
 Comparing Memory Allocation Methods
MEMORY MANAGEMENT IN WINDOWS
USER INTERFACE OF WINDOWS
 The Windows 9x user interface (9x refers to Windows 95
and Windows 98 together) is characterised by a bar at the
bottom of your screen (it may be moved to another edge
by left-mouse-clicking on it and dragging it to the
desired edge while continuing to hold down the mouse
button).
USER INTERFACE IN WINDOWS
 This bar is called the "taskbar." It includes:
 The "Start menu" (which contains shortcuts to
applications stored on your hard drive)
 The list of open windows on your desktop (the
Windows desktop is the entire portion of the screen
located above the taskbar, where shortcuts to
applications may be placed in the form of icons)
 Icons representing shortcuts to programs loaded in
the computer memory, and which can be configured
USER INTERFACE IN WINDOWS
 It includes the following shortcuts:
 Shut down: To shut down or restart a computer, or restart it in MS-DOS mode
 Run: Run a program using a command line (like in DOS). Arguments can be added to an
application (for example, in "dir /s", "/s" is an argument)
 Help: Windows online help
 Find: Lets you search for a file on the hard drive, or for another computer if you are on a
network
 Settings: This is the computer's "control center", where display, hardware, and software
settings can be configured.
 Programs: This contains links to your favorite programs. It can be modified by going to
Settings/Taskbar and Start menu, then clicking on Start menu
 The menu can include other shortcuts, too, such as: Documents: List of the most recently
opened documents
 Favorites: Lets you sort your favorite shortcuts, whether on the Internet or your hard
drive
 etc.
 Write-ahead log scheme requires stable storage
 Stable storage means data is never lost (due to failure, etc)
 To implement stable storage:
 Replicate information on more than one nonvolatile storage media
with independent failure modes
 Update information in a controlled manner to ensure that we can
recover the stable data after any failure during data transfer or
recovery
 Disk write has 1 of 3 outcomes
1. Successful completion - The data were written correctly on disk
2. Partial failure - A failure occurred in the midst of transfer, so only
some of the sectors were written with the new data, and the sector
being written during the failure may have been corrupted
3. Total failure - The failure occurred before the disk write started, so
the previous data values on the disk remain intact
STABLE-STORAGE IMPLEMENTATION

More Related Content

PDF
Unit 6
pm_ghate
 
PPTX
I/O Management
Keyur Vadodariya
 
PPT
Chapter 1 computer hardware and flow of information
Frankie Jones
 
PDF
Basics of Computer for Students
vethics
 
PPT
Organization of a computer
United International University
 
PPTX
COMPUTER SYSTEM AND ITS COMPONENTS
SHIVALI NEGI
 
PPTX
Basic computer in detail with pictures created by creativeness
Aparna Samal
 
Unit 6
pm_ghate
 
I/O Management
Keyur Vadodariya
 
Chapter 1 computer hardware and flow of information
Frankie Jones
 
Basics of Computer for Students
vethics
 
Organization of a computer
United International University
 
COMPUTER SYSTEM AND ITS COMPONENTS
SHIVALI NEGI
 
Basic computer in detail with pictures created by creativeness
Aparna Samal
 

What's hot (20)

PPT
Intro. to computer system
dofirfauzi1302
 
PDF
Chapter 2 Hardware and Software
Anjan Mahanta
 
PDF
Ict basics
jaimemgarcia
 
PDF
01 basic computer structure(20070122)
Prasanna Das
 
PDF
Computer system Hardware and Instruction
Sharad Kafle
 
PPT
HARDWARE
rubyrose dancil
 
PPTX
1.0 introduction to personal computer
Gagandeep Singh
 
PPT
Block diagram of a computer
ZTE Nepal
 
PPTX
Computer System Overview,
Sajid Marwat
 
PPT
Chapter1 introduction to computer systems
Muhammad Waqas
 
PPTX
Introduction to computers by abdul rahaman
Abdul-rahaman Bin Abubakar Suleman
 
PDF
0417 IGCSE ICT Chapter 1
Anthi Aristotelous
 
PPTX
Computer Hardware
Nikhil Sasikumar
 
PPTX
Computer peripheral or Peripheral Devices
Adarsh Kumar Yadav
 
DOC
computer System UNit Every thing
Abdul Rehman
 
PPTX
What's Inside
ramled931
 
PPSX
08. Central Processing Unit (CPU)
Akhila Dakshina
 
PPTX
hardware and software
sharone singh
 
PDF
computer system structure
HAMZA AHMED
 
PPT
Computer fundamental mba
Nilesh Mishra
 
Intro. to computer system
dofirfauzi1302
 
Chapter 2 Hardware and Software
Anjan Mahanta
 
Ict basics
jaimemgarcia
 
01 basic computer structure(20070122)
Prasanna Das
 
Computer system Hardware and Instruction
Sharad Kafle
 
HARDWARE
rubyrose dancil
 
1.0 introduction to personal computer
Gagandeep Singh
 
Block diagram of a computer
ZTE Nepal
 
Computer System Overview,
Sajid Marwat
 
Chapter1 introduction to computer systems
Muhammad Waqas
 
Introduction to computers by abdul rahaman
Abdul-rahaman Bin Abubakar Suleman
 
0417 IGCSE ICT Chapter 1
Anthi Aristotelous
 
Computer Hardware
Nikhil Sasikumar
 
Computer peripheral or Peripheral Devices
Adarsh Kumar Yadav
 
computer System UNit Every thing
Abdul Rehman
 
What's Inside
ramled931
 
08. Central Processing Unit (CPU)
Akhila Dakshina
 
hardware and software
sharone singh
 
computer system structure
HAMZA AHMED
 
Computer fundamental mba
Nilesh Mishra
 
Ad

Viewers also liked (13)

PPTX
Ecs1601
Una Mudimeli
 
PPTX
G8 bimester 1 week 1 challenges
Siorella Gonzales Sánchez
 
PDF
INFORME DE GESTION - SECRETARIA DE AGRICULTURA Y MEDIO AMBIENTE
Alcaldia Chigorodo
 
DOC
English 8 learning module quarter 1
Ignatius Joseph Estroga
 
PDF
10 Good Reasons: NetApp Data Fabric
NetApp
 
DOC
ENGLISH Grade 8 Q1 L1
Ignatius Joseph Estroga
 
PDF
module in english grade 8
Kyla Basco
 
PPTX
Evolución de la internet.
VALERIA GONZALEZ
 
PDF
How Data Drive Beyond Bank - Christian Miccoli (Conio)
Data Driven Innovation
 
DOCX
Pomorscy drogowcy przedstawili plan remontów na ten rok
RadioGdansk
 
DOCX
English learning package 2nd quarter
Francesca Rosel
 
PPTX
etapas de la dirección
suhailMB
 
PPTX
Dieta y presión arterial
Julita García
 
Ecs1601
Una Mudimeli
 
G8 bimester 1 week 1 challenges
Siorella Gonzales Sánchez
 
INFORME DE GESTION - SECRETARIA DE AGRICULTURA Y MEDIO AMBIENTE
Alcaldia Chigorodo
 
English 8 learning module quarter 1
Ignatius Joseph Estroga
 
10 Good Reasons: NetApp Data Fabric
NetApp
 
ENGLISH Grade 8 Q1 L1
Ignatius Joseph Estroga
 
module in english grade 8
Kyla Basco
 
Evolución de la internet.
VALERIA GONZALEZ
 
How Data Drive Beyond Bank - Christian Miccoli (Conio)
Data Driven Innovation
 
Pomorscy drogowcy przedstawili plan remontów na ten rok
RadioGdansk
 
English learning package 2nd quarter
Francesca Rosel
 
etapas de la dirección
suhailMB
 
Dieta y presión arterial
Julita García
 
Ad

Similar to IO SYSTEM AND CASE STUDY STRUCTURE (20)

PPTX
Operating System Case Study and I/O System
prakash ganesan
 
PPTX
Io system
Hero Prabhu
 
PPTX
Io system
malarselvi mms
 
PPT
In out system
Agnas Jasmine
 
PPTX
I/o management and disk scheduling .pptx
webip34973
 
PPT
5120224.ppt
dedanndege
 
PPT
02-archsupport.ppt Architecture Support for OPS
ssuserb53446
 
PPTX
Operating System Unit 1
SanthiNivas
 
PDF
Ch12 io systems
Welly Dian Astika
 
PPTX
Ch 7 io_management & disk scheduling
madhuributani
 
PPT
Computer Architecture & Organization.ppt
FarhanaMariyam1
 
PPTX
Lecture_01 Operating System Course Introduction
ArnoyKhan
 
PPT
chapter 4 Device Management systemss.ppt
danielarega25
 
PPT
Introduction To operating System:
Munazza-Mah-Jabeen
 
PPT
Weeks [01 02] 20100921
Mohamed Kamel
 
PPT
Ch13
tech2click
 
PPTX
Io management disk scheduling algorithm
lalithambiga kamaraj
 
PPTX
I/O Hardware-R.D.Sivakumar
Sivakumar R D .
 
PDF
MK Sistem Operasi.pdf
wisard1
 
Operating System Case Study and I/O System
prakash ganesan
 
Io system
Hero Prabhu
 
Io system
malarselvi mms
 
In out system
Agnas Jasmine
 
I/o management and disk scheduling .pptx
webip34973
 
5120224.ppt
dedanndege
 
02-archsupport.ppt Architecture Support for OPS
ssuserb53446
 
Operating System Unit 1
SanthiNivas
 
Ch12 io systems
Welly Dian Astika
 
Ch 7 io_management & disk scheduling
madhuributani
 
Computer Architecture & Organization.ppt
FarhanaMariyam1
 
Lecture_01 Operating System Course Introduction
ArnoyKhan
 
chapter 4 Device Management systemss.ppt
danielarega25
 
Introduction To operating System:
Munazza-Mah-Jabeen
 
Weeks [01 02] 20100921
Mohamed Kamel
 
Io management disk scheduling algorithm
lalithambiga kamaraj
 
I/O Hardware-R.D.Sivakumar
Sivakumar R D .
 
MK Sistem Operasi.pdf
wisard1
 

Recently uploaded (20)

PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Basics and rules of probability with real-life uses
ravatkaran694
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Virus sequence retrieval from NCBI database
yamunaK13
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 

IO SYSTEM AND CASE STUDY STRUCTURE

  • 1. I/O SYSTEM AND CASE STUDY By Hariharan.A 14BIT025 III B.Sc (IT)
  • 2.  One of the important jobs of an Operating System is to manage various I/O devices including mouse, keyboards, touch pad, disk drives, display adapters, USB devices, Bit-mapped screen, LED, Analog-to-digital converter, On/off switch, network connections, audio I/O, printers etc.  An I/O system is required to take an application I/O request and send it to the physical device, then take whatever response comes back from the device and send it to the application. I/O devices can be divided into two categories −  Block devices − A block device is one with which the driver communicates by sending entire blocks of data. For example, Hard disks, USB cameras, Disk- On-Key etc.  Character devices − A character device is one with which the driver communicates by sending and receiving single characters (bytes, octets). For example, serial ports, parallel ports, sounds cards etc
  • 3. DEVICE CONTROLLERS:  Device drivers are software modules that can be plugged into an OS to handle a particular device. Operating System takes help from device drivers to handle all I/O devices.  The Device Controller works like an interface between a device and a device driver. I/O units (Keyboard, mouse, printer, etc.) typically consist of a mechanical component and an electronic component where electronic component is called the device controller.  There is always a device controller and a device driver for each device to communicate with the Operating Systems. A device controller may be able to handle multiple devices. As an interface its main task is to convert serial bit stream to block of bytes, perform error correction as necessary.  Any device connected to the computer is connected by a plug and socket, and the socket is connected to a device controller. Following is a model for connecting the CPU, memory, controllers, and I/O devices where CPU and device controllers all use a common bus for communication.
  • 4.  Magnetic disks provide bulk of secondary storage of modern computers  Drives rotate at 60 to 250 times per second  Transfer rate is rate at which data flow between drive and computer  Positioning time (random-access time) is time to move disk arm to desired cylinder (seek time) and time for desired sector to rotate under the disk head (rotational latency)  Head crash results from disk head making contact with the disk surface -- That’s bad  Disks can be removable  Drive attached to computer via I/O bus  Busses vary, including EIDE, ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire  Host controller in computer uses bus to talk to disk controller built into drive or storage array OVERVIEW OF MASS STORAGE STRUCTURE
  • 6.  Can just attach disks, or arrays of disks  Storage Array has controller(s), provides features to attached host(s)  Ports to connect hosts to array  Memory, controlling software (sometimes NVRAM, etc)  A few to thousands of disks  RAID, hot spares, hot swap (discussed later)  Shared storage -> more efficiency  Features found in some file systems  Snaphots, clones, thin provisioning, replication, deduplication, etc STORAGE ARRAY
  • 7. MEMORY-MAPPED I/O  When using memory-mapped I/O, the same address space is shared by memory and I/O devices. The device is connected directly to certain main memory locations so that I/O device can transfer block of data to/from memory without going through CPU.  While using memory mapped IO, OS allocates buffer in memory and informs I/O device to use that buffer to send data to the CPU. I/O device operates asynchronously with CPU, interrupts CPU when finished.  The advantage to this method is that every instruction which can access memory can be used to manipulate an I/O device. Memory mapped IO is used for most high-speed I/O devices like disks, communication interfaces.
  • 8. Synchronous vs asynchronous I/O Synchronous I/O − In this scheme CPU execution waits while I/O proceeds Asynchronous I/O − I/O proceeds concurrently with CPU execution Communication to I/O Devices: The CPU must have a way to pass information to and from an I/O device. There are three approaches available to communicate with the CPU and Device. Special Instruction I/O Memory-mapped I/O Direct memory access (DMA) Special Instruction I/O: This uses CPU instructions that are specifically made for controlling I/O devices. These instructions typically allow data to be sent to an I/O device or read from an I/O device.
  • 9.  Swap-space — Virtual memory uses disk space as an extension of main memory  Less common now due to memory capacity increases  Swap-space can be carved out of the normal file system, or, more commonly, it can be in a separate disk partition (raw)  Swap-space management  4.3BSD allocates swap space when process starts; holds text segment (the program) and data segment  Kernel uses swap maps to track swap-space use  Solaris 2 allocates swap space only when a dirty page is forced out of physical memory, not when the virtual memory page is first created  File data written to swap space until write to file system requested  Other dirty pages go to swap space due to no other home  Text segment pages thrown out and reread from the file system as needed  What if a system runs out of swap space?  Some systems allow multiple swap spaces SWAP-SPACE MANAGEMENT
  • 10. DIRECT MEMORY ACCESS (DMA)  Slow devices like keyboards will generate an interrupt to the main CPU after each byte is transferred. If a fast device such as a disk generated an interrupt for each byte, the operating system would spend most of its time handling these interrupts. So a typical computer uses direct memory access (DMA) hardware to reduce this overhead.  Direct Memory Access (DMA) means CPU grants I/O module authority to read from or write to memory without involvement. DMA module itself controls exchange of data between main memory and the I/O device. CPU is only involved at the beginning and end of the transfer and interrupted only after entire block has been transferred.  Direct Memory Access needs a special hardware called DMA controller (DMAC) that manages the data transfers and arbitrates access to the system bus. The controllers are programmed with source and destination pointers (where to read/write the data), counters to track the number of transferred bytes, and settings, which includes I/O and memory types, interrupts and states for the CPU cycles.
  • 12. POLLING VS INTERRUPTS I/O  A computer must have a way of detecting the arrival of any type of input. There are two ways that this can happen, known as polling and interrupts. Both of these techniques allow the processor to deal with events that can happen at any time and that are not related to the process it is currently running.  Polling I/O:  Polling is the simplest way for an I/O device to communicate with the processor the processor. The process of periodically checking status of the device to see if it is time for the next I/O operation, is called polling.  The I/O device simply puts the information in a Status register, and the processor must come and get the information.
  • 13. INTERRUPTS I/O  An alternative scheme for dealing with I/O is the interrupt-driven method. An interrupt is a signal to the microprocessor from a device that requires attention.  A device controller puts an interrupt signal on the bus when it needs CPU’s attention when CPU receives an interrupt, It saves its current state and invokes the appropriate interrupt handler using the interrupt vector (addresses of OS routines to handle various events). When the interrupting device has been dealt with, the CPU continues with its original task as if it had never been interrupted.
  • 14. BEGINNING OF WINDOWS  In 1988, Microsoft decided to develop a “new technology” (NT) portable operating system that supported both the OS/2 and POSIX APIs  Originally, NT was supposed to use the OS/2 API as its native environment but during development NT was changed to use the Win32 API, reflecting the popularity of Windows 3.0.
  • 15. ADVANTAGES OF WINDOWS  Advantages over Windows – It's almost free to relatively inexpensive – Source code is included – Bugs are fixed quickly and help is readily available through the vast support in Internet – Linux is more stable than Windows – Linux is truly multi-user and multi- tasking – multiuser: OS that can simultaneously serve a number of users – multitasking: OS that can simultaneously execute a number of programs – Linux runs on equipment that other operating systems consider too underpowered, e.g. 386 systems, PDA, etc  Microsoft has made several advancements and changes that have made it a much easier to use Operating System, and although arguably it may not be the easiest Operating System  Because of the large amount of Microsoft Windows users, there is a much larger selection of available software programs, utilities, and games for Windows.
  • 16. DISADVANTAGES OF WINDOWS Disadvantages of windows  Although Microsoft Windows has made great improvements in reliability over the last few versions of Windows, it still cannot match the reliability ofLinux.  to viruses and other attacks. Although Microsoft has made great improvements over the years with security on their Operating System, their Operating System continues to be the most vulnerable
  • 18. STATES OF PROCESS MANAGEMENT  Running: A process will be in either running(current process in system)or ready to run(waiting to be assigned to system cpu)  Waiting:The process is waiting for a resource or event. Interputable waiting process can be interputable by signals but are waiting directly on hardware conditions and cannot be interpated
  • 19. STATES OF PROCESS MANAGEMENT (CONTD)  Stopped:The process can be stopped usually by receiving a signal. A process that is being debugged can be in a stopped state  Zombie:This is a halted process which for some reason still has task_struct data structure in task vector.It is like a dead process
  • 20. PROCESS MANAGEMENT IN WINDOWS  A process contains its own independent virtual address space with both code and data, protected from other processes. Each process, in turn, contains one or more independently executing threads. A thread running within a process can execute application code, create new threads, create new independent processes, and manage communication and synchronization among the threads.  By creating and managing processes, applications can have multiple, concurrent tasks processing files, performing computations, or communicating with other networked systems. It is even possible to improve application performance by exploiting multiple CPU processors
  • 21. STATES OF PROCESS MANAGEMENT  Ready:May be scheduled for execution. The microkernel dispatcher keeps track of all ready threads and schedules them in priority order.  Standby:A standby thread has been selected to run next on a particular processor. The thread waits in this state until that processor is made available. If the standby thread's priority is high enough, the running thread on that processor may be preempted in favor of the standby thread. Otherwise, the standby thread waits until the running thread blocks orexhausts its time slice.  Running:Once the microkernel performs a thread or process switch, the standby thread enters the running state and begins execution and continues execution until it is preempted, exhausts its time slice, blocks, or terminates. In the first two cases, it goes back to the ready state
  • 23. ADDRESS TYPES IN PHYSICAL MEMEORY  The following is a list of address types used in Linux.  User virtual addresses:These are the regular addresses seen by user-space programs. User addresses are either 32 or 64 bits in length, depending on the underlying hardware architecture, and each process has its own virtual address space.  Physical addresses:The addresses used between the processor and the system's memory. Physical addresses are 32- or 64-bit quantities; even 32-bit systems can use larger physical addresses in some situations.  Bus addresses:The addresses used between peripheral buses and memory. Often, they are the same as the physical addresses used by the processor, but that is not necessarily the case. Some architectures can provide an I/O memory management unit (IOMMU) that remaps addresses between a bus and main memory. An IOMMU can make life easier in a number of ways (making a buffer scattered in memory appear contiguous to the device, for example), but programming the IOMMU is an extra step that must be performed when setting up DMA operations. Bus addresses are highly architecture dependent, of course.
  • 24. ADDRESS TYPES IN PHYSICAL MEMEORY  Kernel logical addresses: These make up the normal address space of the kernel. These addresses map some portion (perhaps all) of main memory and are often treated as if they were physical addresses. On most architectures, logical addresses and their associated physical addresses differ only by a constant offset. Logical addresses use the hardware's native pointer size and, therefore, may be unable to address all of physical memory on heavily equipped 32-bit systems. Logical addresses are usually stored in variables of type unsigned long or void *. Memory returned from kmalloc has a kernel logical address.  Kernel virtual addresses: Kernel virtual addresses are similar to logical addresses in that they are a mapping from a kernel-space address to a physical address. Kernel virtual addresses do not necessarily have the linear, one-to-one mapping to physical addresses that characterize the logical address space, however. All logical addresses are kernel virtual addresses, but many kernel virtual addresses are not logical addresses. For example, memory allocated by vmalloc has a virtual address (but no direct physical mapping). The kmap function (described later in this chapter) also returns virtual addresses. Virtual addresses are usually stored in pointer variables.
  • 25. MEMORY MANAGEMENT IN WINDOWS  Each process on 32-bit Microsoft Windows has its own virtual address space that enables addressing up to 4 gigabytes of memory. Each process on 64-bit Windows has a virtual address space of 8 terabytes. All threads of a process can access its virtual address space. However, threads cannot access memory that belongs to another process, which protects a process from being corrupted by another proces  Virtual Address Space  Memory Pools  Memory Performance Information  Virtual Memory Functions  Heap Functions  File Mapping  Large Memory Support  Global and Local Functions  Standard C Library Functions  Comparing Memory Allocation Methods
  • 27. USER INTERFACE OF WINDOWS  The Windows 9x user interface (9x refers to Windows 95 and Windows 98 together) is characterised by a bar at the bottom of your screen (it may be moved to another edge by left-mouse-clicking on it and dragging it to the desired edge while continuing to hold down the mouse button).
  • 28. USER INTERFACE IN WINDOWS  This bar is called the "taskbar." It includes:  The "Start menu" (which contains shortcuts to applications stored on your hard drive)  The list of open windows on your desktop (the Windows desktop is the entire portion of the screen located above the taskbar, where shortcuts to applications may be placed in the form of icons)  Icons representing shortcuts to programs loaded in the computer memory, and which can be configured
  • 29. USER INTERFACE IN WINDOWS  It includes the following shortcuts:  Shut down: To shut down or restart a computer, or restart it in MS-DOS mode  Run: Run a program using a command line (like in DOS). Arguments can be added to an application (for example, in "dir /s", "/s" is an argument)  Help: Windows online help  Find: Lets you search for a file on the hard drive, or for another computer if you are on a network  Settings: This is the computer's "control center", where display, hardware, and software settings can be configured.  Programs: This contains links to your favorite programs. It can be modified by going to Settings/Taskbar and Start menu, then clicking on Start menu  The menu can include other shortcuts, too, such as: Documents: List of the most recently opened documents  Favorites: Lets you sort your favorite shortcuts, whether on the Internet or your hard drive  etc.
  • 30.  Write-ahead log scheme requires stable storage  Stable storage means data is never lost (due to failure, etc)  To implement stable storage:  Replicate information on more than one nonvolatile storage media with independent failure modes  Update information in a controlled manner to ensure that we can recover the stable data after any failure during data transfer or recovery  Disk write has 1 of 3 outcomes 1. Successful completion - The data were written correctly on disk 2. Partial failure - A failure occurred in the midst of transfer, so only some of the sectors were written with the new data, and the sector being written during the failure may have been corrupted 3. Total failure - The failure occurred before the disk write started, so the previous data values on the disk remain intact STABLE-STORAGE IMPLEMENTATION