aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples/vesa.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2006-08-28 02:46:06 -0700
committerH. Peter Anvin <hpa@zytor.com>2006-08-28 02:46:06 -0700
commit72fd5d37e68617c3bdd7aff56f519a1e5c9d8817 (patch)
tree5b8789db1c582b32040b437e0f8b91261a3ea014 /com32/samples/vesa.c
parente3f74a218f641d6d17d3241b271dc70320b8a979 (diff)
downloadsyslinux-elf-72fd5d37e68617c3bdd7aff56f519a1e5c9d8817.tar.gz
syslinux-elf-72fd5d37e68617c3bdd7aff56f519a1e5c9d8817.tar.xz
syslinux-elf-72fd5d37e68617c3bdd7aff56f519a1e5c9d8817.zip
Test program for the VESA code
Diffstat (limited to 'com32/samples/vesa.c')
-rw-r--r--com32/samples/vesa.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/com32/samples/vesa.c b/com32/samples/vesa.c
new file mode 100644
index 00000000..faeb3b07
--- /dev/null
+++ b/com32/samples/vesa.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <inttypes.h>
+#include "../lib/sys/vesa/video.h"
+
+int __vesacon_init(void);
+void vesacon_write_at(int row, int col, const char *str, uint8_t attr, int rev);
+
+int main(void)
+{
+ int row, col;
+ int attr;
+ char attr_buf[16];
+
+ __vesacon_init();
+
+ row = col = 0;
+
+ for (attr = 0; attr < 256; attr++) {
+ snprintf(attr_buf, sizeof attr_buf, " [%02X] ", attr);
+ vesacon_write_at(row, col, attr_buf, attr, attr & 3);
+ row++;
+ if (row >= 29) {
+ row = 0;
+ col += 8;
+ }
+ }
+
+ while (1)
+ asm volatile("hlt");
+}