ArticleslgStudy

computer science

Seventh Edition Unix terminal interface

Seventh Edition Unix terminal interface is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Seventh Edition Unix terminal interface rather than just read about it. In short: The Seventh Edition Unix terminal interface is the generalized abstraction, comprising both an application programming interface for programs and a set of behavioural expectations for users, of a terminal as historically available in Seventh Edition Unix. It has been largely superseded by the POSIX terminal interface.

Key takeaways

  • Seventh Edition Unix terminal interface belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Seventh Edition Unix terminal interface to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Seventh Edition Unix terminal interface from memory before moving on to harder problems.

Reference excerpt

The Seventh Edition Unix terminal interface is the generalized abstraction, comprising both an application programming interface for programs and a set of behavioural expectations for users, of a terminal as historically available in Seventh Edition Unix. It has been largely superseded by the POSIX terminal interface.

Concepts and overview The terminal interface provided by Seventh Edition Unix and UNIX/32V, and also presented by BSD version 4 as the old terminal driver, was a simple one, largely geared towards teletypewriters as terminals. Input was entered a line at a time, with the terminal driver in the operating system (and not the terminals themselves) providing simple line editing capabilities. A buffer was maintained by the kernel in which editing took place. Applications reading terminal input would receive the contents of the buffer only when the return key was pressed on the terminal to end line editing. The @ key sent from the terminal to the system would erase ("kill") the entire current contents of the editing buffer, and would be normally displayed as an '@' symbol followed by a newline sequence to move the print position to a fresh blank line. The # key sent from the terminal to the system would erase the last character from the end of the editing buffer, and would be normally displayed as an '#' symbol, which users would have to recognize as denoting a "rubout" of the preceding character (teletypewriters not being physically capable of erasing characters once they have been printed on the paper). From a programming point of view, a terminal device had transmit and receive baud rates, "erase" and "kill" characters (that performed line editing, as explained), "interrupt" and "quit" characters (generating signals to all of the processes for which the terminal was a controlling terminal), "start" and "stop" characters (used for software flow control), an "end of file" character (acting like a carriage return except discarded from the buffer by the read() system call and therefore potentially causing a zero-length result to be returned) and various mode flags determining whether local echo was emulated by the kernel's terminal driver, whether modem flow control was enabled, the lengths of various output delays, mapping for the carriage return character, and the three input modes.

Input modes The three input modes for terminals in Seventh Edition Unix were:

line mode (also called "cooked" mode) In line mode the line discipline performs all line editing functions and recognizes the "interrupt" and "quit" control characters and transforms them into signals sent to processes. Applications programs reading from the terminal receive entire lines, after line editing has been completed by the user pressing return. cbreak mode cbreak mode is one of two character-at-a-time modes. (Stephen R. Bourne jokingly referred to it (Bourne 1983, p. 288) as a "half-cooked" and therefore "rare" mode.) The line discipline performs no line editing, and the control sequences for line editing functions are treated as normal character input. Applications programs reading from the terminal receive characters immediately, as soon as they are available in the input queue to be read. However, the "interrupt" and "quit" control characters, as well as modem flow control characters, are still handled specially and stripped from the input stream. raw mode raw mode is the other of the two character-at-a-time modes. The line discipline performs no line editing, and the control sequences for both line editing functions and the various special characters ("interrupt", "quit", and flow control) are treated as normal character input. Applications programs reading from the terminal receive characters immediately, and receive the entire character stream unaltered, just as it came from the terminal device itself. In the POSIX terminal interface, these modes have been superseded by a system of just two input modes: canonical and non-canonical. The handling of signal-generating special characters in the POSIX terminal interface is independent of input mode, and is separately controllable.

Controlling terminals In Seventh Edition Unix there was no terminal job control and a process group was considered to be not what it is considered to be nowadays. Each process in the system had either a single controlling terminal, or no controlling terminal at all. A process inherits its controlling terminal from its parent. A controlling terminal was acquired when a process with no controlling terminal open()s a terminal device file that isn't already the controlling terminal for some other process. All of the processes that had the same controlling terminal were part of a single process group.

Application programming interface The programmatic interface for querying and modifying all of these modes and control characters was the ioctl() system call. (This replaced the stty() and gtty() system calls of Sixth Edition Unix.) Although the "erase" and "kill" characters were modifiable from their defaults of # and @, for many years after Seventh Edition development inertia meant that they were the pre-set defaults in the terminal device drivers, and on many Unix systems, which only altered terminal device settings as part of the login process, in system login scripts that ran after the user had entered username and password, any mistakes at the login and password prompts had to be corrected using the historical editing key characters inherited from teletypewriter terminals. The symbolic constants, whose values were fixed and defined, and data structure definitions of the programmatic interface were defined in the sgtty.h system header.

ioctl() operations The ioctl() operations were as follows:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Seventh Edition Unix terminal interface

Start with the simplest possible case. Write down what Seventh Edition Unix terminal interface claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Seventh Edition Unix terminal interface before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Seventh Edition Unix terminal interface ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Seventh Edition Unix terminal interface

In research
Seventh Edition Unix terminal interface appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Seventh Edition Unix terminal interface in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Seventh Edition Unix terminal interface is common in secondary-school and first-year university syllabi. It links to neighbouring topics Application programming interfaces, Bell Labs Unices, Berkeley Software Distribution, so understanding it makes those chapters shorter.
In everyday life
Look for Seventh Edition Unix terminal interface outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Seventh Edition Unix terminal interface” →

How to study Seventh Edition Unix terminal interface in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Seventh Edition Unix terminal interface means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Seventh Edition Unix terminal interface out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Seventh Edition Unix terminal interface in simple terms?

The Seventh Edition Unix terminal interface is the generalized abstraction, comprising both an application programming interface for programs and a set of behavioural expectations for users, of a terminal as historically available in Seventh Edition Unix. It has been largely superseded by the POSIX…

Why does Seventh Edition Unix terminal interface matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Seventh Edition Unix terminal interface?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Seventh Edition Unix terminal interface.

Tags

  • Application programming interfaces
  • Bell Labs Unices
  • Berkeley Software Distribution
  • Computer terminals
  • Technical communication

Keep exploring