1 | /* ----------------------------------------------------------------------- * |
---|
2 | * |
---|
3 | * Copyright 2001-2009 H. Peter Anvin - All Rights Reserved |
---|
4 | * Copyright 2009 Intel Corporation; author: H. Peter Anvin |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation, Inc., 53 Temple Place Ste 330, |
---|
9 | * Boston MA 02111-1307, USA; either version 2 of the License, or |
---|
10 | * (at your option) any later version; incorporated herein by reference. |
---|
11 | * |
---|
12 | * ----------------------------------------------------------------------- */ |
---|
13 | |
---|
14 | #include <stdint.h> |
---|
15 | |
---|
16 | /* Addresses in the zero page */ |
---|
17 | #define BIOS_INT13 (0x13*4) /* INT 13h vector */ |
---|
18 | #define BIOS_INT15 (0x15*4) /* INT 15h vector */ |
---|
19 | #define BIOS_INT1E (0x1E*4) /* INT 1Eh vector */ |
---|
20 | #define BIOS_INT40 (0x40*4) /* INT 13h vector */ |
---|
21 | #define BIOS_INT41 (0x41*4) /* INT 41h vector */ |
---|
22 | #define BIOS_INT46 (0x46*4) /* INT 46h vector */ |
---|
23 | #define BIOS_BASEMEM 0x413 /* Amount of DOS memory */ |
---|
24 | #define BIOS_EQUIP 0x410 /* BIOS equipment list */ |
---|
25 | #define BIOS_HD_COUNT 0x475 /* Number of hard drives present */ |
---|
26 | |
---|
27 | /* Access to objects in the zero page */ |
---|
28 | static inline void wrz_8(uint32_t addr, uint8_t data) |
---|
29 | { |
---|
30 | *((uint8_t *) addr) = data; |
---|
31 | } |
---|
32 | |
---|
33 | static inline void wrz_16(uint32_t addr, uint16_t data) |
---|
34 | { |
---|
35 | *((uint16_t *) addr) = data; |
---|
36 | } |
---|
37 | |
---|
38 | static inline void wrz_32(uint32_t addr, uint32_t data) |
---|
39 | { |
---|
40 | *((uint32_t *) addr) = data; |
---|
41 | } |
---|
42 | |
---|
43 | static inline uint8_t rdz_8(uint32_t addr) |
---|
44 | { |
---|
45 | return *((uint8_t *) addr); |
---|
46 | } |
---|
47 | |
---|
48 | static inline uint16_t rdz_16(uint32_t addr) |
---|
49 | { |
---|
50 | return *((uint16_t *) addr); |
---|
51 | } |
---|
52 | |
---|
53 | static inline uint32_t rdz_32(uint32_t addr) |
---|
54 | { |
---|
55 | return *((uint32_t *) addr); |
---|
56 | } |
---|