|
|
@@ -20,6 +20,7 @@
|
|
20
|
20
|
#include <errno.h>
|
|
21
|
21
|
#include <realmode.h>
|
|
22
|
22
|
#include <bios.h>
|
|
|
23
|
+#include <memsizes.h>
|
|
23
|
24
|
#include <gpxe/memmap.h>
|
|
24
|
25
|
|
|
25
|
26
|
/**
|
|
|
@@ -51,19 +52,6 @@ struct e820_entry {
|
|
51
|
52
|
static struct e820_entry __data16 ( e820buf );
|
|
52
|
53
|
#define e820buf __use_data16 ( e820buf )
|
|
53
|
54
|
|
|
54
|
|
-/**
|
|
55
|
|
- * Get size of base memory from BIOS free base memory counter
|
|
56
|
|
- *
|
|
57
|
|
- * @ret basemem Base memory size, in kB
|
|
58
|
|
- */
|
|
59
|
|
-static unsigned int basememsize ( void ) {
|
|
60
|
|
- uint16_t basemem;
|
|
61
|
|
-
|
|
62
|
|
- get_real ( basemem, BDA_SEG, 0x0013 );
|
|
63
|
|
- DBG ( "Base memory size %dkB\n", basemem );
|
|
64
|
|
- return basemem;
|
|
65
|
|
-}
|
|
66
|
|
-
|
|
67
|
55
|
/**
|
|
68
|
56
|
* Get size of extended memory via INT 15,e801
|
|
69
|
57
|
*
|
|
|
@@ -120,8 +108,11 @@ static unsigned int extmemsize_88 ( void ) {
|
|
120
|
108
|
* Get size of extended memory
|
|
121
|
109
|
*
|
|
122
|
110
|
* @ret extmem Extended memory size, in kB
|
|
|
111
|
+ *
|
|
|
112
|
+ * Note that this is only an approximation; for an accurate picture,
|
|
|
113
|
+ * use the E820 memory map obtained via get_memmap();
|
|
123
|
114
|
*/
|
|
124
|
|
-static unsigned int extmemsize ( void ) {
|
|
|
115
|
+unsigned int extmemsize ( void ) {
|
|
125
|
116
|
unsigned int extmem;
|
|
126
|
117
|
|
|
127
|
118
|
/* Try INT 15,e801 first, then fall back to INT 15,88 */
|