aboutsummaryrefslogtreecommitdiffstats
path: root/core/bios.c
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-01-20 14:04:14 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-02-02 16:12:22 +0000
commit73ecc07646aa9577da929e79412989f600005b40 (patch)
treedb78243a5c376257606e8dee01c36a365b62a19d /core/bios.c
parent13aff40f7b7a9644568c6144c3893c77d62492bd (diff)
downloadsyslinux-73ecc07646aa9577da929e79412989f600005b40.tar.gz
syslinux-73ecc07646aa9577da929e79412989f600005b40.tar.xz
syslinux-73ecc07646aa9577da929e79412989f600005b40.zip
firmware: Add .ipappend_strings function pointer
We need a firmware-independent way of getting the ipappend strings so add a function pointer to 'struct firmware'. The BIOS backend uses the old __intcall() method whereas the EFI backend accesses 'IPAppends' and 'numIPAppends' directly. Note that the EFI backend currently always returns 0 for 'numIPAppends' because it does not support PXE. Also, while I'm here I fixed the types of 'numIPAppends' and 'IPAppends' for EFI. For some reason the data types were the wrong way around. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'core/bios.c')
-rw-r--r--core/bios.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/bios.c b/core/bios.c
index 6aaf8c49..8725edad 100644
--- a/core/bios.c
+++ b/core/bios.c
@@ -36,6 +36,30 @@ struct input_ops bios_input_ops = {
.getchar = bios_getchar,
};
+static const char *syslinux_ipappend_string_list[32];
+bool bios_ipappend_strings(char **list, int *count)
+{
+ static com32sys_t reg;
+ int i;
+
+ reg.eax.w[0] = 0x000f;
+ __intcall(0x22, &reg, &reg);
+
+ if (reg.eflags.l & EFLAGS_CF)
+ return false;
+
+ 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));
+ }
+
+ *list = syslinux_ipappend_string_list;
+ *count = reg.ecx.w[0];
+
+ return true;
+}
+
extern char *bios_get_config_file_name(void);
extern void bios_get_serial_console_info(uint16_t *, uint16_t *, uint16_t *);
@@ -47,6 +71,7 @@ struct firmware bios_fw = {
.disk_init = bios_disk_init,
.o_ops = &bios_output_ops,
.i_ops = &bios_input_ops,
+ .ipappend_strings = bios_ipappend_strings,
.get_config_file_name = bios_get_config_file_name,
.get_serial_console_info = bios_get_serial_console_info,
};