Sponsored Content
Full Discussion: can any one answer ????
Top Forums Programming can any one answer ???? Post 302098076 by Perderabo on Thursday 30th of November 2006 11:32:35 AM
Old 11-30-2006
I am not sure that these are homework questions. Assigning homework involving real terminals seems unlikely today because real terminals are disappearing fast. On the other hand, all of mobile01's posts seem to relate to writing a shell. This does sound like a large project for some class and I becoming concerned that all of his or her posts represent a rule violation. But these particular questions sound like it came from some older info. Real terminals are very old devices and it is not easy to find info about them, so I will post a few answers. But I will leave the thread closed.

Q1. A terminal is a device that can display characters to a user and almost always has a keyboard which the user can use to input characters. On this page is a photo of a VT-320 which is a member of DEC's VT-100 family. Not all terminals use a CRT. Some terminal use a printer to print the characters. This page shows an ASR-33 which is the first terminal that I ever used. A terminal can be directly connected to an RS-232 port on a computer and you can use it to login. Many computers expect such a connection to be used for a system console. Terminals are starting to be a rare device. They cost almost as much as a low end PC. So most people will buy a low end PC and use hyper-terminal or some other terminal emulator.

But let's say that you are using a terminal and you are logged in to a Unix system. The tty device driver is used to communicate to the terminal. The tty device driver can do stuff like turn the echoing of characters on and off. A program like passwd uses this to hide the password as it is typed. So the passwd program needs to be able to talk to a terminal device driver. But now you telnet to another system. How can you run passwd now since you are not connected to terminal? Well the telnetd program will allocate a psuedo-termiinal for you. The psuedo-terminal has a device driver that can do many of the things that a real terminal device driver can do. So the remote passwd program can still hide the password as it is typed.

Q2 A terminal login is accomplished via a real terminal using a serial port. A network login is accomplished via a network using a program like telnet. In the old days, Unix was licensed by user and the theory was that every user would have a terminal. The user's terminal would connect before the user could start doing anything. This first connection would be a terminal login and you count it toward the license. But then the user might telnet to another box. This would not be counted since the user already had consumed a per-user license on the first box. There is no way to enforce this type of licensing today since most people connect via a network from a desktop workstation.

Q3 The baud rate only applies to real terminals and it is the rate at which data travels between the computer and the terminal 9600 is a common baud rate for terminals and since 10 bits are needed for each character, this means 960 characters per second. You can set the baud rate on a psuedo-tty buy it has no effect.

Q4 I do not understand this question. But tty drivers (both real and psuedo) have some structures allocated to control the terminal and some of these are used for job control. The structure is allocated in kernal memory. You can do a command:
stty -a
to display this data. For a hint on how to access these structures via C see this thread.
 

9 More Discussions You Might Find Interesting

1. Programming

get system() answer ?

Hi , how can i get the system reply from a system() command ? is it possible to evaluate the return of a system command ? (4 Replies)
Discussion started by: Sven28
4 Replies

2. Solaris

Can anybody answer this.....

Hi i am trying the threads concept in unix environment using C... but i am getting error of "wait_fd: Couldn't find procinfo for fd 24"... what does this error mean..... help me in solving this issue... Thanks in advance shivamasam (3 Replies)
Discussion started by: shivamasam
3 Replies

3. Shell Programming and Scripting

Is sed the answer?

Hey, I am very new to scripting and could use a bit of help. I have a situation where I have an ascii file and I want to delete all lines beneath a particular string. EXAMPLE: The contents of a file named example.txt looks like the following: JANUARY FEBRUARY MARCH APRIL MAY JUNE... (7 Replies)
Discussion started by: LaLonde
7 Replies

4. UNIX for Dummies Questions & Answers

quick answer

i know by posting this people are going to get mad at me but, when i try to download unix for my Windows XP i find a whole bunch of files that i dont know what to do with, so please help, sorry if this has already been posted... or is a stupid question :o (9 Replies)
Discussion started by: DarkestEvil
9 Replies

5. UNIX for Dummies Questions & Answers

Answer them if u can...

Try to answer these questions on Unix: 1.what will be the segment() function do? 2.How Unix is more powerful than Windows? 3.Where ownership details will be stored of a particular file in Unix? 4.State different uses of ^ symbol in regular expressions. 5.What does export command used for?... (5 Replies)
Discussion started by: dreambig
5 Replies

6. Programming

How do I get system answer in c

How do I get the answer of a system call that is printed in the terminal? for example: I execute system("pwd"); and get the answer /home/user/ But because I need to send this result to somewhere, I need to store it in a string. Thanks in advance. (7 Replies)
Discussion started by: eldaran
7 Replies

7. Shell Programming and Scripting

help me to answer this

Hello everyone I update my question. Thanks for your reply joeyg If I type the last command and send to a text file. I get this last >usuarios.txt root pts/0 160.40.35.277 May 22 11:08 still logged in. root pts/0 alopez02 May 22 09:23 - 10:11 (00:47) root pts/0 160.40.35.277 May 20... (0 Replies)
Discussion started by: lo-lp-kl
0 Replies

8. UNIX for Advanced & Expert Users

hi Please try to find an answer to this

Hi Friends, I have siebel installed in one of my aix machines and while opening a file it gives below error. $ vi SmSiebelSSO.conf History file has no read permission. q Please note the file has rwxr-xr-x for oracle:dba and i am trying to open using oracle id itself which is the owner... (1 Reply)
Discussion started by: DJ2176
1 Replies

9. UNIX for Dummies Questions & Answers

I welcome all to answer my Q's

Hi everyone,, I am new to the forum...but not to Unix. I have gathered few questions from my mates who attended interviews in various companies as I have to attend one on dec 3rd for Sys admin position. Please respond with the answers you know and also help with various other interview... (2 Replies)
Discussion started by: impawan
2 Replies
PTY(4)							   BSD Kernel Interfaces Manual 						    PTY(4)

NAME
pty -- BSD-style compatibility pseudo-terminal driver SYNOPSIS
device pty DESCRIPTION
The pty driver provides support for the traditional BSD naming scheme that was used for accessing pseudo-terminals. When the device /dev/ptyXX is being opened, a new terminal shall be created with the pts(4) driver. A device node for this terminal shall be created, which has the name /dev/ttyXX. New code should not try to allocate pseudo-terminals using this interface. It is only provided for compatibility with older C libraries that tried to open such devices when posix_openpt(2) was being called. FILES
The BSD-style compatibility pseudo-terminal driver uses the following device names: /dev/pty[l-sL-S][0-9a-v] Pseudo-terminal master devices. /dev/tty[l-sL-S][0-9a-v] Pseudo-terminal slave devices. DIAGNOSTICS
None. SEE ALSO
posix_openpt(2), pts(4), tty(4) HISTORY
A pseudo-terminal driver appeared in 4.2BSD. BUGS
Unlike previous implementations, the master slave device nodes are destroyed when the PTY becomes unused. A call to stat(2) on a nonexistent master device will already cause a new master device node to be created. The master device can only be destroyed by opening and closing it. The pty driver cannot be unloaded, because it cannot determine if it is being used. BSD
August 20, 2008 BSD
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy