Commit Graph

60 Commits

Author SHA1 Message Date
Volker Ruppert
e662318422 - fixed timer IRQ handler with a callback function for the OUT pin (OUT pin of
the first timer is connected to IRQ line 0)
- code cleanup (indent mode, bool types, reset function, unused stuff)
2006-01-08 20:39:08 +00:00
Volker Ruppert
e98c100f74 - a bunch of warnings in MSVC fixed
- name of source file in wxworkspace.zip fixed
2005-06-04 17:44:59 +00:00
Volker Ruppert
02ae558db8 - removed old unused code designed for a save/restore feature
- fixed pcidev targets in iodev/Makefile.in
- updated all Makefile dependencies using a default setup (.conf.linux).
  TODO: dependencies should be generated at compile time since they depend on
  the config settings
2004-12-13 19:10:38 +00:00
Volker Ruppert
8d585dc813 - removed lowlevel includes from iodev.h and device headers to reduce dependencies
- fixed some warnings
2004-09-05 10:30:19 +00:00
Stanislav Shwartsman
a7cad86666 clean code 2004-06-19 19:16:02 +00:00
Stanislav Shwartsman
5873b26a82 Speed up compilation process.
bochs.h already not include iodev.h which reduces compilation dependences for almost all cpu and fpu files, now cpu files will not be recompiled if iodev includes was changed
2004-06-19 15:20:15 +00:00
Christophe Bothamy
d6fb513243 - changed "console" to "speaker". Speaker can be compiled as plugin.
speaker calls corresponding beeper methods in gui.
2004-02-01 23:42:04 +00:00
Daniel Gimpelevich
6708807b38 Applied SF patch #694889. 2004-01-16 16:30:46 +00:00
Christophe Bothamy
e555765d75 - add a "clock: sync=[none|slowdown|realtime], time0=[timeValue|local|utc]"
- pit: and time0: options are still supported but deprecated
- warn when parsing deprecated directives
- fix wrong number of ata_device_translation_names
- still to do:
  - setting time0 to utc is not yet supported
  - the man page, user guide and .bochsrc still need to be updated
    with the new options
2003-08-19 00:10:39 +00:00
Volker Ruppert
bcdcf42bdd - io_len mask in i/o register functions implemented (1 = 8bit, 2 = 16bit, 4 = 32bit).
Unallowed cases are now handled in devices.cc and cause a BX_ERROR.
- io_len mask fixed and unnecessary io_len checks removed in
  * devices.cc
  * extfpuirq.cc
  * gameport.cc
  * ne2k.cc
  * pit.cc
  * pit_wrap.cc (i/o register function calls replaced by DEV_* macro calls)
- TODO: implement this in all other devices
2003-07-31 12:04:48 +00:00
Volker Ruppert
d1652093ac - applied some parts of the patch from Andrew Zabolotny <zap@cobra.ru>
* changed all %ll format descriptions to FMT_LL macro so that
    Microsoft Visual C works correctly (it uses %I64)
  * missing type conversions added
  * cdrom.cc: variable types for win32 fixed
  * removed some unused variables in eth_win32.cc and harddrv.cc
  * added missing includes in make_cmos_image.c and niclist.c
2003-06-07 19:16:55 +00:00
Gregory Alexander
8b1d1b2668 Fixed pit_wrap and virt_timer to update timer on reads. 2003-04-03 21:59:20 +00:00
Christophe Bothamy
86f5aeb877 - fix compiling if BX_SCHEDULED_DIE_TIME is defined 2003-02-23 22:55:50 +00:00
Gregory Alexander
de1b90d978 pit_wrap.cc never uses the realtime stuff anymore. 2003-02-18 16:57:44 +00:00
Gregory Alexander
b77b477bfa The PIT is going to start using virtual timers instead
of having its own realtime mechanism.  The old PIT
realtime mechanism will be removed next.
2003-02-18 16:54:48 +00:00
Volker Ruppert
366188e67a - more accurate emulation of port 0x61 bit #4. This bit toggles with every
refresh request (15 usec). This fixes SF bug #644042.
2003-01-09 20:43:32 +00:00
Christophe Bothamy
c6d3735a47 - fix compile warnings (patch from HJ) 2003-01-05 01:37:21 +00:00
Gregory Alexander
5130d479d6 change incorrect %lld terms to %llu. 2002-12-08 04:48:52 +00:00
Gregory Alexander
66e7558498 Cleaned up the realtime PIT code for win32.
This seeems to work on my laptop, but the processor
isn't fast enough to run anything substantial, so I'm
not certain how well it works.
2002-12-07 20:01:10 +00:00
Gregory Alexander
a9cf965597 Fixing up realtime PIT for use with win32.
Still need to do some cleanup that I was putting off.
2002-12-07 19:51:42 +00:00
Gregory Alexander
c4ad196af1 Still working on realtime PIT in win32.
This version is a bit of a hack that needs to be cleaned up before release.

