aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-13 12:25:22 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-13 12:25:22 -0700
commitef45d17e31d591a579c1d51a5e6a026493465a64 (patch)
tree6bee89dc040e4941a6d9dd2e9de694d37052770d /com32/samples
parent59c99264362d6a084f6dfff0803e582c01a1ea2b (diff)
downloadsyslinux.git-ef45d17e31d591a579c1d51a5e6a026493465a64.tar.gz
syslinux.git-ef45d17e31d591a579c1d51a5e6a026493465a64.tar.xz
syslinux.git-ef45d17e31d591a579c1d51a5e6a026493465a64.zip
Move vesainfo.c32 from "samples" to "modules"
vesainfo.c32 is turning into an invaluable debugging tool. Put it in "modules" instead of "samples", to encourage distros to package it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/samples')
-rw-r--r--com32/samples/Makefile2
-rw-r--r--com32/samples/vesainfo.c83
2 files changed, 1 insertions, 84 deletions
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index abba4d6f..7f5ea190 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -17,7 +17,7 @@
topdir = ../..
include ../MCONFIG
-all: hello.c32 cat.c32 resolv.c32 vesainfo.c32 serialinfo.c32 \
+all: hello.c32 cat.c32 resolv.c32 serialinfo.c32 \
localboot.c32 \
fancyhello.c32 fancyhello.lnx \
keytest.c32 keytest.lnx \
diff --git a/com32/samples/vesainfo.c b/com32/samples/vesainfo.c
deleted file mode 100644
index a1f00299..00000000
--- a/com32/samples/vesainfo.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * vesainfo.c
- *
- * Dump information about what VESA graphics modes are supported.
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <console.h>
-#include <com32.h>
-#include <inttypes.h>
-#include "../lib/sys/vesa/vesa.h"
-
-/* Wait for a keypress */
-static void wait_key(void)
-{
- char ch;
- while (fread(&ch, 1, 1, stdin) == 0)
- ;
-}
-
-static void print_modes(void)
-{
- static com32sys_t rm;
- struct vesa_general_info *gi;
- struct vesa_mode_info *mi;
- uint16_t mode, *mode_ptr;
- int lines;
-
- /* Allocate space in the bounce buffer for these structures */
- gi = &((struct vesa_info *)__com32.cs_bounce)->gi;
- mi = &((struct vesa_info *)__com32.cs_bounce)->mi;
-
- gi->signature = VBE2_MAGIC; /* Get VBE2 extended data */
- rm.eax.w[0] = 0x4F00; /* Get SVGA general information */
- rm.edi.w[0] = OFFS(gi);
- rm.es = SEG(gi);
- __intcall(0x10, &rm, &rm);
-
- if ( rm.eax.w[0] != 0x004F ) {
- printf("No VESA BIOS detected\n");
- return;
- } else if ( gi->signature != VESA_MAGIC ) {
- printf("VESA information structure has bad magic, trying anyway...\n");
- }
-
- printf("VBE version %d.%d\n"
- "Mode attrib h_res v_res bpp layout rpos gpos bpos\n",
- (gi->version >> 8) & 0xff, gi->version & 0xff);
-
- lines = 1;
-
- mode_ptr = GET_PTR(gi->video_mode_ptr);
-
- while ((mode = *mode_ptr++) != 0xFFFF) {
- if (++lines >= 23) {
- wait_key();
- lines = 0;
- }
-
- rm.eax.w[0] = 0x4F01; /* Get SVGA mode information */
- rm.ecx.w[0] = mode;
- rm.edi.w[0] = OFFS(mi);
- rm.es = SEG(mi);
- __intcall(0x10, &rm, &rm);
-
- /* Must be a supported mode */
- if ( rm.eax.w[0] != 0x004f )
- continue;
-
- printf("0x%04x 0x%04x %5u %5u %3u %6u %4u %4u %4u\n",
- mode, mi->mode_attr, mi->h_res, mi->v_res, mi->bpp,
- mi->memory_layout, mi->rpos, mi->gpos, mi->bpos);
- }
-}
-
-int main(void)
-{
- openconsole(&dev_rawcon_r, &dev_stdcon_w);
-
- print_modes();
- return 0;
-}