Browse Source

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

tags/v0.9.4
Michael Brown 16 years ago
parent
commit
18aa0e79d2

+ 10
- 0
src/arch/i386/firmware/pcbios/hidemem.c View File

20
 #include <biosint.h>
20
 #include <biosint.h>
21
 #include <basemem.h>
21
 #include <basemem.h>
22
 #include <gpxe/init.h>
22
 #include <gpxe/init.h>
23
+#include <gpxe/memmap.h>
23
 #include <gpxe/hidemem.h>
24
 #include <gpxe/hidemem.h>
24
 
25
 
25
 /** Alignment for hidden memory regions */
26
 /** Alignment for hidden memory regions */
121
  * returned by the BIOS.
122
  * returned by the BIOS.
122
  */
123
  */
123
 static void hide_etherboot ( void ) {
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
 	/* Initialise the hidden regions */
131
 	/* Initialise the hidden regions */
126
 	hide_basemem();
132
 	hide_basemem();
130
 	/* Hook INT 15 */
136
 	/* Hook INT 15 */
131
 	hook_bios_interrupt ( 0x15, ( unsigned int ) int15,
137
 	hook_bios_interrupt ( 0x15, ( unsigned int ) int15,
132
 			      &int15_vector );
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 View File

86
 	}
86
 	}
87
 
87
 
88
 	extmem = ( extmem_1m_to_16m_k + ( extmem_16m_plus_64k * 64 ) );
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
 	return extmem;
92
 	return extmem;
92
 }
93
 }
93
 
94
 
103
 	__asm__ __volatile__ ( REAL_CODE ( "int $0x15" )
104
 	__asm__ __volatile__ ( REAL_CODE ( "int $0x15" )
104
 			       : "=a" ( extmem ) : "a" ( 0x8800 ) );
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
 	return extmem;
109
 	return extmem;
108
 }
110
 }
109
 
111
 
203
 
205
 
204
 	/* Get base and extended memory sizes */
206
 	/* Get base and extended memory sizes */
205
 	basemem = basememsize();
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
 	extmem = extmemsize();
210
 	extmem = extmemsize();
208
 	
211
 	
209
 	/* Try INT 15,e820 first */
212
 	/* Try INT 15,e820 first */

+ 2
- 0
src/image/segment.c View File

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

Loading…
Cancel
Save