Re: patch: fast console output ioctl(PIO_DISPLAY)

Perry Harrington (pedward@sun4.apsoft.com)
Fri, 17 Jul 1998 12:39:23 -0700 (PDT)


>
> Consider me as a newbie kernel hacker as this is my first patch...
>
> The problem: Linux 2.0.34 text console is extremely slow. The hardware
> scrolling is fine, but text output especially with lots of colors is
> awful. Just look the "dialog" program or even worse, run BB-demo.
> In my 116x51 screen on Pentium 120 MHz the screen is updated only
> couple of times per second.
>
> Question: is 2.1.x faster?
>
> The solution: to optimize console output code. In fact, somebody had
> already done a patch for 2.0.x that buffered the display output and
> was supposed to make it faster. However, it didn't work very well:
> if I did "cat some-big-file" the display stopped after couple of
> screenfuls (ctrl-c worked still fine, though). Sorry, I don't remember
> now where to get this patch or who made it.

It isn't the console code, it's the dialog program. Just try Midnight
commander or Minicom, they are both color console apps and are fast.

>
> Another solution: to map VGA display memory in user space. KDMAPDISP
> looked promising, but it wasn't implemented. Another problem would
> be that this would be hardware-dependant way.

This is already available and is done is standard unix fashion.

>
> As I am a newbie and know pretty much nothing about the kernel,
> my solution is a lot simplier than any of the above.
>
> I made a new console ioctl() call named PIO_DISPLAY. The user
> programs prepares a image buffer and the ioctl call then simply
> copies it directly to screen. It's still very unoptimized (I'm
> planning to write x86 assembly for it) but it easily redraws the
> screen 300 times per second. The benefits are that it is hardware
> independent and binary clean (you can output _any_ character).
>
> What I would appreciate a lot, are _comments_. This works in my
> non-SMP x86, but would it work on SMP/non-x86? Are there any
> security issues I missed? Generally, what mistakes I made?
> (remember that this is my first kernel modification).
>

Have a look at /dev/vcsa* It's a byte-for-byte image of the display
memory of the console. Just mmap it to get memory addressable access.

/dev/vcsa* has Major 7 and starts at Minor 128

--Perry

-- 
Perry Harrington       Linux rules all OSes.    APSoft      ()
email: perry@apsoft.com 			Think Blue. /\

- 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.altern.org/andrebalsa/doc/lkml-faq.html