[syslinux] [PATCH] gfxboot.c32

Sebastian Herbszt herbszt at gmx.de
Sat Nov 14 03:26:33 PST 2009


Steffen Winterfeldt wrote:
> Ok, here is the first try to turn the gfxboot wrapper into a com32 module. I
> had to extend the interface to the gfxboot core a bit to get it working. So
> it works only with latest gfxboot from
>
> git://gitorious.org/gfxboot/gfxboot.git
>

Nice work! Two notes:

find_file() used to accept the gfx file directly and not forced the use of a cpio archive.
To keep this behaviour the following change is needed:

--- gfxboot.c.orig      2009-11-14 11:04:18.000000000 +0100
+++ gfxboot.c   2009-11-14 11:30:48.000000000 +0100
@@ -424,7 +424,7 @@


 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// Search cpio archive for gfx file.
+// Search (cpio archive) for gfx file.
 //
 unsigned find_file(unsigned char *buf, unsigned len, unsigned *gfx_file_start, unsigned *file_len, unsigned *code_size)
 {
@@ -433,6 +433,9 @@
   *gfx_file_start = 0;
   *code_size = 0;

+  if((code_start = magic_ok(buf, code_size))) {
+    return code_start;
+  }
   for(i = 0; i < len;) {
     if((len - i) >= 0x1a && (buf[i] + (buf[i + 1] << 8)) == 0x71c7) {
       fname_len = *(unsigned short *) (buf + i + 20);


Non kernel type labels are not being run (menu_ptr->kernel and menu_ptr->linux are both NULL).
The following change fixes this:

--- gfxboot.c.orig      2009-11-14 11:04:18.000000000 +0100
+++ gfxboot.c   2009-11-14 11:30:48.000000000 +0100
@@ -730,7 +733,12 @@

   file = menu_ptr->kernel;
   if(!file) file = menu_ptr->linux;
-  if(!file) return;
+  if(!file) {
+    gfx_done();
+    asprintf(&cmd_buf, "%s %s", menu_ptr->label, arg);
+    syslinux_run_command(cmd_buf);
+    return;
+  }

   // first, load kernel


- Sebastian




More information about the Syslinux mailing list