Sponsored Content
Full Discussion: Is UNIX an open source OS ?
Operating Systems Linux Fedora Is UNIX an open source OS ? Post 302911227 by Corona688 on Wednesday 30th of July 2014 02:52:05 PM
Old 07-30-2014
Quote:
Originally Posted by sreyan32
I am sorry for being blunt first of all. But what you said makes absolutely no sense to me. Why would a terminal need a serial port to function ?
In the beginning, terminals and telecommunications equipment were always attached to serial ports; that's what they're there for. Quite a lot of features -- SIGINT on ctrl-C, EOF on ctrl-D, timeouts, line-based reading, simple translation, cleanup when the connection closes, etc etc etc -- were added to the serial port device driver to keep them simple to use. Modems and terminals had a fair amount in common, incidentally.

So, any interactive terminal program in UNIX talks to the terminal like a serial port. When you close an xterm or a PUTTY window, you expect things it was running to die with it, yes? Like a dialup teletype session would die when a modem hung up. It's the same thing.

But these days, they don't always have a serial port! Instead of rewriting everything imperfectly every time they created a new and special kind of terminal, they added a "virtual terminal" device to the UNIX standard. It's like a special kind of pipe where, if you write ctrl-C into one end, the other end dies... It has all the other usual features UNIX terminal programs have come to expect -- and should, since it's the same device driver.

Quote:
Also I have used the terminal in both Debian and Fedora distributions. I have never made any connection to any serial port before using them !
Run 'stty' in an xterm -- it will tell you your terminal's "baud rate". Which doesn't matter for virtual terminals, but it's there for historical reasons.

Quote:
Why would I need to do so?
The serial port driver handles things like
  • Should keystrokes be instantly delivered to the program, or should it wait until ENTER is pressed?
  • What key is backspace?
  • Should I send SIGINT on ctrl-C? Or some other key? Or not at all?

...and lots of other things. That's all in the device driver itself.

Using virtual terminals means you can run the exact same interactive program in a local terminal, remote terminal, GUI terminal, serial terminal, or whatever else and expect it to work the exact same way, right down to the weirdest bits of UNIX terminal history. (Try logging into a LINUX terminal as allcaps -- and watch the rest of the text become allcaps when it decides you're running a 6-bit terminal!)

Quote:
OSes like Windows also offer ctrl+c combination to kill the program(not that I like comparing Windows and UNIX I am just trying to get my point across).
ctrl-C is the only serial-like feature Windows has, and not even for serial ports. Windows actually put that feature inside each program -- but not all programs. Which means ctrl-C only works when it wants to.

Quote:
And what do you mean by it does that directly ? How can a serial port send signals to the CPU?
When you type ctrl-C, the kernel sends SIGINT to whatever's attached to your terminal. It's not a feature of your shell.

When you type a line and hit enter, the kernel delivers the complete line to whatever program's reading. Programs don't have to assemble each individual keystroke themselves (unless they want to.)

These and much more are features of the serial port device driver, which all interactive terminal programs in UNIX depend on.

Quote:
I am sorry but I don't understand what you are saying probably because I am starting out with UNIX. Do you think I should post a separate thread about this topic dealing with serial ports and terminal devices ? Because its getting off topic here.
Serial ports in UNIX are a complicated topic. Sure, if you want.


Quote:
If I am not mistaken you mean that you can move around partitions right ? For example I can unmount the /home partition and put it in a different hard disk all together and use it from there right ?
Depends what you mean by that.

When you mount something atop of /home/, you see the contents of that partition in it and not what was there before.
Quote:
But then why would you call it "partition nesting" ? because that sounds a partition within another partition.
Sorry for the confusion. Perhaps that was poorly worded.

Last edited by Corona688; 07-30-2014 at 04:00 PM..
These 2 Users Gave Thanks to Corona688 For This Post:
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

open source antivirus

Hello What is the best open source anti virus? Thanks (4 Replies)
Discussion started by: mohammadmahdi
4 Replies

2. Shell Programming and Scripting

Open Source

Hi Friends I'm new to this UNIX - I'm working on the porting project from Solaris To Linux i just want to map some commands from solaris to Linux so can any one please tell me how to get the source code of the commands like "ls", "cu", "du" Regards sabee (1 Reply)
Discussion started by: sabee.prakash
1 Replies

3. UNIX and Linux Applications

need open source KB software for UNIX

Anyone know of a good open source Knowledge Base software for UNIX that can connect to an Oracle back end? (0 Replies)
Discussion started by: RJ45
0 Replies

4. UNIX for Dummies Questions & Answers

Open-source projects to learn concurrency-managed network programming in Unix?

Hi, I am a mid-career programmer with extensive experience in object-oriented design and development in C, C++, and C#. I've written a number of multi-threaded server applications and background services, although my grasp of networking protocols is a bit weak: my current job drifted away from... (2 Replies)
Discussion started by: TheTaoOfPhil
2 Replies

5. UNIX for Advanced & Expert Users

UNIX/Linux inventory - Open Source

Hello guys, I need an open source tool that can list all the softwares installed in my unix/linux servers, the tool should list all the softwares installed and the current version, grouped by the hostname, anybody know any solution for this specific problem? Thanks guys, have a good day! (7 Replies)
Discussion started by: denisloide
7 Replies
All times are GMT -4. The time now is 04:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy