2001-04-10 06:20:02 +04:00
|
|
|
// Copyright (C) 2001 MandrakeSoft S.A.
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
2001-04-10 06:20:02 +04:00
|
|
|
// MandrakeSoft S.A.
|
|
|
|
// 43, rue d'Aboukir
|
|
|
|
// 75002 Paris - France
|
|
|
|
// http://www.linux-mandrake.com/
|
|
|
|
// http://www.mandrakesoft.com/
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
2001-04-10 06:20:02 +04:00
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
2001-04-10 06:20:02 +04:00
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
2001-04-10 06:20:02 +04:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2001-04-10 05:59:07 +04:00
|
|
|
//
|
|
|
|
// config.h.in is distributed in the source TAR file. When you run
|
|
|
|
// the configure script, it generates config.h with some changes
|
|
|
|
// according to your build environment. For example, in config.h.in,
|
|
|
|
// SIZEOF_UNSIGNED_CHAR is set to 0. When configure produces config.h
|
|
|
|
// it will change "0" to the detected value for your system.
|
|
|
|
//
|
|
|
|
// config.h contains ONLY preprocessor #defines and a few typedefs.
|
|
|
|
// It must be included by both C and C++ files, so it must not
|
|
|
|
// contain anything language dependent such as a class declaration.
|
|
|
|
//
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
#ifdef _BX_CONFIG_H_
|
|
|
|
#else
|
|
|
|
#define _BX_CONFIG_H_ 1
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////
|
|
|
|
// USER CONFIGURABLE OPTIONS : EDIT ONLY OPTIONS IN THIS SECTION //
|
|
|
|
///////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-04-18 04:22:20 +04:00
|
|
|
|
|
|
|
#if 1
|
|
|
|
// quit_sim is defined in gui/siminterface.h
|
|
|
|
#define BX_EXIT(x) SIM->quit_sim (x)
|
|
|
|
#else
|
|
|
|
// provide the real main and the usual exit.
|
|
|
|
#define BX_EXIT(x) ::exit(x)
|
|
|
|
#endif
|
|
|
|
|
- I've added lots of comments in siminterface.h, and tried to clean up
the terminology a bit. In particular, the term "gui" has started
to mean different things in different contexts, so I've defined
some more specific names for the parts of the user interface, and
updated comments and some variable names to reflect it. See
siminterface.h for a more complete description of all of these.
VGAW: VGA display window and toolbar buttons, the traditional Bochs
display which is ported to X, win32, MacOS X, etc. Implemented
in gui/gui.* and platform dependent gui/*.cc files.
CI: configuration interface that lets the user change settings such
as floppy disk image, ne2k settings, log options. The CI consists
of two parts: configuration user interface (CUI) which does the
actual rendering to the screen and handles key/mouse/menu events,
and the siminterface object.
CUI: configuration user interface. This handles the user interactions
that allow the user to configure Bochs. To actually change any
values it talks to the siminterface object. One implementation of
the CUI is the text-mode menus in gui/control.cc. Another
implementation is (will be) the wxWindows menus and dialogs in
gui/wxmain.cc.
siminterface: the glue between the CUI and the simulation code,
accessible throughout the code by the global variable
bx_simulator_interface_c *SIM;
Among other things, siminterface methods allow the simulator to ask the
CUI to display things or ask for user input, and allows the CUI
to query and modify variables in the simulation code.
GUI: Literally, "graphical user interface". Until the configuration menus
and wxWindows came along, everyone understood that "gui" referred to the
VGA display window and the toolbar buttons because that's all there
was. Now that we have the wxWindows code, which implements both the VGAW
and the CUI, while all other platforms implement only the VGAW, it's not
so clear. So, I'm trying to use VGAW, CI, and CUI consistently since
they are more specific.
control panel: This has been used as another name for the configuration
interface. "control panel" is also somewhat unspecific and it sounds
like it would be graphical with buttons and sliders, but our text-mode
thing is not graphical at all. I've replaced "control panel" with
"configuration interface" wherever I could find it. In configure script,
the --disable-control-panel option is still supported, but it politely
suggests that you use --disable-config-interface instead.
- clean up comments in siminterface,wx* code
- add comments and examples for bx_param_* and BxEvents
- remove some obsolete stuff: notify_*_args,
bx_simulator_interface_c::[sg]et_enabled() methods
- in siminterface.cc, move a few bx_real_sim_c methods to where they belong,
with the rest of the methods. No changes to the actual methods.
- remove some DOS ^M's which crept in and confused my editor.
2002-08-26 19:31:23 +04:00
|
|
|
#define BX_USE_CONFIG_INTERFACE 1
|
2001-06-10 00:01:12 +04:00
|
|
|
|
2001-05-23 12:16:07 +04:00
|
|
|
// I have tested the following combinations:
|
|
|
|
// * processors=1, bootstrap=0, ioapic_id=1 (uniprocessor system)
|
|
|
|
// * processors=2, bootstrap=0, ioapic_id=2
|
|
|
|
// * processors=4, bootstrap=2, ioapic_id=4
|
|
|
|
#define BX_SMP_PROCESSORS 1
|
|
|
|
#define BX_BOOTSTRAP_PROCESSOR 0
|
|
|
|
// choose IOAPIC id to be equal to the number of processors. This leaves
|
|
|
|
// one space for each processor to have an ID, starting with 0.
|
|
|
|
#define BX_IOAPIC_DEFAULT_ID (BX_SMP_PROCESSORS)
|
|
|
|
|
|
|
|
#define BX_ADDRESS_SPACES 1
|
|
|
|
// controls how many instances of BX_MEM_C are created. For
|
|
|
|
// SMP, use several processors with one shared memory space.
|
|
|
|
// For cosimulation, you could use two processors and two address
|
|
|
|
// spaces.
|
|
|
|
|
2001-06-12 17:07:43 +04:00
|
|
|
#define BX_SUPPORT_APIC 0
|
2001-05-23 12:16:07 +04:00
|
|
|
// include in APIC models, required for a multiprocessor system.
|
2001-06-05 21:35:08 +04:00
|
|
|
|
2001-06-12 17:07:43 +04:00
|
|
|
#if (BX_SMP_PROCESSORS>1 && !BX_SUPPORT_APIC)
|
|
|
|
#error For multiprocessor simulation, BX_SUPPORT_APIC is required.
|
2001-06-05 21:35:08 +04:00
|
|
|
#endif
|
2001-05-23 12:16:07 +04:00
|
|
|
|
|
|
|
#define BX_DEBUG_LINUX 0
|
|
|
|
// if simulating Linux, this provides a few more debugging options
|
|
|
|
// such as tracing all system calls.
|
|
|
|
|
|
|
|
#define HAVE_LIBREADLINE 0
|
|
|
|
#define HAVE_READLINE_HISTORY_H 0
|
|
|
|
// adds support for the GNU readline library in the debugger command
|
|
|
|
// prompt.
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
// I rebuilt the code which provides timers to IO devices.
|
|
|
|
// Setting this to 1 will introduce a little code which
|
|
|
|
// will panic out if cases which shouldn't happen occur.
|
|
|
|
// Set this to 0 for optimal performance.
|
|
|
|
#define BX_TIMER_DEBUG 1
|
|
|
|
|
|
|
|
// Settable A20 line. For efficiency, you can disable
|
|
|
|
// having a settable A20 line, eliminating conditional
|
|
|
|
// code for every physical memory access. You'll have
|
|
|
|
// to tell your software not to mess with the A20 line,
|
|
|
|
// and accept it as always being on if you change this.
|
|
|
|
// 1 = use settable A20 line. (normal)
|
|
|
|
// 0 = A20 is like the rest of the address lines
|
|
|
|
|
|
|
|
#define BX_SUPPORT_A20 1
|
|
|
|
|
|
|
|
// Processor Instructions Per Second
|
|
|
|
// To find out what value to use for the 'ips' directive
|
|
|
|
// in your '.bochsrc' file, set BX_SHOW_IPS to 1, and
|
|
|
|
// run the software in bochs you plan to use most. Bochs
|
|
|
|
// will print out periodic IPS ratings. This will change
|
|
|
|
// based on the processor mode at the time, and various
|
|
|
|
// other factors. You'll get a reasonable estimate though.
|
|
|
|
// When you're done, reset BX_SHOW_IPS to 0, do a
|
|
|
|
// 'make all-clean', then 'make' again.
|
|
|
|
|
|
|
|
#define BX_SHOW_IPS 0
|
|
|
|
|
|
|
|
|
|
|
|
#if (BX_SHOW_IPS) && defined(__MINGW32__)
|
|
|
|
#define SIGALRM 14
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Paging Options:
|
|
|
|
// ---------------
|
|
|
|
// Support Paging mechanism.
|
|
|
|
// 0 = don't support paging at all (DOS & Minix don't require it)
|
|
|
|
// 1 = support paging. (Most other OS's require paging)
|
|
|
|
// Use Translation Lookaside Buffer (TLB) for caching
|
|
|
|
// paging translations. This will make paging mode
|
|
|
|
// more efficient. If you're OS doesn't use paging,
|
|
|
|
// then you won't need either.
|
|
|
|
// 1 = Use a TLB for effiency
|
|
|
|
// 0 = don't use a TLB, walk the page tables for every access
|
|
|
|
// BX_TLB_SIZE: Number of entries in TLB
|
|
|
|
// BX_TLB_INDEX_OF(lpf): This macro is passed the linear page frame
|
|
|
|
// (top 20 bits of the linear address. It must map these bits to
|
|
|
|
// one of the TLB cache slots, given the size of BX_TLB_SIZE.
|
|
|
|
// There will be a many-to-one mapping to each TLB cache slot.
|
|
|
|
// When there are collisions, the old entry is overwritten with
|
|
|
|
// one for the newest access.
|
|
|
|
|
|
|
|
#define BX_SUPPORT_PAGING 1
|
|
|
|
#define BX_USE_TLB 1
|
|
|
|
|
|
|
|
#define BX_TLB_SIZE 1024
|
|
|
|
#define BX_TLB_INDEX_OF(lpf) (((lpf) & 0x003ff000) >> 12)
|
|
|
|
|
2002-09-06 23:21:55 +04:00
|
|
|
#define BX_USE_QUICK_TLB_INVALIDATE 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Compile in support for DMA & FLOPPY IO. You'll need this
|
|
|
|
// if you plan to use the floppy drive emulation. But if
|
|
|
|
// you're environment doesn't require it, you can change
|
|
|
|
// it to 0.
|
|
|
|
|
|
|
|
#define BX_DMA_FLOPPY_IO 1
|
|
|
|
|
|
|
|
|
|
|
|
// Default number of Megs of memory to emulate. The
|
|
|
|
// 'megs:' directive in the '.bochsrc' file overrides this,
|
|
|
|
// allowing per-run settings.
|
|
|
|
|
|
|
|
#define BX_DEFAULT_MEM_MEGS 4
|
|
|
|
|
|
|
|
|
|
|
|
// CPU level emulation. Default level is set in
|
|
|
|
// the configure script. BX_CPU_LEVEL defines the CPU level
|
|
|
|
// to emulate. BX_CPU_LEVEL_HACKED is a hack to define the
|
|
|
|
// level of some integer instructions, so they can be tested
|
|
|
|
// before the rest of the emulation is up to that level.
|
|
|
|
|
|
|
|
#define BX_CPU_LEVEL 0
|
|
|
|
#define BX_CPU_LEVEL_HACKED 0
|
|
|
|
|
2002-09-12 11:16:37 +04:00
|
|
|
// emulate x86-64 instruction set?
|
|
|
|
#define BX_SUPPORT_X86_64 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Virtual 8086 mode emulation.
|
|
|
|
// 1 = compile in support for v8086 mode.
|
|
|
|
// 0 = don't compile in support for v8086 mode.
|
|
|
|
|
|
|
|
#define BX_SUPPORT_V8086_MODE 1
|
|
|
|
|
|
|
|
// Support shadowing of ROM from C0000 to FFFFF.
|
|
|
|
// This allows that region to be written to.
|
|
|
|
#define BX_SHADOW_RAM 0
|
|
|
|
|
|
|
|
// Number of CMOS registers
|
|
|
|
#define BX_NUM_CMOS_REGS 64
|
|
|
|
//#define BX_NUM_CMOS_REGS 128
|
|
|
|
|
2001-08-15 21:51:10 +04:00
|
|
|
// Use Greg Alexander's new PIT model (summer 2001) instead of the original.
|
|
|
|
#define BX_USE_NEW_PIT 0
|
2002-02-08 00:22:55 +03:00
|
|
|
#define BX_USE_REALTIME_PIT 0
|
2001-08-15 21:51:10 +04:00
|
|
|
|
2001-09-24 09:35:05 +04:00
|
|
|
#define BX_USE_SLOWDOWN_TIMER 0
|
2001-10-05 17:52:25 +04:00
|
|
|
#define BX_HAVE_SLEEP 0
|
2001-09-24 09:35:05 +04:00
|
|
|
#define BX_HAVE_USLEEP 0
|
|
|
|
#define BX_HAVE_NANOSLEEP 0
|
2001-10-07 04:10:19 +04:00
|
|
|
#define BX_HAVE_ABORT 0
|
2002-03-08 07:45:00 +03:00
|
|
|
#define BX_HAVE_SOCKLEN_T 0
|
2002-09-22 05:56:18 +04:00
|
|
|
#define BX_HAVE_GETTIMEOFDAY 0
|
2002-09-23 06:20:52 +04:00
|
|
|
#define BX_HAVE_REALTIME_USEC BX_HAVE_GETTIMEOFDAY
|
2001-09-24 09:35:05 +04:00
|
|
|
|
2002-01-27 12:24:08 +03:00
|
|
|
// This turns on Roland Mainz's idle hack. Presently it is specific to the X11
|
|
|
|
// gui. If people try to enable it elsewhere, give a compile error after the
|
|
|
|
// gui definition so that they don't waste their time trying.
|
2001-11-12 03:49:57 +03:00
|
|
|
#define BX_USE_IDLE_HACK 0
|
|
|
|
|
2001-05-23 12:16:07 +04:00
|
|
|
// Use Static Member Funtions to eliminate 'this' pointer passing
|
|
|
|
// If you want the efficiency of 'C', you can make all the
|
|
|
|
// members of the C++ CPU class to be static.
|
|
|
|
// This defaults to 1 since it should improve performance, but when
|
|
|
|
// SMP mode is enabled, it will be turned off by configure.
|
|
|
|
|
|
|
|
#define BX_USE_CPU_SMF 1
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Use static member functions in IO DEVice emulation modules.
|
|
|
|
// For efficiency, use C like functions for IO handling,
|
|
|
|
// and declare a device instance at compile time,
|
|
|
|
// instead of using 'new' and storing the pointer. This
|
|
|
|
// eliminates some overhead, especially for high-use IO
|
|
|
|
// devices like the disk drive.
|
|
|
|
// 1 = Use static member efficiency (normal)
|
|
|
|
// 0 = Use nonstatic member functions (use only if you need
|
|
|
|
// multiple instances of a device class
|
|
|
|
|
|
|
|
#define BX_USE_HD_SMF 1 // Hard drive
|
2002-04-02 01:53:23 +04:00
|
|
|
#define BX_USE_BIOS_SMF 1 // BIOS
|
2001-04-10 05:04:59 +04:00
|
|
|
#define BX_USE_CMOS_SMF 1 // CMOS
|
|
|
|
#define BX_USE_DMA_SMF 1 // DMA
|
|
|
|
#define BX_USE_FD_SMF 1 // Floppy
|
|
|
|
#define BX_USE_KEY_SMF 1 // Keyboard
|
|
|
|
#define BX_USE_PAR_SMF 1 // Parallel
|
|
|
|
#define BX_USE_PIC_SMF 1 // PIC
|
|
|
|
#define BX_USE_PIT_SMF 1 // PIT
|
|
|
|
#define BX_USE_SER_SMF 1 // Serial
|
|
|
|
#define BX_USE_UM_SMF 1 // Unmapped
|
|
|
|
#define BX_USE_VGA_SMF 1 // VGA
|
|
|
|
#define BX_USE_SB16_SMF 1 // Sound (SB 16)
|
|
|
|
#define BX_USE_DEV_SMF 1 // System Devices (port92)
|
|
|
|
#define BX_USE_PCI_SMF 1 // PCI
|
2002-09-16 23:18:58 +04:00
|
|
|
#define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge
|
2001-05-23 04:46:47 +04:00
|
|
|
#define BX_USE_NE2K_SMF 1 // NE2K
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
#define BX_SUPPORT_SB16 0
|
|
|
|
|
|
|
|
#if BX_SUPPORT_SB16
|
|
|
|
// Use virtual methods for the sound output functions
|
|
|
|
#define BX_USE_SOUND_VIRTUAL 1
|
|
|
|
// Determines which sound output class is to be used.
|
|
|
|
// Currently the following are available:
|
|
|
|
// bx_sound_linux_c Output for Linux, to /dev/dsp and /dev/midi00
|
|
|
|
// bx_sound_windows_c Output for Windows midi and wave mappers
|
|
|
|
// bx_sound_output_c Dummy functions, no output
|
|
|
|
#define BX_SOUND_OUTPUT_C bx_sound_output_c
|
|
|
|
#endif
|
|
|
|
|
2001-06-16 23:27:41 +04:00
|
|
|
#define USE_RAW_SERIAL 0
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
#define BX_USE_SPECIFIED_TIME0 0
|
|
|
|
|
|
|
|
// This enables writing to port 0xe9 and the output
|
|
|
|
// is sent to the console. Reading from port 0xe9
|
|
|
|
// will return 0xe9 to let you know this is available.
|
|
|
|
// Leave this 0 unless you have a reason to use it.
|
2001-12-05 19:25:24 +03:00
|
|
|
#define BX_PORT_E9_HACK 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2002-10-03 08:58:03 +04:00
|
|
|
#define BX_GDBSTUB 0
|
|
|
|
|
2001-05-07 09:47:59 +04:00
|
|
|
// This option enables "split hard drive" support, which means
|
|
|
|
// that a series of partial hard disk images can be treated
|
|
|
|
// as a single large image. If you set up the partition sizes and
|
|
|
|
// file sizes correctly, this allows you to store each partition
|
|
|
|
// in a separate file, which is very convenient if you want to operate
|
|
|
|
// on a single partition (e.g. mount with loopback, create filesystem,
|
|
|
|
// fsck, etc.).
|
|
|
|
// [[Provide example of partitioning]]
|
|
|
|
#define BX_SPLIT_HD_SUPPORT 0
|
|
|
|
|
2002-09-23 00:56:12 +04:00
|
|
|
// This option defines the number of supported ATA channels.
|
|
|
|
// There are up to two drives per ATA channel.
|
|
|
|
#define BX_MAX_ATA_CHANNEL 4
|
|
|
|
|
|
|
|
#if (BX_MAX_ATA_CHANNEL>4 || BX_MAX_ATA_CHANNEL<1)
|
|
|
|
# error "BX_MAX_ATA_CHANNEL should be between 1 and 4"
|
|
|
|
#endif
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// =================================================================
|
|
|
|
// BEGIN: OPTIONAL DEBUGGER SECTION
|
|
|
|
//
|
|
|
|
// These options are only used if you compile in support for the
|
|
|
|
// native command line debugging environment. Typically, the debugger
|
|
|
|
// is not used, and this section can be ignored.
|
|
|
|
// =================================================================
|
|
|
|
|
|
|
|
#define BX_MAX_DIRTY_PAGE_TABLE_MEGS 64
|
|
|
|
|
|
|
|
// Compile in support for virtual/linear/physical breakpoints.
|
|
|
|
// Set to 1, only those you need. Recommend using only linear
|
|
|
|
// breakpoints, unless you need others. Less supported means
|
|
|
|
// slightly faster execution time.
|
|
|
|
#define BX_DBG_SUPPORT_VIR_BPOINT 1
|
|
|
|
#define BX_DBG_SUPPORT_LIN_BPOINT 1
|
|
|
|
#define BX_DBG_SUPPORT_PHY_BPOINT 1
|
|
|
|
|
|
|
|
// You need only define one initial breakpoint into each
|
|
|
|
// cpu simulator (emulator) here. Each simulator sets callbacks
|
|
|
|
// and variables which the debugger uses from then on.
|
|
|
|
#define BX_SIM1_INIT bx_dbg_init_cpu_mem_env0
|
|
|
|
#ifndef BX_SIM2_INIT
|
|
|
|
#define BX_SIM2_INIT bx_dbg_init_cpu_mem_env1
|
|
|
|
#endif
|
|
|
|
//#define BX_SIM2_INIT sim2_init
|
|
|
|
|
|
|
|
// max number of virtual/linear/physical breakpoints handled
|
|
|
|
#define BX_DBG_MAX_VIR_BPOINTS 10
|
|
|
|
#define BX_DBG_MAX_LIN_BPOINTS 10
|
|
|
|
#define BX_DBG_MAX_PHY_BPOINTS 10
|
|
|
|
|
|
|
|
// max file pathname size for debugger commands
|
|
|
|
#define BX_MAX_PATH 256
|
|
|
|
// max nesting level for debug scripts including other scripts
|
|
|
|
#define BX_INFILE_DEPTH 10
|
|
|
|
// use this command to include (nest) debug scripts
|
|
|
|
#define BX_INCLUDE_CMD "source"
|
|
|
|
|
|
|
|
// Use either 32 or 64 bit instruction counter for
|
|
|
|
// debugger purposes. Uncomment one of these.
|
|
|
|
//#define BX_DBG_ICOUNT_SIZE 32
|
|
|
|
#define BX_DBG_ICOUNT_SIZE 64
|
|
|
|
|
|
|
|
// Make a call to command line debugger extensions. If set to 1,
|
|
|
|
// a call is made. An external routine has a chance to process
|
|
|
|
// the command. If it does, than the debugger ignores the command.
|
|
|
|
#define BX_DBG_EXTENSIONS 0
|
|
|
|
|
|
|
|
// =================================================================
|
|
|
|
// END: OPTIONAL DEBUGGER SECTION
|
|
|
|
// =================================================================
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
|
|
|
|
// THIS IS GENERATED BY THE ./configure SCRIPT //
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#define BX_WITH_X11 0
|
|
|
|
#define BX_WITH_BEOS 0
|
|
|
|
#define BX_WITH_WIN32 0
|
|
|
|
#define BX_WITH_MACOS 0
|
2001-09-26 04:13:16 +04:00
|
|
|
#define BX_WITH_CARBON 0
|
2001-04-10 05:04:59 +04:00
|
|
|
#define BX_WITH_NOGUI 0
|
2001-05-08 23:07:26 +04:00
|
|
|
#define BX_WITH_TERM 0
|
2001-05-24 05:07:09 +04:00
|
|
|
#define BX_WITH_RFB 0
|
2001-08-16 00:33:47 +04:00
|
|
|
#define BX_WITH_AMIGAOS 0
|
- commit patch.check-platform. For full details, pull up the patch itself
and look at the description at the top. Here's an intro.
This patch makes significant changes to the configure script. It adds the
lines AC_CANONICAL_HOST and AC_CANONICAL_TARGET which detect the OS and
processor type. The configure script, knowing the OS and processor type, can
then make intelligent decisions about which CFLAGS are needed and what is the
default GUI for that platform. One of the goals of this patch is to make it
so that on all supported platforms, "configure;make" will compile cleanly.
Configure detects the target platform, but it can be overridden by using
--target=___. This is important when using one platform to generate
Makefiles and header files for another platform. See config.guess script for
the exact details of platform naming.
The defaults that are currently implemented in the modified configure script
include:
If platform is windows* or winnt*, use win32 gui.
If platform is cygwin*, use win32 gui and compile with
"-mno-cygwin -DWIN32".
If platform is macosx* or darwin*, use carbon gui and compile
with "-fpascal-strings -fno-common -arch ppc -Wno-four-char-constants
-Wno-unknown-pragmas -Dmacintosh"
If platform is macos, use macos gui.
If platform is beos, use beos gui.
If platform is amigaos, use amigaos gui.
Otherwise, use X windows gui.
2002-03-07 19:00:39 +03:00
|
|
|
#define BX_WITH_SDL 0
|
2002-04-18 04:22:20 +04:00
|
|
|
#define BX_WITH_WX 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
|
2002-01-27 12:24:08 +03:00
|
|
|
// Roland Mainz's idle hack is presently specific to X11. If people try to
|
|
|
|
// enable it elsewhere, give a compile error so that they don't waste their
|
|
|
|
// time trying.
|
|
|
|
#if (BX_USE_IDLE_HACK && !BX_WITH_X11)
|
|
|
|
# error IDLE_HACK will only work with the X11 gui. Correct configure args and retry.
|
|
|
|
#endif
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
#define WORDS_BIGENDIAN 0
|
|
|
|
|
|
|
|
#define SIZEOF_UNSIGNED_CHAR 0
|
|
|
|
#define SIZEOF_UNSIGNED_SHORT 0
|
|
|
|
#define SIZEOF_UNSIGNED_INT 0
|
|
|
|
#define SIZEOF_UNSIGNED_LONG 0
|
|
|
|
#define SIZEOF_UNSIGNED_LONG_LONG 0
|
2001-04-10 05:50:00 +04:00
|
|
|
#define SIZEOF_INT_P 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2001-04-10 06:06:10 +04:00
|
|
|
#define BX_64BIT_CONSTANTS_USE_LL 1
|
|
|
|
#if BX_64BIT_CONSTANTS_USE_LL
|
|
|
|
// doesn't work on Microsoft Visual C++, maybe others
|
|
|
|
#define BX_CONST64(x) (x##LL)
|
|
|
|
#else
|
|
|
|
#define BX_CONST64(x) (x)
|
|
|
|
#endif
|
|
|
|
|
2002-03-06 22:16:40 +03:00
|
|
|
#if defined(WIN32)
|
2001-04-10 05:04:59 +04:00
|
|
|
typedef unsigned char Bit8u;
|
|
|
|
typedef signed char Bit8s;
|
|
|
|
typedef unsigned short Bit16u;
|
|
|
|
typedef signed short Bit16s;
|
|
|
|
typedef unsigned int Bit32u;
|
|
|
|
typedef signed int Bit32s;
|
|
|
|
#ifdef __MINGW32__
|
|
|
|
typedef unsigned long long Bit64u;
|
|
|
|
typedef signed long long Bit64s;
|
2001-06-11 01:26:11 +04:00
|
|
|
typedef Bit32s ssize_t;
|
2001-04-10 05:04:59 +04:00
|
|
|
#else
|
|
|
|
typedef unsigned __int64 Bit64u;
|
|
|
|
typedef signed __int64 Bit64s;
|
|
|
|
#endif
|
|
|
|
#elif BX_WITH_MACOS
|
|
|
|
typedef unsigned char Bit8u;
|
|
|
|
typedef signed char Bit8s;
|
|
|
|
typedef unsigned short Bit16u;
|
|
|
|
typedef signed short Bit16s;
|
|
|
|
typedef unsigned int Bit32u;
|
|
|
|
typedef signed int Bit32s;
|
|
|
|
typedef unsigned long long Bit64u;
|
|
|
|
typedef signed long long Bit64s;
|
2002-03-06 22:16:40 +03:00
|
|
|
#else
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Unix like platforms
|
|
|
|
|
|
|
|
#if SIZEOF_UNSIGNED_CHAR != 1
|
|
|
|
# error "sizeof (unsigned char) != 1"
|
|
|
|
#else
|
|
|
|
typedef unsigned char Bit8u;
|
|
|
|
typedef signed char Bit8s;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_UNSIGNED_SHORT != 2
|
|
|
|
# error "sizeof (unsigned short) != 2"
|
|
|
|
#else
|
|
|
|
typedef unsigned short Bit16u;
|
|
|
|
typedef signed short Bit16s;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_UNSIGNED_INT == 4
|
|
|
|
typedef unsigned int Bit32u;
|
|
|
|
typedef signed int Bit32s;
|
|
|
|
#elif SIZEOF_UNSIGNED_LONG == 4
|
|
|
|
typedef unsigned long Bit32u;
|
|
|
|
typedef signed long Bit32s;
|
|
|
|
#else
|
|
|
|
# error "can't find sizeof(type) of 4 bytes!"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SIZEOF_UNSIGNED_LONG == 8
|
|
|
|
typedef unsigned long Bit64u;
|
|
|
|
typedef signed long Bit64s;
|
|
|
|
#elif SIZEOF_UNSIGNED_LONG_LONG == 8
|
|
|
|
typedef unsigned long long Bit64u;
|
|
|
|
typedef signed long long Bit64s;
|
|
|
|
#else
|
|
|
|
# error "can't find data type of 8 bytes"
|
|
|
|
#endif
|
|
|
|
|
2002-03-06 22:16:40 +03:00
|
|
|
#endif
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2002-10-14 02:38:17 +04:00
|
|
|
// now that Bit32u and Bit64u exist, defined bx_address
|
|
|
|
#if BX_SUPPORT_X86_64
|
|
|
|
typedef Bit64u bx_address;
|
|
|
|
#else
|
|
|
|
typedef Bit32u bx_address;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2002-09-12 11:16:37 +04:00
|
|
|
|
2001-06-20 18:01:39 +04:00
|
|
|
#define BX_MAX_UINT 4294967295
|
|
|
|
#define BX_MAX_INT 2147483647
|
- apply a patch I've been working on
- modified files: config.h.in cpu/init.cc debug/dbg_main.cc gui/control.cc
gui/siminterface.cc gui/siminterface.h gui/wxdialog.cc gui/wxdialog.h
gui/wxmain.cc gui/wxmain.h iodev/keyboard.cc
----------------------------------------------------------------------
Patch name: patch.wx-show-cpu2
Author: Bryce Denney
Date: Fri Sep 6 12:13:28 EDT 2002
Description:
Second try at implementing the "Debug:Show Cpu" and "Debug:Show
Keyboard" dialog with values that change as the simulation proceeds.
(Nobody gets to see the first try.) This is the first step toward
making something resembling a wxWindows debugger.
First, variables which are going to be visible in the CI must be
registered as parameters. For some variables, it might be acceptable
to change them from Bit32u into bx_param_num_c and access them only
with set/get methods, but for most variables it would be a horrible
pain and wreck performance.
To deal with this, I introduced the concept of a shadow parameter. A
normal parameter has its value stored inside the struct, but a shadow
parameter has only a pointer to the value. Shadow params allow you to
treat any variable as if it was a parameter, without having to change
its type and access it using get/set methods. Of course, a shadow
param's value is controlled by someone else, so it can change at any
time.
To demonstrate and test the registration of shadow parameters, I
added code in cpu/init.cc to register a few CPU registers and
code in iodev/keyboard.cc to register a few keyboard state values.
Now these parameters are visible in the Debug:Show CPU and
Debug:Show Keyboard dialog boxes.
The Debug:Show* dialog boxes are created by the ParamDialog class,
which already understands how to display each type of parameter,
including the new shadow parameters (because they are just a subclass
of a normal parameter class). I have added a ParamDialog::Refresh()
method, which rereads the value from every parameter that it is
displaying and changes the displayed value. At the moment, in the
Debug:Show CPU dialog, changing the values has no effect. However
this is trivial to add when it's time (just call CommitChanges!). It
wouldn't really make sense to change the values unless you have paused
the simulation, for example when single stepping with the debugger.
The Refresh() method must be called periodically or else the dialog
will show the initial values forever. At the moment, Refresh() is
called when the simulator sends an async event called
BX_ASYNC_EVT_REFRESH, created by a call to SIM->refresh_ci ().
Details:
- implement shadow parameter class for Bit32s, called bx_shadow_num_c.
implement shadow parameter class for Boolean, called bx_shadow_bool_c.
more to follow (I need one for every type!)
- now the simulator thread can request that the config interface refresh
its display. For now, the refresh event causes the CI to check every
parameter it is watching and change the display value. Later, it may
be worth the trouble to keep track of which parameters have actually
changed. Code in the simulator thread calls SIM->refresh_ci(), which
creates an async event called BX_ASYNC_EVT_REFRESH and sends it to
the config interface. When it arrives in the wxWindows gui thread,
it calls RefreshDialogs(), which calls the Refresh() method on any
dialogs that might need it.
- in the debugger, SIM->refresh_ci() is called before every prompt
is printed. Otherwise, the refresh would wait until the next
SIM->periodic(), which might be thousands of cycles. This way,
when you're single stepping, the dialogs update with every step.
- To improve performance, the CI has a flag (MyFrame::WantRefresh())
which tells whether it has any need for refresh events. If no
dialogs are showing that need refresh events, then no event is sent
between threads.
- add a few defaults to the param classes that affect the settings of
newly created parameters. When declaring a lot of params with
similar settings it's more compact to set the default for new params
rather than to change each one separately. default_text_format is
the printf format string for displaying numbers. default_base is
the default base for displaying numbers (0, 16, 2, etc.)
- I added to ParamDialog to make it able to display modeless dialog
boxes such as "Debug:Show CPU". The new Refresh() method queries
all the parameters for their current value and changes the value in
the wxWindows control. The ParamDialog class still needs a little
work; for example, if it's modal it should have Cancel/Ok buttons,
but if it's going to be modeless it should maybe have Apply (commit
any changes) and Close.
2002-09-06 20:43:26 +04:00
|
|
|
#define BX_MIN_UINT 0
|
|
|
|
#define BX_MIN_INT -2147483647
|
|
|
|
// I would think BX_MIN_INT should be -2147483648 because that's the smallest
|
|
|
|
// representable number in 32bit unsigned. But gcc gives warnings, probably
|
|
|
|
// because it has to parse the 2147483648 first and then negate it.
|
2001-06-20 18:01:39 +04:00
|
|
|
|
|
|
|
|
2001-04-10 05:50:00 +04:00
|
|
|
// create an unsigned integer type that is the same size as a pointer.
|
|
|
|
// You can typecast a pointer to a bx_pr_equiv_t without losing any
|
|
|
|
// bits (and without getting the compiler excited). This is used in
|
|
|
|
// the FPU emulation code, where pointers and integers are often
|
|
|
|
// used interchangeably.
|
|
|
|
#if SIZEOF_INT_P == 4
|
|
|
|
typedef Bit32u bx_ptr_equiv_t;
|
|
|
|
#elif SIZEOF_INT_P == 8
|
|
|
|
typedef Bit64u bx_ptr_equiv_t;
|
|
|
|
#else
|
2001-04-10 06:31:24 +04:00
|
|
|
# error "could not define bx_ptr_equiv_t to size of int*"
|
2001-04-10 05:50:00 +04:00
|
|
|
#endif
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2001-09-26 21:30:15 +04:00
|
|
|
#if BX_WITH_CARBON
|
2002-10-05 02:11:58 +04:00
|
|
|
// Boolean is defined as unsigned char in Carbon header files.
|
2001-09-26 21:30:15 +04:00
|
|
|
typedef unsigned char Boolean;
|
|
|
|
#elif BX_WITH_MACOS
|
|
|
|
// don't define Boolean at all
|
|
|
|
#else
|
2001-04-10 05:04:59 +04:00
|
|
|
typedef unsigned int Boolean;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if BX_WITH_MACOS
|
|
|
|
# define bx_ptr_t char *
|
|
|
|
#else
|
|
|
|
# define bx_ptr_t void *
|
|
|
|
#endif
|
|
|
|
|
2002-03-06 22:16:40 +03:00
|
|
|
#if defined(WIN32)
|
2001-04-10 05:04:59 +04:00
|
|
|
# define BX_LITTLE_ENDIAN
|
|
|
|
#elif BX_WITH_MACOS
|
|
|
|
# define BX_BIG_ENDIAN
|
|
|
|
#else
|
|
|
|
#if WORDS_BIGENDIAN
|
|
|
|
# define BX_BIG_ENDIAN
|
|
|
|
#else
|
|
|
|
# define BX_LITTLE_ENDIAN
|
|
|
|
#endif
|
2002-03-06 22:16:40 +03:00
|
|
|
#endif // defined(WIN32)
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2002-09-15 09:29:06 +04:00
|
|
|
|
|
|
|
#if BX_SUPPORT_X86_64
|
|
|
|
#ifdef BX_LITTLE_ENDIAN
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
Bit64u lo;
|
|
|
|
Bit64u hi;
|
|
|
|
} Bit128u;
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
Bit64u lo;
|
|
|
|
Bit64s hi;
|
|
|
|
} Bit128s;
|
|
|
|
#else // must be Big Endian
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
Bit64u hi;
|
|
|
|
Bit64u lo;
|
|
|
|
} Bit128u;
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
Bit64s hi;
|
|
|
|
Bit64u lo;
|
|
|
|
} Bit128s;
|
|
|
|
#endif
|
|
|
|
#endif // #if BX_SUPPORT_X86_64
|
|
|
|
|
|
|
|
|
2001-05-09 00:18:04 +04:00
|
|
|
// for now only term.cc requires a GUI sighandler.
|
|
|
|
#define BX_GUI_SIGHANDLER (BX_WITH_TERM)
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
#define HAVE_SIGACTION 1
|
|
|
|
|
2001-04-10 06:10:09 +04:00
|
|
|
// configure will change the definition of "inline" to the value
|
|
|
|
// that the C compiler allows. It tests the following keywords to
|
|
|
|
// see if any is permitted: inline, __inline__, __inline. If none
|
|
|
|
// is permitted, it defines inline to be empty.
|
2001-04-10 05:04:59 +04:00
|
|
|
#define inline inline
|
|
|
|
|
2001-04-10 06:10:09 +04:00
|
|
|
// inline functions in headers that are compiled with C compiler
|
|
|
|
// (e.g. fpu code) are declared with BX_C_INLINE macro. Note that
|
|
|
|
// the word "inline" itself may now be redefined by the above #define.
|
|
|
|
// Many compilers are known to work with "static inline". If the
|
|
|
|
// compiler can put the function inline, it does so and never creates
|
|
|
|
// a symbol for the function. If optimization is off, or inline is
|
|
|
|
// defined to be empty, the static keyword causes the function to create
|
|
|
|
// a symbol that's visible only to that .c file. Each .c file that
|
|
|
|
// includes the header will produde another local version of the
|
|
|
|
// BX_C_INLINE function (not ideal). However without "static" you can
|
|
|
|
// duplicate symbol problems which are even worse.
|
|
|
|
#define BX_C_INLINE static inline
|
|
|
|
|
|
|
|
// Use BX_CPP_INLINE for all C++ inline functions. Note that the
|
|
|
|
// word "inline" itself may now be redefined by the above #define.
|
|
|
|
#define BX_CPP_INLINE inline
|
|
|
|
|
2002-09-19 23:17:20 +04:00
|
|
|
#ifdef __GNUC__
|
2002-10-06 18:16:23 +04:00
|
|
|
|
|
|
|
// Some helpful compiler hints for compilers that allow them; GCC for now.
|
|
|
|
//
|
|
|
|
// BX_CPP_AlignN(n):
|
|
|
|
// Align a construct on an n-byte boundary.
|
|
|
|
//
|
|
|
|
// BX_CPP_AttrPrintf(formatArg, firstArg):
|
|
|
|
// This function takes printf-like arguments, so the compiler can check
|
|
|
|
// the consistency of the format string and the matching arguments.
|
|
|
|
// 'formatArg' is the parameter number (starting from 1) of the format
|
|
|
|
// string argument. 'firstArg' is the parameter number of the 1st argument
|
|
|
|
// to check against the string argument. NOTE: For non-static member
|
|
|
|
// functions, the this-ptr is argument number 1 but is invisible on
|
|
|
|
// the function prototype declaration - but you still have to count it.
|
|
|
|
//
|
|
|
|
// BX_CPP_AttrNoReturn():
|
|
|
|
// This function never returns. The compiler can optimize-out following
|
|
|
|
// code accordingly.
|
|
|
|
|
2002-09-19 23:17:20 +04:00
|
|
|
#define BX_CPP_AlignN(n) __attribute__ ((aligned (n)))
|
2002-10-06 18:16:23 +04:00
|
|
|
#define BX_CPP_AttrPrintf(formatArg, firstArg) \
|
|
|
|
__attribute__ ((format (printf, formatArg, firstArg)))
|
|
|
|
#define BX_CPP_AttrNoReturn() __attribute__ ((noreturn))
|
|
|
|
|
2002-09-20 01:42:24 +04:00
|
|
|
#else
|
2002-10-06 18:16:23 +04:00
|
|
|
|
|
|
|
#define BX_CPP_AlignN(n) /* Not supported. */
|
|
|
|
#define BX_CPP_AttrPrintf(formatArg, firstArg) /* Not supported. */
|
|
|
|
#define BX_CPP_AttrNoReturn() /* Not supported. */
|
|
|
|
|
2002-09-19 23:17:20 +04:00
|
|
|
#endif
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
#define BX_DEBUGGER 0
|
|
|
|
#define BX_DISASM 0
|
|
|
|
|
|
|
|
#define BX_PROVIDE_CPU_MEMORY 1
|
|
|
|
#define BX_PROVIDE_DEVICE_MODELS 1
|
|
|
|
#define BX_PROVIDE_BIOS_HOOKS 1
|
|
|
|
|
|
|
|
#define BX_EMULATE_HGA_DUMPS 0
|
|
|
|
|
|
|
|
#define BX_SUPPORT_VGA 1
|
2002-03-09 01:37:06 +03:00
|
|
|
#define BX_SUPPORT_VBE 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
#define BX_PROVIDE_MAIN 1
|
|
|
|
|
|
|
|
#define BX_INSTRUMENTATION 0
|
|
|
|
|
|
|
|
#define BX_USE_LOADER 0
|
|
|
|
|
|
|
|
// for debugger, CPU simulator handle ID
|
|
|
|
// 0 is the default, for using only one CPU simulator
|
|
|
|
// 1 is for the 2nd CPU simulator
|
|
|
|
#define BX_SIM_ID 0
|
|
|
|
#define BX_NUM_SIMULATORS 1
|
|
|
|
|
|
|
|
// limited i440FX PCI support
|
|
|
|
#define BX_PCI_SUPPORT 0
|
|
|
|
|
2002-09-25 00:02:00 +04:00
|
|
|
// Promise VLBIDE DC2300 Support
|
|
|
|
#define BX_PDC20230C_VLBIDE_SUPPORT 0
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
// dynamic translation (future: not supported yet)
|
|
|
|
#define BX_DYNAMIC_TRANSLATION 0
|
|
|
|
#define BX_DYNAMIC_CPU_I386 0
|
|
|
|
#define BX_DYNAMIC_CPU_SPARC 0
|
|
|
|
|
|
|
|
#define BX_SUPPORT_FPU 0
|
2002-08-26 20:17:10 +04:00
|
|
|
#define BX_SUPPORT_MMX 0
|
2002-10-11 05:11:11 +04:00
|
|
|
#define BX_SUPPORT_SSE 0
|
|
|
|
#define BX_SUPPORT_SSE2 0
|
Integrated patches for:
- Paging code rehash. You must now use --enable-4meg-pages to
use 4Meg pages, with the default of disabled, since we don't well
support 4Meg pages yet. Paging table walks model a real CPU
more closely now, and I fixed some bugs in the old logic.
- Segment check redundancy elimination. After a segment is loaded,
reads and writes are marked when a segment type check succeeds, and
they are skipped thereafter, when possible.
- Repeated IO and memory string copy acceleration. Only some variants
of instructions are available on all platforms, word and dword
variants only on x86 for the moment due to alignment and endian issues.
This is compiled in currently with no option - I should add a configure
option.
- Added a guest linear address to host TLB. Actually, I just stick
the host address (mem.vector[addr] address) in the upper 29 bits
of the field 'combined_access' since they are unused. Convenient
for now. I'm only storing page frame addresses. This was the
simplest for of such a TLB. We can likely enhance this. Also,
I only accelerated the normal read/write routines in access.cc.
Could also modify the read-modify-write versions too. You must
use --enable-guest2host-tlb, to try this out. Currently speeds
up Win95 boot time by about 3.5% for me. More ground to cover...
- Minor mods to CPUI/MOV_CdRd for CMOV.
- Integrated enhancements from Volker to getHostMemAddr() for PCI
being enabled.
2002-09-02 00:12:09 +04:00
|
|
|
#define BX_SUPPORT_4MEG_PAGES 0
|
|
|
|
#define BX_SupportGuest2HostTLB 0
|
2002-09-02 22:44:35 +04:00
|
|
|
#define BX_SupportRepeatSpeedups 0
|
2002-09-10 07:52:32 +04:00
|
|
|
#define BX_SupportGlobalPages 0
|
2002-09-15 03:17:55 +04:00
|
|
|
#define BX_SupportPAE 0
|
2002-09-19 23:17:20 +04:00
|
|
|
#define BX_SupportICache 0
|
2002-09-23 21:59:18 +04:00
|
|
|
#define BX_SupportHostAsms 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
I integrated my hacks to get Linux/x86-64 booting. To keep
these from interfering from a normal compile here's what I did.
In config.h.in (which will generate config.h after a configure),
I added a #define called KPL64Hacks:
#define KPL64Hacks
*After* running configure, you must set this by hand. It will
default to off, so you won't get my hacks in a normal compile.
This will go away soon. There is also a macro just after that
called BailBigRSP(). You don't need to enabled that, but you
can. In many of the instructions which seemed like they could
be hit by the fetchdecode64() process, but which also touched
EIP/ESP, I inserted a macro. Usually this macro expands to nothing.
If you like, you can enabled it, and it will panic if it finds
the upper bits of RIP/RSP set. This helped me find bugs.
Also, I cleaned up the emulation in ctrl_xfer{8,16,32}.cc.
There were some really old legacy code snippets which directly
accessed operands on the stack with access_linear. Lots of
ugly code instead of just pop_32() etc. Cleaning those up,
minimized the number of instructions which directly manipulate
the stack pointer, which should help in refining 64-bit support.
2002-09-24 04:44:56 +04:00
|
|
|
|
2002-09-24 12:15:27 +04:00
|
|
|
// if 1, don't do gpf on MSRs that we don't implement
|
|
|
|
#define BX_IGNORE_BAD_MSR 0
|
|
|
|
|
I integrated my hacks to get Linux/x86-64 booting. To keep
these from interfering from a normal compile here's what I did.
In config.h.in (which will generate config.h after a configure),
I added a #define called KPL64Hacks:
#define KPL64Hacks
*After* running configure, you must set this by hand. It will
default to off, so you won't get my hacks in a normal compile.
This will go away soon. There is also a macro just after that
called BailBigRSP(). You don't need to enabled that, but you
can. In many of the instructions which seemed like they could
be hit by the fetchdecode64() process, but which also touched
EIP/ESP, I inserted a macro. Usually this macro expands to nothing.
If you like, you can enabled it, and it will panic if it finds
the upper bits of RIP/RSP set. This helped me find bugs.
Also, I cleaned up the emulation in ctrl_xfer{8,16,32}.cc.
There were some really old legacy code snippets which directly
accessed operands on the stack with access_linear. Lots of
ugly code instead of just pop_32() etc. Cleaning those up,
minimized the number of instructions which directly manipulate
the stack pointer, which should help in refining 64-bit support.
2002-09-24 04:44:56 +04:00
|
|
|
// ========================================================
|
|
|
|
// These are some very temporary hacks I made to the 64-bit
|
|
|
|
// support to help Peter with debugging etc. They will be removed
|
|
|
|
// soon and there is no configure option for them (on purpose).
|
|
|
|
// By default, they are not compiled in.
|
|
|
|
|
|
|
|
// I set this to 1 to bail in instructions which may not be honoring
|
|
|
|
// the 64-bit widths of RIP/RSP. If I trip a panic, then I clean
|
|
|
|
// the function up and remove the panic. You don't have to use
|
|
|
|
// these.
|
|
|
|
#if 0
|
|
|
|
#define BailBigRSP(s) \
|
|
|
|
if ( (RIP > 0xffffffff) || \
|
|
|
|
(RSP > 0xffffffff) ) \
|
|
|
|
BX_PANIC((s ": bailing due to big RSP value, mode==%u", \
|
|
|
|
BX_CPU_THIS_PTR cpu_mode))
|
|
|
|
#else
|
|
|
|
#define BailBigRSP(s)
|
|
|
|
#endif
|
|
|
|
// ========================================================
|
|
|
|
|
|
|
|
|
2002-09-22 20:11:12 +04:00
|
|
|
#if (BX_SUPPORT_MMX && BX_CPU_LEVEL < 5)
|
|
|
|
#error With CPU level < 5, you must disable MMX support.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (!BX_SUPPORT_FPU && BX_CPU_LEVEL >= 5)
|
|
|
|
#error With CPU level >= 5, you must enable FPU support.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU)
|
2002-10-11 05:11:11 +04:00
|
|
|
#error "MMX cannot be compiled without FPU support"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (BX_SUPPORT_SSE || BX_SUPPORT_SSE2)
|
|
|
|
#if (!BX_SUPPORT_FPU) || (!BX_SUPPORT_MMX)
|
|
|
|
#error "SSE cannot be compiled without FPU+MMX support"
|
|
|
|
#endif
|
2002-09-22 20:11:12 +04:00
|
|
|
#endif
|
|
|
|
|
2002-09-25 07:58:40 +04:00
|
|
|
#if BX_SUPPORT_X86_64
|
|
|
|
// Sanity checks to ensure that you cannot accidently use conflicting options.
|
|
|
|
|
|
|
|
#if BX_CPU_LEVEL < 5
|
|
|
|
#error X86-64 requires cpu level 6 or greater
|
|
|
|
#endif
|
|
|
|
#if !BX_SupportPAE
|
|
|
|
#error X86-64 requires Physical Address Extensions (PAE)
|
|
|
|
#endif
|
|
|
|
#if !BX_SupportGlobalPages
|
|
|
|
#error X86-64 requires Page Global Extension (PGE)
|
|
|
|
#endif
|
|
|
|
#if !BX_SUPPORT_4MEG_PAGES
|
|
|
|
#error X86-64 requires Page Size Extension (PSE)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2001-11-11 08:43:12 +03:00
|
|
|
#define BX_HAVE_GETENV 0
|
2001-04-10 05:04:59 +04:00
|
|
|
#define BX_HAVE_SELECT 0
|
2001-04-10 05:50:00 +04:00
|
|
|
#define BX_HAVE_SNPRINTF 0
|
|
|
|
#define BX_HAVE_STRTOULL 0
|
2001-05-17 10:59:23 +04:00
|
|
|
#define BX_HAVE_STRTOUQ 0
|
2001-04-10 05:59:07 +04:00
|
|
|
#define BX_HAVE_STRDUP 0
|
2001-06-12 07:37:55 +04:00
|
|
|
#define BX_HAVE_STRUCT_TIMEVAL 0
|
2002-09-26 06:36:04 +04:00
|
|
|
#define BX_HAVE_COLOR_SET 0 // used in term gui
|
2001-04-10 05:50:00 +04:00
|
|
|
|
|
|
|
// set if your compiler does not permit an empty struct
|
|
|
|
#define BX_NO_EMPTY_STRUCTS 0
|
|
|
|
|
|
|
|
// set if your compiler does not understand __attribute__ after a struct
|
|
|
|
#define BX_NO_ATTRIBUTES 0
|
|
|
|
#if BX_NO_ATTRIBUTES
|
|
|
|
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
|
|
|
#else
|
|
|
|
#define GCC_ATTRIBUTE __attribute__
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// set if your compiler does not allow label at the end of a {} block
|
|
|
|
#define BX_NO_BLANK_LABELS 0
|
|
|
|
|
|
|
|
// set if you don't have <hash_map.h>, used in debug/dbg_main.c
|
|
|
|
#define BX_HAVE_HASH_MAP 0
|
2001-04-10 05:04:59 +04:00
|
|
|
|
|
|
|
// Support x86 hardware debugger registers and facilites.
|
|
|
|
// These are the debug facilites offered by the x86 architecture,
|
|
|
|
// not the optional built-in debugger.
|
|
|
|
#define BX_X86_DEBUGGER 0
|
|
|
|
|
|
|
|
#define BX_SUPPORT_CDROM 0
|
|
|
|
|
|
|
|
#if BX_SUPPORT_CDROM
|
|
|
|
// This is the C++ class name to use if we are supporting
|
|
|
|
// low-level CDROM.
|
|
|
|
# define LOWLEVEL_CDROM cdrom_interface
|
|
|
|
#endif
|
|
|
|
|
2001-05-23 04:46:47 +04:00
|
|
|
// NE2K network emulation
|
|
|
|
#define BX_NE2K_SUPPORT 0
|
2001-06-14 02:28:17 +04:00
|
|
|
#define BX_ETH_NULL_LOGGING 1
|
2001-06-19 20:09:13 +04:00
|
|
|
#define BX_ETH_FBSD_LOGGING 1
|
2001-05-23 04:46:47 +04:00
|
|
|
|
2002-09-02 01:22:43 +04:00
|
|
|
// determine which NE2K packet mover modules will be enabled
|
|
|
|
// (this was moved from iodev/eth.h)
|
|
|
|
#define ETH_NULL 1
|
|
|
|
#ifdef BX_USE_ETH_ARPBACK
|
|
|
|
# define ETH_ARPBACK 1
|
|
|
|
#endif
|
|
|
|
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
|
|
|
#define ETH_FBSD 1
|
|
|
|
#endif
|
|
|
|
#if defined(linux)
|
|
|
|
#define ETH_LINUX 1
|
|
|
|
#endif
|
|
|
|
#if defined(WIN32)
|
|
|
|
#define ETH_WIN32 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// this enables Ethertap packet mover; determined by configure script
|
|
|
|
#define HAVE_ETHERTAP 0
|
|
|
|
|
|
|
|
// this enables TUN/TAP packet mover; determined by configure script
|
|
|
|
#define HAVE_TUNTAP 0
|
|
|
|
|
|
|
|
|
2001-09-14 18:51:26 +04:00
|
|
|
// I/O Interface to debug
|
|
|
|
#define BX_IODEBUG_SUPPORT 0
|
|
|
|
|
2002-09-12 11:16:37 +04:00
|
|
|
// External Debugger
|
|
|
|
#define BX_EXTERNAL_DEBUGGER 0
|
2002-09-23 19:28:16 +04:00
|
|
|
#define BX_OVERRIDE_ASK 0
|
2002-09-12 11:16:37 +04:00
|
|
|
|
2002-08-28 12:29:19 +04:00
|
|
|
#ifdef WIN32
|
2002-08-28 19:26:09 +04:00
|
|
|
#define BX_FLOPPY0_NAME "Floppy Disk A:"
|
|
|
|
#define BX_FLOPPY1_NAME "Floppy Disk B:"
|
|
|
|
#define BX_HARD_DISK0_NAME "Hard Disk C:"
|
|
|
|
#define BX_HARD_DISK1_NAME "Hard Disk D:"
|
2002-08-30 10:47:21 +04:00
|
|
|
#define BX_CDROM_NAME "CD-ROM D:"
|
2002-08-28 12:29:19 +04:00
|
|
|
#else
|
2002-08-28 19:26:09 +04:00
|
|
|
#define BX_FLOPPY0_NAME "Floppy Disk 0"
|
|
|
|
#define BX_FLOPPY1_NAME "Floppy Disk 1"
|
|
|
|
#define BX_HARD_DISK0_NAME "Hard Disk 0"
|
|
|
|
#define BX_HARD_DISK1_NAME "Hard Disk 1"
|
2002-08-30 10:47:21 +04:00
|
|
|
#define BX_CDROM_NAME "CD-ROM"
|
2002-08-28 12:29:19 +04:00
|
|
|
#endif
|
|
|
|
|
2002-09-01 19:38:29 +04:00
|
|
|
// This is handy for certain performance testing purposes, but otherwise
|
|
|
|
// totally useless. If you define BX_SCHEDULED_DIE_TIME then it enables code
|
|
|
|
// in bx_pit_c::periodic that will cause Bochs to exit() after a certain number
|
|
|
|
// of instructions.
|
|
|
|
//#define BX_SCHEDULED_DIE_TIME 1162230000 // end of redhat6.0 boot
|
|
|
|
|
2001-04-10 05:04:59 +04:00
|
|
|
#endif // _BX_CONFIG_H
|