KMS Frame Buffer How To

Discussion in 'C Programming' started by dman777, Feb 2, 2013.

  1. dman777

    dman777 Guest

    If I want to use terminal 2D graphics in my C programs using KMS, where can I find tutorials or find out how to incorporate/write KMS in my C programs?
    dman777, Feb 2, 2013
    #1
    1. Advertising

  2. Good question. There does not seem to be a sane, portable way to use the
    framebuffer. There's /usr/include/linux/fb.h for the (pure)console. I do
    not know what to use in xterm. You could use xlib xcb or the dga
    extension(the latter full-screen only, but the faster of the three). You
    could use one of the higher level libraries (libdirectfb or sdl being
    popular). They are a little more complex, so your chances to run into
    incompatibilities or brokenness with some bleeding-edge distro is a bit
    higher...

    I have absolutely no idea if any actual modesetting works by now for
    things like the VESAFB kernel module(I assume it does not).

    AFAIK The excellent w3m-img web browser does HTML rendering(+images) in
    both X and console, so you might want to look at that(read the source).
    But the code is just plain ugly.

    Good Luck, you will need it...
    Johann Klammer, Feb 2, 2013
    #2
    1. Advertising

  3. dman777

    dman777 Guest

    On Saturday, February 2, 2013 12:21:18 AM UTC-8, Johann Klammer wrote:
    > Good question. There does not seem to be a sane, portable way to use the
    >
    > framebuffer. There's /usr/include/linux/fb.h for the (pure)console. I do
    >
    > not know what to use in xterm. You could use xlib xcb or the dga
    >
    > extension(the latter full-screen only, but the faster of the three). You
    >
    > could use one of the higher level libraries (libdirectfb or sdl being
    >
    > popular). They are a little more complex, so your chances to run into
    >
    > incompatibilities or brokenness with some bleeding-edge distro is a bit
    >
    > higher...
    >
    >
    >
    > I have absolutely no idea if any actual modesetting works by now for
    >
    > things like the VESAFB kernel module(I assume it does not).
    >
    >
    >
    > AFAIK The excellent w3m-img web browser does HTML rendering(+images) in
    >
    > both X and console, so you might want to look at that(read the source).
    >
    > But the code is just plain ugly.
    >
    >
    >
    > Good Luck, you will need it...



    That drives me crazy I can not find anything on KMS for programming. I wonder for 2d graphics in putty as the terminal emulator if KMS technology makea difference anyways.

    If I use the old school Vesa, would it be a sure way to know it would work on all recent(or 2 year oldish) Linux systems? I found this for it:
    https://docs.google.com/viewer?a=v&...xUsiLT&sig=AHIEtbQMgihTVXDSl03-QUY1f4kuRAJKrw
    dman777, Feb 4, 2013
    #3
  4. dman777 wrote:
    >
    > That drives me crazy I can not find anything on KMS for programming. I wonder for 2d graphics in putty as the terminal emulator if KMS technology make a difference anyways.

    As far as I understand it, KMS is only for modesetting. not for any
    actual drawing. The reason that there's been so much talk about it in
    the last years, is that those things had been done inside the X server
    (userspace) before but have been moved to the linux kernel drivers
    afterwards.

    Putty is a ssh client. Heck, I already get problems trying to use the
    linedrawing characters with it. It will not do any
    framebuffer(=pixel-wise) drawing.

    >
    > If I use the old school Vesa, would it be a sure way to know it would work on all recent(or 2 year oldish) Linux systems? I found this for it:
    > https://docs.google.com/viewer?a=v&...xUsiLT&sig=AHIEtbQMgihTVXDSl03-QUY1f4kuRAJKrw
    >


    I am not even sure if they _do_ still have a BIOS int 10h with all the
    UEFI and closed source firmarez(big doubts). You'll have to use the
    appropriate library/kernel header... fortunately there are so many to
    choose from...

    That's all I know(half-knowledge, that is). Try the documentation for
    the packages mentioned earlier. Also, you could try one of the more
    Linux-centric newsgroups (uk.comp.os.linux, comp.os.linux.misc,
    comp.unix.programmer seem to be active).
    Johann Klammer, Feb 4, 2013
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raja
    Replies:
    12
    Views:
    24,382
    John Harrison
    Jun 21, 2004
  2. Replies:
    2
    Views:
    603
    sergejusz
    Mar 26, 2007
  3. Neal Becker

    buffer creates only read-only buffer?

    Neal Becker, Jan 8, 2009, in forum: Python
    Replies:
    0
    Views:
    410
    Neal Becker
    Jan 8, 2009
  4. xingye
    Replies:
    9
    Views:
    272
    Michael Lu
    Apr 19, 2004
  5. Replies:
    1
    Views:
    590
Loading...

Share This Page