grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] memory commands


From: Hollis Blanchard
Subject: [patch] memory commands
Date: Mon, 12 Dec 2005 23:00:15 -0600

This patch adds a "memory" module, which currently contains two commands:
        Usage: memdump [address [len]]
        Dump the contents of memory.

        Usage: memset address (value [len] | trap)
        Write a 32-bit quantity to memory.

Future commands could include "memload" (load a file into memory) and "memsearch" (search for a given value or string in a specified area of memory. I haven't needed those yet.

The one tricky thing is that I added a "trap" shortcut. On PowerPC, and I assume on Sparc, when the processor hits a trap instruction while the firmware still owns the exception handlers, the firmware will provide helpful debug facilities (such as dumping the register state at the time of the trap). Inserting trap instructions has been very helpful to me for GRUB debugging (for example the OS X loader I've been working on). However, it may not make sense to have something like that on architectures like i386, which is why I made it depend on the HAVE_CPU_INSERT_TRAP define.

Comments?

-Hollis

2005-12-12  Hollis Blanchard  <address@hidden>

        * commands/memory.c: New file.
        * kern/powerpc/misc.c: Likewise.
        * include/grub/powerpc/misc.h: Likewise.
        * include/grub/i386/misc.h: Likewise.
        * include/grub/sparc64/misc.h: Likewise.
        * conf/common.rmk (pkgdata_MODULES): Add memory.mod.
        (memory_mod_SOURCES): New variable.
        (memory_mod_CFLAGS): Likewise.
        (memory_mod_LDFLAGS): Likewise.
        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
        kern/powerpc/misc.c.
        (grubof_SOURCES): Likewise.
        (grubof_HEADERS): Add cache.h and cpu/misc.h.
        * conf/i386-pc.rmk (kernel_img_HEADERS): Likewise.
        * conf/sparc64-ieee1275.rmk (grubof_HEADERS): Likewise.
        * include/grub/misc.h (grub_hexdump): New prototype.

Attachment: hexdump.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]