Re: [AD] Linux keyboard patch, and to-do list

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Jason Wilkins <fenix@xxxxxxxxxx> writes:
> I have a function called IOBase which will return a pointer to the IOPorts.

This doesn't make sense to me: in the 80x86 architecture, IO ports and 
memory are completely different things, so it is a nonsense to get a pointer 
to these. The IO port space is a 64k block of addresses that are accessed 
using special instructions, in parallel and on a different bus to normal 
memory. Some cards also have memory mapped IO registers, but that is a 
different thing.

I suspect that this BeOS function is for non-Intel hardware, where the ISA 
or PCI port space might indeed end up being mapped as a special memory 
region.

> The thing is that the standard hooks are rather limited.  There is a
> screen->screen blit function, rectangle fill, invert, and line drawing, 
> but thats about it.

That's all you get on most hardware in any case. The fills and vram blits 
are where the speed boost comes from. User interface type programs can also 
benefit from hardware expansion of monochrome font data, and line drawing is 
nice if you are writing a wireframe mesh editor, but for most things, 99% of 
the speed boost is in blit(), rectfill(), and clear().

> Hmm, a wicked thought just accured to me.  Would it be possible to mmap 
> the frame buffer, but also map it to a file?

With the Linux fbcon driver, "cat /dev/fb0 > file" is a nice easy way to 
take a screenshot.

> How many drivers will need more than just the frame buffer and what do they 
> use these other areas for?

I think all of them need at least one extra block, and many use two or 
three. They use it for talking to memory mapped IO registers. Old cards use 
IO ports for everything, but with modern ones it is usually faster just to 
use the ports for the setup operations, and use memory registers for the 
actual drawing work. Some cards (eg. NVidia) don't even provide IO port 
versions of the accelerator registers.


--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/