How can i find the address of a device on HPUX 10.20 system

How can i find the address of a device on HPUX 10.20 system

Post by Bahri Okurogl » Tue, 27 Oct 1998 04:00:00



Hi all,

I'd like to learn how to find the address (in the memory address
space) of any device on a HPUX 10.20 machine.

I'm just trying to write a basic device driver; and currently
managed to write a pseudo device driver. The next step is accessing
a real hardware. In order to do this I have to learn the address of
the devices in the memory address space.

Maybe a UNIX command displaying the addresses, or any other
utility.

Cheers,

--

================================================================
Bahri OKUROGLU

Netas R&D        RL-5 : Product Performance & Automation Support


http://193.140.184.5/r748/member/bahrio               (internal)
Netas   Alemdag Cad.    Umraniye 81244           ISTANBUL TURKEY
Tel: +90(216)344 00 44 / 3512              Fax:+90(216)328 02 13
================================================================

 
 
 

How can i find the address of a device on HPUX 10.20 system

Post by Mark Fear » Tue, 27 Oct 1998 04:00:00


: Hi all,
: I'd like to learn how to find the address (in the memory address
: space) of any device on a HPUX 10.20 machine.
: I'm just trying to write a basic device driver; and currently
: managed to write a pseudo device driver. The next step is accessing
: a real hardware. In order to do this I have to learn the address of
: the devices in the memory address space.
: Maybe a UNIX command displaying the addresses, or any other
: utility.
: Cheers,

 How about an 'ioscan -fn'?

: --
--
-----------
Mark Fearer

http://www.fearernet.com/mfearer

 
 
 

1. Serial device /dev/tty1p0 on HPUX 10.20

I'm trying to interface with a serial device (actually the console port of
a routing switch) attached to /dev/tty1p0. If I set up /etc/uucp/Devices to
list it as direct and 9600 bps, cu can connect to it and I can talk to it
just fine.

I now want to automate some of the things I was doing manually through cu. I
created a program which does the following:

..
   fd = open("/dev/tty1p0", O_RDWR | O_NDELAY);
   /* Undo the O_NDELAY */
   fcntl(fd, F_SETFL, 0);

   tcgetattr(fd, &ts);
   ts.c_iflags = 0;
   ts.c_oflags = 0;
   ts.c_cflags = CS8|CREAD|CLOCAL|B9600;
   ts.c_lflags = IGNBRK|IGNPAR;
   ts.c_cc[VMIN] = 0;
   ts.c_cc[VTIME] = 10;
   tcsetattr(fd, TCSANOW, &ts);

   /* Write something, anything */
   cmds = "commands\n";
   wr = write(fd, cmds, strlen(cmds));
   printf("write: %d\n", wr);

   /* Read the output */
   while((rd = read(fd, buf, buf_sz)) >= 0)
   {
      /* just print the size */
      printf("read: %d\n", rd);
   }

..

It's just a little test to see if I can communicate. I have tried playing
with the cflags some. I started up cu on the line and used stty to dump
the settings. No change. On the other hand, if I start cu, then suspend it,
then start my test program, it works correctly. What is it that cu is doing
that I am not? cu apparently undoes whatever it is when it exits -- unless
I kill it with a -9.

It's driving me crazy!!!

Russ

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts

2. Dummy display with X ?

3. compiling libg++ (also compiling ACE) on an HPUX 10.20 system

4. status of ntfs write-support in 2.4.20

5. hpux 10.20 boot problem

6. USB Ethernet

7. NIS problems between HPUX 10.20 and FreeBSD 3.0

8. : reiser4 [5/8] export remove_from_page_cache()

9. Trygin to run an Applet on Netscape 4.7 on HPUX 10.20

10. Problems with following sym links in HPUX 10.20

11. Adding new syscall to HPUX 10.20 / 11.00

12. Apache compile problem under HPUX 10.20

13. problems mounting CD in HPUX 10.20