Commit Graph

225 Commits

Author SHA1 Message Date
Christophe Bothamy
8ce766fc17 - fixed problem reported by Kevin. the buffer index was incremented twice when repeat-speedups is enabled 2002-09-23 21:11:51 +00:00
Christophe Bothamy
af215531f2 - fixed compile problem with --enable-repeat-speedups 2002-09-22 23:47:34 +00:00
Christophe Bothamy
440dffc803 - applied patch.4ata-channels and patch.4ata-channels.bbd
- Features :
 . number of active channels defined at boot-time config
 . new options in bochsrc
 . up to 8 devices support (disks or cdroms)
 . up to 4 cdrom devices can be changed at runtime config
 . wxwindows config interface
2002-09-22 20:56:12 +00:00
Bryce Denney
6a50742b20 - clean up ^M pollution from working in cygwin 2002-09-16 17:00:16 +00:00
Bryce Denney
d6cd93b462 - add support for Peter Tattam's external disk simulator 2002-09-12 06:49:04 +00:00
Kevin Lawton
414e97bc32 Enhanced the repeat IO accelerations (enabled by --enable-repeat-speedups)
to request bulk IO operations to IO devices which are bulk IO aware.
Currently, I modified only harddrv.cc to be aware.  I added some
fields to the bx_devices_c class for the IO instructions to
place requests and receive responses from the IO device emulation.
Devices except the hard drive, don't monitor these fields so they
respond as normal.  The hard drive now monitors these fields for
bulk requests, and if enabled, it memcpy()'s data straight from
the disk buffer to memory.  This eliminates numerous inp/outp calling
sequences per disk sector.

I used the fields in bx_devices_c so that I would not have to
disrupt most IO device modules.  Enhancements can be made to
other devices if they use high-bandwidth IO via in/out instructions.
2002-09-09 16:56:56 +00:00
Bryce Denney
7fdc7303c2 - add "void reset(unsigned type)" method to every I/O device.
Some devices already had one.  Some I had to add an empty one.
  I did a little cleaning of init() methods to make them more uniform
  but generally I left them alone.
- I also put these exact diffs into a patch "patch.iodev-add-reset"
  in case I want to revert these changes for some reason, for example
  if they break an old patch.  It should be deleted after a while.
2002-08-27 19:54:46 +00:00
Christophe Bothamy
1a7d18743f - added subcommand 0x66 (Disable reverting to power-on default)
and 0xCC (Enable reverting to power-on default) to list of unsupported
"Set Feature" subcommands.
2002-08-09 13:16:22 +00:00
Volker Ruppert
f81909361d - panic at MODE SENSE (chg) and a few audio cd functions replaced by a
BX_ERROR. The harddisk controller returns an error code until we are able to
  implement this features.
2002-08-07 08:53:01 +00:00
Christophe Bothamy
6c62d72398 - added a check on odd byte count for atapi command
- fixed problem with multiple drq atapi data transfers
2002-08-05 15:47:40 +00:00
Volker Ruppert
c3cda0a919 - separation of floppy device type and media type started. This feature needs
more work in the floppy and bios code.
- floppy and cdrom entries in the runtime config menu can be disabled if the
  drive wasn't defined in bochsrc or start menu
- floppy variable "initial_status" and cdrom variable "inserted" renamed to
  "status"
- unused variable *ips in function build_runtime_options_prompt() disabled
2002-08-04 08:42:34 +00:00
Volker Ruppert
2b2369a049 - panic at 'Read sub-channel with SubQ' replaced by a BX_ERROR. The harddisk
controller returns an error code until we are able to implement this feature.
- init_send_atapi_command(): don't panic if alloc_length is 0, use byte_count
  to set alloc_length instead
