Automatic bank switching for a frame grabber?

Christer Weinigel (wingel@hog.ctrl-c.liu.se)
4 Mar 1999 16:26:47 -0000


Hi,

I have a ISA frame grabber card with 2 MB of memory on it. This
memory is accesed through a one MB memory window at address 0xf00000.
A bit in a control register switches between the two memory banks.

No, what I would like to do is to mmap the frame grabber memory into a
user processes address space so that the user process sees it as two
MB of memory without having to do the bank switching manually.

Is it possible to do this? I have a vague memory of someone doing
something like this for GGI and an old bank switching VGA adapter.

It should be doable since it's essentially the same as a mmap of a
file, but I simply don't know enough about the MM layer do do this
myself.

I guess this is whatI want to do:

page_fault_handler(void *address)
{
if (address >= high_bank)
{
outb(0x01, bank_ctrl);
set_prot_flags(low_bank, 0x100000, PROT_NONE);
set_prot_flags(high_bank, 0x100000, PROT_READ | PROT_WRITE);
}
else
{
outb(0x00, bank_ctrl);
set_prot_flags(low_bank, 0x100000, PROT_READ | PROT_WRITE);
set_prot_flags(high_bank, 0x100000, PROT_NONE);
}
}

/Christer

-- 
If it's tourist season, why can't we shoot them?

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/