- turn the last few options into parameters (cmos, loader, random stuff)
This commit is contained in:
parent
0742e55fb1
commit
b1b56487c1
@ -605,6 +605,7 @@ typedef struct {
|
|||||||
// any of the 16bit real mode or BIOS assistance. This
|
// any of the 16bit real mode or BIOS assistance. This
|
||||||
// is for the development of freemware, so we don't have
|
// is for the development of freemware, so we don't have
|
||||||
// to implement real mode up front.
|
// to implement real mode up front.
|
||||||
|
#define Load32bitOSNone 0
|
||||||
#define Load32bitOSLinux 1
|
#define Load32bitOSLinux 1
|
||||||
#define Load32bitOSNullKernel 2 // being developed for freemware
|
#define Load32bitOSNullKernel 2 // being developed for freemware
|
||||||
#define Load32bitOSLast 2
|
#define Load32bitOSLast 2
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* gui/control.cc
|
* gui/control.cc
|
||||||
* $Id: control.cc,v 1.28 2001-06-21 19:31:19 bdenney Exp $
|
* $Id: control.cc,v 1.29 2001-06-21 19:57:21 bdenney Exp $
|
||||||
*
|
*
|
||||||
* This is code for a text-mode control panel. Note that this file
|
* This is code for a text-mode control panel. Note that this file
|
||||||
* does NOT include bochs.h. Instead, it does all of its contact with
|
* does NOT include bochs.h. Instead, it does all of its contact with
|
||||||
@ -431,7 +431,7 @@ int bx_control_panel (int menu)
|
|||||||
char oldpath[CPANEL_PATH_LEN];
|
char oldpath[CPANEL_PATH_LEN];
|
||||||
assert (SIM->get_log_file (oldpath, CPANEL_PATH_LEN) >= 0);
|
assert (SIM->get_log_file (oldpath, CPANEL_PATH_LEN) >= 0);
|
||||||
sprintf (prompt, startup_options_prompt, oldpath);
|
sprintf (prompt, startup_options_prompt, oldpath);
|
||||||
if (ask_uint (prompt, 0, 8, 0, &choice, 10) < 0) return -1;
|
if (ask_uint (prompt, 0, 9, 0, &choice, 10) < 0) return -1;
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case 0: return 0;
|
case 0: return 0;
|
||||||
case 1: askparam (BXP_LOG_FILENAME); break;
|
case 1: askparam (BXP_LOG_FILENAME); break;
|
||||||
@ -442,7 +442,7 @@ int bx_control_panel (int menu)
|
|||||||
case 6: do_menu (BXP_MENU_DISK); break;
|
case 6: do_menu (BXP_MENU_DISK); break;
|
||||||
case 7: do_menu (BXP_SB16); break;
|
case 7: do_menu (BXP_SB16); break;
|
||||||
case 8: do_menu (BXP_NE2K); break;
|
case 8: do_menu (BXP_NE2K); break;
|
||||||
case 9: bx_control_panel (BX_CPANEL_START_OPTS_MISC); break;
|
case 9: do_menu (BXP_MENU_MISC); break;
|
||||||
default: BAD_OPTION(menu, choice);
|
default: BAD_OPTION(menu, choice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* gui/siminterface.cc
|
* gui/siminterface.cc
|
||||||
* $Id: siminterface.cc,v 1.27 2001-06-21 19:27:05 bdenney Exp $
|
* $Id: siminterface.cc,v 1.28 2001-06-21 19:57:21 bdenney Exp $
|
||||||
*
|
*
|
||||||
* Defines the actual link between bx_simulator_interface_c methods
|
* Defines the actual link between bx_simulator_interface_c methods
|
||||||
* and the simulator. This file includes bochs.h because it needs
|
* and the simulator. This file includes bochs.h because it needs
|
||||||
@ -242,6 +242,8 @@ char *floppy_status_names[] = { "ejected", "inserted", NULL };
|
|||||||
int n_floppy_status_names = 2;
|
int n_floppy_status_names = 2;
|
||||||
char *floppy_bootdisk_names[] = { "floppy", "hard", NULL };
|
char *floppy_bootdisk_names[] = { "floppy", "hard", NULL };
|
||||||
int n_floppy_bootdisk_names = 2;
|
int n_floppy_bootdisk_names = 2;
|
||||||
|
char *loader_os_names[] = { "none", "linux", "nullkernel", NULL };
|
||||||
|
int n_loader_os_names = 3;
|
||||||
|
|
||||||
char *
|
char *
|
||||||
bx_real_sim_c::get_floppy_type_name (int type)
|
bx_real_sim_c::get_floppy_type_name (int type)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* gui/siminterface.h
|
* gui/siminterface.h
|
||||||
* $Id: siminterface.h,v 1.19 2001-06-21 19:27:05 bdenney Exp $
|
* $Id: siminterface.h,v 1.20 2001-06-21 19:57:21 bdenney Exp $
|
||||||
*
|
*
|
||||||
* Interface to the simulator, currently only used by control.cc.
|
* Interface to the simulator, currently only used by control.cc.
|
||||||
* The base class bx_simulator_interface_c, contains only virtual functions
|
* The base class bx_simulator_interface_c, contains only virtual functions
|
||||||
@ -64,6 +64,7 @@ typedef enum {
|
|||||||
BXP_LOAD32BITOS_PATH,
|
BXP_LOAD32BITOS_PATH,
|
||||||
BXP_LOAD32BITOS_IOLOG,
|
BXP_LOAD32BITOS_IOLOG,
|
||||||
BXP_LOAD32BITOS_INITRD,
|
BXP_LOAD32BITOS_INITRD,
|
||||||
|
BXP_LOAD32BITOS,
|
||||||
BXP_BOOTDRIVE,
|
BXP_BOOTDRIVE,
|
||||||
BXP_MENU_MAIN,
|
BXP_MENU_MAIN,
|
||||||
BXP_MENU_MEMORY,
|
BXP_MENU_MEMORY,
|
||||||
@ -287,6 +288,8 @@ extern char *floppy_status_names[];
|
|||||||
extern int n_floppy_status_names;
|
extern int n_floppy_status_names;
|
||||||
extern char *floppy_bootdisk_names[];
|
extern char *floppy_bootdisk_names[];
|
||||||
extern int n_floppy_bootdisk_names;
|
extern int n_floppy_bootdisk_names;
|
||||||
|
extern char *loader_os_names[];
|
||||||
|
extern int n_loader_os_names;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bx_param_string_c *Opath;
|
bx_param_string_c *Opath;
|
||||||
|
110
bochs/main.cc
110
bochs/main.cc
@ -131,6 +131,17 @@ bx_param_handler (bx_param_c *param, int set, Bit32s val)
|
|||||||
SIM->get_param (BXP_NE2K_ETHDEV)->set_enabled (enable);
|
SIM->get_param (BXP_NE2K_ETHDEV)->set_enabled (enable);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case BXP_LOAD32BITOS_WHICH:
|
||||||
|
if (set) {
|
||||||
|
int enable = (val != 0);
|
||||||
|
SIM->get_param (BXP_LOAD32BITOS_PATH)->set_enabled (enable);
|
||||||
|
SIM->get_param (BXP_LOAD32BITOS_IOLOG)->set_enabled (enable);
|
||||||
|
SIM->get_param (BXP_LOAD32BITOS_INITRD)->set_enabled (enable);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case BXP_CMOS_IMAGE:
|
||||||
|
SIM->get_param (BXP_CMOS_PATH)->set_enabled (val);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
BX_PANIC (("bx_param_handler called with unknown id %d", id));
|
BX_PANIC (("bx_param_handler called with unknown id %d", id));
|
||||||
return -1;
|
return -1;
|
||||||
@ -438,6 +449,7 @@ void bx_init_options ()
|
|||||||
menu = new bx_list_c (BXP_MENU_MEMORY, "Bochs Memory Options", "memmenu", memory_init_list);
|
menu = new bx_list_c (BXP_MENU_MEMORY, "Bochs Memory Options", "memmenu", memory_init_list);
|
||||||
menu->get_options ()->set (menu->BX_SHOW_PARENT);
|
menu->get_options ()->set (menu->BX_SHOW_PARENT);
|
||||||
|
|
||||||
|
// interface
|
||||||
bx_options.Ovga_update_interval = new bx_param_num_c (BXP_VGA_UPDATE_INTERVAL,
|
bx_options.Ovga_update_interval = new bx_param_num_c (BXP_VGA_UPDATE_INTERVAL,
|
||||||
"VGA Update Interval",
|
"VGA Update Interval",
|
||||||
"Number of microseconds between VGA updates",
|
"Number of microseconds between VGA updates",
|
||||||
@ -577,6 +589,53 @@ void bx_init_options ()
|
|||||||
bx_options.sb16.Opresent->set_handler (bx_param_handler);
|
bx_options.sb16.Opresent->set_handler (bx_param_handler);
|
||||||
bx_options.sb16.Opresent->set (0);
|
bx_options.sb16.Opresent->set (0);
|
||||||
|
|
||||||
|
bx_options.log.Ofilename = new bx_param_string_c (BXP_LOG_FILENAME,
|
||||||
|
"log:filename",
|
||||||
|
"Pathname of bochs log file",
|
||||||
|
"-", BX_PATHNAME_LEN);
|
||||||
|
bx_options.log.Ofilename->set_ask_format ("Enter log filename: [%s] ");
|
||||||
|
|
||||||
|
// loader
|
||||||
|
bx_options.load32bitOSImage.OwhichOS = new bx_param_enum_c (BXP_LOAD32BITOS_WHICH,
|
||||||
|
"Which operating system?",
|
||||||
|
"Which OS to boot",
|
||||||
|
loader_os_names,
|
||||||
|
Load32bitOSNone,
|
||||||
|
Load32bitOSNone);
|
||||||
|
bx_options.load32bitOSImage.Opath = new bx_param_string_c (BXP_LOAD32BITOS_PATH,
|
||||||
|
"Pathname of OS to load",
|
||||||
|
NULL,
|
||||||
|
"", BX_PATHNAME_LEN);
|
||||||
|
bx_options.load32bitOSImage.Oiolog = new bx_param_string_c (BXP_LOAD32BITOS_IOLOG,
|
||||||
|
"Pathname of I/O log file",
|
||||||
|
NULL,
|
||||||
|
"", BX_PATHNAME_LEN);
|
||||||
|
bx_options.load32bitOSImage.Oinitrd = new bx_param_string_c (BXP_LOAD32BITOS_INITRD,
|
||||||
|
"Pathname of initrd",
|
||||||
|
NULL,
|
||||||
|
"", BX_PATHNAME_LEN);
|
||||||
|
bx_param_c *loader_init_list[] = {
|
||||||
|
bx_options.load32bitOSImage.OwhichOS,
|
||||||
|
bx_options.load32bitOSImage.Opath,
|
||||||
|
bx_options.load32bitOSImage.Oiolog,
|
||||||
|
bx_options.load32bitOSImage.Oinitrd,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
bx_options.load32bitOSImage.OwhichOS->set_format ("os=%s");
|
||||||
|
bx_options.load32bitOSImage.Opath->set_format (", path=%s");
|
||||||
|
bx_options.load32bitOSImage.Oiolog->set_format (", iolog=%s");
|
||||||
|
bx_options.load32bitOSImage.Oinitrd->set_format (", initrd=%s");
|
||||||
|
bx_options.load32bitOSImage.OwhichOS->set_ask_format ("Enter OS to load: [%s] ");
|
||||||
|
bx_options.load32bitOSImage.Opath->set_ask_format ("Enter pathname of OS: [%s]");
|
||||||
|
bx_options.load32bitOSImage.Oiolog->set_ask_format ("Enter pathname of I/O log: [%s] ");
|
||||||
|
bx_options.load32bitOSImage.Oinitrd->set_ask_format ("Enter pathname of initrd: [%s] ");
|
||||||
|
menu = new bx_list_c (BXP_LOAD32BITOS, "32-bit OS Loader", "", loader_init_list);
|
||||||
|
menu->get_options ()->set (menu->BX_SERIES_ASK);
|
||||||
|
bx_options.load32bitOSImage.OwhichOS->set_handler (bx_param_handler);
|
||||||
|
bx_options.load32bitOSImage.OwhichOS->set (Load32bitOSNone);
|
||||||
|
|
||||||
|
|
||||||
|
// other
|
||||||
bx_options.Okeyboard_serial_delay = new bx_param_num_c (BXP_KBD_SERIAL_DELAY,
|
bx_options.Okeyboard_serial_delay = new bx_param_num_c (BXP_KBD_SERIAL_DELAY,
|
||||||
"keyboard_serial_delay",
|
"keyboard_serial_delay",
|
||||||
"Approximate time in microseconds that it takes one character to be transfered from the keyboard to controller over the serial path.",
|
"Approximate time in microseconds that it takes one character to be transfered from the keyboard to controller over the serial path.",
|
||||||
@ -591,41 +650,34 @@ void bx_init_options ()
|
|||||||
"i440FXSupport",
|
"i440FXSupport",
|
||||||
"Controls whether to emulate PCI I440FX",
|
"Controls whether to emulate PCI I440FX",
|
||||||
0);
|
0);
|
||||||
bx_options.log.Ofilename = new bx_param_string_c (BXP_LOG_FILENAME,
|
|
||||||
"log:filename",
|
|
||||||
"Pathname of bochs log file",
|
|
||||||
"-", BX_PATHNAME_LEN);
|
|
||||||
bx_options.log.Ofilename->set_ask_format ("Enter log filename: [%s] ");
|
|
||||||
bx_options.cmos.Opath = new bx_param_string_c (BXP_CMOS_PATH,
|
|
||||||
"cmos:path",
|
|
||||||
"Pathname of CMOS image",
|
|
||||||
"", BX_PATHNAME_LEN);
|
|
||||||
bx_options.cmos.OcmosImage = new bx_param_bool_c (BXP_CMOS_IMAGE,
|
bx_options.cmos.OcmosImage = new bx_param_bool_c (BXP_CMOS_IMAGE,
|
||||||
"cmos:image",
|
"Use a CMOS image",
|
||||||
"Whether to use a CMOS image or not",
|
NULL,
|
||||||
0);
|
0);
|
||||||
|
bx_options.cmos.Opath = new bx_param_string_c (BXP_CMOS_PATH,
|
||||||
|
"Pathname of CMOS image",
|
||||||
|
NULL,
|
||||||
|
"", BX_PATHNAME_LEN);
|
||||||
bx_options.cmos.Otime0 = new bx_param_num_c (BXP_CMOS_TIME0,
|
bx_options.cmos.Otime0 = new bx_param_num_c (BXP_CMOS_TIME0,
|
||||||
"cmos:time0",
|
"Initial CMOS time for Bochs",
|
||||||
"Start time for Bochs CMOS clock, used if you really want two runs to be identical (cosimulation)",
|
"Start time for Bochs CMOS clock, used if you really want two runs to be identical (cosimulation)",
|
||||||
0, BX_MAX_INT,
|
0, BX_MAX_INT,
|
||||||
0);
|
0);
|
||||||
bx_options.load32bitOSImage.OwhichOS = new bx_param_num_c (BXP_LOAD32BITOS_WHICH,
|
bx_param_c *other_init_list[] = {
|
||||||
"load32bitOS:which",
|
bx_options.Okeyboard_serial_delay,
|
||||||
"Which OS to boot",
|
bx_options.Ofloppy_command_delay,
|
||||||
0, Load32bitOSLast,
|
bx_options.Oi440FXSupport,
|
||||||
0);
|
bx_options.cmos.OcmosImage,
|
||||||
bx_options.load32bitOSImage.Opath = new bx_param_string_c (BXP_LOAD32BITOS_PATH,
|
bx_options.cmos.Opath,
|
||||||
"load32bitOS:path",
|
bx_options.cmos.Otime0,
|
||||||
"Pathname of OS to load",
|
SIM->get_param (BXP_LOAD32BITOS),
|
||||||
"", BX_PATHNAME_LEN);
|
NULL
|
||||||
bx_options.load32bitOSImage.Oiolog = new bx_param_string_c (BXP_LOAD32BITOS_IOLOG,
|
};
|
||||||
"load32bitOS:iolog",
|
menu = new bx_list_c (BXP_MENU_MISC, "Configure Everything Else", "", other_init_list);
|
||||||
"I/O Log",
|
menu->get_options ()->set (menu->BX_SHOW_PARENT);
|
||||||
"", BX_PATHNAME_LEN);
|
bx_options.cmos.OcmosImage->set_handler (bx_param_handler);
|
||||||
bx_options.load32bitOSImage.Oinitrd = new bx_param_string_c (BXP_LOAD32BITOS_INITRD,
|
bx_options.cmos.OcmosImage->set (0);
|
||||||
"load32bitOS:initrd",
|
|
||||||
"Initrd",
|
|
||||||
"", BX_PATHNAME_LEN);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user