* Get ipappend strings
*/
+#include <syslinux/firmware.h>
#include <syslinux/config.h>
-#include <klibc/compiler.h>
-#include <com32.h>
struct syslinux_ipappend_strings __syslinux_ipappend_strings;
-static const char *syslinux_ipappend_string_list[32];
void __syslinux_get_ipappend_strings(void)
{
- static com32sys_t reg;
- int i;
+ char *list;
+ int count;
- reg.eax.w[0] = 0x000f;
- __intcall(0x22, ®, ®);
-
- 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));
- }
+ if (firmware->ipappend_strings(&list, &count)) {
+ __syslinux_ipappend_strings.count = count;
+ __syslinux_ipappend_strings.ptr = list;
}
}
struct input_ops *i_ops;
char *(*get_config_file_name)(void);
void (*get_serial_console_info)(uint16_t *, uint16_t *, uint16_t *);
+ bool (*ipappend_strings)(char **, int *);
};
extern struct firmware *firmware;
.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, ®, ®);
+
+ 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 *);
.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,
};
{
}
-uint16_t IPAppends = 0;
-char numIPAppends[2];
+uint16_t numIPAppends = 0;
+char *IPAppends = NULL;
uint16_t BIOS_fbm = 1;
far_ptr_t InitStack;
uint16_t APIVer;
return ConfigName;
}
+bool efi_ipappend_strings(char **list, int *count)
+{
+ *count = numIPAppends;
+ *list = (char *)IPAppends;
+}
+
extern struct disk *efi_disk_init(com32sys_t *);
extern void serialcfg(uint16_t *, uint16_t *, uint16_t *);
.i_ops = &efi_iops,
.get_config_file_name = efi_get_config_file_name,
.get_serial_console_info = serialcfg,
+ .ipappend_strings = efi_ipappend_strings,
};
static inline void syslinux_register_efi(void)