Commit Graph

427 Commits

Author SHA1 Message Date
Stanislav Shwartsman 90f1973bef Removed BX_USE_TLB - TLB is always used, only Guest2HostTLB is optional feature
Use Guest2HostTLB in prefetch code for IFETCHES - speedup above 3%
2008-04-05 20:41:00 +00:00
Stanislav Shwartsman 08f958f458 Fixed pageWriteStampTable to handle BIOS code as well - increased the table to all 4G instead of allocated memory size
Avoid checking of pageWriteStamp in the heart of cpu loop with trace cache - now decWriteStamp will post stopTraceExecution event if it hits code page
2008-03-29 21:01:25 +00:00
Stanislav Shwartsman 518774d2c9 Add missing check for MSVC in bx_atexit 2008-03-26 22:39:38 +00:00
Stanislav Shwartsman a459a64f3e whispace, tab2space, indent, dos2unix and other cleanups 2008-02-15 22:05:43 +00:00
Stanislav Shwartsman cdcd7522aa Added RIP to the GPR register file as lst register
This allowed to optimize (read - remove) two more BxResolve methods in 64-bit mode
+ Some white space cleanup
2008-02-15 19:03:54 +00:00
Stanislav Shwartsman 55ad3e89b6 another whitespace cleanup by Sebastien 2008-02-05 22:57:43 +00:00
Stanislav Shwartsman 192f398b46 removed --enable-magic-breakpoint configure option - it is enabled by default if Bochs internal debugger compiled in. Also it always possible to switch magic break off by .bochsrc option 2008-01-21 21:36:58 +00:00
Stanislav Shwartsman 7496ee7afa VM8086 is always ON 2007-12-21 21:16:34 +00:00
Stanislav Shwartsman adda3befd3 Trace cache optimization merged 2007-12-09 18:36:05 +00:00
Stanislav Shwartsman a9ea644c5c Print timestamps feature for performance measurements
If enabled (in .bochsrc) + --enable-show-ips=1 Bochs will print IPS + time data every second
2007-11-20 18:36:26 +00:00
Stanislav Shwartsman 0732e744bb again debug print in main.cc :) 2007-11-18 21:09:09 +00:00
Stanislav Shwartsman 30f42d74f1 make sreg index tables static in fetchdecode and remove them from init.cc/cpu.h 2007-11-18 21:07:40 +00:00
Stanislav Shwartsman b75a1d9ea5 Remove debug print 2007-11-18 18:27:09 +00:00
Stanislav Shwartsman cdc9a09090 Split more opcodes 2007-11-18 18:24:46 +00:00
Stanislav Shwartsman 5fd21257de Remove qick TLBN invalidation code - it actually only could slow down emulation 2007-11-09 21:14:56 +00:00
Stanislav Shwartsman e137560b14 Complete MONITOR/MWAIT implemntation (including monitoring of memory range)
Fixed PANIC in read/write Cr/Dr - should #UD with unkown register used
2007-11-01 18:03:48 +00:00
Stanislav Shwartsman d30a0d3699 warning fixes 2007-10-24 23:29:40 +00:00
Stanislav Shwartsman 42fdd8a3a1 During Bochs benchmarking I figured out that hostasm actually slow down the emulation ... so remove this ugly code which also doesn't help :)
speedup flags update for some instructions - idea was taken from DT patch by h.johansson
2007-10-21 22:07:33 +00:00
Stanislav Shwartsman 6c79b067a6 Fixed __386__ macro in guest2host memory accesses - should be LITTLE_ENDIAN instead 2007-10-16 16:17:48 +00:00
Stanislav Shwartsman 8adbbcf17c Started first implementation of MONITOR/MWAIT 2007-10-11 21:29:01 +00:00
Stanislav Shwartsman 071c5c1a26 A lot of changes but everything is really trivial.
Make save/restore default feature, the configure option for save/restore removed from configure script and save/restore made available forever. All code now assume it is exists. Bochs save/restore tree previosly called "save_restore" renamed to "bochs" tree and it will be havily used everywhere, starting from save/restore and ending by various bochs debugger functions. I am going to rework debugger code to get rid of debug CPU access functions and use this "bochs" param tree instead
2007-09-28 19:52:08 +00:00
Stanislav Shwartsman c719eecb8d Implemented Bochs benchmarking mode according to feature request
[ 1799946 ] benchmark mode
2007-09-22 15:59:41 +00:00
Stanislav Shwartsman ebde420f14 Fixed SMP assertion 2007-09-22 12:59:40 +00:00
Stanislav Shwartsman 71902dc8bd Print ACPI support indication 2007-09-20 18:50:01 +00:00
Stanislav Shwartsman 91e6ca8d5c Implemented MTRR support
Fixes in #PF exception priority
2007-09-20 17:33:35 +00:00
Stanislav Shwartsman 5a2ce284c3 Fixed Bochs exit in SMP mode when only one CPU present 2007-09-13 09:44:56 +00:00
Stanislav Shwartsman 40a395a3f4 Improve single threaded simulation speed in SMP binary of Bochs
This is still significantly slower than in native no-SMP binary but faster than before at least
2007-03-06 21:12:20 +00:00
Stanislav Shwartsman c24627c00f Implemented CLFLUSH instruction
Set of minor fixes for correctness
2007-01-28 21:27:31 +00:00
Volker Ruppert ed3a41ac63 - since the print_tree() function is only used by the debugger, it has to use
dbg_printf() to make the redirection of the output to a gui frontend possible
2006-11-12 21:25:06 +00:00
Volker Ruppert 598c34ed0a - added special logfunction for the gdbstub and set panics to fatal
- removed trailing linefeeds from log messages
- removed command line parameters from init function
- added copyright and CVS ID
2006-10-26 17:27:04 +00:00
Volker Ruppert f348c6cf50 - fixed broken debugger "rc file" command line option. Now it is possible to
execute debugger commands from the specified file. This is the command line
  counterpart to the undocumented debugger command "source".