There is also a glaring bug that lets things go WAY too fast when
we're trying to catch up to real time.  This is my highest priority
right now.
2002-12-07 19:17:01 +00:00
Bryce Denney
e9b135a5c6 - define macros to work around VC++ brain-dead-ness about converting between
unsigned 64-bit integer and 64-bit double precision floating point.  It
  knows how to convert Bit64s to double, but it refuses to convert Bit64u
  to double.  The macros: F2I converts from floating point to integer, and
  I2F converts the other way, using Bit64s as a transition step.
    F2I:  double -> Bit64s -> Bit64u
	I2F:  Bit64u -> Bit64s -> double
2002-12-05 17:43:00 +00:00
Gregory Alexander
5c99750c8b Updated the realtime PIT to work with win32. 2002-12-04 19:51:51 +00:00
Gregory Alexander
33fb7c544f Moved things around and cleaned up the options a bit. 2002-10-30 23:54:29 +00:00
Gregory Alexander
5bc28d6dfa Add a minimum IPS value at compile time.
This is used for calculating the minimum speed for the realtime PIT and for flagging errors with user IPS values.
2002-10-30 18:30:29 +00:00
Gregory Alexander
fc61a0522a Added support for run-time configuration of realtime PIT. 2002-10-29 22:26:32 +00:00
Gregory Alexander
dc46dfa784 Made PIT runtime configurable, except haven't added the bx_option line. 2002-10-28 05:55:47 +00:00
Gregory Alexander
cc48301722 Fix for bug #628957
I accidentally left a debug define turned on.
2002-10-27 06:02:47 +00:00
Bryce Denney
cec9135e9f - Apply patch.replace-Boolean rev 1.3. Every "Boolean" is now changed to a
"bx_bool" which is always defined as Bit32u on all platforms.  In Carbon
  specific code, Boolean is still used because the Carbon header files
  define it to unsigned char.
- this fixes bug [ 623152 ] MacOSX: Triple Exception Booting win95.
  The bug was that some code in Bochs depends on Boolean to be a
  32 bit value.  (This should be fixed, but I don't know all the places
  where it needs to be fixed yet.)  Because Carbon defined Boolean as
  an unsigned char, Bochs just followed along and used the unsigned char
  definition to avoid compile problems.  This exposed the dependency
  on 32 bit Boolean on MacOS X only and led to major simulation problems,
  that could only be reproduced and debugged on that platform.
