Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pcbios] Add extra debugging messages relating to the system memory map
  • Loading branch information
Michael Brown committed Sep 7, 2008
1 parent a30c707 commit 18aa0e7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/arch/i386/firmware/pcbios/hidemem.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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();
Expand All @@ -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 );
}

/**
Expand Down
11 changes: 7 additions & 4 deletions src/arch/i386/firmware/pcbios/memmap.c
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 2 additions & 0 deletions src/image/segment.c
Expand Up @@ -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 );
Expand Down

0 comments on commit 18aa0e7

Please sign in to comment.