开发者

How to run libsvga program at ubuntu?

I am trying to use the following program given in the libsvga tutorial.

    #include <stdlib.h>
    #include <vga.h>

    int main(void)
    {
       vga_init();
  开发者_如何学C     vga_setmode(vga_getdefaultmode());
       vga_setcolor(4);
       vga_drawpixel(10, 10);

       sleep(5);
       vga_setmode(TEXT);

       return EXIT_SUCCESS;
    }

I am using following command to compile it

   gcc -O3 -o sample sample.c -lvga

The output is the following

    Using EGA driver
    svgalib 1.4.3

and after that nothing happens. I am using ubuntu. I am wondering if someone can help me in figuring out the problem.


I just tried this and it didn't work either. I looked around in /proc/fb (for the "framebuffer" device) and it mentioned VESA.

So, I edited the file /etc/vga/libvga.config and removed the # at the start of the line for VESA chipsets, so it now looks like this:

chipset VESA # nicely behaved VESA bioses

and libsvga seems to work fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