struct output_ops *o_ops;
struct input_ops *i_ops;
char *(*get_config_file_name)(void);
+ void (*get_serial_console_info)(uint16_t *, uint16_t *, uint16_t *);
};
extern struct firmware *firmware;
};
extern char *bios_get_config_file_name(void);
+extern void bios_get_serial_console_info(uint16_t *, uint16_t *, uint16_t *);
struct firmware bios_fw = {
.init = bios_init,
.o_ops = &bios_output_ops,
.i_ops = &bios_input_ops,
.get_config_file_name = bios_get_config_file_name,
+ .get_serial_console_info = bios_get_serial_console_info,
};
void syslinux_register_bios(void)
*/
#include <klibc/compiler.h>
+#include <syslinux/firmware.h>
#include <syslinux/config.h>
#include <string.h>
#include <com32.h>
struct syslinux_serial_console_info __syslinux_serial_console_info;
-void __constructor __syslinux_get_serial_console_info(void)
+void bios_get_serial_console_info(uint16_t *iobase, uint16_t *divisor,
+ uint16_t *flowctl)
{
static com32sys_t reg;
reg.eax.w[0] = 0x000b;
__intcall(0x22, ®, ®);
- __syslinux_serial_console_info.iobase = reg.edx.w[0];
- __syslinux_serial_console_info.divisor = reg.ecx.w[0];
- __syslinux_serial_console_info.flowctl = reg.ebx.w[0];
+ *iobase = reg.edx.w[0];
+ *divisor = reg.ecx.w[0];
+ *flowctl = reg.ebx.w[0];
+}
+
+void __constructor __syslinux_get_serial_console_info(void)
+{
+ uint16_t iobase, divisor, flowctl;
+
+ firmware->get_serial_console_info(&iobase, &divisor, &flowctl);
+
+ __syslinux_serial_console_info.iobase = iobase;
+ __syslinux_serial_console_info.divisor = divisor;
+ __syslinux_serial_console_info.flowctl = flowctl;
}
write_serial(regs->eax.b[0]);
}
-void pm_serialcfg(com32sys_t *regs)
+void serialcfg(uint16_t *iobase, uint16_t *divisor, uint16_t *flowctl)
{
uint8_t al, ah;
- regs->eax.w[0] = SerialPort;
- regs->ecx.w[0] = BaudDivisor;
+ *iobase = SerialPort;
+ *divisor = BaudDivisor;
al = FlowOutput;
ah = FlowInput;
if (!DisplayCon)
ah |= 0x80;
- regs->ebx.w[0] = al | (ah << 8);
+ *flowctl = al | (ah << 8);
+}
+
+void pm_serialcfg(com32sys_t *regs)
+{
+ serialcfg(®s->eax.w[0], ®s->ecx.w[0], ®s->ebx.w[0]);
}
static void write_serial_displaymask(char data)
}
extern struct disk *efi_disk_init(com32sys_t *);
+extern void serialcfg(uint16_t *, uint16_t *, uint16_t *);
+
struct firmware efi_fw = {
.init = efi_init,
.scan_memory = efi_scan_memory,
.o_ops = &efi_ops,
.i_ops = &efi_iops,
.get_config_file_name = efi_get_config_file_name,
+ .get_serial_console_info = serialcfg,
};
static inline void syslinux_register_efi(void)