Skip to content

Instantly share code, notes, and snippets.

@terryoy
Created January 28, 2013 05:52
Show Gist options
  • Save terryoy/4653341 to your computer and use it in GitHub Desktop.
Save terryoy/4653341 to your computer and use it in GitHub Desktop.
Linux VGA Programming Helloworld
# pre-requisities: sudo apt-get install libsvga1 libsvga1-dev
gcc -lvga helloworld.c -o helloworld
sudo ./helloworld
# output:
# (on screen: a small red point displaying for 5 sec)
# (on console: [svgalib: allocated virtual console #8])
#include <stdlib.h>
#include <vga.h>
int main(void)
{
vga_init();
vga_setmode(G320x200x256);
vga_setcolor(4);
vga_drawpixel(10, 10);
sleep(5);
vga_setmode(TEXT);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment