diff --git a/src/boot.c b/src/boot.c index 119f290..931ec3f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -14,7 +14,7 @@ #include "cmos.h" // inb_cmos #include "paravirt.h" // romfile_loadfile #include "pci.h" //pci_bdf_to_* - +#include "probes.h" /**************************************************************** * Boot priority ordering @@ -512,6 +512,7 @@ call_boot_entry(struct segoff_s bootsegip, u8 bootdrv) // Set the magic number in ax and the boot drive in dl. br.dl = bootdrv; br.ax = 0xaa55; + PROBE(BOOT_OS); call16(&br); } @@ -643,6 +644,7 @@ do_boot(u16 seq_nr) void VISIBLE32FLAT handle_18(void) { + PROBE(INT_18); debug_serial_setup(); debug_enter(NULL, DEBUG_HDL_18); u16 ebda_seg = get_ebda_seg(); @@ -655,6 +657,7 @@ handle_18(void) void VISIBLE32FLAT handle_19(void) { + PROBE(INT_19); debug_serial_setup(); debug_enter(NULL, DEBUG_HDL_19); SET_EBDA(boot_sequence, 0); diff --git a/src/post.c b/src/post.c index b4ad1fa..59e6a37 100644 --- a/src/post.c +++ b/src/post.c @@ -26,6 +26,7 @@ #include "xen.h" // xen_probe_hvm_info #include "ps2port.h" // ps2port_setup #include "virtio-blk.h" // virtio_blk_setup +#include "probes.h" /**************************************************************** @@ -354,6 +355,7 @@ dopost(void) void VISIBLE32FLAT handle_post(void) { + PROBE(POST); debug_serial_setup(); dprintf(1, "Start bios (version %s)\n", VERSION); diff --git a/src/probes.h b/src/probes.h new file mode 100644 index 0000000..1ec639f --- /dev/null +++ b/src/probes.h @@ -0,0 +1,25 @@ +#ifndef __PROBES_H +#define __PROBES_H + +/* Copy from QEMU pc.c */ +enum { + PROBE_SEABIOS_POST = 1001, + PROBE_SEABIOS_INT_18 = 1002, + PROBE_SEABIOS_INT_19 = 1003, + PROBE_SEABIOS_BOOT_OS = 1004, +}; + +#define PROBE_IO_PORT 0x404 + +static inline void _probe(u32 event) +{ + outl(event, PROBE_IO_PORT); +} + +#define PROBE(name) \ + do { \ + dprintf(9, "PROBE " #name "\n"); \ + _probe(PROBE_SEABIOS_ ## name); \ + } while (0) + +#endif /* __PROBES_H */