Classifying Peripheral Devices, Explained

UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 5.4 Free with a free account

Classifying Peripheral Devices

Introduction to Operating Systems · Chapter 5: Peripheral Devices and I/O SystemsSection 5.4 · lesson 39 of 837 min · free with a free account

← The System BusNext lesson: Device Access Methods →

A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

In this lesson

Sorting devices by data direction and by character, block or network shape.

  • Classify devices by direction as input, output, both or storage
  • Distinguish character devices from block devices and network devices
  • Relate block devices to direct access and streams to sequential access
  • Explain how the operating system handles each device class differently

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (906 words). Read along, or search it.

Opening Question

Streams Versus Numbered Chunks

A keyboard can only talk to the computer. A monitor can only listen. A touchscreen does both, and a drive remembers whatever you tell it. But the operating system sees a different divide. Some devices hand over a stream of bytes as they happen. Others let you ask for chunk number seven. Which kind a device is changes how the system must treat it. So how do we sort them? Let's find out.

By Direction

Input, Output, Both and Storage

The simplest sort asks one question: which way does the data travel, relative to the processor? Input devices send data into the computer: a keyboard, a mouse, a microphone, a barcode scanner. Output devices take data out of it: a monitor, speakers, a receipt printer. Some carry data both ways: a touchscreen, a network adapter, a headset with a microphone. And storage devices write data to keep it, and read it back later: a hard drive, an SSD, a USB stick. They do input and output too, but their special purpose is keeping data, so they get a class of their own.

Quick Check

A Controller That Rumbles

Quick check. A game controller has buttons and a joystick. And when your car crashes in the game, it rumbles in your hands. Which class is it: input only, output only, or both? Pause, and decide. Both. The buttons and the joystick send data in. The rumble is the computer sending a command out, to a little motor inside. Input is the tempting answer, because we think of controllers as things we press. But the moment it rumbles, data is flowing the other way.

By Data Shape

Character Devices and Block Devices

The operating system asks a second question: what shape is the data? A character device sends or takes data as a stream of single bytes, one after another, in order. You can't ask a keyboard for the five hundredth key you pressed last week. You get each keystroke as it happens. Keyboards, mice, serial lines, scanners, and most printers are character devices. A block device stores data in fixed-size chunks called blocks, each with its own number. You can ask for block seven, then block two, then block nine hundred, in any order. That's called random access. Hard drives, SSDs, USB sticks, and optical discs are block devices.

Third Kind

Network Devices and Packets

Operating systems often add a third kind, just for network adapters. A Wi-Fi adapter is neither a clean stream nor a set of numbered blocks. Its data arrives in packets, at moments nobody controls, and some packets can be lost. You'll meet packets properly in lesson 8.3.

Access Methods

Jumping Ahead Versus Passing Through

The shape gives two ways of getting at data. Block devices allow direct access: jump straight to a numbered block. A stream allows only sequential access, and so does an old tape. To reach the five hundredth item, you pass the first four hundred ninety-nine. Disks sit in the middle. They offer direct access to blocks, but they're still read faster in order.

Real Case

A Scanner That Remembers Nothing

Sam, who runs a small online bakery, once asked why the barcode scanner never remembers the last bag it scanned. Ivy, who looks after the computers at a school, explained. It's a character device. It hands you each code once, as it happens, and keeps nothing. If your program isn't listening at that moment, the code is gone. So Sam's order program now listens all day. The external drive is the opposite. As a block device, it keeps every block until Sam writes over it.

Two Labels

Direction and Shape Together

So every device gets two labels, and they answer separate questions. Here's Sam's shop, sorted both ways. The keyboard and the scanner are input, and character. The receipt printer is output, but still character. The external drive and the laptop's SSD are storage, and block. And the Wi-Fi adapter works in both directions, and it's a network device. A common mistake is treating direction and shape as one question. They're two questions, so answer both.

OS Handling

Buffers, Reordering and Block Caches

Why does the operating system care? Because each kind needs different handling. For a character device, it passes the bytes straight through, in the order they arrive. It may hold them in a small waiting area, a buffer, so a fast typist's burst isn't lost. But there's no going back to byte twelve. For a block device, it can reorder requests so the drive does less work. And it can keep recently used blocks in memory, so a later read skips the device. That's a cache. The file system, in lesson 6.2, sits on top of block devices. And for a network device, it must handle data that turns up at any moment, or never arrives at all.

Quick Check

A Dashcam Memory Card

Quick check. A dashcam in a car saves its video to a small memory card. The playback app jumps straight to minute forty of yesterday's drive, without reading the first thirty-nine minutes. Is the memory card a character device, a block device, or a network device? Pause, and decide. A block device. Jumping straight to a spot, without passing everything before it, is exactly what numbered blocks allow. Character device is the tempting pick, because the video plays like a stream. But how you watch it doesn't decide anything. The card can be asked for any block, in any order.

Key Takeaways

Two Questions for Every Device

To recap. By direction, a device is input, output, both, or storage. By shape, it's a character device, a stream, or a block device, with numbered chunks. Network devices are a third kind: packets, at any moment, and some get lost. And the class decides how the operating system handles it.

About Introduction to Operating Systems at UPI Study

Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Classifying Peripheral Devices

What is the difference between a character device and a block device?
A character device sends or receives data as a stream of single bytes in order, while a block device stores data in fixed-size, numbered blocks that can be read in any order. Keyboards, mice, serial lines and most printers are character devices. Hard drives, SSDs, USB sticks and optical discs are block devices, which allow random, direct access to any block.
Is a game controller an input or output device?
A game controller with rumble is both an input and an output device. Its buttons and joystick send data into the computer, while its rumble motor receives commands sent out from the computer. People often call it input only, because they think of controllers as things to press, but whenever it vibrates in response to the game, data is flowing the other way.
Why are network adapters treated as a separate device class?
Network adapters get their own class because their data fits neither the character model nor the block model. Data arrives in packets at moments nobody controls, and some packets may be lost along the way. The operating system must therefore handle data that turns up at any time or never arrives, which differs from a steady byte stream or a set of numbered blocks.
How does an operating system handle block devices differently from character devices?
For block devices, the operating system can reorder requests so the drive does less work, and it can cache recently used blocks in memory so later reads skip the device. For character devices, it passes bytes straight through in arrival order, perhaps through a small buffer so a fast burst is not lost, but it cannot go back to an earlier byte.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Introduction to Operating Systems.

83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Updated

Introduction to Operating Systems
3 credits · NCCRS
Enroll →