2006-10-24 17:53:47 +00:00
Volker Ruppert a614b2613e - return early if Windows text console creation fails
- set title of text console for wxWidgets on win32
2006-10-15 10:45:15 +00:00
Volker Ruppert 48ed7e1ba6 - fixes for second simulation support with wxBochs
* wxBochsStopSim flag is now reset before starting the SimThread
  * the siminterface 'init_done' flag now controls the execution of the hardware
    cleanup in bx_atexit()
2006-09-23 09:07:15 +00:00
Stanislav Shwartsman 3ab94305a0 1. Fixed bug report
[ bochs-Bugs-1562172 ] TLB_init() fails to initialize priv_check array if USE_TLB 0
2. Paging is always exists for i386+
   To disable paging it is better to use normal model without special code, only by setting cr0.pg=0
2006-09-20 17:02:20 +00:00
Volker Ruppert 647b0e3e6c - removed exit() method from the devmodel object, since all that stuff can be
done by the object destructor (changes in cmos, hard drive and keyboard)
- bx_unload_plugins() now deletes the devmodel object in non-plugin mode
- CMOS device now prints the time on exit in human-readable format
2006-09-16 14:47:40 +00:00
Volker Ruppert 0a804aeb18 - memory cleanup code moved to a separate method (called from bx_atexit())
- fixed memory handler init and cleanup code (memory leaks)
2006-09-15 17:02:52 +00:00
Volker Ruppert c07197758b - plugin unload mechanism implemented in the plugin and devices code
- added exit() method to the devmodel object for devices that need to do special
  cleanups on exit. Device plugins should call this method from their plugin_fini()
  function. If Bochs is compiled without plugin support, for non-core plugins
  the exit() method is called directly from bx_unload_plugins().
