From a6d07ad166989c90a2c77775d5c4e041755cde25 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Thu, 1 Aug 2002 07:37:56 +0000 Subject: [PATCH] - added support for 360k floppy images * new floppy type 360k can be used in .bochsrc and the config interface * media type and geometry can be set for the floppy type * BIOS changes to make 360k floppy drives work * bximage can create 360k images now --- bochs/bios/BIOS-bochs-latest | Bin 65536 -> 65536 bytes bochs/bios/rombios.c | 18 ++++++++++++------ bochs/bochs.h | 5 +++-- bochs/gui/siminterface.cc | 10 +++++----- bochs/gui/siminterface.h | 7 ++++--- bochs/iodev/floppy.cc | 22 ++++++++++++++++++++-- bochs/main.cc | 12 ++++++++++-- bochs/misc/bximage.c | 21 +++++++++++---------- 8 files changed, 65 insertions(+), 30 deletions(-) diff --git a/bochs/bios/BIOS-bochs-latest b/bochs/bios/BIOS-bochs-latest index b63ce08fa0f4bb69190cf9f0465d6ff93370c50f..633b1ad870fc33e6a37cd483f8881f80a8525b68 100644 GIT binary patch delta 9654 zcmZ`<2|!d;_n$lBxS?zU0}8T?3vO(hil~V6$~6!*u^h!Lx6(uyO;HdKnHeGNSX!A& z=9-_Pw7f)(5?jo2sjN@^jQmU=j;WD~Au<1R?tKpi`~IeJ&+ndl?m6fF?!D)|M{cfL zZmwJDY&I%7#H2GNrDr}L7ZMW{6%!dXFfuASBx*ohY`?hv1F3W5%(#$@1uxB*vtUu* z=XzU0qWeA;{l9d}4zVer><4Hc-aT|*L{d_8MY3{4{G{gB5&4yF*pQhHahMoBjE#ZU z!{gaeI2V42#lQj66!ueD+pedXzEwB4*sVWX0bboN>HjoAsVS(;y~jzWZySysflw0> z%+7#U&t7ai4Cz_Vc0pXP5LO7!^cukuVGFiHp`urR=79UXLfO|~>>a{(!yx?sYM9cy zKXby`-o02?IMRC{y9xJt%Pbc5_X*W|b%C>e67;8op+mSIMD+C}%YDOG0Zi>XhXuly zeK!xjotj_iZk6g+Rb+^3+IrTX9yX&H^VmD=A zIBbm^re{I$YvhltXW7S5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tYwK*NUmB0A<6f1vN{tc;hoft0&U@crO?Bnqg!DMzxpp(G2s4I(rfkkm_4JZKZNLbo^z7Px4{q><7x}4CR+x<@kQZ{h)H?oqxB3 z!P~uCEB(9Dpzn9N2bUXi(cNKv^?OHd{H}jyP_dJ)UdJ*M&~89k%x?wdb5f(K#2JYUT!M-S{ k`mi)$hOE;ST~q8+(gMHGgyjGYXYD@W9w-bisIj^K7aZ9KR{#J2 diff --git a/bochs/bios/rombios.c b/bochs/bios/rombios.c index 952e083cf..814db0838 100644 --- a/bochs/bios/rombios.c +++ b/bochs/bios/rombios.c @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: rombios.c,v 1.60 2002-07-23 18:45:26 vruppert Exp $ +// $Id: rombios.c,v 1.61 2002-08-01 07:34:58 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -1067,10 +1067,10 @@ Bit16u cdrom_boot(); #endif // BX_ELTORITO_BOOT -static char bios_cvs_version_string[] = "$Revision: 1.60 $"; -static char bios_date_string[] = "$Date: 2002-07-23 18:45:26 $"; +static char bios_cvs_version_string[] = "$Revision: 1.61 $"; +static char bios_date_string[] = "$Date: 2002-08-01 07:34:58 $"; -static char CVSID[] = "$Id: rombios.c,v 1.60 2002-07-23 18:45:26 vruppert Exp $"; +static char CVSID[] = "$Id: rombios.c,v 1.61 2002-08-01 07:34:58 vruppert Exp $"; /* Offset to skip the CVS $Id: prefix */ #define bios_version_string (CVSID + 4) @@ -3853,10 +3853,16 @@ floppy_media_sense(drive) drive_type >>= 4; else drive_type &= 0x0f; - if ( drive_type == 2 ) { + if ( drive_type == 1 ) { + // 360K 5.25" drive + config_data = 0x00; // 0000 0000 + media_state = 0x25; // 0010 0101 + retval = 1; + } + else if ( drive_type == 2 ) { // 1.2 MB 5.25" drive config_data = 0x00; // 0000 0000 - media_state = 0x25; // 0001 0101 + media_state = 0x25; // 0010 0101 retval = 1; } else if ( drive_type == 3 ) { diff --git a/bochs/bochs.h b/bochs/bochs.h index 3f62950cc..19e1f7450 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: bochs.h,v 1.73 2002-07-29 09:52:03 cbothamy Exp $ +// $Id: bochs.h,v 1.74 2002-08-01 07:34:58 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -479,7 +479,8 @@ extern bx_debug_t bx_dbg; #define BX_FLOPPY_1_44 12 // 1.44M 3.5" #define BX_FLOPPY_2_88 13 // 2.88M 3.5" #define BX_FLOPPY_720K 14 // 720K 3.5" -#define BX_FLOPPY_LAST 14 // last one +#define BX_FLOPPY_360K 15 // 360K 5.25" +#define BX_FLOPPY_LAST 15 // last one #define BX_READ 10 diff --git a/bochs/gui/siminterface.cc b/bochs/gui/siminterface.cc index bbe4cdac8..bafb2d711 100644 --- a/bochs/gui/siminterface.cc +++ b/bochs/gui/siminterface.cc @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: siminterface.cc,v 1.42 2002-06-26 14:42:35 cbothamy Exp $ +// $Id: siminterface.cc,v 1.43 2002-08-01 07:34:59 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // /* * gui/siminterface.cc - * $Id: siminterface.cc,v 1.42 2002-06-26 14:42:35 cbothamy Exp $ + * $Id: siminterface.cc,v 1.43 2002-08-01 07:34:59 vruppert Exp $ * * Defines the actual link between bx_simulator_interface_c methods * and the simulator. This file includes bochs.h because it needs @@ -324,8 +324,8 @@ bx_real_sim_c::get_cdrom_options (int drive, bx_cdrom_options *out) return 0; } -char *floppy_type_names[] = { "none", "1.2M", "1.44M", "2.88M", "720K", NULL }; -int n_floppy_type_names = 5; +char *floppy_type_names[] = { "none", "1.2M", "1.44M", "2.88M", "720K", "360K", NULL }; +int n_floppy_type_names = 6; char *floppy_status_names[] = { "ejected", "inserted", NULL }; int n_floppy_status_names = 2; char *floppy_bootdisk_names[] = { "floppy", "hard","cdrom", NULL }; @@ -338,7 +338,7 @@ int n_keyboard_type_names = 3; char * bx_real_sim_c::get_floppy_type_name (int type) { - BX_ASSERT (type >= BX_FLOPPY_NONE && type <= BX_FLOPPY_720K); + BX_ASSERT (type >= BX_FLOPPY_NONE && type <= BX_FLOPPY_LAST); type -= BX_FLOPPY_NONE; return floppy_type_names[type]; } diff --git a/bochs/gui/siminterface.h b/bochs/gui/siminterface.h index 3ce14e541..3c15b6e6a 100644 --- a/bochs/gui/siminterface.h +++ b/bochs/gui/siminterface.h @@ -1,10 +1,10 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: siminterface.h,v 1.40 2002-07-24 17:52:34 cbothamy Exp $ +// $Id: siminterface.h,v 1.41 2002-08-01 07:34:59 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // /* * gui/siminterface.h - * $Id: siminterface.h,v 1.40 2002-07-24 17:52:34 cbothamy Exp $ + * $Id: siminterface.h,v 1.41 2002-08-01 07:34:59 vruppert Exp $ * * Interface to the simulator, currently only used by control.cc. * The base class bx_simulator_interface_c, contains only virtual functions @@ -530,7 +530,8 @@ public: #define BX_FLOPPY_1_44 12 // 1.44M 3.5" #define BX_FLOPPY_2_88 13 // 2.88M 3.5" #define BX_FLOPPY_720K 14 // 720K 3.5" -#define BX_FLOPPY_LAST 14 // last legal value of floppy type +#define BX_FLOPPY_360K 15 // 360K 5.25" +#define BX_FLOPPY_LAST 15 // last legal value of floppy type #define BX_FLOPPY_GUESS 20 // decide based on image size extern char *floppy_type_names[]; diff --git a/bochs/iodev/floppy.cc b/bochs/iodev/floppy.cc index 8ae24e7e7..fc8ba3442 100644 --- a/bochs/iodev/floppy.cc +++ b/bochs/iodev/floppy.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: floppy.cc,v 1.44 2002-07-26 16:39:18 vruppert Exp $ +// $Id: floppy.cc,v 1.45 2002-08-01 07:34:59 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -89,7 +89,7 @@ bx_floppy_ctrl_c::init(bx_devices_c *d, bx_cmos_c *cmos) { Bit8u i; - BX_DEBUG(("Init $Id: floppy.cc,v 1.44 2002-07-26 16:39:18 vruppert Exp $")); + BX_DEBUG(("Init $Id: floppy.cc,v 1.45 2002-08-01 07:34:59 vruppert Exp $")); BX_FD_THIS devices = d; BX_REGISTER_DMA8_CHANNEL(2, bx_floppy.dma_read, bx_floppy.dma_write, "Floppy Drive"); @@ -124,6 +124,9 @@ bx_floppy_ctrl_c::init(bx_devices_c *d, bx_cmos_c *cmos) case BX_FLOPPY_NONE: cmos->s.reg[0x10] = (cmos->s.reg[0x10] & 0x0f) | 0x00; break; + case BX_FLOPPY_360K: + cmos->s.reg[0x10] = (cmos->s.reg[0x10] & 0x0f) | 0x10; + break; case BX_FLOPPY_1_2: cmos->s.reg[0x10] = (cmos->s.reg[0x10] & 0x0f) | 0x20; break; @@ -170,6 +173,9 @@ bx_floppy_ctrl_c::init(bx_devices_c *d, bx_cmos_c *cmos) case BX_FLOPPY_NONE: cmos->s.reg[0x10] = (cmos->s.reg[0x10] & 0xf0) | 0x00; break; + case BX_FLOPPY_360K: + cmos->s.reg[0x10] = (cmos->s.reg[0x10] & 0xf0) | 0x01; + break; case BX_FLOPPY_1_2: cmos->s.reg[0x10] = (cmos->s.reg[0x10] & 0xf0) | 0x02; break; @@ -1510,6 +1516,12 @@ bx_floppy_ctrl_c::evaluate_media(unsigned type, char *path, floppy_t *media) if ( S_ISREG(stat_buf.st_mode) ) { // regular file switch (type) { + case BX_FLOPPY_360K: // 360K 5.25" + media->type = BX_FLOPPY_360K; + media->sectors_per_track = 9; + media->tracks = 40; + media->heads = 2; + break; case BX_FLOPPY_720K: // 720K 3.5" media->type = BX_FLOPPY_720K; media->sectors_per_track = 9; @@ -1568,6 +1580,12 @@ bx_floppy_ctrl_c::evaluate_media(unsigned type, char *path, floppy_t *media) // character or block device // assume media is formatted to typical geometry for drive switch (type) { + case BX_FLOPPY_360K: // 360K 5.25" + media->type = BX_FLOPPY_360K; + media->sectors_per_track = 9; + media->tracks = 40; + media->heads = 2; + break; case BX_FLOPPY_720K: // 720K 3.5" media->type = BX_FLOPPY_720K; media->sectors_per_track = 9; diff --git a/bochs/main.cc b/bochs/main.cc index 328618646..c373c993a 100644 --- a/bochs/main.cc +++ b/bochs/main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: main.cc,v 1.107 2002-07-24 17:52:34 cbothamy Exp $ +// $Id: main.cc,v 1.108 2002-08-01 07:34:58 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -1632,6 +1632,10 @@ parse_line_formatted(char *context, int num_params, char *params[]) bx_options.floppya.Opath->set (¶ms[i][5]); bx_options.floppya.Otype->set (BX_FLOPPY_720K); } + else if (!strncmp(params[i], "360k=", 5)) { + bx_options.floppya.Opath->set (¶ms[i][5]); + bx_options.floppya.Otype->set (BX_FLOPPY_360K); + } else if (!strncmp(params[i], "status=ejected", 14)) { bx_options.floppya.Oinitial_status->set (BX_EJECTED); } @@ -1663,6 +1667,10 @@ parse_line_formatted(char *context, int num_params, char *params[]) bx_options.floppyb.Opath->set (¶ms[i][5]); bx_options.floppyb.Otype->set (BX_FLOPPY_720K); } + else if (!strncmp(params[i], "360k=", 5)) { + bx_options.floppyb.Opath->set (¶ms[i][5]); + bx_options.floppyb.Otype->set (BX_FLOPPY_360K); + } else if (!strncmp(params[i], "status=ejected", 14)) { bx_options.floppyb.Oinitial_status->set (BX_EJECTED); } @@ -2335,7 +2343,7 @@ parse_line_formatted(char *context, int num_params, char *params[]) } static char *fdtypes[] = { - "none", "1_2", "1_44", "2_88", "720k" + "none", "1_2", "1_44", "2_88", "720k", "360k" }; int diff --git a/bochs/misc/bximage.c b/bochs/misc/bximage.c index a2b221b98..ea533bcb1 100644 --- a/bochs/misc/bximage.c +++ b/bochs/misc/bximage.c @@ -1,6 +1,6 @@ /* * misc/bximage.c - * $Id: bximage.c,v 1.7 2002-05-21 07:23:09 cbothamy Exp $ + * $Id: bximage.c,v 1.8 2002-08-01 07:35:00 vruppert Exp $ * * Create empty hard disk or floppy disk images for bochs. * @@ -14,7 +14,7 @@ #include "config.h" char *EOF_ERR = "ERROR: End of input"; -char *rcsid = "$Id: bximage.c,v 1.7 2002-05-21 07:23:09 cbothamy Exp $"; +char *rcsid = "$Id: bximage.c,v 1.8 2002-08-01 07:35:00 vruppert Exp $"; char *divider = "========================================================================"; /* menu data for choosing floppy/hard disk */ @@ -23,9 +23,9 @@ char *fdhd_choices[] = { "fd", "hd" }; int fdhd_n_choices = 2; /* menu data for choosing floppy size */ -char *fdsize_menu = "\nChoose the size of floppy disk image to create, in megabytes.\nPlease type 0.72, 1.2, 1.44, or 2.88. [1.44] "; -char *fdsize_choices[] = { "0.72","1.2","1.44","2.88" }; -int fdsize_n_choices = 4; +char *fdsize_menu = "\nChoose the size of floppy disk image to create, in megabytes.\nPlease type 0.36, 0.72, 1.2, 1.44, or 2.88. [1.44] "; +char *fdsize_choices[] = { "0.36","0.72","1.2","1.44","2.88" }; +int fdsize_n_choices = 5; /* stolen from main.cc */ void bx_center_print (FILE *file, char *line, int maxwidth) @@ -267,13 +267,14 @@ int main() } else { int fdsize, cyl=0, heads=0, spt=0; char *name = NULL; - if (ask_menu (fdsize_menu, fdsize_n_choices, fdsize_choices, 2, &fdsize) < 0) + if (ask_menu (fdsize_menu, fdsize_n_choices, fdsize_choices, 3, &fdsize) < 0) fatal (EOF_ERR); switch (fdsize) { - case 0: name="720k"; cyl=80; heads=2; spt=9; break; /* 0.72 meg */ - case 1: name="1_2"; cyl=80; heads=2; spt=15; break; /* 1.2 meg */ - case 2: name="1_44"; cyl=80; heads=2; spt=18; break; /* 1.44 meg */ - case 3: name="2_88"; cyl=80; heads=2; spt=36; break; /* 2.88 meg */ + case 0: name="360k"; cyl=40; heads=2; spt=9; break; /* 0.36 meg */ + case 1: name="720k"; cyl=80; heads=2; spt=9; break; /* 0.72 meg */ + case 2: name="1_2"; cyl=80; heads=2; spt=15; break; /* 1.2 meg */ + case 3: name="1_44"; cyl=80; heads=2; spt=18; break; /* 1.44 meg */ + case 4: name="2_88"; cyl=80; heads=2; spt=36; break; /* 2.88 meg */ default: fatal ("ERROR: fdsize out of range"); }