> >Thanks for the reply - I will dig further. Here is what I am doing in case
> >you know of a better way than virt to/from/phys:
> >I need to get an address FOR bios FROM bios: I need to hunt bios physical
> >mem 0xF0000-0xFFFF0 for a signature. After validatiing the checksum, I can
> >extract the physical address from BIOS that is a physical pointer address
> >(0xFxxxx) to the BIOS function I need to call (thus I think I need to do a
> >phys to virt right?). This is not regular BIOS but for thinkpad SMAPI. It
> >works similar so I will investigate bios.c more.
> >thanks again, nothing is easy, but anymore help would be great. If not I
> >will plod along...
> physical addresses are not automatically mapped into kernel virtual space.
> on startup, the kernel maps space for itself and some data structures,
> but individual device drivers should map the appropriate BIOS/DMA/bus
> register areas.
Oh yes -- if it hasn't changed, the approach that I used was to
allocate the virtual address (mark already knows this) by doing
something like kmem_alloc_pageable or somesuch. Some versions
of the code allowed the ability to deny faults (and normal hardware
mappings should require that), and then doing pmap_kenter (or
pmap_enter as appropriate.) I seem to remember that non
pageable kernel entries can be made by pmap_kenter.
There are also issues of the new fancy I/O mapping code, that others
know more about that I knew at all (or remember.)
So, when normally allocating memory, the seperation between virtual
and physical allocation is somewhat hidden. When allocating physical
space, then allocating the viritual memory is done, then the mappings
explicitly forced.
It is (or used to be) okay to do a hard kernel mapping, since kernel
mappings mostly don't change from process to process (at least,
normal kernel mappings.) pmap_enter is more useful when pages
should be managed for paging and things like that. pmap_kenter
is kind of a hard-mapping.
If I get around to it, I'll look at the code to see what is going on, but
again, there are people who are MUCH MORE familiar with current
practices!!!
John