- exit() method implemented in the keyboard device
- wx "Show Keyboard" feature now only appear when the wxdebug keyboard subtree
  is not empty
- cpu cleanup must be done before the devices cleanup
- moved PCI chipset dump call to the devices exit method
2006-09-10 09:13:47 +00:00
Volker Ruppert 5dd0d64b11 - several changes for restart support in wx (not yet complete)
* don't initialize cpu specific parameters for the wx debugger if they already
    exist
  * separate siminterface method init_save_restore() added
  * old wx specific handling in quit_sim() removed
  * new bx_list_c method clear() deletes all parameters from the list
  * moved devices cleanup code from the pc_system to a new devices method exit()
  * pc_system init code now sets ticksTotal to 0
2006-09-07 18:50:51 +00:00
Volker Ruppert d3d8346943 - reset sent to keyboard has no effect on the 8042 (scancode translation mode)
- restore status bar indicators for the keyboard based on saved LED status
- don't reset status bar indicators in restore mode
2006-07-21 18:26:53 +00:00
Stanislav Shwartsman 275ea4f7c9 - Allow to control SMP quantum value through .bochsrc CPU
option parameter. Previous Bochs version used hardcoded quantum=5
    value.
2006-06-21 20:42:26 +00:00
Stanislav Shwartsman 34061a2f22 Enable show-param support in debugger.
Fixed print_tree function to correctly print 64-bit data
2006-05-30 19:46:31 +00:00
Volker Ruppert 6ca6b46203 - failure handling for save/restore added 2006-05-28 16:39:25 +00:00
Stanislav Shwartsman 8b0df8e99b Merge SAVE_RESTORE branch to CVS 2006-05-27 15:54:49 +00:00
Volker Ruppert 6a299e61a7 - get rid of the unused description field of shadow bool and data parameters
(new/modified constructor)
- new constructor for bx_list_c objects without title
- shadow parameter bitmasks fixed
- functions bx_sr_before_save_state() and bx_sr_after_restore_state() prepared
- ne2k.cc: reset behaviour fixes
- sb16: some variable types changed
2006-05-14 15:47:37 +00:00
Stanislav Shwartsman 1a0b7ee1e3 I want to replace debugger ICOUNT guard by existent cpu_loop funtionality, first step to do that ... 2006-04-29 07:12:13 +00:00
Volker Ruppert 96b101e60d - the print_tree() function now reports binary data (for save/restore) and unknown
parameter types
2006-04-16 09:29:02 +00:00
Volker Ruppert 36498746c1 - some more work for the save/restore feature in the plugins and devices code
* register_state() will be called after init() and registers the device members
    required for save/restore
  * before_save_state() can do some work before the device state is saved by the
    siminterface
  * after_restore_state() can do some work after the device state has been
    restored (updating dependant stuff)
2006-04-15 17:03:59 +00:00
Volker Ruppert 0396a9d86f - save state function now supported on win32 in the runtime dialog
- for the BrowseDir() function Bochs for win32 needs to be linked with SHELL32.DLL
  (currently used for the save/restore support only)
- save/restore support symbol name changed
2006-04-09 13:55:55 +00:00
Volker Ruppert 841c802e6b - save/restore of log options implemented (using bochsrc style)
- log options must be restored after initializing all devices
- menu items and descriptions for save/restore updated
- TODO: implement access to save/restore functions for win32 and wx
2006-04-09 09:05:30 +00:00
Volker Ruppert 97520ff814 - save/restore of the configuration implemented (in bochsrc format)
- don't load another config file if the restore flag is set
- disabled restore_hardware() for now (will be enabled when save/restore is
  complete and stable)
