Bochs/bochs/gui/textconfig.cc

1072 lines
33 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2013 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2009-12-04 23:02:12 +03:00
//
/////////////////////////////////////////////////////////////////////////
//
// This is code for a text-mode configuration interface. Note that this file
- I've added lots of comments in siminterface.h, and tried to clean up the terminology a bit. In particular, the term "gui" has started to mean different things in different contexts, so I've defined some more specific names for the parts of the user interface, and updated comments and some variable names to reflect it. See siminterface.h for a more complete description of all of these. VGAW: VGA display window and toolbar buttons, the traditional Bochs display which is ported to X, win32, MacOS X, etc. Implemented in gui/gui.* and platform dependent gui/*.cc files. CI: configuration interface that lets the user change settings such as floppy disk image, ne2k settings, log options. The CI consists of two parts: configuration user interface (CUI) which does the actual rendering to the screen and handles key/mouse/menu events, and the siminterface object. CUI: configuration user interface. This handles the user interactions that allow the user to configure Bochs. To actually change any values it talks to the siminterface object. One implementation of the CUI is the text-mode menus in gui/control.cc. Another implementation is (will be) the wxWindows menus and dialogs in gui/wxmain.cc. siminterface: the glue between the CUI and the simulation code, accessible throughout the code by the global variable bx_simulator_interface_c *SIM; Among other things, siminterface methods allow the simulator to ask the CUI to display things or ask for user input, and allows the CUI to query and modify variables in the simulation code. GUI: Literally, "graphical user interface". Until the configuration menus and wxWindows came along, everyone understood that "gui" referred to the VGA display window and the toolbar buttons because that's all there was. Now that we have the wxWindows code, which implements both the VGAW and the CUI, while all other platforms implement only the VGAW, it's not so clear. So, I'm trying to use VGAW, CI, and CUI consistently since they are more specific. control panel: This has been used as another name for the configuration interface. "control panel" is also somewhat unspecific and it sounds like it would be graphical with buttons and sliders, but our text-mode thing is not graphical at all. I've replaced "control panel" with "configuration interface" wherever I could find it. In configure script, the --disable-control-panel option is still supported, but it politely suggests that you use --disable-config-interface instead. - clean up comments in siminterface,wx* code - add comments and examples for bx_param_* and BxEvents - remove some obsolete stuff: notify_*_args, bx_simulator_interface_c::[sg]et_enabled() methods - in siminterface.cc, move a few bx_real_sim_c methods to where they belong, with the rest of the methods. No changes to the actual methods. - remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
// does NOT include bochs.h. Instead, it does all of its contact with
// the simulator through an object called SIM, defined in siminterface.cc
// and siminterface.h. This separation adds an extra layer of method
// calls before any work can be done, but the benefit is that the compiler
// enforces the rules. I can guarantee that textconfig.cc doesn't call any
- I've added lots of comments in siminterface.h, and tried to clean up the terminology a bit. In particular, the term "gui" has started to mean different things in different contexts, so I've defined some more specific names for the parts of the user interface, and updated comments and some variable names to reflect it. See siminterface.h for a more complete description of all of these. VGAW: VGA display window and toolbar buttons, the traditional Bochs display which is ported to X, win32, MacOS X, etc. Implemented in gui/gui.* and platform dependent gui/*.cc files. CI: configuration interface that lets the user change settings such as floppy disk image, ne2k settings, log options. The CI consists of two parts: configuration user interface (CUI) which does the actual rendering to the screen and handles key/mouse/menu events, and the siminterface object. CUI: configuration user interface. This handles the user interactions that allow the user to configure Bochs. To actually change any values it talks to the siminterface object. One implementation of the CUI is the text-mode menus in gui/control.cc. Another implementation is (will be) the wxWindows menus and dialogs in gui/wxmain.cc. siminterface: the glue between the CUI and the simulation code, accessible throughout the code by the global variable bx_simulator_interface_c *SIM; Among other things, siminterface methods allow the simulator to ask the CUI to display things or ask for user input, and allows the CUI to query and modify variables in the simulation code. GUI: Literally, "graphical user interface". Until the configuration menus and wxWindows came along, everyone understood that "gui" referred to the VGA display window and the toolbar buttons because that's all there was. Now that we have the wxWindows code, which implements both the VGAW and the CUI, while all other platforms implement only the VGAW, it's not so clear. So, I'm trying to use VGAW, CI, and CUI consistently since they are more specific. control panel: This has been used as another name for the configuration interface. "control panel" is also somewhat unspecific and it sounds like it would be graphical with buttons and sliders, but our text-mode thing is not graphical at all. I've replaced "control panel" with "configuration interface" wherever I could find it. In configure script, the --disable-control-panel option is still supported, but it politely suggests that you use --disable-config-interface instead. - clean up comments in siminterface,wx* code - add comments and examples for bx_param_* and BxEvents - remove some obsolete stuff: notify_*_args, bx_simulator_interface_c::[sg]et_enabled() methods - in siminterface.cc, move a few bx_real_sim_c methods to where they belong, with the rest of the methods. No changes to the actual methods. - remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
// I/O device objects directly, for example, because the bx_devices symbol
// isn't even defined in this context.
//
#include "config.h"
#if BX_USE_TEXTCONFIG
2004-11-22 16:14:54 +03:00
#ifndef __QNXNTO__
extern "C" {
2004-11-22 16:14:54 +03:00
#endif
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
2004-11-22 16:14:54 +03:00
#ifndef __QNXNTO__
}
2004-11-22 16:14:54 +03:00
#endif
#include "osdep.h"
#include "param_names.h"
#include "textconfig.h"
#include "siminterface.h"
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
#include "extplugin.h"
- I've added lots of comments in siminterface.h, and tried to clean up the terminology a bit. In particular, the term "gui" has started to mean different things in different contexts, so I've defined some more specific names for the parts of the user interface, and updated comments and some variable names to reflect it. See siminterface.h for a more complete description of all of these. VGAW: VGA display window and toolbar buttons, the traditional Bochs display which is ported to X, win32, MacOS X, etc. Implemented in gui/gui.* and platform dependent gui/*.cc files. CI: configuration interface that lets the user change settings such as floppy disk image, ne2k settings, log options. The CI consists of two parts: configuration user interface (CUI) which does the actual rendering to the screen and handles key/mouse/menu events, and the siminterface object. CUI: configuration user interface. This handles the user interactions that allow the user to configure Bochs. To actually change any values it talks to the siminterface object. One implementation of the CUI is the text-mode menus in gui/control.cc. Another implementation is (will be) the wxWindows menus and dialogs in gui/wxmain.cc. siminterface: the glue between the CUI and the simulation code, accessible throughout the code by the global variable bx_simulator_interface_c *SIM; Among other things, siminterface methods allow the simulator to ask the CUI to display things or ask for user input, and allows the CUI to query and modify variables in the simulation code. GUI: Literally, "graphical user interface". Until the configuration menus and wxWindows came along, everyone understood that "gui" referred to the VGA display window and the toolbar buttons because that's all there was. Now that we have the wxWindows code, which implements both the VGAW and the CUI, while all other platforms implement only the VGAW, it's not so clear. So, I'm trying to use VGAW, CI, and CUI consistently since they are more specific. control panel: This has been used as another name for the configuration interface. "control panel" is also somewhat unspecific and it sounds like it would be graphical with buttons and sliders, but our text-mode thing is not graphical at all. I've replaced "control panel" with "configuration interface" wherever I could find it. In configure script, the --disable-control-panel option is still supported, but it politely suggests that you use --disable-config-interface instead. - clean up comments in siminterface,wx* code - add comments and examples for bx_param_* and BxEvents - remove some obsolete stuff: notify_*_args, bx_simulator_interface_c::[sg]et_enabled() methods - in siminterface.cc, move a few bx_real_sim_c methods to where they belong, with the rest of the methods. No changes to the actual methods. - remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
#define CI_PATH_LENGTH 512
/* functions for changing particular options */
void bx_config_interface_init();
int bx_read_rc(char *rc);
int bx_write_rc(char *rc);
void bx_plugin_ctrl();
void bx_log_options(int individual);
int bx_atexit();
#if BX_DEBUGGER
void bx_dbg_exit(int code);
#endif
/******************************************************************/
/* lots of code stolen from bximage.c */
/* remove leading spaces, newline junk at end. returns pointer to
cleaned string, which is between s0 and the null */
2008-03-07 00:15:40 +03:00
char *clean_string(char *s0)
{
char *s = s0;
char *ptr;
/* find first nonblank */
while (isspace(*s))
s++;
/* truncate string at first non-alphanumeric */
ptr = s;
while (isprint(*ptr))
ptr++;
*ptr = 0;
return s;
}
/* returns 0 on success, -1 on failure. The value goes into out. */
2008-03-07 00:15:40 +03:00
int ask_uint(const char *prompt, const char *help, Bit32u min, Bit32u max, Bit32u the_default, Bit32u *out, int base)
{
Bit32u n = max + 1;
char buffer[1024];
char *clean;
int illegal;
assert(base==10 || base==16);
while (1) {
printf(prompt, the_default);
fflush(stdout);
if (!fgets(buffer, sizeof(buffer), stdin))
return -1;
clean = clean_string(buffer);
if (strlen(clean) < 1) {
// empty line, use the default
*out = the_default;
return 0;
}
if ((clean[0] == '?') && (strlen(help) > 0)) {
printf("\n%s\n", help);
if (base == 10) {
printf("Your choice must be an integer between %u and %u.\n\n", min, max);
} else {
printf("Your choice must be an integer between 0x%x and 0x%x.\n\n", min, max);
}
continue;
}
const char *format = (base==10) ? "%d" : "%x";
illegal = (1 != sscanf(buffer, format, &n));
if (illegal || n<min || n>max) {
if (base == 10) {
printf("Your choice (%s) was not an integer between %u and %u.\n\n",
clean, min, max);
} else {
printf("Your choice (%s) was not an integer between 0x%x and 0x%x.\n\n",
clean, min, max);
}
} else {
// choice is okay
*out = n;
return 0;
}
}
}
// identical to ask_uint, but uses signed comparisons
2008-03-07 00:15:40 +03:00
int ask_int(const char *prompt, const char *help, Bit32s min, Bit32s max, Bit32s the_default, Bit32s *out)
{
int n = max + 1;
char buffer[1024];
char *clean;
int illegal;
while (1) {
printf(prompt, the_default);
fflush(stdout);
if (!fgets(buffer, sizeof(buffer), stdin))
return -1;
clean = clean_string(buffer);
if (strlen(clean) < 1) {
// empty line, use the default
*out = the_default;
return 0;
}
if ((clean[0] == '?') && (strlen(help) > 0)) {
printf("\n%s\n", help);
printf("Your choice must be an integer between %u and %u.\n\n", min, max);
continue;
}
illegal = (1 != sscanf(buffer, "%d", &n));
if (illegal || n<min || n>max) {
printf("Your choice (%s) was not an integer between %d and %d.\n\n",
clean, min, max);
} else {
// choice is okay
*out = n;
return 0;
}
}
}
2008-03-07 00:15:40 +03:00
int ask_menu(const char *prompt, const char *help, int n_choices, const char *choice[], int the_default, int *out)
{
char buffer[1024];
char *clean;
int i;
*out = -1;
while (1) {
printf(prompt, choice[the_default]);
fflush(stdout);
if (!fgets(buffer, sizeof(buffer), stdin))
return -1;
clean = clean_string(buffer);
if (strlen(clean) < 1) {
// empty line, use the default
*out = the_default;
return 0;
}
for (i=0; i<n_choices; i++) {
if (!strcmp(choice[i], clean)) {
// matched, return the choice number
*out = i;
return 0;
}
}
if (clean[0] != '?') {
printf("Your choice (%s) did not match any of the choices:\n", clean);
} else if (strlen(help) > 0) {
printf("\n%s\nValid values are: ", help);
}
for (i=0; i<n_choices; i++) {
if (i>0) printf(", ");
printf("%s", choice[i]);
}
printf("\n");
}
}
2008-03-07 00:15:40 +03:00
int ask_yn(const char *prompt, const char *help, Bit32u the_default, Bit32u *out)
{
char buffer[16];
char *clean;
*out = 1<<31;
while (1) {
// if there's a %s field, substitute in the default yes/no.
printf(prompt, the_default ? "yes" : "no");
fflush(stdout);
if (!fgets(buffer, sizeof(buffer), stdin))
return -1;
clean = clean_string(buffer);
if (strlen(clean) < 1) {
// empty line, use the default
*out = the_default;
return 0;
}
switch (tolower(clean[0])) {
case 'y': *out=1; return 0;
case 'n': *out=0; return 0;
case '?':
if (strlen(help) > 0) {
printf("\n%s\n", help);
}
break;
}
printf("Please type either yes or no.\n");
}
}
// returns -1 on error (stream closed or something)
// returns 0 if default was taken
// returns 1 if value changed
// returns -2 if help requested
int ask_string(const char *prompt, const char *the_default, char *out)
{
char buffer[1024];
char *clean;
assert(the_default != out);
out[0] = 0;
printf(prompt, the_default);
fflush(stdout);
if (fgets(buffer, sizeof(buffer), stdin) == NULL)
return -1;
clean = clean_string(buffer);
if (clean[0] == '?')
return -2;
if (strlen(clean) < 1) {
// empty line, use the default
strcpy(out, the_default);
return 0;
}
strcpy(out, clean);
return 1;
}
/******************************************************************/
2007-10-25 03:09:59 +04:00
static const char *startup_menu_prompt =
"------------------------------\n"
"Bochs Configuration: Main Menu\n"
"------------------------------\n"
"\n"
"This is the Bochs Configuration Interface, where you can describe the\n"
- clean up the command line argument parsing. Before, we had two slightly different versions of the code for wxWindows and non-wxWindows and the GDB stub did not accept any command line options at all. - IMPORTANT CHANGE: the quick start option used to cause two things: 1) read the bochsrc immediately, 2) start simulation immediately without going into the config interface. This has changed in a subtle way. Now, we always try to read the bochsrc immediately. Then if the quick start option is on, we start the simulation immediately. - add "Restore Factory Default Configuration" in text config menu. It was already there in wx. Now the default choice is always "5. Begin simulation" and because the bochsrc is always read now, this works. - When the user chooses "Read configuration file" from either text mode or wx interfaces, reset all bochs parameters first, then read in the new file. This means that every time you read a configuration file you are starting from a consistent "blank slate". - move much of the code from bx_do_text_config_interface into bx_init_main so that wxWindows and non-wxWindows code uses the same logic. There was only a tiny bit left in bx_do_text_config_interface so I eliminated it. - move the "help" message into a separate function print_usage() - detect all flags (cmdline args that start with -) in a loop, instead of a big if/else. This makes it easy to add others. - fix problem with Carbon gui, so that -psn arg gets ignored - print usage if you type -h, --help, or if flags are not recognized - code that called io->set_log_action (that sets the log action for all devices) was only called if the configuration interface was on; I'm not sure why. Now it is called all the time. - the wxWindows equivalent of main() is called MyApp::OnInit. Now OnInit and main() are very similar. They both call bx_init_siminterface, then bx_init_main (and quit if it fails), then show the config interface if quickstart is off, and then simulate. - modified: main.cc gui/control.cc gui/wxmain.cc
2002-10-14 17:37:20 +04:00
"machine that you want to simulate. Bochs has already searched for a\n"
"configuration file (typically called bochsrc.txt) and loaded it if it\n"
"could be found. When you are satisfied with the configuration, go\n"
"ahead and start the simulation.\n"
"\n"
"You can also start bochs with the -q option to skip these menus.\n"
"\n"
- clean up the command line argument parsing. Before, we had two slightly different versions of the code for wxWindows and non-wxWindows and the GDB stub did not accept any command line options at all. - IMPORTANT CHANGE: the quick start option used to cause two things: 1) read the bochsrc immediately, 2) start simulation immediately without going into the config interface. This has changed in a subtle way. Now, we always try to read the bochsrc immediately. Then if the quick start option is on, we start the simulation immediately. - add "Restore Factory Default Configuration" in text config menu. It was already there in wx. Now the default choice is always "5. Begin simulation" and because the bochsrc is always read now, this works. - When the user chooses "Read configuration file" from either text mode or wx interfaces, reset all bochs parameters first, then read in the new file. This means that every time you read a configuration file you are starting from a consistent "blank slate". - move much of the code from bx_do_text_config_interface into bx_init_main so that wxWindows and non-wxWindows code uses the same logic. There was only a tiny bit left in bx_do_text_config_interface so I eliminated it. - move the "help" message into a separate function print_usage() - detect all flags (cmdline args that start with -) in a loop, instead of a big if/else. This makes it easy to add others. - fix problem with Carbon gui, so that -psn arg gets ignored - print usage if you type -h, --help, or if flags are not recognized - code that called io->set_log_action (that sets the log action for all devices) was only called if the configuration interface was on; I'm not sure why. Now it is called all the time. - the wxWindows equivalent of main() is called MyApp::OnInit. Now OnInit and main() are very similar. They both call bx_init_siminterface, then bx_init_main (and quit if it fails), then show the config interface if quickstart is off, and then simulate. - modified: main.cc gui/control.cc gui/wxmain.cc
2002-10-14 17:37:20 +04:00
"1. Restore factory default configuration\n"
"2. Read options from...\n"
"3. Edit options\n"
"4. Save options to...\n"
2006-05-27 19:54:49 +04:00
"5. Restore the Bochs state from...\n"
"6. Begin simulation\n"
"7. Quit now\n"
"\n"
"Please choose one: [%d] ";
2007-10-25 03:09:59 +04:00
static const char *startup_options_prompt =
"------------------\n"
"Bochs Options Menu\n"
"------------------\n"
"0. Return to previous menu\n"
"1. Optional plugin control\n"
"2. Logfile options\n"
"3. Log options for all devices\n"
"4. Log options for individual devices\n"
"5. CPU options\n"
"6. CPUID options\n"
"7. Memory options\n"
"8. Clock & CMOS options\n"
"9. PCI options\n"
"10. Bochs Display & Interface options\n"
"11. Keyboard & Mouse options\n"
"12. Disk & Boot options\n"
"13. Serial / Parallel / USB options\n"
"14. Network card options\n"
"15. Sound card options\n"
"16. Other options\n"
#if BX_PLUGINS
"17. User-defined options\n"
#endif
"\n"
"Please choose one: [0] ";
2007-10-25 03:09:59 +04:00
static const char *runtime_menu_prompt =
"---------------------\n"
"Bochs Runtime Options\n"
"---------------------\n"
"1. Floppy disk 0: %s\n"
"2. Floppy disk 1: %s\n"
"3. CDROM runtime options\n"
"4. Log options for all devices\n"
"5. Log options for individual devices\n"
"6. USB runtime options\n"
"7. Misc runtime options\n"
"8. Save configuration\n"
"9. Continue simulation\n"
"10. Quit now\n"
"\n"
"Please choose one: [9] ";
static const char *plugin_ctrl_prompt =
"\n-----------------------\n"
"Optional plugin control\n"
"-----------------------\n"
"0. Return to previous menu\n"
"1. Load optional plugin\n"
"2. Unload optional plugin\n"
"\n"
"Please choose one: [0] ";
#define NOT_IMPLEMENTED(choice) \
fprintf(stderr, "ERROR: choice %d not implemented\n", choice);
#define BAD_OPTION(menu,choice) \
do {fprintf(stderr, "ERROR: menu %d has no choice %d\n", menu, choice); \
assert(0); } while (0)
2007-10-25 03:09:59 +04:00
void build_runtime_options_prompt(const char *format, char *buf, int size)
{
bx_list_c *floppyop;
char pname[80];
char buffer[6][128];
for (int i=0; i<2; i++) {
sprintf(pname, "floppy.%d", i);
floppyop = (bx_list_c*) SIM->get_param(pname);
if (SIM->get_param_enum("devtype", floppyop)->get() == BX_FDD_NONE)
strcpy(buffer[i], "(not present)");
else {
sprintf(buffer[i], "%s, size=%s, %s", SIM->get_param_string("path", floppyop)->getptr(),
SIM->get_param_enum("type", floppyop)->get_selected(),
SIM->get_param_enum("status", floppyop)->get_selected());
if (!SIM->get_param_string("path", floppyop)->getptr()[0]) strcpy(buffer[i], "none");
}
}
snprintf(buf, size, format, buffer[0], buffer[1]);
}
int do_menu(const char *pname)
{
bx_list_c *menu = (bx_list_c *)SIM->get_param(pname, NULL);
while (1) {
menu->set_choice(0);
int status = menu->text_ask(stdin, stderr);
if (status < 0) return status;
if (menu->get_choice() < 1)
return menu->get_choice();
else {
int index = menu->get_choice() - 1; // choosing 1 means list[0]
bx_param_c *chosen = menu->get(index);
assert(chosen != NULL);
if (chosen->get_enabled()) {
if (SIM->get_init_done() && !chosen->get_runtime_param()) {
fprintf(stderr, "\nWARNING: parameter not available at runtime!\n");
} else if (chosen->get_type() == BXT_LIST) {
char chosen_pname[80];
chosen->get_param_path(chosen_pname, 80);
do_menu(chosen_pname);
} else {
chosen->text_ask(stdin, stderr);
}
}
}
}
}
void askparam(char *pname)
{
bx_param_c *param = SIM->get_param(pname);
param->text_ask(stdin, stderr);
}
int bx_config_interface(int menu)
{
Bit32u choice;
char sr_path[CI_PATH_LENGTH];
while (1) {
switch (menu) {
case BX_CI_INIT:
bx_config_interface_init();
return 0;
case BX_CI_START_SIMULATION:
SIM->begin_simulation(bx_startup_flags.argc, bx_startup_flags.argv);
// we don't expect it to return, but if it does, quit
SIM->quit_sim(1);
break;
case BX_CI_START_MENU:
{
Bit32u n_choices = 7;
Bit32u default_choice;
switch (SIM->get_param_enum(BXPN_BOCHS_START)->get()) {
case BX_LOAD_START:
default_choice = 2; break;
case BX_EDIT_START:
default_choice = 3; break;
default:
default_choice = 6; break;
}
if (ask_uint(startup_menu_prompt, "", 1, n_choices, default_choice, &choice, 10) < 0) return -1;
switch (choice) {
case 1:
fprintf(stderr, "I reset all options back to their factory defaults.\n\n");
SIM->reset_all_param();
SIM->get_param_enum(BXPN_BOCHS_START)->set(BX_EDIT_START);
break;
case 2:
// Before reading a new configuration, reset every option to its
// original state.
SIM->reset_all_param();
if (bx_read_rc(NULL) >= 0)
SIM->get_param_enum(BXPN_BOCHS_START)->set(BX_RUN_START);
break;
case 3:
bx_config_interface(BX_CI_START_OPTS);
SIM->get_param_enum(BXPN_BOCHS_START)->set(BX_RUN_START);
break;
case 4: bx_write_rc(NULL); break;
case 5:
2006-05-27 19:54:49 +04:00
if (ask_string("\nWhat is the path to restore the Bochs state from?\nTo cancel, type 'none'. [%s] ", "none", sr_path) >= 0) {
if (strcmp(sr_path, "none")) {
SIM->get_param_bool(BXPN_RESTORE_FLAG)->set(1);
SIM->get_param_string(BXPN_RESTORE_PATH)->set(sr_path);
bx_config_interface(BX_CI_START_SIMULATION);
}
}
break;
case 6: bx_config_interface(BX_CI_START_SIMULATION); break;
case 7: SIM->quit_sim(1); return -1;
default: BAD_OPTION(menu, choice);
}
}
break;
case BX_CI_START_OPTS:
if (ask_uint(startup_options_prompt, "", 0, 16+BX_PLUGINS, 0, &choice, 10) < 0) return -1;
switch (choice) {
case 0: return 0;
case 1: bx_plugin_ctrl(); break;
case 3: bx_log_options(0); break;
case 4: bx_log_options(1); break;
case 2: do_menu("log"); break;
case 5: do_menu("cpu"); break;
case 6: do_menu("cpuid"); break;
case 7: do_menu("memory"); break;
case 8: do_menu("clock_cmos"); break;
case 9: do_menu("pci"); break;
case 10: do_menu("display"); break;
case 11: do_menu("keyboard_mouse"); break;
case 12: do_menu(BXPN_MENU_DISK); break;
case 13: do_menu("ports"); break;
case 14: do_menu("network"); break;
case 15: do_menu("sound"); break;
case 16: do_menu("misc"); break;
#if BX_PLUGINS
case 17: do_menu("user"); break;
#endif
default: BAD_OPTION(menu, choice);
}
break;
case BX_CI_RUNTIME:
{
char prompt[1024];
build_runtime_options_prompt(runtime_menu_prompt, prompt, 1024);
if (ask_uint(prompt, "", 1, BX_CI_RT_QUIT, BX_CI_RT_CONT, &choice, 10) < 0) return -1;
switch (choice) {
case BX_CI_RT_FLOPPYA:
if (SIM->get_param_enum(BXPN_FLOPPYA_DEVTYPE)->get() != BX_FDD_NONE) do_menu(BXPN_FLOPPYA);
break;
case BX_CI_RT_FLOPPYB:
if (SIM->get_param_enum(BXPN_FLOPPYB_DEVTYPE)->get() != BX_FDD_NONE) do_menu(BXPN_FLOPPYB);
break;
case BX_CI_RT_CDROM: do_menu(BXPN_MENU_RUNTIME_CDROM); break;
case BX_CI_RT_LOGOPTS1: bx_log_options(0); break;
case BX_CI_RT_LOGOPTS2: bx_log_options(1); break;
2013-11-26 01:14:26 +04:00
case BX_CI_RT_USB: do_menu(BXPN_MENU_RUNTIME_USB); break;
case BX_CI_RT_MISC: do_menu(BXPN_MENU_RUNTIME_MISC); break;
case BX_CI_RT_SAVE_CFG:
bx_write_rc(NULL);
break;
case BX_CI_RT_CONT:
SIM->update_runtime_options();
fprintf(stderr, "Continuing simulation\n");
return 0;
case BX_CI_RT_QUIT:
fprintf(stderr, "You chose quit on the configuration interface.\n");
bx_user_quit = 1;
#if !BX_DEBUGGER
bx_atexit();
SIM->quit_sim(1);
#else
bx_dbg_exit(1);
#endif
return -1;
default: fprintf(stderr, "Menu choice %d not implemented.\n", choice);
}
}
break;
default:
fprintf(stderr, "Unknown config interface menu type.\n");
assert(menu >=0 && menu < BX_CI_N_MENUS);
}
}
}
static void bx_print_log_action_table()
{
// just try to print all the prefixes first.
fprintf(stderr, "Current log settings:\n");
fprintf(stderr, " Debug Info Error Panic\n");
fprintf(stderr, "ID Device Action Action Action Action\n");
fprintf(stderr, "---- --------- --------- --------- ---------- ----------\n");
int i, j, imax=SIM->get_n_log_modules();
2001-06-12 00:51:15 +04:00
for (i=0; i<imax; i++) {
if (strcmp(SIM->get_prefix(i), BX_NULL_PREFIX)) {
fprintf(stderr, "%3d. %s ", i, SIM->get_prefix(i));
for (j=0; j<SIM->get_max_log_level(); j++) {
fprintf(stderr, "%10s ", SIM->get_action_name(SIM->get_log_action(i, j)));
}
fprintf(stderr, "\n");
}
}
}
2007-10-25 03:09:59 +04:00
static const char *log_options_prompt1 = "Enter the ID of the device to edit, or -1 to return: [-1] ";
static const char *log_level_choices[] = { "ignore", "report", "ask", "fatal", "no change" };
static int log_level_n_choices_normal = 4;
void bx_log_options(int individual)
{
if (individual) {
int done = 0;
while (!done) {
bx_print_log_action_table();
Bit32s id, level, action;
Bit32s maxid = SIM->get_n_log_modules();
if (ask_int(log_options_prompt1, "", -1, maxid-1, -1, &id) < 0)
return;
if (id < 0) return;
fprintf(stderr, "Editing log options for the device %s\n", SIM->get_prefix(id));
for (level=0; level<SIM->get_max_log_level(); level++) {
char prompt[1024];
int default_action = SIM->get_log_action(id, level);
sprintf(prompt, "Enter action for %s event: [%s] ", SIM->get_log_level_name(level), SIM->get_action_name(default_action));
// don't show the no change choice (choices=3)
if (ask_menu(prompt, "", log_level_n_choices_normal, log_level_choices, default_action, &action)<0)
return;
// the exclude expression allows some choices not being available if they
// don't make any sense. For example, it would be stupid to ignore a panic.
if (!BX_LOG_OPTS_EXCLUDE(level, action)) {
SIM->set_log_action(id, level, action);
} else {
fprintf(stderr, "Event type '%s' does not support log action '%s'.\n",
SIM->get_log_level_name(level), log_level_choices[action]);
}
}
}
} else {
// provide an easy way to set log options for all devices at once
bx_print_log_action_table();
for (int level=0; level<SIM->get_max_log_level(); level++) {
char prompt[1024];
int action, default_action = 4; // default to no change
sprintf(prompt, "Enter action for %s event on all devices: [no change] ", SIM->get_log_level_name(level));
// do show the no change choice (choices=4)
if (ask_menu(prompt, "", log_level_n_choices_normal+1, log_level_choices, default_action, &action)<0)
return;
if (action < log_level_n_choices_normal) {
if (!BX_LOG_OPTS_EXCLUDE(level, action)) {
SIM->set_default_log_action(level, action);
SIM->set_log_action(-1, level, action);
} else {
fprintf(stderr, "Event type '%s' does not support log action '%s'.\n",
SIM->get_log_level_name(level), log_level_choices[action]);
}
}
}
}
}
int bx_read_rc(char *rc)
{
if (rc && SIM->read_rc(rc) >= 0) return 0;
- I've added lots of comments in siminterface.h, and tried to clean up the terminology a bit. In particular, the term "gui" has started to mean different things in different contexts, so I've defined some more specific names for the parts of the user interface, and updated comments and some variable names to reflect it. See siminterface.h for a more complete description of all of these. VGAW: VGA display window and toolbar buttons, the traditional Bochs display which is ported to X, win32, MacOS X, etc. Implemented in gui/gui.* and platform dependent gui/*.cc files. CI: configuration interface that lets the user change settings such as floppy disk image, ne2k settings, log options. The CI consists of two parts: configuration user interface (CUI) which does the actual rendering to the screen and handles key/mouse/menu events, and the siminterface object. CUI: configuration user interface. This handles the user interactions that allow the user to configure Bochs. To actually change any values it talks to the siminterface object. One implementation of the CUI is the text-mode menus in gui/control.cc. Another implementation is (will be) the wxWindows menus and dialogs in gui/wxmain.cc. siminterface: the glue between the CUI and the simulation code, accessible throughout the code by the global variable bx_simulator_interface_c *SIM; Among other things, siminterface methods allow the simulator to ask the CUI to display things or ask for user input, and allows the CUI to query and modify variables in the simulation code. GUI: Literally, "graphical user interface". Until the configuration menus and wxWindows came along, everyone understood that "gui" referred to the VGA display window and the toolbar buttons because that's all there was. Now that we have the wxWindows code, which implements both the VGAW and the CUI, while all other platforms implement only the VGAW, it's not so clear. So, I'm trying to use VGAW, CI, and CUI consistently since they are more specific. control panel: This has been used as another name for the configuration interface. "control panel" is also somewhat unspecific and it sounds like it would be graphical with buttons and sliders, but our text-mode thing is not graphical at all. I've replaced "control panel" with "configuration interface" wherever I could find it. In configure script, the --disable-control-panel option is still supported, but it politely suggests that you use --disable-config-interface instead. - clean up comments in siminterface,wx* code - add comments and examples for bx_param_* and BxEvents - remove some obsolete stuff: notify_*_args, bx_simulator_interface_c::[sg]et_enabled() methods - in siminterface.cc, move a few bx_real_sim_c methods to where they belong, with the rest of the methods. No changes to the actual methods. - remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
char oldrc[CI_PATH_LENGTH];
if (SIM->get_default_rc(oldrc, CI_PATH_LENGTH) < 0)
strcpy(oldrc, "none");
- I've added lots of comments in siminterface.h, and tried to clean up the terminology a bit. In particular, the term "gui" has started to mean different things in different contexts, so I've defined some more specific names for the parts of the user interface, and updated comments and some variable names to reflect it. See siminterface.h for a more complete description of all of these. VGAW: VGA display window and toolbar buttons, the traditional Bochs display which is ported to X, win32, MacOS X, etc. Implemented in gui/gui.* and platform dependent gui/*.cc files. CI: configuration interface that lets the user change settings such as floppy disk image, ne2k settings, log options. The CI consists of two parts: configuration user interface (CUI) which does the actual rendering to the screen and handles key/mouse/menu events, and the siminterface object. CUI: configuration user interface. This handles the user interactions that allow the user to configure Bochs. To actually change any values it talks to the siminterface object. One implementation of the CUI is the text-mode menus in gui/control.cc. Another implementation is (will be) the wxWindows menus and dialogs in gui/wxmain.cc. siminterface: the glue between the CUI and the simulation code, accessible throughout the code by the global variable bx_simulator_interface_c *SIM; Among other things, siminterface methods allow the simulator to ask the CUI to display things or ask for user input, and allows the CUI to query and modify variables in the simulation code. GUI: Literally, "graphical user interface". Until the configuration menus and wxWindows came along, everyone understood that "gui" referred to the VGA display window and the toolbar buttons because that's all there was. Now that we have the wxWindows code, which implements both the VGAW and the CUI, while all other platforms implement only the VGAW, it's not so clear. So, I'm trying to use VGAW, CI, and CUI consistently since they are more specific. control panel: This has been used as another name for the configuration interface. "control panel" is also somewhat unspecific and it sounds like it would be graphical with buttons and sliders, but our text-mode thing is not graphical at all. I've replaced "control panel" with "configuration interface" wherever I could find it. In configure script, the --disable-control-panel option is still supported, but it politely suggests that you use --disable-config-interface instead. - clean up comments in siminterface,wx* code - add comments and examples for bx_param_* and BxEvents - remove some obsolete stuff: notify_*_args, bx_simulator_interface_c::[sg]et_enabled() methods - in siminterface.cc, move a few bx_real_sim_c methods to where they belong, with the rest of the methods. No changes to the actual methods. - remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
char newrc[CI_PATH_LENGTH];
while (1) {
if (ask_string("\nWhat is the configuration file name?\nTo cancel, type 'none'. [%s] ", oldrc, newrc) < 0) return -1;
if (!strcmp(newrc, "none")) return -1;
if (SIM->read_rc(newrc) >= 0) return 0;
fprintf(stderr, "The file '%s' could not be found.\n", newrc);
}
}
int bx_write_rc(char *rc)
{
- I've added lots of comments in siminterface.h, and tried to clean up the terminology a bit. In particular, the term "gui" has started to mean different things in different contexts, so I've defined some more specific names for the parts of the user interface, and updated comments and some variable names to reflect it. See siminterface.h for a more complete description of all of these. VGAW: VGA display window and toolbar buttons, the traditional Bochs display which is ported to X, win32, MacOS X, etc. Implemented in gui/gui.* and platform dependent gui/*.cc files. CI: configuration interface that lets the user change settings such as floppy disk image, ne2k settings, log options. The CI consists of two parts: configuration user interface (CUI) which does the actual rendering to the screen and handles key/mouse/menu events, and the siminterface object. CUI: configuration user interface. This handles the user interactions that allow the user to configure Bochs. To actually change any values it talks to the siminterface object. One implementation of the CUI is the text-mode menus in gui/control.cc. Another implementation is (will be) the wxWindows menus and dialogs in gui/wxmain.cc. siminterface: the glue between the CUI and the simulation code, accessible throughout the code by the global variable bx_simulator_interface_c *SIM; Among other things, siminterface methods allow the simulator to ask the CUI to display things or ask for user input, and allows the CUI to query and modify variables in the simulation code. GUI: Literally, "graphical user interface". Until the configuration menus and wxWindows came along, everyone understood that "gui" referred to the VGA display window and the toolbar buttons because that's all there was. Now that we have the wxWindows code, which implements both the VGAW and the CUI, while all other platforms implement only the VGAW, it's not so clear. So, I'm trying to use VGAW, CI, and CUI consistently since they are more specific. control panel: This has been used as another name for the configuration interface. "control panel" is also somewhat unspecific and it sounds like it would be graphical with buttons and sliders, but our text-mode thing is not graphical at all. I've replaced "control panel" with "configuration interface" wherever I could find it. In configure script, the --disable-control-panel option is still supported, but it politely suggests that you use --disable-config-interface instead. - clean up comments in siminterface,wx* code - add comments and examples for bx_param_* and BxEvents - remove some obsolete stuff: notify_*_args, bx_simulator_interface_c::[sg]et_enabled() methods - in siminterface.cc, move a few bx_real_sim_c methods to where they belong, with the rest of the methods. No changes to the actual methods. - remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
char oldrc[CI_PATH_LENGTH], newrc[CI_PATH_LENGTH];
if (rc == NULL) {
if (SIM->get_default_rc(oldrc, CI_PATH_LENGTH) < 0)
strcpy(oldrc, "none");
} else {
strncpy(oldrc, rc, CI_PATH_LENGTH);
oldrc[sizeof(oldrc) - 1] = '\0';
}
while (1) {
if (ask_string("Save configuration to what file? To cancel, type 'none'.\n[%s] ", oldrc, newrc) < 0) return -1;
if (!strcmp(newrc, "none")) return 0;
// try with overwrite off first
int status = SIM->write_rc(newrc, 0);
if (status >= 0) {
fprintf(stderr, "Wrote configuration to '%s'.\n", newrc);
return 0;
} else if (status == -2) {
// return code -2 indicates the file already exists, and overwrite
// confirmation is required.
Bit32u overwrite = 0;
char prompt[256];
sprintf(prompt, "Configuration file '%s' already exists. Overwrite it? [no] ", newrc);
if (ask_yn(prompt, "", 0, &overwrite) < 0) return -1;
if (!overwrite) continue; // if "no", start loop over, asking for a different file
// they confirmed, so try again with overwrite bit set
if (SIM->write_rc(newrc, 1) >= 0) {
fprintf(stderr, "Overwriting existing configuration '%s'.\n", newrc);
return 0;
} else {
fprintf(stderr, "Write failed to '%s'.\n", newrc);
}
}
}
}
void bx_plugin_ctrl()
{
Bit32u choice;
bx_list_c *plugin_ctrl;
int count;
char plugname[512];
while (1) {
if (ask_uint(plugin_ctrl_prompt, "", 0, 2, 0, &choice, 10) < 0) return;
if (choice == 0) {
return;
} else {
plugin_ctrl = (bx_list_c*) SIM->get_param(BXPN_PLUGIN_CTRL);
count = plugin_ctrl->get_size();
if (count == 0) {
fprintf(stderr, "\nNo optional plugins loaded\n");
} else {
fprintf(stderr, "\nCurrently loaded plugins:");
for (int i = 0; i < count; i++) {
if (i > 0) fprintf(stderr, ",");
fprintf(stderr, " %s", plugin_ctrl->get(i)->get_name());
}
fprintf(stderr, "\n");
}
if (choice == 1) {
ask_string("\nEnter the name of the plugin to load.\nTo cancel, type 'none'. [%s] ", "none", plugname);
if (strcmp(plugname, "none")) {
if (!SIM->opt_plugin_ctrl(plugname, 1)) {
fprintf(stderr, "\nPlugin already loaded.\n");
}
}
} else {
ask_string("\nEnter the name of the plugin to unload.\nTo cancel, type 'none'. [%s] ", "none", plugname);
if (strcmp(plugname, "none")) {
if (!SIM->opt_plugin_ctrl(plugname, 0)) {
fprintf(stderr, "\nNo plugin unloaded.\n");
}
}
}
}
}
}
2007-10-25 03:09:59 +04:00
const char *log_action_ask_choices[] = { "cont", "alwayscont", "die", "abort", "debug" };
int log_action_n_choices = 4 + (BX_DEBUGGER||BX_GDBSTUB?1:0);
BxEvent *
config_interface_notify_callback(void *unused, BxEvent *event)
{
event->retcode = -1;
switch (event->type)
{
case BX_SYNC_EVT_TICK:
event->retcode = 0;
return event;
case BX_SYNC_EVT_ASK_PARAM:
event->retcode = event->u.param.param->text_ask(stdin, stderr);
return event;
case BX_SYNC_EVT_LOG_ASK:
{
int level = event->u.logmsg.level;
fprintf(stderr, "========================================================================\n");
fprintf(stderr, "Event type: %s\n", SIM->get_log_level_name (level));
fprintf(stderr, "Device: %s\n", event->u.logmsg.prefix);
fprintf(stderr, "Message: %s\n\n", event->u.logmsg.msg);
fprintf(stderr, "A %s has occurred. Do you want to:\n", SIM->get_log_level_name (level));
fprintf(stderr, " cont - continue execution\n");
fprintf(stderr, " alwayscont - continue execution, and don't ask again.\n");
fprintf(stderr, " This affects only %s events from device %s\n", SIM->get_log_level_name (level), event->u.logmsg.prefix);
fprintf(stderr, " die - stop execution now\n");
fprintf(stderr, " abort - dump core %s\n",
BX_HAVE_ABORT ? "" : "(Disabled)");
#if BX_DEBUGGER
fprintf(stderr, " debug - continue and return to bochs debugger\n");
#endif
#if BX_GDBSTUB
fprintf(stderr, " debug - hand control to gdb\n");
#endif
int choice;
ask:
if (ask_menu("Choose one of the actions above: [%s] ", "",
log_action_n_choices, log_action_ask_choices, 2, &choice) < 0)
event->retcode = -1;
// return 0 for continue, 1 for alwayscontinue, 2 for die, 3 for debug.
if (!BX_HAVE_ABORT && choice==BX_LOG_ASK_CHOICE_DUMP_CORE) goto ask;
2002-04-01 08:12:11 +04:00
fflush(stdout);
fflush(stderr);
event->retcode = choice;
}
return event;
- apply a patch I've been working on - modified files: config.h.in cpu/init.cc debug/dbg_main.cc gui/control.cc gui/siminterface.cc gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h iodev/keyboard.cc ---------------------------------------------------------------------- Patch name: patch.wx-show-cpu2 Author: Bryce Denney Date: Fri Sep 6 12:13:28 EDT 2002 Description: Second try at implementing the "Debug:Show Cpu" and "Debug:Show Keyboard" dialog with values that change as the simulation proceeds. (Nobody gets to see the first try.) This is the first step toward making something resembling a wxWindows debugger. First, variables which are going to be visible in the CI must be registered as parameters. For some variables, it might be acceptable to change them from Bit32u into bx_param_num_c and access them only with set/get methods, but for most variables it would be a horrible pain and wreck performance. To deal with this, I introduced the concept of a shadow parameter. A normal parameter has its value stored inside the struct, but a shadow parameter has only a pointer to the value. Shadow params allow you to treat any variable as if it was a parameter, without having to change its type and access it using get/set methods. Of course, a shadow param's value is controlled by someone else, so it can change at any time. To demonstrate and test the registration of shadow parameters, I added code in cpu/init.cc to register a few CPU registers and code in iodev/keyboard.cc to register a few keyboard state values. Now these parameters are visible in the Debug:Show CPU and Debug:Show Keyboard dialog boxes. The Debug:Show* dialog boxes are created by the ParamDialog class, which already understands how to display each type of parameter, including the new shadow parameters (because they are just a subclass of a normal parameter class). I have added a ParamDialog::Refresh() method, which rereads the value from every parameter that it is displaying and changes the displayed value. At the moment, in the Debug:Show CPU dialog, changing the values has no effect. However this is trivial to add when it's time (just call CommitChanges!). It wouldn't really make sense to change the values unless you have paused the simulation, for example when single stepping with the debugger. The Refresh() method must be called periodically or else the dialog will show the initial values forever. At the moment, Refresh() is called when the simulator sends an async event called BX_ASYNC_EVT_REFRESH, created by a call to SIM->refresh_ci (). Details: - implement shadow parameter class for Bit32s, called bx_shadow_num_c. implement shadow parameter class for Boolean, called bx_shadow_bool_c. more to follow (I need one for every type!) - now the simulator thread can request that the config interface refresh its display. For now, the refresh event causes the CI to check every parameter it is watching and change the display value. Later, it may be worth the trouble to keep track of which parameters have actually changed. Code in the simulator thread calls SIM->refresh_ci(), which creates an async event called BX_ASYNC_EVT_REFRESH and sends it to the config interface. When it arrives in the wxWindows gui thread, it calls RefreshDialogs(), which calls the Refresh() method on any dialogs that might need it. - in the debugger, SIM->refresh_ci() is called before every prompt is printed. Otherwise, the refresh would wait until the next SIM->periodic(), which might be thousands of cycles. This way, when you're single stepping, the dialogs update with every step. - To improve performance, the CI has a flag (MyFrame::WantRefresh()) which tells whether it has any need for refresh events. If no dialogs are showing that need refresh events, then no event is sent between threads. - add a few defaults to the param classes that affect the settings of newly created parameters. When declaring a lot of params with similar settings it's more compact to set the default for new params rather than to change each one separately. default_text_format is the printf format string for displaying numbers. default_base is the default base for displaying numbers (0, 16, 2, etc.) - I added to ParamDialog to make it able to display modeless dialog boxes such as "Debug:Show CPU". The new Refresh() method queries all the parameters for their current value and changes the value in the wxWindows control. The ParamDialog class still needs a little work; for example, if it's modal it should have Cancel/Ok buttons, but if it's going to be modeless it should maybe have Apply (commit any changes) and Close.
2002-09-06 20:43:26 +04:00
case BX_ASYNC_EVT_REFRESH:
case BX_ASYNC_EVT_DBG_MSG:
case BX_ASYNC_EVT_LOG_MSG:
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
// The text mode interface does not use these events, so just ignore
// them.
return event;
default:
fprintf(stderr, "textconfig: notify callback called with event type %04x\n", event->type);
return event;
}
assert(0); // switch statement should return
}
2008-03-07 00:15:40 +03:00
void bx_config_interface_init()
{
SIM->set_notify_callback(config_interface_notify_callback, NULL);
}
/////////////////////////////////////////////////////////////////////
// implement the text_* methods for bx_param types.
2008-03-07 00:15:40 +03:00
void bx_param_num_c::text_print(FILE *fp)
{
if (get_long_format()) {
fprintf(fp, get_long_format(), get());
} else {
const char *format = "%s: %d";
assert(base==10 || base==16);
if (base==16) format = "%s: 0x%x";
if (get_label()) {
fprintf(fp, format, get_label(), get());
} else {
fprintf(fp, format, get_name(), get());
}
}
}
2008-03-07 00:15:40 +03:00
void bx_param_bool_c::text_print(FILE *fp)
{
if (get_format()) {
fprintf(fp, get_format(), get() ? "yes" : "no");
} else {
const char *format = "%s: %s";
if (get_label()) {
fprintf(fp, format, get_label(), get() ? "yes" : "no");
} else {
fprintf(fp, format, get_name(), get() ? "yes" : "no");
}
}
}
2008-03-07 00:15:40 +03:00
void bx_param_enum_c::text_print(FILE *fp)
{
int n = get();
assert(n >= min && n <= max);
2007-10-25 03:09:59 +04:00
const char *choice = choices[n - min];
if (get_format()) {
fprintf(fp, get_format(), choice);
} else {
const char *format = "%s: %s";
if (get_label()) {
fprintf(fp, format, get_label(), choice);
} else {
fprintf(fp, format, get_name(), choice);
}
}
}
2008-03-07 00:15:40 +03:00
void bx_param_string_c::text_print(FILE *fp)
{
char value[1024];
this->sprint(value, 1024, 0);
if (get_format()) {
fprintf(fp, get_format(), value);
} else {
if (get_label()) {
fprintf(fp, "%s: %s", get_label(), value);
} else {
fprintf(fp, "%s: %s", get_name(), value);
}
}
}
2008-03-07 00:15:40 +03:00
void bx_list_c::text_print(FILE *fp)
{
bx_listitem_t *item;
int i = 0;
fprintf(fp, "%s: ", get_name());
for (item = list; item; item = item->next) {
if (item->param->get_enabled()) {
if ((i > 0) && (options & SERIES_ASK))
fprintf(fp, ", ");
item->param->text_print(fp);
if (!(options & SERIES_ASK))
fprintf(fp, "\n");
}
i++;
}
}
2008-03-07 00:15:40 +03:00
int bx_param_num_c::text_ask(FILE *fpin, FILE *fpout)
{
fprintf(fpout, "\n");
int status;
const char *prompt = get_ask_format();
const char *help = get_description();
if (prompt == NULL) {
// default prompt, if they didn't set an ask format string
text_print(fpout);
fprintf(fpout, "\n");
prompt = "Enter new value or '?' for help: [%d] ";
if (base==16)
prompt = "Enter new value in hex or '?' for help: [%x] ";
}
Bit32u n = get();
status = ask_uint(prompt, help, (Bit32u)min, (Bit32u)max, n, &n, base);
if (status < 0) return status;
set(n);
return 0;
}
2008-03-07 00:15:40 +03:00
int bx_param_bool_c::text_ask(FILE *fpin, FILE *fpout)
{
fprintf(fpout, "\n");
int status;
const char *prompt = get_ask_format();
const char *help = get_description();
char buffer[512];
if (prompt == NULL) {
if (get_label() != NULL) {
sprintf(buffer, "%s? [%%s] ", get_label());
prompt = buffer;
} else {
// default prompt, if they didn't set an ask format or label string
sprintf(buffer, "%s? [%%s] ", get_name());
prompt = buffer;
}
}
Bit32u n = get();
status = ask_yn(prompt, help, n, &n);
if (status < 0) return status;
set(n);
return 0;
}
2008-03-07 00:15:40 +03:00
int bx_param_enum_c::text_ask(FILE *fpin, FILE *fpout)
{
fprintf(fpout, "\n");
const char *prompt = get_ask_format();
const char *help = get_description();
if (prompt == NULL) {
// default prompt, if they didn't set an ask format string
fprintf(fpout, "%s = ", get_name());
text_print(fpout);
fprintf(fpout, "\n");
prompt = "Enter new value or '?' for help: [%s] ";
}
Bit32s n = (Bit32s)(get() - min);
int status = ask_menu(prompt, help, (Bit32u)(max-min+1), choices, n, &n);
if (status < 0) return status;
n += (Bit32s)min;
set(n);
return 0;
}
int parse_raw_bytes(char *dest, char *src, int destsize, char separator)
{
int i;
unsigned int n;
for (i=0; i<destsize; i++)
dest[i] = 0;
for (i=0; i<destsize; i++) {
while (*src == separator)
src++;
if (*src == 0) break;
// try to read a byte of hex
if (sscanf(src, "%02x", &n) == 1) {
dest[i] = n;
src+=2;
} else {
return -1;
}
}
return 0;
}
2008-03-07 00:15:40 +03:00
int bx_param_string_c::text_ask(FILE *fpin, FILE *fpout)
{
fprintf(fpout, "\n");
int status;
const char *prompt = get_ask_format();
if (prompt == NULL) {
if (options & SELECT_FOLDER_DLG) {
fprintf(fpout, "%s\n\n", get_label());
prompt = "Enter a path to an existing folder or press enter to cancel\n";
} else {
// default prompt, if they didn't set an ask format string
text_print(fpout);
fprintf(fpout, "\n");
prompt = "Enter a new value, '?' for help, or press return for no change.\n";
}
}
while (1) {
char buffer[1024];
status = ask_string(prompt, getptr(), buffer);
if (status == -2) {
fprintf(fpout, "\n%s\n", get_description());
continue;
}
if (status < 0) return status;
int opts = options;
char buffer2[1024];
strcpy(buffer2, buffer);
if (opts & RAW_BYTES) {
if (status == 0) return 0;
// copy raw hex into buffer
status = parse_raw_bytes(buffer, buffer2, maxsize, separator);
if (status < 0) {
fprintf(fpout, "Illegal raw byte format. I expected something like 3A%c03%c12%c...\n", separator, separator, separator);
continue;
}
}
if (!equals(buffer))
set(buffer);
return 0;
}
}
int bx_list_c::text_ask(FILE *fpin, FILE *fpout)
{
bx_listitem_t *item;
bx_list_c *child;
const char *my_title = title;
fprintf(fpout, "\n");
int i, imax = strlen(my_title);
for (i=0; i<imax; i++) fprintf(fpout, "-");
fprintf(fpout, "\n%s\n", my_title);
for (i=0; i<imax; i++) fprintf(fpout, "-");
fprintf(fpout, "\n");
if (options & SERIES_ASK) {
for (item = list; item; item = item->next) {
if (item->param->get_enabled()) {
if (!SIM->get_init_done() || item->param->get_runtime_param()) {
item->param->text_ask(fpin, fpout);
}
}
}
} else {
if (options & SHOW_PARENT)
fprintf(fpout, "0. Return to previous menu\n");
int i = 0;
for (item = list; item; item = item->next) {
fprintf(fpout, "%d. ", i+1);
if ((item->param->get_enabled()) &&
(!SIM->get_init_done() || item->param->get_runtime_param())) {
if (item->param->get_type() == BXT_LIST) {
child = (bx_list_c*)item->param;
fprintf(fpout, "%s\n", child->get_title());
} else {
if ((options & SHOW_GROUP_NAME) && (item->param->get_group() != NULL))
fprintf(fpout, "%s ", item->param->get_group());
item->param->text_print(fpout);
fprintf(fpout, "\n");
}
} else {
if (item->param->get_type() == BXT_LIST) {
child = (bx_list_c*)item->param;
fprintf(fpout, "%s (disabled)\n", child->get_title());
} else {
fprintf(fpout, "(disabled)\n");
}
}
i++;
}
fprintf(fpout, "\n");
int min = (options & SHOW_PARENT) ? 0 : 1;
int max = size;
int status = ask_uint("Please choose one: [%d] ", "", min, max, choice, &choice, 10);
if (status < 0) return status;
}
return 0;
}
static int ci_callback(void *userdata, ci_command_t command)
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
{
switch (command)
{
case CI_START:
bx_config_interface_init();
if (SIM->get_param_enum(BXPN_BOCHS_START)->get() == BX_QUICK_START)
bx_config_interface(BX_CI_START_SIMULATION);
else {
if (!SIM->test_for_text_console())
return CI_ERR_NO_TEXT_CONSOLE;
bx_config_interface(BX_CI_START_MENU);
}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
break;
case CI_RUNTIME_CONFIG:
bx_config_interface(BX_CI_RUNTIME);
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
break;
case CI_SHUTDOWN:
break;
}
return 0;
}
// if I can make things compile without this module linked in, then
// this file can become a plugin too.
int init_text_config_interface()
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
{
SIM->register_configuration_interface("textconfig", ci_callback, NULL);
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h gui/gui.cc gui/gui.h gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
return 0; // success
}
#endif