Home | History | Annotate | Download | only in libmenu
      1 /* -*- c -*- ------------------------------------------------------------- *
      2  *
      3  *   Copyright 2004-2005 Murali Krishnan Ganapathy - All Rights Reserved
      4  *
      5  *   This program is free software; you can redistribute it and/or modify
      6  *   it under the terms of the GNU General Public License as published by
      7  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
      8  *   Boston MA 02111-1307, USA; either version 2 of the License, or
      9  *   (at your option) any later version; incorporated herein by reference.
     10  *
     11  * ----------------------------------------------------------------------- */
     12 
     13 #include <string.h>
     14 #include <com32.h>
     15 #include <core.h>
     16 #include <graphics.h>
     17 #include "syslnx.h"
     18 #include <syslinux/config.h>
     19 #include <syslinux/video.h>
     20 
     21 com32sys_t inreg, outreg;	// Global registers for this module
     22 
     23 void runsyslinuxcmd(const char *cmd)
     24 {
     25     char *bounce;
     26 
     27     bounce = lmalloc(strlen(cmd) + 1);
     28     if (!bounce)
     29 	return;
     30 
     31     strcpy(bounce, cmd);
     32     load_kernel(bounce);
     33 }
     34 
     35 void gototxtmode(void)
     36 {
     37     syslinux_force_text_mode();
     38 }
     39 
     40 void syslinux_idle(void)
     41 {
     42     __idle();
     43 }
     44 
     45 unsigned int getversion(char *deriv, unsigned int *numfun)
     46 {
     47     if (deriv)
     48 	*deriv = __syslinux_version.filesystem;
     49     if (numfun)
     50 	*numfun = __syslinux_version.max_api;
     51     return __syslinux_version.version;
     52 }
     53 
     54 char issyslinux(void)
     55 {
     56     return !!getversion(NULL, NULL);
     57 }
     58 
     59 void runsyslinuximage(const char *cmd, long ipappend)
     60 {
     61     (void)ipappend;		// XXX: Unused?!
     62 
     63     getversion(NULL, NULL);
     64     runsyslinuxcmd(cmd);
     65 }
     66