2006-04-07 12:49:50 +00:00
Volker Ruppert 74c8c05d22 - prepared save/restore feature
- some siminterface types changed
2006-04-06 20:42:51 +00:00
Stanislav Shwartsman e85a90a720 Remove cpu.h -> devices.cc dependancy, kill_bochs_request moved from CPU to bx_pc_system
Small Icache simplification and speedup
2006-03-14 18:11:22 +00:00
Volker Ruppert 4e4df52109 - added new function bx_stop_simulation() to stop the Bochs simulation thread
(used by wx). Now the siminterface no longer depends on cpu.h
2006-03-11 22:40:32 +00:00
Stanislav Shwartsman 7ba6e5a2bb Forgot to check-in main.cc
But anyway - this is more clear fix which also fixes code duplication
2006-03-08 20:10:29 +00:00
Volker Ruppert 575a17e50f - converted cpu state parameters to param-tree style
- removed old-style parameter init methods
- NOTE: the wx CPU registers dialog (debugger) currently reports nothing
- TODO: fix wx CPU registers dialog, remove remaining bx_id related stuff
2006-03-07 20:32:07 +00:00
Volker Ruppert c66191bd13 - prepared save/restore subtree to make the conversion of the cpu and keyboard
parameters of the wx debugger possible
- started rewrite of shadow parameters and converted keyboard parameter stuff
- test function print_tree() now shows raw byte strings correctly
- removed unnecessary spaces
2006-03-07 17:54:27 +00:00
Stanislav Shwartsman 7b6c2587a9 Now devices could be compiled separatelly from CPU
Averything that required cpu.h include now has it explicitly and there are a lot of files not dependant by CPU at all which will compile a lot faster now ...
2006-03-06 22:03:16 +00:00
Volker Ruppert dd7e08de99 - remaining config options and special menus added to parameter tree
- parameter tree structure updated (TODO: should be moved to development.dbk)
- code cleanup: bx_options stuff and obsolete parameter access methods removed
- TODO: rewrite of shadow parameter stuff (for subtree "save_restore")
2006-03-05 10:24:29 +00:00
Stanislav Shwartsman fc0894bbe1 Enable A20 after system reset 2006-03-04 16:58:10 +00:00
Volker Ruppert 15efba10dd - ata/atapi options rewritten to a parameter tree
- siminterface get_param_*() methods num support a base parameter like the generic
  get_param() method
- new parameter lists now also have a generated id
- test function print_tree() now handles enum parameters correctly
- proposed parameter tree updated
2006-02-26 19:11:20 +00:00
Volker Ruppert a4f412d3e8 - boot and loader options rewritten to a parameter tree
- wx: ParamDialog method EnableParam can now handle new-style parameters
- saving of pcidev options fixed
2006-02-23 22:48:57 +00:00
Stanislav Shwartsman 79306b851c Separate fetch/decode instruction block to stand-alone method.
The method could be reused when building instruction trace for DT
2006-02-23 18:23:31 +00:00
Volker Ruppert c47508bdb1 - keyboard and mouse options rewritten to a parameter tree
- siminterface method ask_param() can now handle new-style parameters
- proposed parameter tree updated
2006-02-22 19:18:29 +00:00
Volker Ruppert d4d4cbf6dd - display and interface options rewritten to a parameter tree
- new enum parameter method get_selected() returns a pointer to the selected string
- proposed parameter tree updated
2006-02-21 21:35:09 +00:00
Volker Ruppert 6311fface8 - pci options rewritten to a parameter tree
- proposed parameter tree updated
- pci presence flag stored in the memory code
2006-02-19 21:35:50 +00:00
Volker Ruppert 2a6261fba7 - cpu options rewritten to a parameter tree
- boolean parameter type now supports new parameter handling
- new parameter object constructors now supports label initialization
- bx_list_c constructor now supports title initialization
- textconfig: initial support for new parameter handling
- wx: missing CPU config dialog added
- wx: ParamDialog now handles disabled parameters correctly
- removed unnecessary spaces from function calls
2006-02-18 16:53:18 +00:00
Volker Ruppert a14b2a9720 - memory parameter handling rewrite completed
- added BXPN_* symbols for parameter names (taken from old save/restore branch)
2006-02-17 22:27:38 +00:00
Volker Ruppert 4cece81589 - started implementation of the parameter tree based on patch.param-tree
* memory parameter handling rewritten (not yet complete)
  * new reset() method for bx_list_c for recursive reset of all list members
  * memory options in wx now handled in a ParamDialog (ConfigMemoryDialog removed)
  * removed obsolete BXP_* constants in siminterface.h
  * updated proposed parameter tree
