mirror of
https://github.com/memtest86plus/memtest86plus
synced 2025-03-13 17:33:14 +03:00
Merge pull request #4 from memtest86plus/debrouxl_misc_improvements
Misc small improvements
This commit is contained in:
commit
15b233cc89
@ -118,6 +118,8 @@ static void parse_option(const char *option, const char *params)
|
||||
enable_halt = false;
|
||||
} else if (strncmp(option, "smp", 4) == 0) {
|
||||
smp_enabled = true;
|
||||
} else if (strncmp(option, "trace", 6) == 0) {
|
||||
enable_trace = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,13 +27,13 @@
|
||||
#define HLT_OPCODE 0xf4
|
||||
|
||||
#ifdef __x86_64__
|
||||
#define REG_PREFIX 'r'
|
||||
#define REG_DIGITS 16
|
||||
#define ADR_DIGITS 12
|
||||
#define REG_PREFIX "r"
|
||||
#define REG_DIGITS "16"
|
||||
#define ADR_DIGITS "12"
|
||||
#else
|
||||
#define REG_PREFIX 'e'
|
||||
#define REG_DIGITS 8
|
||||
#define ADR_DIGITS 8
|
||||
#define REG_PREFIX "e"
|
||||
#define REG_DIGITS "8"
|
||||
#define ADR_DIGITS "8"
|
||||
#endif
|
||||
|
||||
static const char *codes[] = {
|
||||
@ -139,31 +139,31 @@ void interrupt(struct trap_regs *trap_regs)
|
||||
} else {
|
||||
display_pinned_message(2, 0, "Type: %i", trap_regs->vect);
|
||||
}
|
||||
display_pinned_message(3, 0, " PC: %0*x", REG_DIGITS, (uintptr_t)trap_regs->ip);
|
||||
display_pinned_message(4, 0, " CS: %0*x", REG_DIGITS, (uintptr_t)trap_regs->cs);
|
||||
display_pinned_message(5, 0, "Flag: %0*x", REG_DIGITS, (uintptr_t)trap_regs->flags);
|
||||
display_pinned_message(6, 0, "Code: %0*x", REG_DIGITS, (uintptr_t)trap_regs->code);
|
||||
display_pinned_message(7, 0, " DS: %0*x", REG_DIGITS, (uintptr_t)trap_regs->ds);
|
||||
display_pinned_message(8, 0, " ES: %0*x", REG_DIGITS, (uintptr_t)trap_regs->es);
|
||||
display_pinned_message(9, 0, " SS: %0*x", REG_DIGITS, (uintptr_t)trap_regs->ss);
|
||||
display_pinned_message(3, 0, " PC: %0" REG_DIGITS "x", (uintptr_t)trap_regs->ip);
|
||||
display_pinned_message(4, 0, " CS: %0" REG_DIGITS "x", (uintptr_t)trap_regs->cs);
|
||||
display_pinned_message(5, 0, "Flag: %0" REG_DIGITS "x", (uintptr_t)trap_regs->flags);
|
||||
display_pinned_message(6, 0, "Code: %0" REG_DIGITS "x", (uintptr_t)trap_regs->code);
|
||||
display_pinned_message(7, 0, " DS: %0" REG_DIGITS "x", (uintptr_t)trap_regs->ds);
|
||||
display_pinned_message(8, 0, " ES: %0" REG_DIGITS "x", (uintptr_t)trap_regs->es);
|
||||
display_pinned_message(9, 0, " SS: %0" REG_DIGITS "x", (uintptr_t)trap_regs->ss);
|
||||
if (trap_regs->vect == 14) {
|
||||
display_pinned_message(9, 0, " Addr: %0*x", REG_DIGITS, address);
|
||||
display_pinned_message(9, 0, " Addr: %0" REG_DIGITS "x", address);
|
||||
}
|
||||
|
||||
display_pinned_message(2, 25, "%cax: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->ax);
|
||||
display_pinned_message(3, 25, "%cbx: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->bx);
|
||||
display_pinned_message(4, 25, "%ccx: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->cx);
|
||||
display_pinned_message(5, 25, "%cdx: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->dx);
|
||||
display_pinned_message(6, 25, "%cdi: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->di);
|
||||
display_pinned_message(7, 25, "%csi: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->si);
|
||||
display_pinned_message(8, 25, "%cbp: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->bp);
|
||||
display_pinned_message(9, 25, "%csp: %0*x", REG_PREFIX, REG_DIGITS, (uintptr_t)trap_regs->sp);
|
||||
display_pinned_message(2, 25, REG_PREFIX "ax: %0" REG_DIGITS "x", (uintptr_t)trap_regs->ax);
|
||||
display_pinned_message(3, 25, REG_PREFIX "bx: %0" REG_DIGITS "x", (uintptr_t)trap_regs->bx);
|
||||
display_pinned_message(4, 25, REG_PREFIX "cx: %0" REG_DIGITS "x", (uintptr_t)trap_regs->cx);
|
||||
display_pinned_message(5, 25, REG_PREFIX "dx: %0" REG_DIGITS "x", (uintptr_t)trap_regs->dx);
|
||||
display_pinned_message(6, 25, REG_PREFIX "di: %0" REG_DIGITS "x", (uintptr_t)trap_regs->di);
|
||||
display_pinned_message(7, 25, REG_PREFIX "si: %0" REG_DIGITS "x", (uintptr_t)trap_regs->si);
|
||||
display_pinned_message(8, 25, REG_PREFIX "bp: %0" REG_DIGITS "x", (uintptr_t)trap_regs->bp);
|
||||
display_pinned_message(9, 25, REG_PREFIX "sp: %0" REG_DIGITS "x", (uintptr_t)trap_regs->sp);
|
||||
|
||||
display_pinned_message(0, 50, "Stack:");
|
||||
for (int i = 0; i < 12; i++) {
|
||||
uintptr_t addr = trap_regs->sp + sizeof(reg_t)*(11 - i);
|
||||
reg_t data = *(reg_t *)addr;
|
||||
display_pinned_message(1 + i, 50, "%0*x %0*x", ADR_DIGITS, addr, REG_DIGITS, (uintptr_t)data);
|
||||
display_pinned_message(1 + i, 50, "%0" ADR_DIGITS "x %0" REG_DIGITS "x", addr, (uintptr_t)data);
|
||||
}
|
||||
|
||||
display_pinned_message(11, 0, "CS:PC:");
|
||||
|
Loading…
x
Reference in New Issue
Block a user