- On the mailing list we debated whether to make all Booleans into "bool" or
  our own type.  I chose bx_bool for several reasons.
  1. Unlike C++'s bool, we can guarantee that bx_bool is the same size on all
     platforms, which makes it much less likely to have more platform-specific
     simulation differences in the future.  (I spent hours on a borrowed
     MacOSX machine chasing bug 618388 before discovering that different sized
     Booleans were the problem, and I don't want to repeat that.)
  2. We still have at least one dependency on 32 bit Booleans which must be
     fixed some time, but I don't want to risk introducing new bugs into the
     simulation just before the 2.0 release.

Modified Files:
    bochs.h config.h.in gdbstub.cc logio.cc main.cc pc_system.cc
    pc_system.h plugin.cc plugin.h bios/rombios.c cpu/apic.cc
    cpu/arith16.cc cpu/arith32.cc cpu/arith64.cc cpu/arith8.cc
    cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer16.cc cpu/ctrl_xfer32.cc
    cpu/ctrl_xfer64.cc cpu/data_xfer16.cc cpu/data_xfer32.cc
    cpu/data_xfer64.cc cpu/debugstuff.cc cpu/exception.cc
    cpu/fetchdecode.cc cpu/flag_ctrl_pro.cc cpu/init.cc
    cpu/io_pro.cc cpu/lazy_flags.cc cpu/lazy_flags.h cpu/mult16.cc
    cpu/mult32.cc cpu/mult64.cc cpu/mult8.cc cpu/paging.cc
    cpu/proc_ctrl.cc cpu/segment_ctrl_pro.cc cpu/stack_pro.cc
    cpu/tasking.cc debug/dbg_main.cc debug/debug.h debug/sim2.cc
    disasm/dis_decode.cc disasm/disasm.h doc/docbook/Makefile
    docs-html/cosimulation.html fpu/wmFPUemu_glue.cc
    gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/gui.cc gui/gui.h
    gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc
    gui/rfb.cc gui/sdl.cc gui/siminterface.cc gui/siminterface.h
    gui/term.cc gui/win32.cc gui/wx.cc gui/wxmain.cc gui/wxmain.h
    gui/x.cc instrument/example0/instrument.cc
    instrument/example0/instrument.h
    instrument/example1/instrument.cc
    instrument/example1/instrument.h
    instrument/stubs/instrument.cc instrument/stubs/instrument.h
    iodev/cdrom.cc iodev/cdrom.h iodev/cdrom_osx.cc iodev/cmos.cc
    iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_arpback.cc
    iodev/eth_packetmaker.cc iodev/eth_packetmaker.h
    iodev/floppy.cc iodev/floppy.h iodev/guest2host.h
    iodev/harddrv.cc iodev/harddrv.h iodev/ioapic.cc
    iodev/ioapic.h iodev/iodebug.cc iodev/iodev.h
    iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.h
    iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pic.h
    iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h
    iodev/sb16.cc iodev/sb16.h iodev/serial.cc iodev/serial.h
    iodev/vga.cc iodev/vga.h memory/memory.h memory/misc_mem.cc
2002-10-25 11:44:41 +00:00
Bryce Denney
5e520261db Add plugin support to Bochs by merging all the changes from the
BRANCH_PLUGINS branch!

Authors:
  Bryce Denney
  Christophe Bothamy
  Kevin Lawton (we grabbed a lot of plugin code from plex86)
Testing help from:
  Volker Ruppert
  Don Becker (Psyon)
  Jeremy Parsons (Br'fin)

The change log is too long to paste in here.  To read the change log, do
  cvs log patches/patch.final-from-BRANCH_PLUGINS.gz

All the changes and a detailed description are contained in a patch
called patch.final-from-BRANCH_PLUGINS.gz.  To look at the complete
patch, do
  cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz

Then you will have a local copy of the patch, which you can gunzip and
play with however you want.

Modified Files:
    .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure
    configure.in gdbstub.cc logio.cc main.cc pc_system.cc
    pc_system.h state_file.h bios/Makefile.in bios/rombios.c
    cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc
    cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h
    cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc
    cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc
    cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc
    cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc
    cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc
    cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc
    debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in
    doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in
    gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc
    gui/control.cc gui/control.h gui/gui.cc gui/gui.h
    gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc
    gui/rfb.cc gui/sdl.cc gui/sdlkeys.h gui/siminterface.cc
    gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc
    gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h
    gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map
    gui/keymaps/x11-pc-de.map instrument/example0/instrument.h
    instrument/example1/instrument.h
    instrument/stubs/instrument.cc instrument/stubs/instrument.h
    iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h
    iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc
    iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc
    iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc
    iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h
    iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc
    iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc
    iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc
    iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc
    iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc
    iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc
    iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h
    iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc
    iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h
    iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc
    memory/memory.h memory/misc_mem.cc misc/bximage.c
    misc/niclist.c
Added Files:
    README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in
    ltmain.sh plugin.cc plugin.h
2002-10-24 21:07:56 +00:00
Bryce Denney
c818baa0c9 - modified every I/O device so that it will not re-register its timers
if init() is called a second time.  This allows me to restart a
  simulation (wxwindows interface only) without restarting the whole
  application.
- modified: iodev/*.cc
2002-10-06 19:04:47 +00:00
Kevin Lawton
83c9d266d0 Added a field on register_timer() so that a name identifying the
requesting source can be registered as well.  Otherwise, there
  is no way to know which source modules are requesting
  suspect frequencies which are too high.
2002-10-02 05:16:01 +00:00
Bryce Denney
b9847fe6c1 - rename MIN and MAX to BX_MIN and BX_MAX to avoid name conflicts
on MacOS X
2002-09-23 03:49:39 +00:00
Gregory Alexander
249131fbed I added a support function to osdep.
The function gets the real time in useconds and puts it in
a Bit64u.  This function is defined when:
BX_HAVE_REALTIME_USEC is 1.

Right now, BX_HAVE_REALTIME_USEC is defined to be BX_HAVE_GETTIMEOFDAY
and bx_get_realtime64_usec is defined in terms of gettimeofday().

However, it could be defined in terms of any other method of obtaining
the current time accurate to the usecond.  That is why I moved the
function to osdep and added the new define.
2002-09-23 02:20:52 +00:00
Bryce Denney
e41655a78c - add configure test for BX_HAVE_GETTIMEOFDAY
- hardcode BX_HAVE_GETTIMEOFDAY=0 if cross compiling for VC++
  (this part hasn't been tested)
- modified files: configure configure.in config.h.in iodev/pit_wrap.cc
2002-09-22 01:56:18 +00:00
Gregory Alexander
e668567e85 Made BX_USE_REALTIME_PIT checked at runtime. This is
a precursor to making it a runtime option.  I'm not
sure how to do this, but it should be trivial.  All it
would take is adding the option and changing the
macro for BX_USE_REALTIME_PIT to point to that option.
2002-09-21 04:02:51 +00:00
Gregory Alexander
44c5829ea5 Realtime PIT with gettimeofday is working beautifully.
It's MUCH smoother than with the time(NULL) version.

We need to work on setting up the config parameters some more.
2002-09-21 03:20:59 +00:00
Gregory Alexander
1f05d9aa6b Working on Realtime PIT code.
Getting fair results with gettimeofday.
2002-09-20 23:10:55 +00:00
Gregory Alexander
f5f6cc65be Working on using gettimeofday for timing instead of time(NULL). 2002-09-20 04:42:25 +00:00
Bryce Denney
ffc84c8be9 - add BX_SCHEDULED_DIE_TIME which causes Bochs to exit automatically after a
certain number of instructions.  I use it for performance testing, and it
  won't hurt anyone unless they are foolish enough to enable it in config.h.
  Of course it is disabled by default!
2002-09-01 15:38:29 +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
Gregory Alexander
b30fdb2487 Fix problem with PIT when the machine is being really slow.
This means that the REALTIME_PIT now only works on machines
that are capable of sustaining 150000 IPS, in aggregate.  This
seems a reasonable requirement, as even my 200Mhz PPC with 16MB
of memory can sustain that.

This is now probably ready for primetime, so I need to get it
added to the configure options.
2002-05-21 15:07:45 +00:00
Gregory Alexander
e92fb8deff Updated realtime PIT code.
This seems to work, but I don't think it works on slow machines (like mine.)

At least, I'm getting fails with the dlxlinux image, but they're pretty
sporadic.  This code shouldn't cause any fails.
2002-05-20 21:53:26 +00:00
Gregory Alexander
cfab846fe1 More #define changes. 2002-02-08 22:27:51 +00:00
Gregory Alexander
49e715178d More updates to the realtime PIT code. 2002-02-08 05:18:14 +00:00
Gregory Alexander
6b0dca1508 Fix using 1/4 speed. 2002-02-08 02:57:27 +00:00
Gregory Alexander
57273620e6 Added an experimental realtime PIT to the mix.
This is basically the opposite of the slowdown timer.  Instead
of trying to keep the PIT ticks in sync with bochs time, we
keep them in sync with REAL time.  This is bad because it creates
unreproducible fails, but it's good if you want to run bochs at
maximum speed on your machine.  However, bochs will take all of
the available resources from the machine also.

DO NOT use this with the slowdown timer.  Results would be
unpredictable.
2002-02-07 21:22:55 +00:00
Gregory Alexander
dcdc5b2624 Minor fix to raise/lower irq code. 2002-01-31 17:26:26 +00:00
Gregory Alexander
05983c7a48 Changes to the pit wrapper code that should help synchronization some. 2002-01-31 17:18:38 +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