Re: How to access law device on tru64unix

From: chanpost (chanpost_at_chol.com)
Date: 12/31/03


Date: 30 Dec 2003 16:28:51 -0800

peter@abbnm.com (Peter da Silva) wrote in message news:<bspfs9$10f8$1@jeeves.eng.abbnm.com>...
> In article <afea6c23.0312282229.6630af87@posting.google.com>,
> chanpost <chanpost@chol.com> 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.



Relevant Pages

  • Re: CIN Code crashing LabView - "(MSVCRT.DLL): 0xC0000096: Privileged Instruction? Error
    ... Most likely you will run into this sort of problem due to WinXP not allowing direct access to the hardware. ... You have to go through drivers. ... There is a util out on the web that is free that lets you 'forward' direct hardware requests sort of like packet forwarding in networking. ...
    (comp.lang.labview)
  • Best way to acess to the parallel port
    ... I have a special device that is ... communicate with,use DMAand IRQ under Windows ... I have successfully used some I/O drivers to access ... Must I write a parallel port class driver? ...
    (microsoft.public.development.device.drivers)
  • Re: DAC software
    ... Win95/98/ME allows the direct access to ports with the interrupts disabled. ... There are the special drivers for the port hacking in WinNT/2k/XP. ... solution using the dos found on the windows boot disk. ...
    (sci.electronics.design)
  • Re: passing generics
    ... people who aren't drivers shouldn't be in the list of drivers, ... In a real life DMV situation you would not get access to their actual database, you would get a copy only. ... But in the generics example you would get direct access and thats a problem because then you can start inserting data into the list that does not conform to the original intent of the list. ...
    (comp.lang.java.help)
  • Re: Looking for Info/Drivers for Old Magneto-Optical Drive
    ... optical SCSI drive I have found in our storage. ... Maybe you don't need any drivers. ... "direct access" it should be able to use it with generic SCSI disk ...
    (comp.periphs.scsi)