aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/modules/vesainfo.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-04-26 09:59:53 +0100
committerMatt Fleming <matt.fleming@linux.intel.com>2011-04-26 10:04:59 +0100
commit74518b8b691c8aba1425673864c45b7721d9a738 (patch)
tree2b0d26c3617cabfd1c5e60bc046fd872014def4a /com32/elflink/modules/vesainfo.c
parent8f10ba6d251ac05b54f183cb98bf5310a0675338 (diff)
downloadsyslinux-74518b8b691c8aba1425673864c45b7721d9a738.tar.gz
syslinux-74518b8b691c8aba1425673864c45b7721d9a738.tar.xz
syslinux-74518b8b691c8aba1425673864c45b7721d9a738.zip
elflink: Make ELF the default object format
com32/elflink/modules was originally created to house ELF modules and keep them separate from the COM32 modules as the elflink branch was being developed. However, this has inadvertently created a maintenance nightmare because code was copied from elsewhere in the tree into com32/elflink/modules, resulting in duplication. Bug fixes have been going into the original code but have not been merged onto the elflink branch, leaving the duplicate code in com32/elflink/modules buggy. So let's delete this directory. There really is no reason to keep ELF and COM32 modules separate because there's no reason to need both COM32 and ELF modules to coexist. ELF is a far superior object file format and all modules are not emitted as ELF objects. Now that we're outputting ELF modules we can use dynamic memory instead of the cs_bounce bounce buffer. This commit requires a certain amount of shuffling for some files. quicksort.c isn't a module and belongs as part of the util library. cli.h belongs in com32/include so that other modules can make use of the cli code in ldlinux.c32. All libraries are now ELF shared libraries which are only loaded to fixup unresolved symbols for executable modules and renamed from *.a to *.c32. This reduces the runtime memory footprint because libraries are only loaded when needed and because every executable no longer gets its own copy of code/data (as it would if linking with a static library). Also, remove MINLIBOBJS from libcom32.c32 because it is already part of libcom32min.a and we don't want to have any duplicate symbols between the core (which links with libcom32min.a) and libcom32.c32. Welcome to the New World Order of ELF modules! Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
Diffstat (limited to 'com32/elflink/modules/vesainfo.c')
-rw-r--r--com32/elflink/modules/vesainfo.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/com32/elflink/modules/vesainfo.c b/com32/elflink/modules/vesainfo.c
deleted file mode 100644
index 86a43657..00000000
--- a/com32/elflink/modules/vesainfo.c
+++ /dev/null
@@ -1,90 +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;
-
- struct vesa_info *vesa;
-
- vesa = lmalloc(sizeof(*vesa));
- if (!vesa) {
- printf("vesainfo.c32: fail in lmalloc\n");
- return;
- }
- gi = &vesa->gi;
- mi = &vesa->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");
- goto exit;
- } 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);
- }
-
-exit:
- free(vesa);
- return;
-}
-
-int main(int argc, char **argv)
-{
- print_modes();
- return 0;
-}