2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 09:31:51 +00:00

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

This commit is contained in:
Michael Brown 2008-09-07 21:38:19 +01:00
parent a30c70727a
commit 18aa0e79d2
3 changed files with 19 additions and 4 deletions

View File

@ -20,6 +20,7 @@
#include <biosint.h>
#include <basemem.h>
#include <gpxe/init.h>
#include <gpxe/memmap.h>
#include <gpxe/hidemem.h>
/** Alignment for hidden memory regions */
@ -121,6 +122,11 @@ void hide_text ( void ) {
* returned by the BIOS.
*/
static void hide_etherboot ( void ) {
struct memory_map memmap;
/* Dump memory map before mangling */
DBG ( "Hiding gPXE from system memory map\n" );
get_memmap ( &memmap );
/* Initialise the hidden regions */
hide_basemem();
@ -130,6 +136,10 @@ static void hide_etherboot ( void ) {
/* Hook INT 15 */
hook_bios_interrupt ( 0x15, ( unsigned int ) int15,
&int15_vector );
/* Dump memory map after mangling */
DBG ( "Hidden gPXE from system memory map\n" );
get_memmap ( &memmap );
}
/**

View File

@ -86,8 +86,9 @@ static unsigned int extmemsize_e801 ( void ) {
}
extmem = ( extmem_1m_to_16m_k + ( extmem_16m_plus_64k * 64 ) );
DBG ( "INT 15,e801 extended memory size %d+64*%d=%d kB\n",
extmem_1m_to_16m_k, extmem_16m_plus_64k, extmem );
DBG ( "INT 15,e801 extended memory size %d+64*%d=%d kB [100000,%x)\n",
extmem_1m_to_16m_k, extmem_16m_plus_64k, extmem,
( 0x100000 + ( extmem * 1024 ) ) );
return extmem;
}
@ -103,7 +104,8 @@ static unsigned int extmemsize_88 ( void ) {
__asm__ __volatile__ ( REAL_CODE ( "int $0x15" )
: "=a" ( extmem ) : "a" ( 0x8800 ) );
DBG ( "INT 15,88 extended memory size %d kB\n", extmem );
DBG ( "INT 15,88 extended memory size %d kB [100000, %x)\n",
extmem, ( 0x100000 + ( extmem * 1024 ) ) );
return extmem;
}
@ -203,7 +205,8 @@ void get_memmap ( struct memory_map *memmap ) {
/* Get base and extended memory sizes */
basemem = basememsize();
DBG ( "FBMS base memory size %d kB\n", basemem );
DBG ( "FBMS base memory size %d kB [0,%x)\n",
basemem, ( basemem * 1024 ) );
extmem = extmemsize();
/* Try INT 15,e820 first */

View File

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