1 ----------------------------------------------------------------------
2 Patch name: patch.marklog
7 While working on getting SCO OSR5 installed into bochs,
8 I added this mod to the gui programs. It adds a button
9 (labelled XX LOG; my bitmap artsmanship leaves MUCH to
10 be desired!) to the gui bar that writes a BX_ERROR
11 entry into the log file. The format of the entry is:
13 tttttttttt-x-@eeeeeeee[XGUI ]
14 ================================
16 ================================
18 where nnnn is a sequential number from the beginning of
19 the bochs session. A message is also written to stdout
20 stating that the entry was logged, which also shows the
23 This is useful to log demarcation points in the log
24 file (e.g., "skip everything before marker #1"; "stuff
25 between markers 3 & 4 is where the hard disk gets
28 Please make this a part of the standard bochs package.
34 Patch was created with:
36 Apply patch to what version:
37 cvs checked out on May, 1st 2002
39 To patch, go to main bochs directory.
41 Type "patch -p0 < THIS_PATCH_FILE".
42 ----------------------------------------------------------------------
44 ===================================================================
45 RCS file: /cvsroot/bochs/bochs/gui/gui.h,v
46 retrieving revision 1.27
48 --- gui.h 20 Apr 2002 07:19:35 -0000 1.27
49 +++ gui.h 1 May 2002 18:13:03 -0000
51 static void cdromD_handler(void);
52 static void reset_handler(void);
53 static void power_handler(void);
54 + static void marklog_handler(void);
55 static void copy_handler(void);
56 static void paste_handler(void);
57 static void snapshot_handler(void);
59 unsigned floppyA_bmap_id, floppyA_eject_bmap_id, floppyA_hbar_id;
60 unsigned floppyB_bmap_id, floppyB_eject_bmap_id, floppyB_hbar_id;
61 unsigned cdromD_bmap_id, cdromD_eject_bmap_id, cdromD_hbar_id;
62 + unsigned marklog_bmap_id, marklog_hbar_id;
63 unsigned power_bmap_id, power_hbar_id;
64 unsigned reset_bmap_id, reset_hbar_id;
65 unsigned copy_bmap_id, copy_hbar_id;
67 unsigned snapshot_bmap_id, snapshot_hbar_id;
68 unsigned config_bmap_id, config_hbar_id;
69 unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
71 + unsigned markercount;
75 #define BX_MAX_PIXMAPS 16
76 -#define BX_MAX_HEADERBAR_ENTRIES 10
77 +#define BX_MAX_HEADERBAR_ENTRIES 11
78 #define BX_HEADER_BAR_Y 32
80 // align pixmaps towards left or right side of header bar
82 ===================================================================
83 RCS file: /cvsroot/bochs/bochs/gui/gui.cc,v
84 retrieving revision 1.41
86 --- gui.cc 18 Apr 2002 00:22:19 -0000 1.41
87 +++ gui.cc 1 May 2002 18:13:03 -0000
89 #include "gui/bitmaps/paste.h"
90 #include "gui/bitmaps/configbutton.h"
91 #include "gui/bitmaps/cdromd.h"
92 +#include "gui/bitmaps/marklog.h"
97 BX_GUI_THIS nomouse_bmap_id = create_bitmap(bx_nomouse_bmap,
98 BX_MOUSE_BMAP_X, BX_MOUSE_BMAP_Y);
101 BX_GUI_THIS power_bmap_id = create_bitmap(bx_power_bmap, BX_POWER_BMAP_X, BX_POWER_BMAP_Y);
102 BX_GUI_THIS reset_bmap_id = create_bitmap(bx_reset_bmap, BX_RESET_BMAP_X, BX_RESET_BMAP_Y);
103 BX_GUI_THIS snapshot_bmap_id = create_bitmap(bx_snapshot_bmap, BX_SNAPSHOT_BMAP_X, BX_SNAPSHOT_BMAP_Y);
104 BX_GUI_THIS copy_bmap_id = create_bitmap(bx_copy_bmap, BX_COPY_BMAP_X, BX_COPY_BMAP_Y);
105 BX_GUI_THIS paste_bmap_id = create_bitmap(bx_paste_bmap, BX_PASTE_BMAP_X, BX_PASTE_BMAP_Y);
106 BX_GUI_THIS config_bmap_id = create_bitmap(bx_config_bmap, BX_CONFIG_BMAP_X, BX_CONFIG_BMAP_Y);
107 + BX_GUI_THIS marklog_bmap_id = create_bitmap(bx_marklog_bmap, BX_MARKLOG_BMAP_X, BX_MARKLOG_BMAP_Y);
109 + BX_GUI_THIS markercount = 0;
112 // Add the initial bitmaps to the headerbar, and enable callback routine, for use
115 BX_GUI_THIS copy_hbar_id = headerbar_bitmap(BX_GUI_THIS copy_bmap_id,
116 BX_GRAVITY_RIGHT, copy_handler);
118 + BX_GUI_THIS marklog_hbar_id = headerbar_bitmap(BX_GUI_THIS marklog_bmap_id,
119 + BX_GRAVITY_RIGHT, marklog_handler);
124 bx_pc_system.ResetSignal( PCS_SET ); /* XXX is this right? */
125 for (int i=0; i<BX_SMP_PROCESSORS; i++)
126 BX_CPU(i)->reset(BX_RESET_HARDWARE);
130 +bx_gui_c::marklog_handler(void)
132 + // the user pressed Mark Log button, so write error marker to log file
133 + BX_GUI_THIS markercount += 1;
134 + BX_ERROR (("\n================================\nLog Marker # %d\n================================", BX_GUI_THIS markercount));
135 + fprintf (stderr, "Marker # %d written to log.\n", BX_GUI_THIS markercount);
139 --- /dev/null Thu Aug 30 16:30:55 2001
140 +++ bitmaps/marklog.h Wed May 1 09:58:00 2002
142 +/////////////////////////////////////////////////////////////////////////
143 +// $Id: patch.marklog,v 1.1 2002/05/01 21:07:13 cbothamy Exp $
144 +/////////////////////////////////////////////////////////////////////////
146 +#define BX_MARKLOG_BMAP_X 32
147 +#define BX_MARKLOG_BMAP_Y 32
149 +static const unsigned char bx_marklog_bmap[(BX_MARKLOG_BMAP_X * BX_MARKLOG_BMAP_Y)/8] = {
150 + 0x60, 0x18, 0x86, 0x01, 0xc0, 0x0c, 0xcc, 0x00, 0x80, 0x07, 0x78, 0x00,
151 + 0x00, 0x03, 0x30, 0x00, 0x80, 0x07, 0x78, 0x00, 0xc0, 0x0c, 0xcc, 0x00,
152 + 0x60, 0x18, 0x86, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
153 + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
154 + 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00,
155 + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x30, 0x18, 0x00,
156 + 0x00, 0x30, 0x18, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x30, 0x18, 0x00,
157 + 0x00, 0x30, 0x18, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
158 + 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x30, 0x00, 0x00,
159 + 0x00, 0x30, 0x1e, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x30, 0x18, 0x00,
160 + 0x00, 0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00