From b84c82e80cfa32483ff0a5a49609f72a5f03cd1b Mon Sep 17 00:00:00 2001 From: Christophe Bothamy Date: Sat, 4 May 2002 16:00:40 +0000 Subject: [PATCH] - changed the floppy_bootsig_check syntax to be more logical. the syntax is now : floppy_bootsig_check: disabled=[0|1]. It is not disabled by default. Sorry for any inconvenience it could cause - changed the default (if cmos reg is 0) behavior for the floppy boot signature check, so the new bios is compatible with older bochs binaries (useful if we want to use the new bios when we release 1.4.1) : 1 : disabled 0 : enabled - added info at launch time about the boot device and the floppy boot signature check - added a "LBA capable" flag in the ata controller --- bochs/.bochsrc | 12 ++++++------ bochs/iodev/harddrv.cc | 15 +++++++++------ bochs/main.cc | 10 +++++----- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/bochs/.bochsrc b/bochs/.bochsrc index e7ad3e856..757997471 100644 --- a/bochs/.bochsrc +++ b/bochs/.bochsrc @@ -129,15 +129,15 @@ diskc: file="30M.sample", cyl=615, heads=6, spt=17 boot: c #======================================================================= -# FLOPPY_BOOTSIG_CHECK: enabled=[0|1] +# FLOPPY_BOOTSIG_CHECK: disabled=[0|1] # Enables or disables the 0xaa55 signature check on boot floppies -# Defaults to enabled=1 +# Defaults to disabled=0 # Examples: -# floppy_bootsig_check: enabled=0 -# floppy_bootsig_check: enabled=1 +# floppy_bootsig_check: disabled=0 +# floppy_bootsig_check: disabled=1 #======================================================================= -#floppy_bootsig_check: enabled=0 -floppy_bootsig_check: enabled=1 +#floppy_bootsig_check: disabled=1 +floppy_bootsig_check: disabled=0 #======================================================================= # LOG: diff --git a/bochs/iodev/harddrv.cc b/bochs/iodev/harddrv.cc index b87fb0e58..9807d63fa 100644 --- a/bochs/iodev/harddrv.cc +++ b/bochs/iodev/harddrv.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: harddrv.cc,v 1.55 2002-05-03 08:17:18 cbothamy Exp $ +// $Id: harddrv.cc,v 1.56 2002-05-04 16:00:40 cbothamy Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -128,7 +128,7 @@ bx_hard_drive_c::~bx_hard_drive_c(void) bx_hard_drive_c::init(bx_devices_c *d, bx_cmos_c *cmos) { BX_HD_THIS devices = d; - BX_DEBUG(("Init $Id: harddrv.cc,v 1.55 2002-05-03 08:17:18 cbothamy Exp $")); + BX_DEBUG(("Init $Id: harddrv.cc,v 1.56 2002-05-04 16:00:40 cbothamy Exp $")); /* HARD DRIVE 0 */ @@ -304,19 +304,22 @@ bx_hard_drive_c::init(bx_devices_c *d, bx_cmos_c *cmos) if ( bx_options.Obootdrive->get () == BX_BOOT_FLOPPYA) { // system boot sequence A: cmos->s.reg[0x3d] = 0x01; + BX_INFO(("Boot device will be 'a'")); } else if ( bx_options.Obootdrive->get () == BX_BOOT_DISKC) { // system boot sequence C: cmos->s.reg[0x3d] = 0x02; + BX_INFO(("Boot device will be 'c'")); } else if ( bx_options.Obootdrive->get () == BX_BOOT_CDROM) { // system boot sequence cdrom cmos->s.reg[0x3d] = 0x03; + BX_INFO(("Boot device will be 'cdrom'")); } - // Set the signature check flag + // Set the signature check flag in cmos, inverted for compatibility cmos->s.reg[0x38] = bx_options.OfloppySigCheck->get(); - BX_INFO(("Floppy boot signature will %sbe checked", bx_options.OfloppySigCheck->get()==0?"not ":"")); + BX_INFO(("Floppy boot signature check is %sabled", bx_options.OfloppySigCheck->get() ? "dis" : "en")); } //switch (stat_buf.st_size) { @@ -2427,7 +2430,7 @@ bx_hard_drive_c::identify_drive(unsigned drive) // 9: 1 = LBA supported // 8: 1 = DMA supported // 7-0: Vendor unique - BX_SELECTED_HD.id_drive[49] = 0; + BX_SELECTED_HD.id_drive[49] = 1<<9; // Word 50: Reserved BX_SELECTED_HD.id_drive[50] = 0; @@ -2562,7 +2565,7 @@ bx_hard_drive_c::init_send_atapi_command(Bit8u command, int req_length, int allo if ((BX_SELECTED_CONTROLLER.byte_count & 1) && !(alloc_length <= BX_SELECTED_CONTROLLER.byte_count)) { - BX_PANIC(("Odd byte count to ATAPI command")); + BX_ERROR(("Odd byte count to ATAPI command")); } if (alloc_length <= 0) BX_PANIC(("Allocation length <= 0")); diff --git a/bochs/main.cc b/bochs/main.cc index fa5dd5e0f..e447b6d49 100644 --- a/bochs/main.cc +++ b/bochs/main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: main.cc,v 1.99 2002-05-02 07:54:22 cbothamy Exp $ +// $Id: main.cc,v 1.100 2002-05-04 16:00:40 cbothamy Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -585,7 +585,7 @@ void bx_init_options () bx_options.OfloppySigCheck = new bx_param_bool_c (BXP_FLOPPYSIGCHECK, "Flopppy Boot Signature Check", "Checks for the 0xaa55 signature on floppy boot device.", - 1); + 0); // disk menu bx_param_c *disk_menu_init_list[] = { @@ -1676,12 +1676,12 @@ parse_line_formatted(char *context, int num_params, char *params[]) if (num_params != 2) { BX_PANIC(("%s: floppy_bootsig_check directive malformed.", context)); } - if (strncmp(params[1], "enabled=", 8)) { + if (strncmp(params[1], "disabled=", 9)) { BX_PANIC(("%s: floppy_bootsig_check directive malformed.", context)); } - if (params[1][8] == '0') + if (params[1][9] == '0') bx_options.OfloppySigCheck->set (0); - else if (params[1][8] == '1') + else if (params[1][9] == '1') bx_options.OfloppySigCheck->set (1); else { BX_PANIC(("%s: floppy_bootsig_check directive malformed.", context));