LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-06-2005, 12:19 PM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
l and ttyS0


[root@c83-250-89-7 ka]# ls -l /dev/ttyS0
lr-xr-xr-x 1 root root 5 Aug 6 2005 /dev/ttyS0 -> tts/0
[root@c83-250-89-7 ka]#

I know 'r' means read only and 'x' means executable.

What is the meaning of 'l' ?

On top of this what is 'ttyS0' ?
 
Old 08-06-2005, 12:50 PM   #2
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
The 'l' in "lr-xr-xr-x" means that the file is actually a symbolic link, a pointer to another file. That's why it shows "/dev/ttyS0 -> tts/0", that's where it points to. See more on Linux file permissions at http://www.comptechdoc.org/os/linux/...ugfilesp.html.
/dev/ttyS0 is the first character device for serial terminal lines.
 
Old 08-06-2005, 01:00 PM   #3
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
harken
Thanks for the reply.
The URL you mentioned is dead. I don't know why.

In Solaris systems, they talk about 'character special device files' and 'block special device files'.

Does this exist in Linux too? I have Mandrake linux 10.0 version.

If it exists, what is the purpose of them?
 
Old 08-06-2005, 01:08 PM   #4
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
There was an extra point character '.' in the link. Here it is: http://www.comptechdoc.org/os/linux/..._ugfilesp.html
As for the two types of files, yes they exist in Linux too. I'll quote from one of the man pages, for a brief explanation:
Quote:
A special file is a triple (boolean, integer, integer)
stored in the filesystem. The boolean chooses between
character special file and block special file. The two
integers are the major and minor device number.

Thus, a special file takes almost no place on disk, and is
used only for communication with the operating system, not
for data storage. Often special files refer to hardware
devices (disk, tape, tty, printer) or to operating system
services (/dev/null, /dev/random).

Block special files usually are disk-like devices (where
data can be accessed given a block number, and e.g. it is
meaningful to have a block cache). All other devices are
character special files. (Long ago the distinction was a
different one: I/O to a character special file would be
unbuffered, to a block special file buffered.)

Last edited by harken; 08-06-2005 at 01:10 PM.
 
Old 08-06-2005, 01:13 PM   #5
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
Also, a quotation from http://www.win.tue.nl/~aeb/linux/lk/lk-6.html, section 6.2, "Device special files" paragraph:
Quote:
The Unix philosophy is: "everything is a file". That makes life easy, the same system calls are used to read from any device. Special device nodes are inodes that refer to a device rather than to a file. They come in two kinds: block special devices are block-structured, allow random access, and, in case they contain a filesystem, can be mounted. The typical example is a disk. All (other) devices are character special devices. One has tapes, scanners, modems, etc. Also block special devices can be often accessed via a character special device node.

Device special files are very simple: the inode contains a pair of small integers (the major and minor device numbers), and these numbers are used by the system as index in some table to find the driver for the device.

Last edited by harken; 08-06-2005 at 01:15 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to get COM (ttyS0) working!! mattp Linux - Hardware 6 10-25-2005 02:54 PM
Opening ttyS0 someshss Linux - General 5 08-19-2005 08:44 PM
Using ttys0 LWATCDR Programming 5 04-26-2005 04:37 PM
problems using ttyS0 _HB_ Linux - Software 1 06-29-2004 01:27 AM
Modem ttyS0 Pedroski Linux - Software 0 01-27-2002 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration