summaryrefslogtreecommitdiff
path: root/include/x86/bios.h
blob: a19e5701b05ea9682ecb364de7a6d8d172f0aff9 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
** @file	bios.h
**
** @author	Warren R. Carithers
**
** BIOS-related declarations
*/

#ifndef BIOS_H_
#define BIOS_H_

/*
** BIOS-related memory addresses
*/

#define BIOS_BDA       0x0400

/*
** Selected BIOS interrupt numbers
*/

#define BIOS_TIMER     0x08
#define BIOS_KBD       0x09
#define BIOS_VIDEO     0x10
#define BIOS_EQUIP     0x11
#define BIOS_MSIZ      0x12
#define BIOS_DISK      0x13
#define BIOS_SERIAL    0x14
#define BIOS_MISC      0x15
#define BIOS_KBDSVC    0x16
#define BIOS_PRTSVC    0x17
#define BIOS_BOOT      0x19
#define BIOS_RTCPCI    0x1a

// BIOS video commands (AH)
#define BV_W_ADV     0x0e

// BIOS disk commands (AH)
#define BD_RESET     0x00
#define BD_CHECK     0x01
#define BD_RDSECT    0x02
#define BD_WRSECT    0x03
#define BD_PARAMS    0x08

// BIOS disk commands with parameters (AX)
#define BD_READ(n)   ((BD_RDSECT << 8) | (n))
#define BD_READ1     0x0201

// CMOS ports (used for masking NMIs)
#define	CMOS_ADDR    0x70
#define	CMOS_DATA    0x71

// important related commands
#define NMI_ENABLE   0x00
#define NMI_DISABLE  0x80

/*
** Physical Memory Map Table (0000:2D00 - 0000:7c00)
**
** Primarily used with the BIOS_MISC interrupt
*/
#define MMAP_SEG       0x02D0
#define MMAP_DISP      0x0000
#define MMAP_ADDR      ((MMAP_SEG << 4) + MMAP_DISP)
#define MMAP_SECTORS   0x0a

#define MMAP_ENT       24            /* bytes per entry */
#define MMAP_MAX_ENTS  (BOOT_ADDR - MMAP_ADDR - 4) / 24

#define MMAP_CODE      0xE820        /* int 0x15 code */
#define MMAP_MAGIC_NUM 0x534D4150    /* for 0xE820 interrupt */

#endif