/
hw86.h
82 lines (78 loc) · 1.51 KB
/
hw86.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Hardware utilities for x86
*/
#ifndef _HWx86_H
#define _HWx86_H
/*
* Functions defined in hw86.s
*/
/*
* Dump all register values to serial port
*/
extern void dump_regs();
/*
* Set the VGA text mode to 80x25 with 16 colors
*/
extern void io_set_text_mode();
/*
* Clears the screen
*/
extern void io_clear_screen();
/*
* Send a character to the screen in teletype mode
*/
extern void io_out_char(uchar c);
/*
* Send a character to the screen at specific position
* with attributes (text and background color)
*/
extern void io_out_char_attr(uint x, uint y, uchar c, uchar attr);
/*
* Send a character to the serial port
*/
extern void io_out_char_serial(uchar c);
/*
* Read a character from the serial port
*/
extern uchar io_in_char_serial();
/*
* Hide the cursor
*/
extern void io_hide_cursor();
/*
* Show the cursor
*/
extern void io_show_cursor();
/*
* Get the cursor position
*/
extern void io_get_cursor_pos(uint* x, uint* y);
/*
* Set the cursor position
*/
extern void io_set_cursor_pos(uint x, uint y);
/*
* Get keystroke
*/
extern uint io_in_key();
/*
* Halt the computer
*/
extern void halt();
/*
* Get disk hardware info
*/
extern uint get_disk_info(uint disk, uint* st, uint* hd, uint* cl);
/*
* Read disk sector
*/
extern uint read_disk_sector(uint disk, uint sector, uint n, uchar* buff);
/*
* Write disk sector
*/
extern uint write_disk_sector(uint disk, uint sector, uint n, uchar* buff);
/*
* Get system time
*/
extern void get_time(uchar* BDCtime, uchar* date);
#endif /* _HWx86_H */