- fixed a BX_PANIC message in the io write handler for port 0x1f0
2002-07-30 09:54:26 +00:00
Volker Ruppert
4dbd597456 - panic at READ CD replaced by a BX_ERROR. The harddisk controller
returns an error code until we are able to implement this feature.
2002-07-27 18:42:31 +00:00
Volker Ruppert
397043b5e9 - odd byte count error in init_send_atapi_command() fixed: a byte count of
0xffff must be decremeted to 0xfffe
- ATAPI command code added to odd byte count error message
2002-07-19 13:32:49 +00:00
Christophe Bothamy
43f7efce45 - 32bits access flag for atapi devices (word 48 of identify packet device)
- fixed io_len check on port != 0x1f0 : must be 1 byte
2002-07-11 07:44:32 +00:00
Volker Ruppert
6aa5eed1ec - panic at MODE SENSE (curr) replaced by a BX_ERROR. The harddisk controller
returns an error code until we are able to implement this features.
2002-07-07 18:51:49 +00:00
Volker Ruppert
afca461cf3 - reading port 0x01f0 with drq==0 causes a BX_ERROR, not a BX_PANIC. The return
value after the error is set to 0. This fixes the problem with the netbsd 1.5
  rescue disk (SF bug #419415)
2002-06-29 08:54:11 +00:00
Christophe Bothamy
17fe31ad4d - reverted to before patch.blkdevsize inclusion, because compilation fails on WIN32.
It will be included back when we know which platforms handle the GETBLKSIZE ioctl right
2002-06-28 21:34:30 +00:00
Christophe Bothamy
fcc5bd67cb - added patch for block device size detection from Ph. Marek
- included it in the main branch as it is only active with block devices
2002-06-26 16:45:27 +00:00
Christophe Bothamy
b84c82e80c - 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
2002-05-04 16:00:40 +00:00
Christophe Bothamy
a2fc610355 - included "patch.harddrv-sco-osr5" from Carl Sopchak 2002-05-03 08:17:18 +00:00
Christophe Bothamy
cd50268e2f - added a floppy_bootsig_check option to .bochsrc that will be used to enable/disable the 0xaa55 signature check ONLY for floppy-boot
- stored the boot signature check flag in cmos reg 0x38
- the rombios that is able to handle that flag will be uploaded later
2002-04-23 07:44:34 +00:00
Bryce Denney
7306746f0b - fd was never initialized, then the close() method read it. Thanks
valgrind.
2002-04-09 15:52:02 +00:00
Christophe Bothamy
fcd6f99391 - fixed cmos info on 2nd disk landing zone. 2002-03-25 01:47:13 +00:00
Volker Ruppert
8263d15e76 - renamed update_floppy_status_buttons() to update_drive_status_buttons() since
it handles the cdrom status too
2002-03-17 20:57:54 +00:00
Christophe Bothamy
7b6f19f1d2 - small bug fix in ATAPI command 0x42 (read sub-channel). 2002-02-12 16:03:00 +00:00
Christophe Bothamy
716e461c9d - enabled dword IO. Tiny performance increase 2002-02-07 17:43:06 +00:00
Volker Ruppert
2d5a9bd459 - new sense key SENSE_UNIT_ATTENTION for media change
- set sense key and raise an interrupt after inserting cdrom media
- atapi command 'eject disk' implemented
2002-02-03 20:49:44 +00:00
Volker Ruppert
84b649831e - new cdrom button in the headerbar
- changing cdrom media in a Bochs session now possible
- don't eject cdrom when the guest OS has locked the drive
2002-02-01 16:46:27 +00:00
Christophe Bothamy
ac91aa0d3c . changes to enable El-Torito boot. It is disabled by default in rombios.c 2002-01-30 10:30:52 +00:00
Volker Ruppert
ad072e2bc6 - implementation of the edge triggered IRQ mode
- new functions raise_irq() and lower_irq()
- all trigger_irq() / untrigger_irq() calls are replaced by the new functions
- REMARK: timer IRQ handling is not correct but it works
- TODO: IOAPIC IRQ handling needs to be changed
2002-01-29 17:20:12 +00:00
Volker Ruppert
2933948216 - set the media status for the siminterface to 'ejected' if cdrom is not present 2002-01-27 21:58:41 +00:00
Volker Ruppert
a9c1b785f0 - when checking the presence if diskd, check the presence of diskc, too
- clear IRQ after reading status register 0x1f7
- unused variable 'alloc_length' removed
- some messages fixed
2002-01-20 12:38:35 +00:00
Bryce Denney
cbd68598a3 - apply patch.memleaks-tominac from Darko Tominac <darko.tominac@zg.tel.hr>
which fixes some potential memory leaks
2001-12-21 19:33:18 +00:00
Bryce Denney
3934cd370c - change a few "char"s to "const char", from Roland Mainz compile patch 2001-11-12 03:34:45 +00:00
Bryce Denney
7279914d1b - don't blindly reject odd length atapi commands. There are cases when
it's really ok according to ATA-4.
2001-10-06 23:55:19 +00:00
Bryce Denney
a9204c53f0 - make hard disk code return error codes when data is not available instead
of just panicing.  In particular, if the logical sector is out of bounds
  or the disk image cannot be read/written at the desired offset, we now
  abort the ATA command and return an error code.  Many of the old BX_PANIC
  messages are turned to BX_ERROR, so they will still appear in the
  log, but now the device model will try to communicate this fact to
  the OS instead of simply giving up.
2001-10-06 09:04:39 +00:00
Bryce Denney
ec6a8b3ef5 - when you write the device/head register, if the device doesn't exist or
something, we need to set the error in the status register.
2001-10-06 08:59:01 +00:00
Bryce Denney
daf2a9fb55 - add RCS Id to header of every file. This makes it easier to know what's
going on when someone sends in a modified file.
2001-10-03 13:10:38 +00:00
Bryce Denney
6145266a70 - now there are BX_ERROR lines for all commands from ATA/ATAPI 3,4,5,6. 2001-09-29 02:08:11 +00:00
Bryce Denney
1a856a1726 - add BX_ERROR for every command in ATAPI-6 that bochs does not support.
I still need to do add some commands from older specs that are obsolete
  (and not listed) in ATAPI-6.
- commands that aren't in the spec will still panic.
2001-09-28 22:20:49 +00:00
Bryce Denney
c0719c7eb7 - more cleanup: clarify some log messages, add command aborted when some
atapi commands are tried on a disk, etc.
2001-09-28 07:18:55 +00:00
Bryce Denney
951014d794 - add note about where to find the spec
- fill in names from spec on various commands
- add command aborted for 0x08 device reset on disks (it's only for ATAPI)
- add command aborted for 0xe1 idle immediate
2001-09-28 07:14:50 +00:00
Bryce Denney
3bba2f657f - apply patch from patches/patch.lba. This is taken from plex86 cvs
and modified for bochs.  Minimal testing so far...
2001-09-19 15:30:44 +00:00
Bryce Denney
690c4eee31 - clarify BX_INFO message 2001-09-19 15:10:38 +00:00
Bryce Denney
8c6446cf4c - only put 0xf into the 2nd hard disk field when the cdrom is not present.
This is a patch from Volker Ruppert <Volker.Ruppert@t-online.de>, who
  comments: "The fdisk command reports an unusable second harddisk if the cdrom
  is enabled. This patch helps, but I don't know if it is the right way."
2001-09-15 13:35:42 +00:00
Todd T.Fries
64ea80c050 more INFO->ERROR/DEBUG cleanups 2001-08-31 22:02:29 +00:00
Todd T.Fries
28885e4973 some INFO->DEBUG/ERROR cleanups 2001-08-31 16:06:32 +00:00
Bryce Denney
595d6a0132 - now I know that 0xe7 is flush cache so I improved the comments somewhat
- if an unknown command comes along and triggers a BX_PANIC and they
  choose the continue, call command_aborted().
2001-08-15 20:54:36 +00:00
Bryce Denney
b483593107 - add case for IDE command 0xe7 so that it doesn't panic when installing
win2000
2001-08-13 15:58:35 +00:00
Todd T.Fries
4f1c151520 Move Init $ to ::init() 2001-06-27 20:27:49 +00:00
Todd T.Fries
f833500359 some reformat, various misc stuff with Init, introduce $ 2001-06-27 20:11:10 +00:00
Todd T.Fries
a06b031dcf setprefix -> put 2001-06-27 19:16:01 +00:00
Bryce Denney
cbb040f68c - added BX_DEBUGs 2001-06-23 17:59:14 +00:00
Bryce Denney
6fcc0b3aa1 - bx_options.cdromd.inserted is now an enum, with values BX_INSERTED or
BX_EJECTED
- added a BX_DEBUG line or two
2001-06-23 15:28:49 +00:00
Bryce Denney
b7cb1a5dde - applied patch from bochs@sigint.cs.purdue.edu. The comments are:
> The Linux 2.4.5 CD-ROM driver sends a READ_DISC_INFO command which caused
  > an "unrecognized ATAPI command" panic.  Looks like READ_DISC_INFO is only
  > recognized by CD-R and CD-RW drives, so I ignore it for now.  (I don't
  > know if ASC_INV_FIELD_IN_CMD_PACKET is the right code, but it shouldn't
  > matter to Linux anyway.)
2001-06-22 04:08:15 +00:00
Bryce Denney
a6d74fd4b0 - oops Odev should have been Opath 2001-06-21 15:06:14 +00:00
Bryce Denney
e9d8fc0738 - fixed some bx_options name changes which were hiding inside
#ifdef LOWLEVEL_CDROM ... #endif
2001-06-21 14:40:01 +00:00
Bryce Denney
ec0fbf18bc - convert nearly all bx_options to parameter form. All options that have
been converted into parameters temporarily have the letter "O" appended
  to their name.  I don't want to keep it this way, but it has helped
  in the conversion process because the compiler refuses to compile the
  old uses of the name.  Before I started using the "O" trick, there were
  many bugs like this:   if (bx_options.diskc.present) {...}
  This was legal with the new parameters, but it was testing whether the
  parameter structure had been created, instead of testing the value of
  the present parameter.  Renaming present to Opresent turns this into
  a compile error, which points out the incorrect use of the param.
- the "--disable-control-panel" no longer works, I'm afraid.  I can no
  longer support this and continue progress.
2001-06-20 14:01:39 +00:00
Todd T.Fries
12985edb26 setprefix now uses a variable length name as a string for an argument 2001-06-19 21:36:09 +00:00
Bryce Denney
5b0481dd25 - use BX_ASSERT instead of assert 2001-06-07 20:52:26 +00:00
Todd T.Fries
2bbb1ef8eb strip '\n' from BX_{INFO,DEBUG,ERROR,PANIC}
don't need it, moved the output of it into the general io functions.
saves space, as well as removes the confusing output if a '\n' is left off
2001-05-30 18:56:02 +00:00
Todd T.Fries
cd01453c9d cleanup output 2001-05-23 19:36:55 +00:00
Todd T.Fries
70099281ff tweaks and if(bx_dbg.foo) BX_INFO -> BX_DEBUG .. 2001-05-23 14:31:21 +00:00
Bryce Denney
af4ccaae3e - added I/O APIC and local APICs
- for more details, see BRANCH-smp-bochs
2001-05-23 07:48:11 +00:00
Todd T.Fries
bdb89cd364 merge in BRANCH-io-cleanup.
To see the commit logs for this use either cvsweb or
cvs update -r BRANCH-io-cleanup and then 'cvs log' the various files.

In general this provides a generic interface for logging.

logfunctions:: is a class that is inherited by some classes, and also
.   allocated as a standalone global called 'genlog'.  All logging uses
.   one of the ::info(), ::error(), ::ldebug(), ::panic() methods of this
.   class through 'BX_INFO(), BX_ERROR(), BX_DEBUG(), BX_PANIC()' macros
.   respectively.
.
.   An example usage:
.     BX_INFO(("Hello, World!\n"));

iofunctions:: is a class that is allocated once by default, and assigned
as the iofunction of each logfunctions instance.  It is this class that
maintains the file descriptor and other output related code, at this
point using vfprintf().  At some future point, someone may choose to
write a gui 'console' for bochs to which messages would be redirected
simply by assigning a different iofunction class to the various logfunctions
objects.

More cleanup is coming, but this works for now.  If you want to see alot
of debugging output, in main.cc, change onoff[LOGLEV_DEBUG]=0 to =1.

Comments, bugs, flames, to me: todd@fries.net
2001-05-15 14:49:57 +00:00
Bryce Denney
dfd58f5a0f - this change should not affect functionality at all. Make IDE_DISK the
default for diskd, but if a cdrom is present change to a cdrom.
2001-05-08 19:55:40 +00:00
Bryce Denney
a7b7563e3c - add support for split hard disk image, so that it is possible to store
different partitions in separate files.
2001-05-07 05:47:59 +00:00
Bryce Denney
ebc315500e - added code to fill in CMOS registers 0x24-0x2c when diskd is present.
- made the code that fills 0x1b-0x23 for diskc conditional on diskc being
  present; this was probably not necessary.
- added some code (still commented out) that will help in supporting a second
  IDE interface.
2001-05-03 21:08:42 +00:00
Bryce Denney
10412cdf1e - why restrict when people read the sector count? This was causing
unnecessary panics on openbsd when sector count was read soon after a
  reset.
2001-05-03 20:40:08 +00:00
Bryce Denney
ad175e9aae - specify where on the hard drive it fails to read or write. 2001-05-03 00:41:36 +00:00
Bryce Denney
417e4c01ec - print which unknown hard drive command causes a panic 2001-04-10 02:33:27 +00:00
Bryce Denney
a6fef54678 - update copyright dates to 2001 for all mandrake headers
- for bochs files with other header, replaced with current mandrake header
2001-04-10 02:20:02 +00:00
Bryce Denney
b05159c112 - Applied patch from Greg Alexander, 12/22/2000.
Implement aborts on a few SET FEATURE commands for ATA.
2001-04-10 02:09:09 +00:00
cvs
beff63eb32 - entered original Bochs snapshot bochs-2000_0325a.tar.gz from
ftp.bochs.com
2001-04-10 01:04:59 +00:00