#author("2018-07-16T14:24:34+09:00","","")
[[FrontPage]]

I/O devices, esp. flash memory (basic physics, performance characteristics, device capacity and density trends)

* I/O Devices [#vcc49f62]

** Introduction [#geb0af7b]
In the context of computer systems, I/O refers to input and output.  Input is the data received by a system or component, and output is the processed data that is sent out from a device.  In modern computer systems, I/O devices are those that send and receive data.  This can be in the form of a storage device, such as a hard disk drive (HDD), solid state drive (SSD), CD/DVD/BD drive reader, or a communications device such as a network interface card or Bluetooth adapter.

Within a computer system, individual programs also have a concept of I/O.  Data input from a keyboard or mouse is frequently used to control a program or piece of software, and the graphics displayed on a monitor or printed out from a connected printer are the result of programs running on the computer.  In addition, computers use data from other devices and computers as both input and output (as when transmitting data over Ethernet, Wi-fi, or Bluetooth).

** Buses! (not Twin Liner) [#g6a21759]
In a computer system, I/O devices are generally connected to the rest of the system via a bus dedicated for I/O.  However, due to cost and physical reasons, buses in a system follow a hierarchical structure.  It costs more to engineer and develop high speed buses, so memory buses and the like are generally unable to fit many devices.  Likewise, a lower-speed bus dedicated for storage can fit many more devices on it, allowing the system to accommodate more devices of that type.

[](diagram from OSTEP)

Thus, devices with higher performance demands tend to be located closer to the CPU while lower performance devices and components are farther away.  This hierarchical design structure allows system designers to balance the needs of few, high-performance components, such as memory, with the flexibility of being able to add numerous slower devices, as in the case of hard disks and external USB devices.

** I/O types [#tfbe3634]
In a computer system, there are two types of I/O: synchronous and asynchronous.  Asynchronous I/O occurs when I/O occurs concurrently with CPU execution, whereas synchronous I/O will force the CPU to wait while I/O occurs.

** Device-specific handling [#e302fa33]
In order for a computer to be able to communicate with a device, the computer needs a driver, which is a software module that interfaces with a specific device and translates commands between an I/O device and the CPU.  Drivers may vary between devices and vendors.

** Properties of flash storage [#m7ae99dc]
Flash storage is a form of solid-state storage that can be used to store data in a nonvolatile way.  There are two main types of flash storage, named after NAND and NOR logic gates.  The two types have similar behavioral characteristic properties as the logic gates they are named after, and their names are taken from interconnect structure between memory cells.  For NAND, cells are connected in a serial manner and can only be accessed via pages.  NOR on the other hand are connected in parallel and thus, allow for random-access reading.

With regards to physical resources, NOR flash costs more to produce because they require parallel connections for all flash chips, whereas NAND flash requires only a serial connection (with the previously mentioned drawback of accessing via pages).

Reading from NOR memory is accomplished similarly to reading from RAM due to the parallel connection structure of each of the internal chips.  NAND is accessed in a similar way to traditional hard disks or other block devices, where each block consists of a series of pages, which are typicall 512 (2^9), 2048 (2^11), or 4096 (2^12) bytes in size.  Each page also usually has a few associated bytes that can be used to store a code for error correction purposes.

NAND relies on this error correction code to detect and/or accomodate bits that may fail during normal device operation.  In particular, devices may be shipped from the manufacturer with a certain number of blocks that are already bad/failed.  By using an internal scheme to mark and avoid use of bad blocks, manufacturers can achieve significantly higher production than if all blocks in a device needed to be verified as good.  As a cost tradeoff, costs are significantly reduced while performance is only slightly reduced in comparison.

** Development of flash storage [#u422e9f4]
Flash chip capacity tends to follow Moore's Law because flash chips are manufactured with many of the same techniques, equipment, and components as processing chips.  Chips store data in exact multiples of 2, but flash memory devices generally ship with a higher-than-advertised capacity.  This is to provide distribution of wear across all the individual chips within the device, provide backup capacity for failed chips, and to store error correction codes or other internal device metadata.  In 2018, it is not uncommon to find 32GB USB flash drives or SD cards, and many laptops now ship with upwards of 500GB SSDs.  Apple's July 2018 Macbook Pro has an option for a 4TB SSD.  However, approximately ten years ago, it was much more common to find flash drives on the order of 1 to 2 GB in advertised capacity.

** Sources [#s5fbffef]
- OSTEP chapter on I/O (http://pages.cs.wisc.edu/~remzi/OSTEP/file-devices.pdf)
- Wikipedia page on flash memory (https://en.wikipedia.org/wiki/Flash_memory)



トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS