- ne2k: replaced debugger command 'info ne2k' completely by a new version based
on 'info device' with additional arguments and removed all of the now obsolete
stuff (ne2k device stub, macro for print_info())
- pci: added option 'dump=full' for the debugger command 'info device' to show
the whole PCI config space
- TODO: some other devices could have support for additional options in
debug_dump()
- removed FILE parameter from print_info() (unused - since dbg_printf() doesn't
need it)
- converted tabs to spaces
- TODO: implement 'info device' with optional arguments to get rid of the
print_info() method
It already had limited usability before. With stack direct access optimization the callback won't be called for stack accesses as well.
See note by Brian Slechta:
=== Cut Hete ===
While using Bochs as a reference model for simulations, the simulator needs
information about what loads/stores are taking place with each instruction.
Presumably, that is what the BX_INSTR_MEM_DATA() instrumentation macros
cover (which is the place where our simulator hooks up).
The RETnear_xxx() functions call access_linear() directly, rather than call
read_virtual_xxx() functions. This is a problem for code making use of the
BX_INSTR_MEM_DATA() hook because it does not get called for these
instructions. Should this be changed along with some other instructions
that exhibit this?
=== Cut Hete ===
For Bryan's usage bx_instr_lin_access and bx_instr_phy_read/bx_instr_phy_write callbacks should be used.
in the config interface. Applied settings are marked as 'done' with the value
-1 to avoid unwanted modification. NOTE: Not all Bochs modules exist when
running the start menu / dialog.
but in case you want a few %% of extra emulation performance - it is still possible to disable it with configure option.
most guests I saw do not use it !
for CPU emulation performance reasons, the alignment check compilation
still can be enabled using configure option --enable-alignment-check.
There is no software in the world which enable #AC exception checking, this
x86 feature is completely legacy but its emulation support costs up to 3-5%
emulation speed.
The checking for #AC exception enable still will be done, if
CPL == 3, EFLAGS.AC = 1 and CR0.AM = 1
but the alignment check is not compiled in, the Bochs will PANIC with corresponding message.
You can press 'always continue' and ignore the PANIC, the simulation will continue as if alignment checking is not enabled.
The problem with Parity is it is generally referenced very rarely so the current lazy flags code is not efficient to updated Parify flag only (because it updates low 8 bits of .result value the existing Zero Flag has to be shadowed in .auxbits.
So I flipped it around, to make Parity be shadowed in auxbits. .result now is only needed to derive Zero Flag, and both Sign and Parify are derived from .result + .auxbits (as Zero Flag is now). For the 90% of the conditional jumps that are JZ or JNZ, this is a speedup.
Parity is now derived from 8 bits in .result and 8 bits in .auxbits, and Sign is derived from one flag in .result and 1 bit in .auxbits by XOR-ing them all together. It makes the code sequences for SAHF and POPF simpler too.
of the device specified in 'string'. Added register mechanism and chained
list to store the device name and pointer. Replace hardcoded debug info
implementations for pic, pci and vga by the new one.
- TODO #1: improve existing debug_dump() output and add more devices
- TODO #2: add support for additional arguments and replace the NE2k print_info()
- TODO:
add debug info for more devices without adding them to bx_devices_c and
without a macro in plugin. A register mechanism in the debugger code would
be nice. Currently it is only possible to show the devices state by
accessing the save/restore tree. The debug_dump() output should show
the operation mode and the most important registers.
on Windows. Added early command line check for this option to call the
console creation for sdl and wx only if required. NOTE: The console is still
needed for the config interface 'textconfig', the console debugger and log
output to stdout/stderr.
- for sequencer reg #1 a screen update is required after changing bit #0, #3 and #5
- added new method skip_update() that checks the conditions to skip the screen update
and it is called after resizing the display
- clear screen request from the sequencer is now handled by the update() code
in the new method skip_update() instead of clearing display directly
- siminterface: don't create plugin parameter if it already exists
- wx: make sure all plugins are loaded when creating plugin control dialog
- USB HC's: fixed removal of parameters when unloading plugin
Added phenom_8650_toliman <AMD Phenom X3 8650 (Toliman)> comment into .bochsrc example with all other supported CPU configs.
Added missed SVM definitions into Toliman CPUDB module
also works and no deplist trick is required
- bx_param_c destructor now deletes the dependent list if it exists (memory leak)
- bx_list_c::clear() only deletes the parameter if the list is it's parent
- added new method cleanup_save_restore() to free memory on simulator shutdown
------------
Implemented SVN nested paging support - the Virtual Box boots perfectly with Nested Paging guest !
A lot of code duplication was added for now - major cleanup will follow later.
! Added AMD Phenom X3 8650 (Toliman) configuration to the CPUDB - this configuration has Nested Paging enabled.
Some CPUID modules rework done to enable Toliman configuration.
Ckean up 'executable' attribute from all CPU source files.
- bx_list_c: don't accept duplicate param names in list (except dependent lists
and special menus)
- added BX_PANIC for malloc() failure
- harddrv: fixed wrong variable found with bx_list_c changes
- VMX: EPT reserved bits set should cause EPT misconfiguration and not EPT violation
- VMX: EPT walk for guest CR3 address should be considered as 'page walk'
- added new class bx_vgacore_c containing the core of the standard VGA
emulation. This is now the base class for both vga and cirrus.
- created 2 separate plugins 'vga' (for standard VGA and VBE) and 'svga_cirrus'
(Cirrus emulation). The vga extension option is used to select which plugin
should be loaded.
- TODO: move the pcivga code to the VGA/VBE code, add subdirectory for display
adapters, severak improvements and cleanups
- changed argument for the text mode info structure to a pointer
- added attribute controller palette to bx_vga_tminfo_t and removed the
previous implementation
- carbon.cc: attempt to fix the text mode colors (untested)
- x.cc: fixed warnings
also for textconfig - fix operation under cygwin
under cygwin it is not guaranteed that any printf is printed on the screen under you flush the FILE stream.
in the gui object. Now the gui doesn't need to include vga.h.
- TODO #1: win32.cc also shouldn't include vga.h
- TODO #2: replace BX_MAX_XRES / BX_MAX_YRES by variables that can be set
depending on the configuration
- store memory type array in the memory object to avoid calling the pci plugin
frequently. The pci code calls a memory method to change the memory type in
case the PAM registers are modified.
- removed now obsolete code and minor cleanups
- TODO #1: update MSVC workspace files
- TODO #2: these 'device classes' could be moved to subdirectories, too:
- pci (when we have more than one chipset)
- display (when we have one more device and vga / cirrus cleaned up)
plugin system.The load order is important for these devices!
- load support plugins for networking, sound and usb only if at least one of the
related plugin devices is loaded.
- plugin_ctrl: added missing devices to the list in bochsrc sample
parsing to the plugin device code
- sb16: modified misc runtime menu creation to make the sb16 parameters optional
- ne2k: changed location of the init() method in file (now matches coding style
of other device plugins)
nearly all cases and plugins that depend on others. These plugins cannot be
managed with 'plugin_ctrl' (e.g. keyboard, harddrv, pci_ide). Store the plugin
type in the divice structure for compatiblity with the "no-plugin" compilation.
Call the device methods init(), reset() and after_restore_state() for each type
separately in the order: stanard, optional, user. This also affects the status
bar LED feature: now the keyboard and harddrv LEDs are always visible, but
those of optional plugins may be invisible if there is no space left.
- TODO #1: add the devices 'ne2k' and 'sb16' to 'plugin_ctrl'
- TODO #2: manage core plugins with the device plugin system
option parsing to the plugin device code
- added function bx_init_usb_options() to reduce code duplication
- added log function names for 'usb_ohci' and 'usb_uhci'
- documentation updates
the device code. Added panic message to force the user to enable the plugin
with 'plugin_ctrl'.
- moved config parameter creation and bochsrc option parsing for device
'usb_xhci' to the plugin device code
- added minimal documentation for the "log action per device" feature
- added log function name for 'usb_xhci'
header file that contains the required bswap code. This fix will be backported
for 2.5.1, but a better solution should be found for the next major release.
- bxcommit: fixed another big endian issue
- some more hidden / system directory fixes
- parse_directory() / write_file(): continue only if next cluster is valid
- TODO: fix VVFAT with Windows XP guest (unmodified FAT ?)
- unknown module names now cause a panic
- added log function names to some more devices
- TODO: find a way to configure log actions by device in the config interface
start menu (most of the devices do not exist at this point)
invalid module names, save log actions to bochsrc)
- added new member 'name' to the logfunctions class for the case the prefix
is too short. Added to some devices with longer names.
to update the status text if there is really a change
- changed the counter resolution to 5 (auto-off still happens after 0.5 seconds)
- the element value -1 is only used to reset the LEDs, so we have to ignore the
status flags
bochsrc parser. When read it will be possible to define exceptions from the
default setting like this:
debug: action=ignore, pci=report
- TODO (almost everything)
- add a 'name' member to the logfunctions class, since the prefix might be
too short
- apply special log actions the log modules and panic on unknown modules
- support saving special log action to bochsrc
existing "iolight timer" code in the hard drive code. If an LED is registered
with the "auto-off" flag, the device only needs to turn on the LED to indicate
data transfer. The LED timer in the gui code turns it off after 0.5 seconds if
it is not actived by another transfer. Added this feature to all network
devices.
- TODO #1: implement this feature in the USB host controllers
- TODO #2: the unused timer in the hard drive code could be used for the
emulation of seek functions
- IO intercept is not implemented yet
- MSR intercept is not implemented yet
VMX:
Fixed Bochs PANIC crash when doing I/O access crossing VMX I/O permission bitmaps.
This can happen because access_physical_read and access_physical_write cannot access memory cross 4K boundary.
I am merging the code in order to start making shortcuts between VMX emulation and SVM emulation.
Of course SVM emulation is incomplete, completely untested and not expected to work.
But someone could already take a look one the code and give some suggestions.
Also looking for anybody with existing SVM kernels - as simple as possible - for testing.
Status:
- exceptions intercept is not implemented yet
- IO intercept is not implemented yet
- MSR intercept is not implemented yet
- virtual interrupts are not implemented yet
- CPUID is not implemented yet
No advanced SVM featurez planned - I am implementing the very basic 'Pacifica' document from 2005 using QEMU code as reference.
directly while parsing the bochsrc or command line. If plugin support is enabled,
the option could load all optional plugins, not only the ones supported before.
NOTE #1: The old option had all plugins enabled by default and gave the user
a chance to diable them. Now the plugins are only loaded if they
appear in the config line and they are set to "1".
NOTE #2: Loading a plugin that is controlled by a bochsrc option is possible,
but it currently leads to a panic, since the load command is still
present in devices.cc.
NOTE #3: The plugin init code creates the device object and registers the
optional plugin device. As an option, it can create config parameters
and register an option parser. The device init, register state and
reset is still handled in devices.cc, but in the order the devices
have been loaded with the plugin control.
NOTE #4: If plugin support is disabled, the plugin control only accepts the
devices listed in plugin.cc.
- plugin init of core plugins now fails if they are not loaded with the expected
type. For core plugins the load order is important and they cannot be handled
with the chained devices list (used for optional and user plugins).
- some additions for calling config.cc functions from a plugin device
- added plugin unload function and improved load function
- use new function in bx_unload_plugins()
- new macro BX_UNREGISTER_DEVICE_DEVMODEL for future enhancements
plugins is implemented in bochsrc, these functions can be used to install
additional options from the devices code. Then the whole init / parse / save
code for this device can be moved from config.cc to the device plugin.
turned off. Removed workaround code from devices.cc.
- removed 'pci_ide' plugin from the optional plugin control, since it depends
on the presence of 'pci' and 'harddrv'.
- define types for plugin init/fini functions
- use 'pci_rom_size - 1' as the mask for the offset address
- ne2k: memory handlers must be disabled if compiled without PCI support
- svga_cirrus: check for the PCI ROM size to make VBE work correctly
- added BX_INFO to the mem write handlers
For now it returns a flag that indicated that the device can receive data
from the eth module and flags for the device speed. TODO: Use this callback
in the eth modules before sending data to the device.