elflink: Replace __intcall() with direct function calls
authorMatt Fleming <matt.fleming@intel.com>
Tue, 3 Jul 2012 07:50:13 +0000 (08:50 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 20 Jul 2012 09:20:19 +0000 (10:20 +0100)
There's no reason to use the COMBOOT API at all now that we can have
any undefined symbols resolved at runtime - we can just access
functions directly.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
33 files changed:
com32/chain/utility.c
com32/cmenu/libmenu/syslnx.c
com32/elflink/ldlinux/ldlinux.c
com32/include/syslinux/config.h
com32/include/syslinux/features.h
com32/lib/Makefile
com32/lib/sys/ansicon_write.c
com32/lib/sys/rawcon_read.c
com32/lib/sys/rawcon_write.c
com32/lib/sys/serial_write.c
com32/lib/sys/stdcon_write.c
com32/lib/sys/xserial_write.c
com32/lib/syslinux/features.c [deleted file]
com32/lib/syslinux/ipappend.c
com32/lib/syslinux/keyboard.c
com32/lib/syslinux/run_command.c
com32/lib/syslinux/run_default.c
com32/lib/syslinux/runimage.c
com32/lib/syslinux/serial.c
com32/lib/syslinux/shuffle.c
com32/lib/syslinux/version.c
com32/lib/syslinux/video/fontquery.c
com32/lib/syslinux/video/reportmode.c
core/comboot.inc
core/console.c
core/diskfs.inc
core/font.c
core/fs/pxe/pxe.c
core/hello.c
core/include/bios.h
core/include/core.h
core/include/graphics.h
core/isolinux.asm

index b54e0cd..cb88272 100644 (file)
@@ -4,7 +4,9 @@
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
+#include <fs.h>
 #include <syslinux/disk.h>
+#include <syslinux/pmapi.h>
 #include "utility.h"
 
 static const char *bpbtypes[] = {
@@ -93,14 +95,11 @@ void lba2chs(disk_chs *dst, const struct disk_info *di, uint64_t lba, uint32_t m
 
 uint32_t get_file_lba(const char *filename)
 {
-    com32sys_t inregs;
+    struct com32_filedata fd;
     uint32_t lba = 0;
     int size = 65536;
     char *buf;
 
-    /* Start with clean registers */
-    memset(&inregs, 0, sizeof(com32sys_t));
-
     buf = lmalloc(size);
     if (!buf)
        return 0;
@@ -108,32 +107,15 @@ uint32_t get_file_lba(const char *filename)
     /* Put the filename in the bounce buffer */
     strlcpy(buf, filename, size);
 
-    /* Call comapi_open() which returns a structure pointer in SI
-     * to a structure whose first member happens to be the LBA.
-     */
-    inregs.eax.w[0] = 0x0006;
-    inregs.esi.w[0] = OFFS(buf);
-    inregs.es = SEG(buf);
-    __com32.cs_intcall(0x22, &inregs, &inregs);
-
-    if ((inregs.eflags.l & EFLAGS_CF) || inregs.esi.w[0] == 0) {
+    if (open_file(buf, &fd) <= 0) {
        goto fail;              /* Filename not found */
     }
 
     /* Since the first member is the LBA, we simply cast */
-    lba = *((uint32_t *) MK_PTR(inregs.ds, inregs.esi.w[0]));
-
-    /* Clean the registers for the next call */
-    memset(&inregs, 0, sizeof(com32sys_t));
-
-    /* Put the filename in the bounce buffer */
-    strlcpy(buf, filename, size);
+    lba = *((uint32_t *) MK_PTR(0, fd.handle));
 
     /* Call comapi_close() to free the structure */
-    inregs.eax.w[0] = 0x0008;
-    inregs.esi.w[0] = OFFS(buf);
-    inregs.es = SEG(buf);
-    __com32.cs_intcall(0x22, &inregs, &inregs);
+    close_file(fd.handle);
 
 fail:
     lfree(buf);
index 27823df..c681f58 100644 (file)
 
 #include <string.h>
 #include <com32.h>
+#include <core.h>
+#include <graphics.h>
 #include "syslnx.h"
+#include <syslinux/config.h>
 
 com32sys_t inreg, outreg;      // Global registers for this module
 
@@ -35,33 +38,26 @@ void runsyslinuxcmd(const char *cmd)
        return;
 
     strcpy(bounce, cmd);
-    REG_AX(inreg) = 0x0003;    // Run command
-    REG_BX(inreg) = OFFS(bounce);
-    REG_ES(inreg) = SEG(bounce);
-    __intcall(0x22, &inreg, &outreg);
+    load_kernel(bounce);
 }
 
 void gototxtmode(void)
 {
-    REG_AX(inreg) = 0x0005;
-    __intcall(0x22, &inreg, &outreg);
+    syslinux_force_text_mode();
 }
 
 void syslinux_idle(void)
 {
-    REG_AX(inreg) = 0x0013;
-    __intcall(0x22, &inreg, &outreg);
+    __idle();
 }
 
 unsigned int getversion(char *deriv, unsigned int *numfun)
 {
-    REG_AX(inreg) = 0x0001;
-    __intcall(0x22, &inreg, &outreg);
     if (deriv)
-       *deriv = REG_DL(outreg);
+       *deriv = __syslinux_version.filesystem;
     if (numfun)
-       *numfun = REG_AX(outreg);
-    return REG_CX(outreg);
+       *numfun = __syslinux_version.max_api;
+    return __syslinux_version.version;
 }
 
 void runsyslinuximage(const char *cmd, long ipappend)
index 8879d2a..073f111 100644 (file)
@@ -137,7 +137,7 @@ static const char *apply_extension(const char *kernel, const char *ext)
  * the the kernel. If we return the caller should call enter_cmdline()
  * so that the user can help us out.
  */
-static void load_kernel(const char *command_line)
+void load_kernel(const char *command_line)
 {
        struct menu_entry *me;
        const char *cmdline;
index 50bd52f..7bdcdd6 100644 (file)
@@ -181,4 +181,9 @@ static inline const struct syslinux_ipappend_strings
     return &__syslinux_ipappend_strings;
 }
 
+static inline enum syslinux_filesystem syslinux_filesystem(void)
+{
+    return syslinux_derivative_info()->c.filesystem;
+}
+
 #endif /* _SYSLINUX_CONFIG_H */
index 4bebda4..d25d08d 100644 (file)
 #define SYSLINUX_FEATURE_LOCAL_BOOT    (0*8+0)
 #define SYSLINUX_FEATURE_NOOP_IDLE     (0*8+1)
 
-extern struct __syslinux_feature_flags {
-    unsigned int len;
-    const unsigned char *ptr;
-} __syslinux_feature_flags;
+extern uint8_t feature_flags;
+extern uint8_t feature_flags_len;
 
 static inline int syslinux_has_feature(unsigned int __flag)
 {
     unsigned int __byte = __flag >> 3;
     unsigned int __bit = __flag & 7;
 
-    if (__byte <= __syslinux_feature_flags.len)
-       return (__syslinux_feature_flags.ptr[__byte] >> __bit) & 1;
+    if (__byte <= feature_flags_len)
+       return (feature_flags[__byte] >> __bit) & 1;
     else
        return 0;
 }
index b83ae6b..5d270a4 100644 (file)
@@ -46,7 +46,6 @@ LIBPCI_OBJS = \
 
 LIBSYSLINUX_OBJS = \
        syslinux/reboot.o syslinux/keyboard.o                           \
-       syslinux/features.o                                             \
        syslinux/version.o                                              \
        syslinux/pxe_get_cached.o syslinux/pxe_get_nic.o                \
        syslinux/pxe_dns.o                                              \
index b25f2d2..e5483fb 100644 (file)
@@ -42,6 +42,7 @@
 #include <syslinux/config.h>
 #include "file.h"
 #include "ansi.h"
+#include "graphics.h"
 
 static void ansicon_erase(const struct term_state *, int, int, int, int);
 static void ansicon_write_char(int, int, uint8_t, const struct term_state *);
@@ -90,8 +91,7 @@ int __ansicon_open(struct file_info *fp)
            ti.cols = 80;
        } else {
            /* Force text mode */
-           ireg.eax.w[0] = 0x0005;
-           __intcall(0x22, &ireg, NULL);
+           syslinux_force_text_mode();
 
            /* Initial state */
            ti.rows = BIOS_ROWS ? BIOS_ROWS + 1 : 25;
index fbcd936..7eae95f 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <com32.h>
+#include <core.h>
 #include <minmax.h>
 #include "file.h"
 
 /* Global, since it's used by stdcon_read */
 ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
 {
-    com32sys_t ireg, oreg;
     char *bufp = buf;
     size_t n = 0;
+    char hi = 0;
 
     (void)fp;
 
-    memset(&ireg, 0, sizeof ireg);
-
     while (n < count) {
+       if (hi) {
+           *bufp++ = hi;
+           n++;
+           hi = 0;
+           continue;
+       }
+
        /* Poll */
-       ireg.eax.b[1] = 0x0B;
-       __intcall(0x21, &ireg, &oreg);
-       if (!oreg.eax.b[0])
+       if (!pollchar())
            break;
 
        /* We have data, go get it */
-       ireg.eax.b[1] = 0x08;
-       __intcall(0x21, &ireg, &oreg);
-       *bufp++ = oreg.eax.b[0];
+       *bufp++ = getchar(&hi);
        n++;
     }
 
index 2d45a7b..1f7920b 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <com32.h>
+#include <core.h>
 #include <minmax.h>
 #include "file.h"
 
 static ssize_t __rawcon_write(struct file_info *fp, const void *buf,
                              size_t count)
 {
-    com32sys_t ireg;
     const char *bufp = buf;
     size_t n = 0;
 
     (void)fp;
 
-    memset(&ireg, 0, sizeof ireg);
-    ireg.eax.b[1] = 0x02;
-
     while (count--) {
-       ireg.edx.b[0] = *bufp++;
-       __intcall(0x21, &ireg, NULL);
+       writechr(*bufp++);
        n++;
     }
 
index fa0f4f4..3f949fb 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <com32.h>
+#include <core.h>
 #include <minmax.h>
 #include <syslinux/config.h>
 #include "file.h"
 
 ssize_t __serial_write(struct file_info *fp, const void *buf, size_t count)
 {
-    com32sys_t ireg;
     const char *bufp = buf;
     size_t n = 0;
 
@@ -49,12 +49,8 @@ ssize_t __serial_write(struct file_info *fp, const void *buf, size_t count)
     if (!syslinux_serial_console_info()->iobase)
        return count;           /* Nothing to do */
 
-    memset(&ireg, 0, sizeof ireg);
-    ireg.eax.b[1] = 0x04;
-
     while (count--) {
-       ireg.edx.b[0] = *bufp++;
-       __intcall(0x21, &ireg, NULL);
+       write_serial(*bufp++);
        n++;
     }
 
index 9cb2f7d..9bd225f 100644 (file)
@@ -34,6 +34,7 @@
 #include <errno.h>
 #include <string.h>
 #include <com32.h>
+#include <core.h>
 #include <minmax.h>
 #include "file.h"
 
@@ -57,22 +58,16 @@ static int __stdcon_open(struct file_info *fp)
 static ssize_t __stdcon_write(struct file_info *fp, const void *buf,
                              size_t count)
 {
-    com32sys_t ireg;
     const char *bufp = buf;
     size_t n = 0;
 
     (void)fp;
 
-    memset(&ireg, 0, sizeof ireg);
-    ireg.eax.b[1] = 0x02;
-
     while (count--) {
-       if (*bufp == '\n') {
-           ireg.edx.b[0] = '\r';
-           __intcall(0x21, &ireg, NULL);
-       }
-       ireg.edx.b[0] = *bufp++;
-       __intcall(0x21, &ireg, NULL);
+       if (*bufp == '\n')
+           writechr('\r');
+
+       writechr(*bufp++);
        n++;
     }
 
index e399f5f..8a4fb9e 100644 (file)
@@ -35,6 +35,7 @@
 #include <errno.h>
 #include <string.h>
 #include <com32.h>
+#include <core.h>
 #include <minmax.h>
 #include <colortbl.h>
 #include <syslinux/config.h>
 
 static void emit(char ch)
 {
-    static com32sys_t ireg;    /* Zeroed with the BSS */
-
-    ireg.eax.b[1] = 0x04;
-    ireg.edx.b[0] = ch;
-
-    __intcall(0x21, &ireg, NULL);
+    write_serial(ch);
 }
 
 ssize_t __xserial_write(struct file_info *fp, const void *buf, size_t count)
diff --git a/com32/lib/syslinux/features.c b/com32/lib/syslinux/features.c
deleted file mode 100644 (file)
index c88aef3..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- *   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
- *
- *   Permission is hereby granted, free of charge, to any person
- *   obtaining a copy of this software and associated documentation
- *   files (the "Software"), to deal in the Software without
- *   restriction, including without limitation the rights to use,
- *   copy, modify, merge, publish, distribute, sublicense, and/or
- *   sell copies of the Software, and to permit persons to whom
- *   the Software is furnished to do so, subject to the following
- *   conditions:
- *
- *   The above copyright notice and this permission notice shall
- *   be included in all copies or substantial portions of the Software.
- *
- *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *   OTHER DEALINGS IN THE SOFTWARE.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * syslinux/features.c
- *
- * SYSLINUX feature flag query
- */
-
-#include <klibc/compiler.h>
-#include <syslinux/features.h>
-#include <string.h>
-#include <com32.h>
-
-struct __syslinux_feature_flags __syslinux_feature_flags;
-
-void __constructor __syslinux_detect_features(void)
-{
-    static com32sys_t reg;
-
-    memset(&reg, 0, sizeof reg);
-    reg.eax.w[0] = 0x0015;
-    __intcall(0x22, &reg, &reg);
-
-    __syslinux_feature_flags.len = reg.ecx.w[0];
-    __syslinux_feature_flags.ptr = MK_PTR(reg.es, reg.ebx.w[0]);
-}
index bd00092..3eda48c 100644 (file)
 
 #include <syslinux/config.h>
 #include <klibc/compiler.h>
-#include <com32.h>
+#include <core.h>
 
 struct syslinux_ipappend_strings __syslinux_ipappend_strings;
 static const char *syslinux_ipappend_string_list[32];
 
 void __constructor __syslinux_get_ipappend_strings(void)
 {
-    static com32sys_t reg;
-    int i;
+    unsigned int i;
 
-    reg.eax.w[0] = 0x000f;
-    __intcall(0x22, &reg, &reg);
+    __syslinux_ipappend_strings.count = (size_t)numIPAppends;
+    __syslinux_ipappend_strings.ptr = syslinux_ipappend_string_list;
 
-    if (!(reg.eflags.l & EFLAGS_CF)) {
-       __syslinux_ipappend_strings.count = reg.ecx.w[0];
-       __syslinux_ipappend_strings.ptr = syslinux_ipappend_string_list;
-       for (i = 0; i < reg.ecx.w[0]; i++) {
-           syslinux_ipappend_string_list[i] =
-               MK_PTR(reg.es,
-                      *(uint16_t *) MK_PTR(reg.es, reg.ebx.w[0] + i * 2));
-       }
-    }
+    for (i = 0; i < (size_t)numIPAppends; i++)
+       syslinux_ipappend_string_list[i] = (const char *)(size_t)IPAppends[i];
 }
index feafde0..03bd216 100644 (file)
  * ----------------------------------------------------------------------- */
 
 #include <syslinux/keyboard.h>
-#include <com32.h>
+#include <core.h>
 
 struct syslinux_keyboard_map __syslinux_keyboard_map;
 
 void __constructor __syslinux_get_keyboard_map(void)
 {
-    static com32sys_t reg;
-
-    reg.eax.w[0] = 0x001e;
-    __intcall(0x22, &reg, &reg);
-    if (!(reg.eflags.l & EFLAGS_CF)) {
-       __syslinux_keyboard_map.version = reg.eax.w[0];
-       __syslinux_keyboard_map.length = reg.ecx.w[0];
-       __syslinux_keyboard_map.map = MK_PTR(reg.es, reg.ebx.w[0]);
-    }
+    __syslinux_keyboard_map.version = 1;
+    __syslinux_keyboard_map.length = sizeof(KbdMap);
+    __syslinux_keyboard_map.map = (void *)KbdMap;
 }
index a0ac9a0..0efb61f 100644 (file)
 #include <syslinux/boot.h>
 #include <stddef.h>
 #include <string.h>
-#include <com32.h>
+#include <core.h>
 
 int syslinux_run_command(const char *command)
 {
-    static com32sys_t ireg;
     char *lm_command = lstrdup(command);
 
     if (!lm_command)
        return -1;
     
-    ireg.eax.w[0] = 0x0003;
-    ireg.es = SEG(lm_command);
-    /* ireg.ebx.w[0] = OFFS(lm_command); */
-
-    __intcall(0x22, &ireg, NULL);
+    create_args_and_load(lm_command);
 
     /* Should not return even on failure, but in case... */
     lfree(lm_command);
index 8dc9fbe..0cfa547 100644 (file)
  * ----------------------------------------------------------------------- */
 
 #include <syslinux/boot.h>
+#include <core.h>
 #include <stddef.h>
-#include <com32.h>
+
+extern const char *default_cmd;
 
 __noreturn syslinux_run_default(void)
 {
-    static com32sys_t ireg;
-
-    ireg.eax.w[0] = 0x0004;
-    __intcall(0x22, &ireg, NULL);
-
+    load_kernel(default_cmd);
     /* Should not return even on failure */
     for (;;) ;
 }
index d5cdbc6..4391114 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 #include <syslinux/boot.h>
-#include <com32.h>
+#include <syslinux/config.h>
+#include <core.h>
+
+extern unsigned int ipappend;
 
 void syslinux_run_kernel_image(const char *filename, const char *cmdline,
                               uint32_t ipappend_flags, uint32_t type)
 {
-    static com32sys_t ireg;
     char *bbfilename = NULL;
     char *bbcmdline  = NULL;
 
+
     bbfilename = lstrdup(filename);
     if (!bbfilename)
        goto fail;
@@ -51,16 +54,10 @@ void syslinux_run_kernel_image(const char *filename, const char *cmdline,
     if (!bbcmdline)
        goto fail;
 
+    if (syslinux_filesystem() == SYSLINUX_FS_PXELINUX)
+       ipappend = ipappend_flags;
 
-    ireg.eax.w[0] = 0x0016;
-    ireg.ds = SEG(bbfilename);
-    /* ireg.esi.w[0] = OFFS(bbfilename); */
-    ireg.es = SEG(bbcmdline);
-    /* ireg.ebx.w[0] = OFFS(bbcmdline); */
-    ireg.ecx.l = ipappend_flags;
-    ireg.edx.l = type;
-
-    __intcall(0x22, &ireg, 0);
+    execute(bbfilename, type);
 
 fail:
     if (bbcmdline)
index f06e8c8..bb92222 100644 (file)
 #include <klibc/compiler.h>
 #include <syslinux/config.h>
 #include <string.h>
-#include <com32.h>
+#include <bios.h>
+#include <core.h>
 
 struct syslinux_serial_console_info __syslinux_serial_console_info;
 
 void __constructor __syslinux_get_serial_console_info(void)
 {
-    static com32sys_t reg;
+    uint16_t flowctl;
 
-    memset(&reg, 0, sizeof reg);
-    reg.eax.w[0] = 0x000b;
-    __intcall(0x22, &reg, &reg);
+    __syslinux_serial_console_info.iobase = SerialPort;
+    __syslinux_serial_console_info.divisor = BaudDivisor;
 
-    __syslinux_serial_console_info.iobase = reg.edx.w[0];
-    __syslinux_serial_console_info.divisor = reg.ecx.w[0];
-    __syslinux_serial_console_info.flowctl = reg.ebx.w[0];
+    flowctl = FlowOutput | FlowInput | (FlowIgnore << 4);
+
+    if (!DisplayCon)
+       flowctl |= (0x80 << 8);
+
+    __syslinux_serial_console_info.flowctl = flowctl;
 }
index e9ee6aa..544915a 100644 (file)
@@ -38,6 +38,7 @@
 #include <string.h>
 #include <inttypes.h>
 #include <com32.h>
+#include <core.h>
 #include <minmax.h>
 #include <dprintf.h>
 #include <syslinux/movebits.h>
@@ -51,12 +52,8 @@ static int shuffler_size;
 
 static void __constructor __syslinux_get_shuffer_size(void)
 {
-    static com32sys_t reg;
-
-    reg.eax.w[0] = 0x0023;
-    __intcall(0x22, &reg, &reg);
-
-    shuffler_size = (reg.eflags.l & EFLAGS_CF) ? 2048 : reg.ecx.w[0];
+    /* +15 padding is to guarantee alignment */
+    shuffler_size = __bcopyxx_len + 15;
 }
 
 /*
index 15b617b..1cd2efd 100644 (file)
 
 #include <syslinux/config.h>
 #include <klibc/compiler.h>
-#include <com32.h>
+#include <core.h>
+#include <../../../version.h>
 
 struct syslinux_version __syslinux_version;
 
 void __constructor __syslinux_get_version(void)
 {
-    static com32sys_t reg;
+    __syslinux_version.version = (VERSION_MAJOR << 8) + VERSION_MINOR;
 
-    reg.eax.w[0] = 0x0001;
-    __intcall(0x22, &reg, &reg);
+    /* We no longer support the COMBOOT API  */
+    __syslinux_version.max_api = 0xffff;
 
-    __syslinux_version.version = reg.ecx.w[0];
-    __syslinux_version.max_api = reg.eax.w[0];
-    __syslinux_version.filesystem = reg.edx.b[0];
-    __syslinux_version.version_string = MK_PTR(reg.es, reg.esi.w[0]);
-    __syslinux_version.copyright_string = MK_PTR(reg.es, reg.edi.w[0]);
+    __syslinux_version.filesystem = syslinux_filesystem();
+
+    /* Skip leading CR LF */
+    __syslinux_version.version_string = &syslinux_banner[2];
+
+    /* Skip leading space */
+    __syslinux_version.copyright_string = &copyright_str[1];
 }
index dd5d86e..ac1fab3 100644 (file)
  */
 
 #include <syslinux/video.h>
-#include <com32.h>
+#include <graphics.h>
 
 /*
  * Returns height of font or zero if no custom font loaded
  */
 int syslinux_font_query(uint8_t **font)
 {
-    static com32sys_t ireg;
-    com32sys_t oreg;
-    int height;
+    if (!UserFont)
+       return 0;
 
-    ireg.eax.w[0] = 0x0018;
-    __intcall(0x22, &ireg, &oreg);
+    *font = (uint8_t *)fontbuf;
 
-    height = !(oreg.eflags.l & EFLAGS_CF) ? oreg.eax.b[0] : 0;
-    if (height)
-       *font = MK_PTR(oreg.es, oreg.ebx.w[0]);
-
-    return height;
+    return VGAFontSize;
 }
 
index 57fd6fd..2a2c577 100644 (file)
  */
 
 #include <syslinux/video.h>
-#include <com32.h>
+#include <graphics.h>
 
 void syslinux_report_video_mode(uint16_t flags, uint16_t xsize, uint16_t ysize)
 {
-    static com32sys_t ireg;
+    if (flags > 0x0f)
+       return;
 
-    ireg.eax.w[0] = 0x0017;
-    ireg.ebx.w[0] = flags;
-    ireg.ecx.w[0] = xsize;
-    ireg.edx.w[0] = ysize;
-    __intcall(0x22, &ireg, NULL);
+    using_vga(flags, xsize, ysize);
 }
index 1e19d28..175c50c 100644 (file)
@@ -842,6 +842,7 @@ zero_string db 0                    ; Empty, null-terminated string
 ; Note: PXELINUX clears the idle is noop flag if appropriate
 ; in pxe_detect_nic_type
 ;
+               global feature_flags, feature_flags_len
 feature_flags:
                db 1                    ; Have local boot, idle is not noop
 feature_flags_len equ ($-feature_flags)
index 282c57f..3b545bb 100644 (file)
@@ -1,18 +1,15 @@
 #include <stddef.h>
 #include <com32.h>
+#include <core.h>
 #include <stdio.h>
 #include <string.h>
 
 void myputchar(int c)
 {
-    static com32sys_t ireg;
-
     if (c == '\n')
        myputchar('\r');
 
-    ireg.eax.b[1] = 0x02;
-    ireg.edx.b[0] = c;
-    __intcall(0x21, &ireg, NULL);
+    writechr(c);
 }
 
 void myputs(const char *str)
index 02382cc..dcbc924 100644 (file)
@@ -109,9 +109,9 @@ PXERetry    dw 0                    ; Extra PXE retries
                section .data16
                global SerialNotice
 SerialNotice   db 1                    ; Only print this once
+               global IPAppends, numIPAppends
 %if IS_PXELINUX
                extern IPOption
-               global IPAppends, numIPAppends
                alignz 2
 IPAppends      dw IPOption
 numIPAppends   equ ($-IPAppends)/2
index 31fb29e..9e7aa8f 100644 (file)
@@ -26,9 +26,7 @@
 #include "graphics.h"
 #include "core.h"
 
-static __lowmem char fontbuf[8192];
-
-extern uint8_t UserFont;
+__lowmem char fontbuf[8192];
 
 uint16_t GXPixCols = 1;                /* Graphics mode pixel columns */
 uint16_t GXPixRows = 1;                /* Graphics mode pixel rows */
index 8c95623..1e64b58 100644 (file)
@@ -1187,9 +1187,6 @@ static void ip_init(void)
 /*
  * Print the IPAPPEND strings, in order
  */
-extern const uint16_t IPAppends[];
-extern const char numIPAppends[];
-
 static void print_ipappend(void)
 {
     size_t i;
index 5b22478..d30fc3b 100644 (file)
@@ -9,14 +9,10 @@
 
 void myputchar(int c)
 {
-    static com32sys_t ireg;
-
     if (c == '\n')
        myputchar('\r');
 
-    ireg.eax.b[1] = 0x02;
-    ireg.edx.b[0] = c;
-    __intcall(0x21, &ireg, NULL);
+    writechr(c);
 }
 
 void myputs(const char *str)
index 4bf6bc4..42a9768 100644 (file)
@@ -74,7 +74,6 @@ extern union screen _screensize;
 #define VidRows                _screensize.b.row
 
 /* font.c */
-extern uint16_t VGAFontSize;
 extern void use_font(void);
 extern void bios_adjust_screen(void);
 
index 6604a5b..da94dbf 100644 (file)
@@ -25,9 +25,19 @@ extern char ConfigFile[];
 extern char syslinux_banner[];
 extern char copyright_str[];
 extern char StackBuf[];
+extern unsigned int __bcopyxx_len;
 
 extern uint8_t KbdMap[256];
 
+extern const uint16_t IPAppends[];
+extern const char numIPAppends[];
+
+extern uint16_t SerialPort;
+extern uint16_t BaudDivisor;
+extern uint8_t FlowOutput;
+extern uint8_t FlowInput;
+extern uint8_t FlowIgnore;
+
 /* diskstart.inc isolinux.asm*/
 extern void getlinsec(void);
 
@@ -101,16 +111,20 @@ static inline void set_flags(com32sys_t *regs, uint32_t flags)
 }
 
 extern int start_ldlinux(char **argv);
+extern int create_args_and_load(char *);
 
 extern void write_serial(char data);
 extern void writestr(char *str);
 extern void writechr(char data);
 extern void crlf(void);
+extern int pollchar(void);
+extern char getchar(char *hi);
 
 extern void cleanup_hardware(void);
 extern void sirq_cleanup(void);
 extern void adjust_screen(void);
 
 extern void execute(const char *cmdline, uint32_t type);
+extern void load_kernel(const char *cmdline);
 
 #endif /* CORE_H */
index 897103e..814ffe7 100644 (file)
@@ -44,6 +44,11 @@ extern uint16_t VGAPos;
 extern uint16_t *VGAFilePtr;
 extern char VGAFileBuf[VGA_FILE_BUF_SIZE];
 extern char VGAFileMBuf[];
+extern uint16_t VGAFontSize;
+
+extern uint8_t UserFont;
+
+extern __lowmem char fontbuf[8192];
 
 extern void syslinux_force_text_mode(void);
 extern void vgadisplayfile(FILE *_fd);
index 4790887..5930a1e 100644 (file)
@@ -1219,9 +1219,9 @@ PXERetry  dw 0                    ; Extra PXE retries
                section .data16
                global SerialNotice
 SerialNotice   db 1                    ; Only print this once
+               global IPAppends, numIPAppends
 %if IS_PXELINUX
                extern IPOption
-               global IPAppends, numIPAppends
                alignz 2
 IPAppends      dw IPOption
 numIPAppends   equ ($-IPAppends)/2