Please enable JavaScript.
Coggle requires JavaScript to display documents.
Devices and I/O (Architecture (Bus (Configuration (The CPU is generally…
Devices and I/O
Architecture
Bus
-
Peripheral Bus
Lower level bus where connections such as: SCSI, SATA, or USB are connected.
-
Configuration
The CPU is generally connected to the main memory via the memory bus. The memory bus is connected to the peripheral bus via a bus bridge.
-
SYS/161
In SYS/161 LAMEbus is the bus that connects all devices together. SYS/161 supports: hardware timers, disk drivers, serial consoles and network interfaces
We control each device by writing to their:
- Command/control registers (controlling the device)
- Status registers (querying the device status)
- Data registers (transferring data between the processor and device)
-
Basic Protocol
- OS polls the device until it is not busy
- OS writes data to data register
- OS writes command to command register
- OS waits until device completes command
This doesn't make good use of the CPU as when a process is polling for the device the CPU is available but not doing anything
Improvement:This can be improved by using interrupts:
- OS issues the request of the device,
- Process is put to sleep. Context switch to another process
- When the device finishes with the request it'll issue an interrupt.
- OS jumps to the interrupt handler where the request is finished
-
-
-
SSD (Solid State Drive)
-
-
-
Wear Leveling
-
If a block is no longer writable it becomes read-only and if enough blocks become unwritable than the disk becomes read-only
-
Advantages
- Faster access time
- No mechanical parts
- Operate at larger temperature ranges
Disadvantages
- Limited lifespan
- Data unrecoverable from dead drives
Hard Disk Drives
Interface
A modern disk drive is made up of a bunch of sectors. Each sector is 512 bytes. Sectors are number 0 to n - 1.
-
-
Disk Head Scheduling
The purpose of scheduling is so we can reduce the seek time by controlling the order in which requests are serviced.
In order for scheduling to be effective there needs to be a queue of outstanding requests (since we wouldn't be able to reorder anything if there was only one)
-
-
Elevator (SCAN)
The disk head travels from the outer track to the inner track and back servicing requests as they appear. If a request appears while the head is servicing in one direction it will not back-track to get it. It'll get it on its return the other direction