Created
January 28, 2013 05:52
-
-
Save terryoy/4653341 to your computer and use it in GitHub Desktop.
Linux VGA Programming Helloworld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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