aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux
diff options
context:
space:
mode:
Diffstat (limited to 'com32/elflink/ldlinux')
-rw-r--r--com32/elflink/ldlinux/Makefile13
-rw-r--r--com32/elflink/ldlinux/adv.c15
-rw-r--r--com32/elflink/ldlinux/advwrite.c10
-rw-r--r--com32/elflink/ldlinux/get_key.c25
4 files changed, 37 insertions, 26 deletions
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index 556f93a5..bfec4503 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -10,20 +10,21 @@
##
## -----------------------------------------------------------------------
-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 \
+ loadhigh.o msg.o
BTARGET = ldlinux.c32
all: $(BTARGET) ldlinux_lnx.a
-ldlinux.elf : 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 loadhigh.o msg.o
+ldlinux.elf : $(OBJS)
$(LD) $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -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, &reg, NULL);
-
- reg.eax.w[0] = 0x001c;
- __intcall(0x22, &reg, &reg);
- __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, &reg, &reg);
- return (reg.eflags.l & EFLAGS_CF) ? -1 : 0;
+ return firmware->adv_ops->write();
}
diff --git a/com32/elflink/ldlinux/get_key.c b/com32/elflink/ldlinux/get_key.c
index cece0f81..6cba1244 100644
--- a/com32/elflink/ldlinux/get_key.c
+++ b/com32/elflink/ldlinux/get_key.c
@@ -112,6 +112,31 @@ static const struct keycode keycodes[] = {
CODE(KEY_INSERT, "\033[2~"),
CODE(KEY_INSERT, "\033[@"),
CODE(KEY_DELETE, "\033[3~"),
+
+ /* EFI scan codes */
+ CODE(KEY_UP, "\0\x01"),
+ CODE(KEY_DOWN, "\0\x02"),
+ CODE(KEY_RIGHT, "\0\x03"),
+ CODE(KEY_LEFT, "\0\x04"),
+ CODE(KEY_HOME, "\0\x05"),
+ CODE(KEY_END, "\0\x06"),
+ CODE(KEY_INSERT, "\0\x07"),
+ CODE(KEY_DELETE, "\0\x08"),
+ CODE(KEY_PGUP, "\0\x09"),
+ CODE(KEY_PGDN, "\0\x0a"),
+ CODE(KEY_F1, "\0\x0b"),
+ CODE(KEY_F2, "\0\x0c"),
+ CODE(KEY_F3, "\0\x0d"),
+ CODE(KEY_F4, "\0\x0e"),
+ CODE(KEY_F5, "\0\x0f"),
+ CODE(KEY_F6, "\0\x10"),
+ CODE(KEY_F7, "\0\x11"),
+ CODE(KEY_F8, "\0\x12"),
+ CODE(KEY_F9, "\0\x13"),
+ CODE(KEY_F10, "\0\x14"),
+ CODE(KEY_F11, "\0\x15"),
+ CODE(KEY_F12, "\0\x16"),
+ CODE(KEY_ESC, "\0\x17"),
};
#define NCODES ((int)(sizeof keycodes/sizeof(struct keycode)))