Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!rochester!ur-tut!ur-valhalla!micropen!dave From: dave@micropen (David F. Carlson) Newsgroups: comp.unix.microport Subject: Re: How to attach to physical memory Keywords: SV/386 sptalloc Message-ID: <525@micropen> Date: 28 Jul 88 12:07:37 GMT Organization: Micropen Dirent Writing Systems, Pittsford, NY Lines: 39 Why do smart mailers mess things up nearly 100% of the time? > > How does one get access to a memory buffer that is hard wired to a > physical memory location outside of the normal system memory? > > Larry Williamson Focus Automation Systems > UUCP: watmath!focsys!larry 608 Weber St. N, Waterloo, Ontario N2V 1K4 > +1 519 746 4918 Larry, First, there is no need for two devices. vidbuf can contain both your memory map and the ioctl interface to the registers. Good coding practice dicates an abstraction level from your physical registers to the actual ioctl functions your define. For 386 unix in the kernel: char *sptalloc( int size /* in 4k pages */, int mode /* PG_P in immu.h */, int base /* physical address in 4k pages (ie << 12 ) */, int flag /* don't care for non-zero base */ ) void sptfree(vaddr, size, flag) /* similarly to above */ alloc can be an init routine in the driver or on first open. I have never used free because I want the mapping to be for the lifetime of the kernel. Good luck. David F. Carlson, Micropen, Inc. ...!{ames|harvard|rutgers|topaz|...}!rochester!ur-valhalla!micropen!dave "The faster I go, the behinder I get." --Lewis Carroll -- David F. Carlson, Micropen, Inc. ...!{ames|harvard|rutgers|topaz|...}!rochester!ur-valhalla!micropen!dave "The faster I go, the behinder I get." --Lewis Carroll