1 /* ----------------------------------------------------------------------- *
3 * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 * Dump the entry point registers
23 #include <syslinux/config.h>
26 uint16_t gs
, fs
, es
, ds
;
27 uint32_t edi
, esi
, ebp
, esp
;
28 uint32_t ebx
, edx
, ecx
, eax
;
30 uint16_t ret_ip
, ret_cs
;
31 uint16_t pxe_ip
, pxe_cs
;
36 const union syslinux_derivative_info
*di
;
37 const struct stack_frame
*sf
;
41 openconsole(&dev_null_r
, &dev_stdcon_w
);
44 openconsole(&dev_rawcon_r
, &dev_ansiserial_w
);
47 di
= syslinux_derivative_info();
49 if (di
->c
.filesystem
!= SYSLINUX_FS_PXELINUX
) {
50 printf("Not running under PXELINUX (fs = %02x)\n", di
->c
.filesystem
);
54 sf
= (const struct stack_frame
*)di
->pxe
.stack
;
56 printf("EAX: %08x EBX: %08x ECX: %08x EDX: %08x\n"
57 "ESP: %08x EBP: %08x ESI: %08x EDI: %08x\n"
58 "SS: %04x DS: %04x ES: %04x FS: %04x GS: %04x\n"
59 "EFLAGS: %08x RET: %04x:%04x PXE: %04x:%04x\n",
60 sf
->eax
, sf
->ebx
, sf
->ecx
, sf
->edx
,
61 sf
->esp
+ 4, sf
->ebp
, sf
->esi
, sf
->edi
,
62 di
->rr
.r
.fs
, sf
->ds
, sf
->es
, sf
->fs
, sf
->gs
,
63 sf
->eflags
, sf
->ret_cs
, sf
->ret_ip
, sf
->pxe_cs
, sf
->pxe_ip
);