diff options
Diffstat (limited to 'com32/modules/ethersel.c')
-rw-r--r-- | com32/modules/ethersel.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/com32/modules/ethersel.c b/com32/modules/ethersel.c index 64c2ceb3..d200d627 100644 --- a/com32/modules/ethersel.c +++ b/com32/modules/ethersel.c @@ -35,6 +35,8 @@ #include <console.h> #include <sys/pci.h> #include <com32.h> +#include <syslinux/boot.h> +#include <syslinux/config.h> #ifdef DEBUG # define dprintf printf @@ -42,17 +44,6 @@ # define dprintf(...) ((void)0) #endif -static const char * -get_config(void) -{ - static com32sys_t r; - - r.eax.w[0] = 0x000E; - __intcall(0x22, &r, &r); - - return MK_PTR(r.es, r.ebx.w[0]); -} - static char * skipspace(char *p) { @@ -139,7 +130,7 @@ parse_config(const char *filename) struct match *m; if ( !filename ) - filename = get_config(); + filename = syslinux_config_file(); f = fopen(filename, "r"); if ( !f ) @@ -198,19 +189,6 @@ parse_config(const char *filename) return list; } -static void __attribute__((noreturn)) -execute(const char *cmdline) -{ - static com32sys_t ireg; - - strcpy(__com32.cs_bounce, cmdline); - ireg.eax.w[0] = 0x0003; /* Run command */ - ireg.ebx.w[0] = OFFS(__com32.cs_bounce); - ireg.es = SEG(__com32.cs_bounce); - __intcall(0x22, &ireg, NULL); - exit(255); /* Shouldn't return */ -} - int main(int argc, char *argv[]) { struct match *list, *match; @@ -225,7 +203,7 @@ int main(int argc, char *argv[]) match = find_pci_device(&pci_device_list,list); if ( match ) - execute(match->filename); + syslinux_run_command(match->filename); /* On error, return to the command line */ fputs("Error: no recognized network card found!\n", stderr); |