aboutsummaryrefslogtreecommitdiffstats
path: root/core/bios.c
blob: 6aaf8c4960b842292d9bf9b81da0166d7585acb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <sys/io.h>
#include <fs.h>
#include <bios.h>
#include <syslinux/memscan.h>
#include <syslinux/firmware.h>

struct firmware *firmware = NULL;

extern struct ansi_ops bios_ansi_ops;

extern void bios_erase(int, int, int, int, uint8_t);
extern void bios_write_char(uint8_t, uint8_t);
extern void bios_showcursor(uint16_t);
extern void bios_scroll_up(uint8_t, uint8_t, uint8_t);
extern void bios_set_cursor(int, int, bool);
extern void bios_beep(void);
extern void bios_set_mode(uint16_t mode);
extern void bios_get_mode(int *rows, int *cols);
extern void bios_get_cursor(int *x, int *y);

struct output_ops bios_output_ops = {
	.erase = bios_erase,
	.write_char = bios_write_char,
	.showcursor = bios_showcursor,
	.set_cursor = bios_set_cursor,
	.scroll_up = bios_scroll_up,
	.beep = bios_beep,
	.get_mode = bios_get_mode,
	.set_mode = bios_set_mode,
	.get_cursor = bios_get_cursor,
};

extern char bios_getchar(void);

struct input_ops bios_input_ops = {
	.getchar = bios_getchar,
};

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,
	.scan_memory = bios_scan_memory,
	.adjust_screen = bios_adjust_screen,
	.cleanup = bios_cleanup_hardware,
	.disk_init = bios_disk_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)
{
	firmware = &bios_fw;
}