From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,833dab1baa4e49aa X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-12-30 16:28:52 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: chanpost@chol.com (chanpost) Newsgroups: comp.unix.tru64 Subject: Re: How to access law device on tru64unix Date: 30 Dec 2003 16:28:51 -0800 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 211.208.179.72 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1072830532 2882 127.0.0.1 (31 Dec 2003 00:28:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 31 Dec 2003 00:28:52 +0000 (UTC) Xref: archiver1.google.com comp.unix.tru64:11072 peter@abbnm.com (Peter da Silva) wrote in message news:... > In article , > chanpost wrote: > > By the way, I want to create "law device" in this unix and access... > > I assume you mean "raw device"? > > What sort of device, and what version of tru64? I am sorry. It is my mistake. And unix version is 5.1A.. Alan Rollow (alan@nabeth.cxo.cpqcorp.net ) gave reply as following very kindly. Desire to be refered. The words "law device" in regard to Tru64 UNIX (or any other UNIX) don't make sense together. Someone else followed up, perhaps you meant "raw device". UNIX systems have traditionally allowed direct access to I/O devices through the special device file interface. The files representing devices are typically kept in the /dev directory. They can be opened, read and written by applications that need direct access to a device. The special files are divided into two general groups; character device or block devices. The character devices are also called raw device, because they give the most direct access to the device; writing a single byte to the raw device will, in so far as the device is capable of of it, cause a single byte to be written to the device. The block devices put the file system buffer cache between the application and device, accepting writes until some internal buffer is full and then writing it. For reads, a whole buffer is read and given back to the user at whatever I/O size they use. Generally only disk devices provide a block device interface. I qualified my description of raw device as "in so far as the device is capable". Most disk device only allow I/O in the sector size supported by the device. A single byte I/O, or an other not the sector size, may be disallowed. A Tru64 UNIX provides character/raw devices for all tape, disk and tty devices available on the system. A variety of other special device are provide for access to other parts of the system; /dev/mem and /dev/kmem for direct access to memory, /dev/console for access to the console device, etc. Other drivers may provide access to whatever class drive they support; some versions include a SCSI-2 Media Changer driver that allows access to SCSI-2 Media Changers. Drivers of this class may only allow a small handful of generic command using the ioctl(2) interface to send SCSI commands to the device. The particulars depend on the device and driver. Special device files has two key characterics that allows access to a device; the major and minor device number. The major number is the index into a table of device drivers. The minor number encodes which unit controlled by that driver and other device specific characteristics. If you know the major and minor numbers associated with a device, you can create the special files yourself with mknod(1) command. But, as noted before, most devices that are going to allow direct access will have their special files created without you needing to do so. Generally this is done when the system boots.