Kaynağa Gözat

[pcbios] Add extra debugging messages relating to the system memory map

tags/v0.9.4
Michael Brown 16 yıl önce
ebeveyn
işleme
18aa0e79d2

+ 10
- 0
src/arch/i386/firmware/pcbios/hidemem.c Dosyayı Görüntüle

@@ -20,6 +20,7 @@
20 20
 #include <biosint.h>
21 21
 #include <basemem.h>
22 22
 #include <gpxe/init.h>
23
+#include <gpxe/memmap.h>
23 24
 #include <gpxe/hidemem.h>
24 25
 
25 26
 /** Alignment for hidden memory regions */
@@ -121,6 +122,11 @@ void hide_text ( void ) {
121 122
  * returned by the BIOS.
122 123
  */
123 124
 static void hide_etherboot ( void ) {
125
+	struct memory_map memmap;
126
+
127
+	/* Dump memory map before mangling */
128
+	DBG ( "Hiding gPXE from system memory map\n" );
129
+	get_memmap ( &memmap );
124 130
 
125 131
 	/* Initialise the hidden regions */
126 132
 	hide_basemem();
@@ -130,6 +136,10 @@ static void hide_etherboot ( void ) {
130 136
 	/* Hook INT 15 */
131 137
 	hook_bios_interrupt ( 0x15, ( unsigned int ) int15,
132 138
 			      &int15_vector );
139
+
140
+	/* Dump memory map after mangling */
141
+	DBG ( "Hidden gPXE from system memory map\n" );
142
+	get_memmap ( &memmap );
133 143
 }
134 144
 
135 145
 /**

+ 7
- 4
src/arch/i386/firmware/pcbios/memmap.c Dosyayı Görüntüle

@@ -86,8 +86,9 @@ static unsigned int extmemsize_e801 ( void ) {
86 86
 	}
87 87
 
88 88
 	extmem = ( extmem_1m_to_16m_k + ( extmem_16m_plus_64k * 64 ) );
89
-	DBG ( "INT 15,e801 extended memory size %d+64*%d=%d kB\n",
90
-	      extmem_1m_to_16m_k, extmem_16m_plus_64k, extmem );
89
+	DBG ( "INT 15,e801 extended memory size %d+64*%d=%d kB [100000,%x)\n",
90
+	      extmem_1m_to_16m_k, extmem_16m_plus_64k, extmem,
91
+	      ( 0x100000 + ( extmem * 1024 ) ) );
91 92
 	return extmem;
92 93
 }
93 94
 
@@ -103,7 +104,8 @@ static unsigned int extmemsize_88 ( void ) {
103 104
 	__asm__ __volatile__ ( REAL_CODE ( "int $0x15" )
104 105
 			       : "=a" ( extmem ) : "a" ( 0x8800 ) );
105 106
 
106
-	DBG ( "INT 15,88 extended memory size %d kB\n", extmem );
107
+	DBG ( "INT 15,88 extended memory size %d kB [100000, %x)\n",
108
+	      extmem, ( 0x100000 + ( extmem * 1024 ) ) );
107 109
 	return extmem;
108 110
 }
109 111
 
@@ -203,7 +205,8 @@ void get_memmap ( struct memory_map *memmap ) {
203 205
 
204 206
 	/* Get base and extended memory sizes */
205 207
 	basemem = basememsize();
206
-	DBG ( "FBMS base memory size %d kB\n", basemem );
208
+	DBG ( "FBMS base memory size %d kB [0,%x)\n",
209
+	      basemem, ( basemem * 1024 ) );
207 210
 	extmem = extmemsize();
208 211
 	
209 212
 	/* Try INT 15,e820 first */

+ 2
- 0
src/image/segment.c Dosyayı Görüntüle

@@ -43,6 +43,8 @@ int prep_segment ( userptr_t segment, size_t filesz, size_t memsz ) {
43 43
 	physaddr_t end = user_to_phys ( segment, memsz );
44 44
 	unsigned int i;
45 45
 
46
+	DBG ( "Preparing segment [%lx,%lx,%lx)\n", start, mid, end );
47
+
46 48
 	/* Sanity check */
47 49
 	if ( filesz > memsz ) {
48 50
 		DBG ( "Insane segment [%lx,%lx,%lx)\n", start, mid, end );

Loading…
İptal
Kaydet