- since Christophe added the four-ata patch, it is possible to boot from

the first hard drive or first cdrom drive no matter where they are found.
  Now the wxWindows interface recognizes this fact.  It allows you to
  select HD boot if there is a hard drive in any ATA location, and
  select CDROM boot if there is a cdrom in any ATA location.
- this fixes bug [ 616139 ] wx: boot hd/cd must be in ata0 interface

Modified Files:
  gui/siminterface.cc gui/siminterface.h gui/wxmain.cc
This commit is contained in:
Bryce Denney 2002-12-07 19:43:53 +00:00
parent c4ad196af1
commit 16ebed0b1e
3 changed files with 21 additions and 17 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.cc,v 1.88 2002-12-06 19:34:32 bdenney Exp $
// $Id: siminterface.cc,v 1.89 2002-12-07 19:43:52 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// See siminterface.h for description of the siminterface concept.
@ -99,7 +99,14 @@ public:
// maybe need to check if something has been initialized yet?
bx_gui->handle_events ();
}
bx_param_c *get_first_cdrom ();
// find first hard drive or cdrom
bx_param_c *get_first_atadevice (Bit32u search_type);
bx_param_c *get_first_cdrom () {
return get_first_atadevice (BX_ATA_DEVICE_CDROM);
}
bx_param_c *get_first_hd () {
return get_first_atadevice (BX_ATA_DEVICE_DISK);
}
#if BX_DEBUGGER
virtual void debug_break ();
virtual void debug_interpret_cmd (char *cmd);
@ -628,15 +635,14 @@ void bx_real_sim_c::refresh_ci () {
}
bx_param_c *
bx_real_sim_c::get_first_cdrom ()
{
bx_real_sim_c::get_first_atadevice (Bit32u search_type) {
for (int channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) {
if (!bx_options.ata[channel].Opresent->get ())
continue;
for (int slave=0; slave<2; slave++) {
Bit32u present = bx_options.atadevice[channel][slave].Opresent->get ();
Bit32u type = bx_options.atadevice[channel][slave].Otype->get ();
if (present && (type == BX_ATA_DEVICE_CDROM)) {
if (present && (type == search_type)) {
return bx_options.atadevice[channel][slave].Omenu;
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.91 2002-12-06 19:34:32 bdenney Exp $
// $Id: siminterface.h,v 1.92 2002-12-07 19:43:52 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Before I can describe what this file is for, I have to make the
@ -1252,8 +1252,10 @@ public:
// can force the gui events to be handled, so that interactive things such
// as a toolbar click will be processed.
virtual void handle_events () {}
// return first hard disk in ATA interface
virtual bx_param_c *get_first_cdrom () {return NULL;}
// return first cdrom in ATA interface
bx_param_c *get_first_cdrom () {return NULL;}
virtual bx_param_c *get_first_hd () {return NULL;}
#if BX_DEBUGGER
// for debugger: same behavior as pressing control-C
virtual void debug_break () {}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////
// $Id: wxmain.cc,v 1.80 2002-12-07 16:52:06 cbothamy Exp $
// $Id: wxmain.cc,v 1.81 2002-12-07 19:43:53 bdenney Exp $
/////////////////////////////////////////////////////////////////
//
// wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
@ -569,22 +569,18 @@ void MyFrame::OnEditBoot(wxCommandEvent& WXUNUSED(event))
devices[bootDevices] = wxT("First floppy drive");
dev_id[bootDevices++] = BX_BOOT_FLOPPYA;
}
#ifdef __GNUC__
#warning wxwindows interface will only allow booting from hard disk if it is on ATA0 master
#endif
if (ata0_mpres->get() && ata0_mtype->get() == BX_ATA_DEVICE_DISK) {
bx_param_c *firsthd = SIM->get_first_hd ();
if (firsthd != NULL) {
devices[bootDevices] = wxT("First hard drive");
dev_id[bootDevices++] = BX_BOOT_DISKC;
}
#ifdef __GNUC__
#warning wxwindows interface will only allow booting from cdrom if it is on ATA0 slave
#endif
if (ata0_spres->get() && ata0_stype->get() == BX_ATA_DEVICE_CDROM) {
bx_param_c *firstcd = SIM->get_first_cdrom ();
if (firstcd != NULL) {
devices[bootDevices] = wxT("CD-ROM drive");
dev_id[bootDevices++] = BX_BOOT_CDROM;
}
if (bootDevices == 0) {
wxMessageBox( "All the possible boot devices are disabled right now!\nYou must enable the first floppy drive, the first hard drive, or the CD-ROM.", "None enabled", wxOK | wxICON_ERROR );
wxMessageBox( "All the possible boot devices are disabled right now!\nYou must enable the first floppy drive, a hard drive, or a CD-ROM.", "None enabled", wxOK | wxICON_ERROR );
return;
}
int which = wxGetSingleChoiceIndex ("Select the device to boot from", "Boot Device", bootDevices, devices);