need help accessing device i/o memory from device driver

need help accessing device i/o memory from device driver

Post by Gregory D. Moncrea » Thu, 10 Oct 1996 04:00:00



I'm working on a device driver for a serial board under Freebsd.  I
did a hack and slash on a similar driver that used the same serial
chips as the board I'm working with.  The only difference is that the
new board has a dual-port ram and the old board/driver didn't.  

What I don't understand is how you "wire" pages of, virtual I guess,
memory to a physical location.  I can see in some other device drivers
calls to kvtope() which then calls pmap_kextract(), neither of which
are mentioned in design & implemetaion of bsd 4.4, and neither of
which seems to have an obvious effect, and seem to indicate the
reverse operation of what I think should be needed.

Are there any references as to how this needs to be done that I could
be looking at?  are there man pages for kernel functions for those
working inside the kernel?

Thanks,
gdm

 
 
 

need help accessing device i/o memory from device driver

Post by J Wuns » Sat, 12 Oct 1996 04:00:00



Quote:> I'm working on a device driver for a serial board under Freebsd.  I
> did a hack and slash on a similar driver that used the same serial
> chips as the board I'm working with.  The only difference is that the
> new board has a dual-port ram and the old board/driver didn't.

> What I don't understand is how you "wire" pages of, virtual I guess,
> memory to a physical location.

Is your memory located in the ``ISA hole'', or somewhere in the upper
memory?  The ISA hole is already mapped.  For the upper memory area,
you could perhaps adopt the algorithm used in the /dev/mem
implementation.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

need help accessing device i/o memory from device driver

Post by Gregory D. Moncrea » Tue, 15 Oct 1996 04:00:00




>> I'm working on a device driver for a serial board under Freebsd.  I
>> did a hack and slash on a similar driver that used the same serial
>> chips as the board I'm working with.  The only difference is that the
>> new board has a dual-port ram and the old board/driver didn't.

>> What I don't understand is how you "wire" pages of, virtual I guess,
>> memory to a physical location.

>Is your memory located in the ``ISA hole'', or somewhere in the upper
>memory?  The ISA hole is already mapped.  For the upper memory area,
>you could perhaps adopt the algorithm used in the /dev/mem
>implementation.

It worked, eventually.

I assume that the kernel performs the appropriate vm/paging based on
the isa_device->id_maddr, id_msize if the probe reports success,  I
just needed to use the appropriate virtual to physical address
conversion to program the device's view of the address of the memory.

 
 
 

1. Device Driver that will allow access to Kernel memory from shared memory?

Hello,

I would like to create a device driver that allows me to look at kernel
memory.  Specifically, I want to somehow look at an array that is
created and maintained within kernel memory space.  I need to look at it

from shared memory.  Is there any handy C command that allows you to do
this?  If someone has some code example that would be great!! I would
appreciate any help in this area if you could get me some information.

Thanks,
Rob Morris

2. Dialup xntpd under AIX 4.1.4

3. HELP needed: Solaris PCI device driver, device not auto detected.

4. ATM device; DSL adapter and Linux??

5. Device driver for accessing remote devices?

6. ftp and bash shell users????

7. need device: devices.pci.b7100010:devices.pci.b7100092

8. Change Cylinder Size of Harddisk SomeThing For Experts ????

9. user access to device and driver memory

10. In a Driver Read/Write Routine, accessing a memory-mapped device

11. Accessing memory at 0000:0004 from a device driver

12. x86 device driver accessing BIOS memory

13. process memory access from device driver