CPS 445 Lecture notes: Terminal control



Coverage: [USP] §§6.5-6.6 (pp. 203-218)


Canonical vs. noncanonical modes of processing terminal input

  • canonical
    • line-at-a-time processing; read requests do not return until user enters a line delimiter (usually a newline)
    • ERASE and KILL characters work only on undelimited portion
  • noncanonical; uses MIN and TIME parameters


In-class exercise:

writing a program to change the ERASE key to #



Experimenting with the audio device on the UD CPS Sun system

  • /dev/audio
  • yet another example of the uniformity (consistency) in UNIX I/O
  • must use at console
  • ioctl function
    • gets device status info or sets device control parameters
    • has variable argument list
  • pass O_NONBLOCK to open to open device for nonblocking I/O


References

    [USP] K.A. Robbins and S. Robbins. UNIX Systems Programming: Concurrency, Communication, and Threads. Prentice Hall, Upper Saddle River, NJ, Second edition, 2003.

Return Home