- constant BX_N_OPTRAM_IMAGES for optional RAM images limit added
2006-02-16 21:44:17 +00:00
Stanislav Shwartsman 0bf03f370d Support for DC and HT in SMP configurations
Extended format of CPU::COUNT .bochsrc option to define number of core/threads
2006-02-11 15:28:43 +00:00
Stanislav Shwartsman 6ca296de8b Move --enable-reset-on-triple-fault option to runtime CPU::reste_on_triple-fault option in .bocshrc
Cleanup and optimize parser for debugger
2006-02-01 18:12:08 +00:00
Volker Ruppert a0f880b06d - show IPS value in the status bar of the Bochs window (win32 and x11)
- Bochs now compiles with BX_SHOW_IPS enabled on MSVC
2006-01-22 12:31:16 +00:00
Stanislav Shwartsman 2c8f6f7720 Merged patch: determine number of processors to emulate through .bochsrc 2006-01-18 18:35:38 +00:00
Stanislav Shwartsman 7739b7c8f2 Added description to BX_CPU_C defintion in main.cc 2006-01-17 08:02:25 +00:00
Stanislav Shwartsman c92aba3776 Using back tracking in CVS I found the reason why CVS sources not compiled with configure --enable-debugger configuration (reported by Brendan).
Again it is andom change which cause to debugger not to compile ;(
This is definitelly GCC bug !
2006-01-17 07:58:11 +00:00
Stanislav Shwartsman 3dbf0f3b97 Bochs supports only ONE memory address space anyway so the code sould be optimized for this case a little (mainly in SMP configuration) 2006-01-15 19:35:39 +00:00
Stanislav Shwartsman 6913d6f152 indent change 2006-01-15 17:56:36 +00:00
Stanislav Shwartsman d7d2de421f Remove code duplication in CPU and memory objects initialization 2006-01-11 18:22:12 +00:00
Stanislav Shwartsman 5899932f0c Merge APIC patch to the CVS.
- Fix lowest priority interrupt delivery from I/O APIC
 - XAPIC support
 - Implemented APIC bus functionality
 - cleanup APIC code
2006-01-10 06:13:26 +00:00
Stanislav Shwartsman b07e698b3e Initialize CPU and APIC after the bx_pc_system object 2006-01-05 21:39:11 +00:00
Stanislav Shwartsman 8c91790680 Redefine registers accessors in cpu.h
Change BxSupportPAE and BxSupportGlobalPages macros to Bochs style names
Set bx_cpu_id in BX_CPU_C constructor (safe way)
Backup cpu-level check for paging features at compile time (already checked in configure)
Some warnings and indent fixes
speed up get_segment_base method for x86-64 case
2005-11-26 21:36:51 +00:00
Kevin Lawton 641650e7e1 Added optramimage directive for .bochsrc files, with same syntax as
optromimage.  You can load up to 4 arbitrary binary images into RAM.
  I didn't do any checking on the addresses, so it's up to you to make
  sure they don't collide with anything else.  Should only be used for
  placing files into standard RAM.
2005-10-28 00:12:27 +00:00
Stanislav Shwartsman f1f2647819 Print VME together with other features list 2005-10-17 14:48:43 +00:00
Stanislav Shwartsman 469358aaf9 Move SHOW_IPS action to bx_gui object, may be some GUI will be able to print IPS online in the simulation window status bar ...
Small code cleanup
2005-10-13 16:22:21 +00:00
Volker Ruppert cc59e24639 - removed BX_USE_CONFIG_INTERFACE stuff. A configuration interface is always
present and a quickstart option exists, too
- improved check for GTK 2.x (only needed if basename of wx is 'wx_gtk2')
- moved/added some deprecated configure options to the end of the script. These
  checks should force users and distrubutors to update their config options.
2005-10-03 10:28:56 +00:00
Volker Ruppert 9e514095fa - modified Bochs console window name on win32 2005-08-20 16:41:41 +00:00
Volker Ruppert 38d6c547dc - accept argument /? as help request on win32
- devices configuration added on top of the logfile
2005-08-07 09:03:15 +00:00
Volker Ruppert c83745753b - moved BX_SHARE_PATH check and definition to bochs.h
- small cleanup in bochs.h
2005-07-31 15:35:01 +00:00
Stanislav Shwartsman f93bd1c664 Optimize SHOW_IPS calculation, now it does not require additional ips_count++ operation after every instruction execution 2005-07-04 18:02:37 +00:00
Stanislav Shwartsman ddb6224b1e Do not print IPS in SHOW_IPS mode if no instructions executed 2005-04-16 19:37:53 +00:00
Volker Ruppert 8d02b01e41 - fixed a warning (extra token) 2005-04-15 12:02:10 +00:00
Stanislav Shwartsman 1755589376 Separate pageWriteStamp from ICACHE. The pageWriteStamp has totally independant structure and could be used in future with icache structure. Also it could be significantly speeded up using BX_SMF analog constructions. 2005-04-10 19:42:48 +00:00
Volker Ruppert 4ee7865930 - BX_GDBSTUB and BX_SUPPORT_X86_64 are always defined in config.h 2005-03-16 16:36:31 +00:00
Volker Ruppert bafa4abb4b - print the status of thr PCI controller only when the configuration system and
the devices are initialized
- status of the fast-function-call optimization added to the logfile header
2005-01-30 08:54:49 +00:00
Volker Ruppert f98ecd09b1 - changed wxWindows to wxWidgets (includes SF patch #1094407 by Alexander Schuch) 2005-01-05 19:54:32 +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 3cad938b05 - gdbstub support turned into a runtime option (SF patch #1021740 by Charles Duffy)
- gdb_* options moved to the new gdbstub option
2004-11-06 10:50:03 +00:00
Volker Ruppert 9a6a7ec2fd - rom address space check added to avoid overlapping rom images
- vgaromimage option now compatible with the other rom options. Old style syntax
  (without 'file=...") is still supported.
- load order for the rom images fixed (system, vga, other)
- rom images sizes not multiple 512 cause a BX_INFO for now. The original check
  will be enabled after updating the vgabios files
- optromimage error messages fixed
- some updates of the bochsrc sample
2004-09-01 18:12:23 +00:00
Volker Ruppert d06c80cee3 - changed all iodev config macros to BX_SUPPORT_xxx
- removed incorrect SDL/ prefix from include paths (patch from Robin KAY)
2004-08-06 15:49:55 +00:00
Stanislav Shwartsman f9bd2b74be 1. Fixed bug in FSUB instruction
2. Fixed bug

[ 989478 ] I-Cache and undefined Instruktions

The L4 microkernel uses an undefined instruction to
trap for a special requests into the kernel (LOCK NOP).
The handler fixes this up and gives the user a special
code page with syscall stubs. If you're not using the
I-Cache optimization everthing works find on bochs. But
if you enable the I-Cache (--enable-icache), then the
undefined opcode exception is thrown only once for ever
virtual address it occurs. See the demodisk of the
L4KA::pistachio
(http://www.l4ka.org/projects/pistachio/download.php).
In this case the pingpong benchmark of this demo is of
interest. Everything runs fine until the program tries
to spawn a new task for its measurements. This new task
shares the code of the creating program. But the new
task stops executing at the undefined instruction
explained above and no exception is thrown.
2004-07-29 20:15:19 +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