Browse Source

[pcbios] Add extra debugging messages when unhiding iPXE from memory

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 years ago
parent
commit
b33082a52b
1 changed files with 15 additions and 5 deletions
  1. 15
    5
      src/arch/i386/firmware/pcbios/hidemem.c

+ 15
- 5
src/arch/i386/firmware/pcbios/hidemem.c View File

190
  * possible.
190
  * possible.
191
  */
191
  */
192
 static void unhide_etherboot ( int flags __unused ) {
192
 static void unhide_etherboot ( int flags __unused ) {
193
+	struct memory_map memmap;
194
+	int rc;
193
 
195
 
194
 	/* If we have more than one hooked interrupt at this point, it
196
 	/* If we have more than one hooked interrupt at this point, it
195
 	 * means that some other vector is still hooked, in which case
197
 	 * means that some other vector is still hooked, in which case
203
 		return;
205
 		return;
204
 	}
206
 	}
205
 
207
 
206
-	/* Try to unhook INT 15.  If it fails, then just leave it
207
-	 * hooked; it takes care of protecting itself.  :)
208
-	 */
209
-	unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
210
-				&int15_vector );
208
+	/* Try to unhook INT 15 */
209
+	if ( ( rc = unhook_bios_interrupt ( 0x15, ( unsigned int ) int15,
210
+					    &int15_vector ) ) != 0 ) {
211
+		DBG ( "Cannot unhook INT15: %s\n", strerror ( rc ) );
212
+		/* Leave it hooked; there's nothing else we can do,
213
+		 * and it should be intrinsically safe (though
214
+		 * wasteful of RAM).
215
+		 */
216
+	}
211
 
217
 
212
 	/* Unhook fake E820 map, if used */
218
 	/* Unhook fake E820 map, if used */
213
 	if ( FAKE_E820 )
219
 	if ( FAKE_E820 )
214
 		unfake_e820();
220
 		unfake_e820();
221
+
222
+	/* Dump memory map after unhiding */
223
+	DBG ( "Unhidden iPXE from system memory map\n" );
224
+	get_memmap ( &memmap );
215
 }
225
 }
216
 
226
 
217
 /** Hide Etherboot startup function */
227
 /** Hide Etherboot startup function */

Loading…
Cancel
Save