MonkOS  v0.1
A simple 64-bit operating system (x86_64)
dump.h File Reference

Debugging memory and CPU state dump routines. More...

#include <core.h>
#include <kernel/x86/cpu.h>

Go to the source code of this file.

Enumerations

Functions

int dump_registers (char *buf, size_t bufsize, const registers_t *regs)
 Dump the contents of a CPU registers structure to a string buffer. More...
 
int dump_cpuflags (char *buf, size_t bufsize, uint64_t rflags)
 Dump the contents of the CPU flags register. More...
 
int dump_memory (char *buf, size_t bufsize, const void *mem, size_t memsize, enum dumpstyle style)
 Dump the contents of memory. More...
 

Detailed Description

Debugging memory and CPU state dump routines.

Definition in file dump.h.

Enumeration Type Documentation

enum dumpstyle

Memory dump output style.

Used to select how the memory address is displayed in a a memory dump.

Enumerator
DUMPSTYLE_NOADDR 

No address or offset in memory dump.

DUMPSTYLE_ADDR 

Include full address in memory dump.

DUMPSTYLE_OFFSET 

Include address offset in memory dump.

Definition at line 48 of file dump.h.

Function Documentation

int dump_registers ( char *  buf,
size_t  bufsize,
const registers_t regs 
)

Dump the contents of a CPU registers structure to a string buffer.

Parameters
[in]bufPointer to the character buffer to hold the resulting null-terminated string.
[in]bufsizeSize of the buffer used to hold the string.
[in]regsPointer to a CPU registers structure.
Returns
The number of characters that would have been written to the buffer if n had been sufficiently large.

Definition at line 16 of file dump.c.

Referenced by dump_context().

int dump_cpuflags ( char *  buf,
size_t  bufsize,
uint64_t  rflags 
)

Dump the contents of the CPU flags register.

Parameters
[in]bufPointer to the character buffer to hold the resulting null-terminated string.
[in]bufsizeSize of the buffer used to hold the string.
[in]rflagsThe 64-bit rflags register value.
Returns
The number of characters that would have been written to the buffer if n had been sufficiently large.

Definition at line 33 of file dump.c.

Referenced by dump_context().

int dump_memory ( char *  buf,
size_t  bufsize,
const void *  mem,
size_t  memsize,
enum dumpstyle  style 
)

Dump the contents of memory.

Parameters
[in]bufPointer to the character buffer to hold the resulting null-terminated string.
[in]bufsizeSize of the buffer used to hold the string.
[in]memPointer to the first byte of memory to dump.
[in]memsizeNumber of memory bytes to dump.
[in]styleThe output style used for the memory dump.
Returns
The number of characters that would have been written to the buffer if n had been sufficiently large.

Definition at line 50 of file dump.c.

Referenced by dump_context().