diff options
Diffstat (limited to 'com32/elflink')
-rw-r--r-- | com32/elflink/ldlinux/Makefile | 13 | ||||
-rw-r--r-- | com32/elflink/ldlinux/adv.c | 15 | ||||
-rw-r--r-- | com32/elflink/ldlinux/advwrite.c | 10 |
3 files changed, 12 insertions, 26 deletions
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile index 93ca127d..aa35f475 100644 --- a/com32/elflink/ldlinux/Makefile +++ b/com32/elflink/ldlinux/Makefile @@ -10,18 +10,19 @@ ## ## ----------------------------------------------------------------------- -topdir = ../../.. -MAKEDIR = $(topdir)/mk +VPATH = $(SRC) include $(MAKEDIR)/elf.mk CFLAGS += -I$(topdir)/core/elflink -I$(topdir)/core/include -I$(topdir)/com32/lib -fvisibility=hidden -LIBS = --whole-archive $(com32)/lib/libcom32min.a +LIBS = --whole-archive $(objdir)/com32/lib/libcom32min.a + +OBJS = ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o adv.o \ + execute.o chainboot.o kernel.o get_key.o advwrite.o setadv.o \ + eprintf.o loadhigh.o msg.o all: ldlinux.c32 ldlinux_lnx.a -ldlinux.c32 : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \ - adv.o execute.o chainboot.o kernel.o get_key.o \ - advwrite.o setadv.o eprintf.o loadhigh.o msg.o +ldlinux.c32 : $(OBJS) $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) LNXCFLAGS += -D__export='__attribute__((visibility("default")))' diff --git a/com32/elflink/ldlinux/adv.c b/com32/elflink/ldlinux/adv.c index 4c3ad508..677fe92d 100644 --- a/com32/elflink/ldlinux/adv.c +++ b/com32/elflink/ldlinux/adv.c @@ -32,24 +32,13 @@ */ #include <syslinux/adv.h> +#include <syslinux/firmware.h> #include <klibc/compiler.h> -#include <inttypes.h> -#include <com32.h> __export void *__syslinux_adv_ptr; __export size_t __syslinux_adv_size; -extern void adv_init(void); void __constructor __syslinux_init(void) { - static com32sys_t reg; - - /* Initialize the ADV structure */ - reg.eax.w[0] = 0x0025; - __intcall(0x22, ®, NULL); - - reg.eax.w[0] = 0x001c; - __intcall(0x22, ®, ®); - __syslinux_adv_ptr = MK_PTR(reg.es, reg.ebx.w[0]); - __syslinux_adv_size = reg.ecx.w[0]; + firmware->adv_ops->init(); } diff --git a/com32/elflink/ldlinux/advwrite.c b/com32/elflink/ldlinux/advwrite.c index 35829c1c..47e45534 100644 --- a/com32/elflink/ldlinux/advwrite.c +++ b/com32/elflink/ldlinux/advwrite.c @@ -31,15 +31,11 @@ * Write back the ADV */ -#include <syslinux/adv.h> #include <klibc/compiler.h> -#include <com32.h> +#include <syslinux/adv.h> +#include <syslinux/firmware.h> __export int syslinux_adv_write(void) { - static com32sys_t reg; - - reg.eax.w[0] = 0x001d; - __intcall(0x22, ®, ®); - return (reg.eflags.l & EFLAGS_CF) ? -1 : 0; + return firmware->adv_ops->write(); } |