home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.sun.hardware:6361 comp.sys.sun.misc:5914 comp.unix.wizards:5275
- Path: sparky!uunet!dziuxsolim.rutgers.edu!caip.rutgers.edu!andre
- From: andre@caip.rutgers.edu (Timothy Andre)
- Newsgroups: comp.sys.sun.hardware,comp.sys.sun.misc,comp.unix.wizards
- Subject: Sun Device Driver HELP, PLEASE
- Keywords: lots-o-meg
- Message-ID: <Dec.18.11.13.08.1992.17922@caip.rutgers.edu>
- Date: 18 Dec 92 16:13:08 GMT
- Followup-To: comp.sys.sun.hardware
- Organization: Rutgers Univ., New Brunswick, N.J.
- Lines: 23
-
-
- I am working on a loadable device driver under SunOS 4.1.2 on a Sun
- 4/260. The board I am writing the driver for has a couple of control
- registers and a large chunk of DRAM. Once the control registers are
- mapped into the driver, I am able to query the board as to the
- physical address and size of the DRAM. I use this information to then
- map in the DRAM. With the 4MB DRAM option, I am able to map the
- entire DRAM with no problems using rmalloc() followed by mapin().
- However, with the 16MB DRAM option, it seems that rmalloc() fails as
- it returns 0 (Sun's device driver manual does not specify what
- rmalloc() returns on failure, so I assume 0 means it failed), which
- then causes mapin() to panic with "panic: Memory address alignment".
- However, if I open /dev/vme32d32 and use mmap() to map the entire 16MB
- DRAM, it succeeds. How can I map in the entire DRAM from my driver?
-
- The driver itself does not need to see the whole DRAM, only the top
- 1MB. But I think I need to map the whole thing in so that a user
- program can use mmap() to get at the DRAM.
-
- Any help is much appreciated!
-
- Timothy Andre
- andre@caip.rutgers.edu
-