From: Jeff Dike <jdike@ka...> - 2002-12-25 21:26:06
> The file will stat with a length of 256. 256 is the length of the pci
> data area and it is available as the first 256 bytes of the file.
> iomem= will only access this data.
> But other things work too: fd = open(/proc/bus/pci/00/0b.0)
> addr1 = os_map_memory(0, fd, 0xDC000000, 0x100000, 1, 1, 0)
> addr2 = os_map_memory(0, fd, 0xE1000000, 0x100000, 1, 1, 0)
> addr3 = os_map_memory(0, fd, 0xB0000, 0x1000, 1, 1, 0)
> You can also map regions that are way into the file.
> These regions correspond to the physical memory on the card.
Hmmm, it seems that iomem is indeed too simple for your needs and that you're
basically doing the right thing. Too bad you had to get involved with my
low-level VM system - it's a lot nastier than it should be.
Can you post your current code?
Try the attached patch. Isn't there some more direct
way to do this in bk? I generated it with this:
for i in `bk changes -L -f -k | bk key2rev ChangeSet`;
bk export -tpatch -r$i >> ../patch;
Two issues with mem man code:
1) phys_region doesn't work right when region entries
are sequentially assigned.
2) os_map_memory assumes the virt address is going to
be what you asked for instead of returning the virt
address from the function. Parm #1 is only a hint, ret
value may be different. loc should be returned.
With my patch applied your /proc/bus and /proc/pci
should mimic the ones in your host. Code in
arch/um/kernel/ioremap_kern.c tries to map/unmap the
memory. Code in drivers/pci/vpci.c builds the ranges.
I have a PCI video card installed in my machine (an
ATI Rage128). The host ignores it. In my 2.5 UML tree
I build the console driver for it into the kernel and
pass in video=aty128fb. When the kernel inits the card
my new PCI code locates the memory regions on it by
reading the PCI registers. In pci_enable_device I take
the list of regions, enable them on the card, and
build the range entries in UML for them. Later, the
driver ioremap's the memory. At this point I want to
This process should work with any spare PCI card in
your machine, for example a sound card. But I may not
have enough PCI functions implemented yet.
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.