Keyboard shortcuts

/ or ⌘/Ctrl K
Find a note
j / k
Next / previous section or linked note
h / l
Collapse or go to parent / expand or enter
e or Alt-click
Read a linked note here
o
Open focused note on its own
g g / G
First / last section or linked note
g h / g a
Home / all notes
g b / g t
Backlinks / table of contents
t
Cycle System, Light, Dark
? / Esc
Show / close this reference

Search: ↑/↓ or Ctrl N/P, Enter to open. Shortcuts pause while typing.

sectionioctl (Devices) [7aa79a42]

  • Devices are special file
  • /dev is devices
  • When we need to do IO on a device, just go out and access it!
  • Block special files and character special files

    • ls -l -> c for character file, b for block file
    • major and minor numbers, represents type of the device, and reprsents the instance

      • 4k major numbers, 2^20 minor numbers
    • mknod is used to make a device special file
    • Nothing special about these files! You can make them anywhere
    • udev is a program that sits there and creates files in the /dev directory

      • devices can register themselves or get a number assigned to them
    • much effort has gone into making devices work together
    • traditional device operations

      • open()
      • close()
      • read()
      • write()
      • seek()
      • ioctl

        • lets you do particular things to particular device
        • usually takes some integers (like everything in unix world)
    • block devices

      • tend to do I/O in terms of blocks
      • like disk drives
      • usually more random access
      • disks for example
    • character devices

      • operate in bytes
      • usually more seequential
      • mouse/audio card/printer/tape/terminal for example