Pete Zaitcev ([info]zaitcev) wrote,
@ 2008-05-12 18:18:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:linux

John Carmack and Linux VT

Says John:

Our flight computer now has a display screen to show the current status to a pilot. My first inclination was just to mmap the framebuffer and pretend I was back in the days of DOS, but I decided to try and be a good linux programmer and use ncurses. It took me longer than I expected to get it working properly for displaying on the VGA for an application launched from a telnet session, and the performance was very bad. I wound up writing directly to the terminal device myself, spitting out all the escape sequences manually, but it was still quite appallingly slow. I have it working acceptably by only updating the various display items in a scanning fashion to avoid slowing it down on any individual frame, but I should have just followed my first thought and gone with a direct memory mapping.

I'm a little disturbed by the above, because I consider his application essentially equivalent to what Hercules does, and I never saw any performance issues with it. We all know that ncurses is a pig, and of course he should be using Slang instead of ncurses, but since he says that the result was slow even for the raw sequences, certainly this is not the issue. Weird.

It would be awesome if he posted his code somewhere.

UPDATE: John replies in comments:

The flight computer is only a 486-100, so it doesn't take much to bog it down, even with just text writes. I am doing straightforward fwrites and fprintfs to the console tty for everything.

It is at an acceptable rate now, so I probably won't make any other changes, but if RRL decides that they want anything fancy, like scrolling bar graphs, I will go straight to the framebuffer.



(Post a new comment)


[info]turgid
2008-05-13 05:17 am UTC (link)
Two possibilities:

- He's using a crappy Gnome/KDE super-rich terminal. These things are bloated and dog slow.
- His console framebuffer is doing manual blitting, and is unaccelerated.

Either way, he should know better...

-Jon

(Reply to this)(Thread)


[info]zaitcev
2008-05-13 07:04 am UTC (link)
I'm pretty sure he's on the text-mode console, unless he somehow managed to enable the /dev/fb. So my guess would be writing character-by-character by accident. That's not very credible either, but what could it be? There aren't any screenshots in the posting.

(Reply to this)(Parent)

Linux terminal speed
[info]edm
2008-05-13 10:53 am UTC (link)
Given who we're talking about, my first thought when he said it wasn't fast enough was that he was only getting a few frames per second... which would be fairly impressive for a terminal application, but painfully slow for someone accustomed to real time gaming.

Still it'd be interesting to find out more about what he's trying to do, and what the actual performance is.

Ewen

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…