Re: mmap cdev function in device drivers

2000-05-09 Thread Coleman Kane
Poul-Henning Kamp had the audacity to say: > A good example to look at is the pci/xrpu.c file, that driver > barely does anything but a mmap. > > Poul-Henning > Hey, thanks. That's a great idea. I'll check that out. I've been leafing through the rather monolithic meteor, brooktree, and even the

Re: mmap cdev function in device drivers

2000-05-09 Thread Coleman Kane
Yeah, I've been flipping through the source code and drinking lots of coffee, I figured out what atop, i386_btop and all the rman stuff do. I am thinking that i386_btop is i386 base to page, which has been replaced (for portability?) by atop. The rman_* functions just give a nice description of wh

Re: mmap cdev function in device drivers

2000-05-09 Thread Poul-Henning Kamp
A good example to look at is the pci/xrpu.c file, that driver barely does anything but a mmap. Poul-Henning In message <[EMAIL PROTECTED]>, Peter Edwards writes: >Hi, >Just trying to take some of the aforementioned "magic" out of i386_btop >/ vtop :-) > >>return( atop(vtophys(bktr->bigbuf)

Re: mmap cdev function in device drivers

2000-05-09 Thread Peter Edwards
Hi, Just trying to take some of the aforementioned "magic" out of i386_btop / vtop :-) >return( atop(vtophys(bktr->bigbuf) + offset) ); atop (I assume) stands for "address to page" (given a pointer, give the number of the page it is in) vtophys is "virtual to physical". (given a pointer in a

Re: mmap cdev function in device drivers

2000-05-08 Thread Coleman Kane
Daniel O'Connor had the audacity to say: > > The return type is the errno for the mmap() call.. > > You need to inform the VM systems about it. > The meat of your mmap call should be -> > > return(i386_btop(vtophys(rman_get_virtual(sc->g_membase.reshandle)) + > offset)); > This is probably w

Re: mmap cdev function in device drivers

2000-05-07 Thread Coleman Kane
One step ahead of you brian. I searched all over until I found it, he was writing a driver for the older pci implementation. He got hung up on the mmap thing too... Brian Fundakowski Feldman had the audacity to say: > I just want to inform you before doing a huge amount of work on this that > ov

RE: mmap cdev function in device drivers

2000-05-07 Thread Daniel O'Connor
On 08-May-00 Coleman Kane wrote: > the memory region mapped by the PCI BIOS (in this case the 0x100 region > between 0xec00 and 0xecff), or an address of a mapped region within > kernel memory area? I had it return the former and it crashed the machine, > trying to use bus_alloc_r

Re: mmap cdev function in device drivers

2000-05-07 Thread Brian Fundakowski Feldman
I just want to inform you before doing a huge amount of work on this that over a year ago, Stepehen Hocking started work on a 3dfx driver. His work seems to have disappeared from the planet, but you can try to contact him, and you'll probably get some old code to work with maybe :) -- Brian Fun

mmap cdev function in device drivers

2000-05-07 Thread Coleman Kane
Hello, I have taken it upon myself to write a device driver to access the 3dfx voodoo cards, just like the 3dfx linux driver that is available. I am using the linux code as a reference and have come to a brick wall while writing the cdev mmap function. What exactly is the return value of the devic