Commit Graph

46 Commits

Author SHA1 Message Date
Kevin Lawton b742ccec7e Changed eflags accessors for get_?F() to use (val32 & (1<<N)) instead
of (1 & (val32>>N)), and added a getB_?F() accessor for special
  cases which need a strict binary value (exactly 0 or 1).  Most
  code only needed a value for logical comparison.  I modified the
  special cases which do need a binary number for shifting and
  comparison between flags, to use the special getB_?F() accessor.

Cleaned up memory.cc functions a little, now that all accesses
  are within a single page.

Fixed a (not very likely encountered) bug in fetchdecode.cc (and
  fetchdecode64.cc) where a 2-byte opcode starting with a prefix
  starts at the last offset on a page.  There were no checks
  on the segment overrides for a boundary condition.  I added them.

The eflags enhancements added just a tiny bit of performance.
2002-09-22 18:22:24 +00:00
Jeroen Janssen 53723a8569 hopefully solved bugreport [ 612741 ] VBE mem conflicts w/ local APIC address 2002-09-22 11:31:48 +00:00
Kevin Lawton 0cd7346b9c - Added an instruction cache. Size is fixed for the moment,
but if you hand edit cpu/cpu.h, and change BxICacheEntries,
  you can try different sizes.  I'll make this more flexible
  with configure.  For now, use "--enable-icache" with no parameters.

- Modified fetchdecode.cc/fetchdecode64.cc just enough so that
  instructions which encode a direct address now use a memory
  resolution function which just sticks the immediate address
  into rm_addr.  With cached instructions we need this.
2002-09-19 19:17:20 +00:00
Bryce Denney 4e091e37ea - the constructors for BX_MEM_C did not always init vector and actual_vector
to NULL.  If actual_vector points to junk when alloc_vector_aligned
  is called, it will try to free the junk, leading to memory corruption
  or crashes.
2002-09-18 05:28:55 +00:00
Kevin Lawton f0c9896964 Now, when you compile with --enable-guest2host-tlb, non-paged
mode uses the notion of the guest-to-host TLB.  This has the
benefit of allowing more uniform and streamlined acceleration
code in access.cc which does not have to check if CR0.PG
is set, eliminating a few instructions per guest access.
Shaved just a little off execution time, as expected.

Also, access_linear now breaks accesses which span two pages,
into two calls the the physical memory routines, when paging
is off, just like it always has for paging on.  Besides
being more uniform, this allows the physical memory access
routines to known the complete data item is contained
within a single physical page, and stop reapplying the
A20ADDR() macro to pointers as it increments them.
Perhaps things can be optimized a little more now there too...
I renamed the routines to {read,write}PhysicalPage() as
a reminder that these routines now operate on data
solely within one page.

I also added a little code so that the paging module is
notified when the A20 line is tweaked, so it can dump
whatever mappings it wants to.
2002-09-05 02:31:24 +00:00
Bryce Denney 7b157bbf43 - remove panic condition "memory not suitably aligned" and replace with
an allocation scheme that is guaranteed to return a block that is
  aligned correctly.
- Kevin asked me to go ahead and align the memory to 4k page boundaries,
  so I did.  If we need to change this, just change BX_MEM_VECTOR_ALIGN
  in memory/memory.h (now 4096).
2002-09-04 02:11:33 +00:00
Bryce Denney 31b30d562e - if ROM image could not be opened, we were doing a BX_INFO and then
a BX_EXIT.  I changed it to BX_PANIC followed by a return (just in case
  the user continues) to be more consistent with how everything else works.
2002-09-03 16:44:33 +00:00
Kevin Lawton 3d8e5f8b61 Removed the BX_FETCHDECODE_CACHE mods, and the patch that
Bryce created for use of ensuring all mods were removed
cleanly.
2002-09-01 23:02:36 +00:00
Kevin Lawton 3a5f338419 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-01 20:12:09 +00:00
Volker Ruppert e1d8d30e4c - meaning of the memory type values changed (0 = ROM, 1 = Shadow RAM)
- the functions mapRead() and mapWrite() are no longer necessary
2002-08-31 15:35:51 +00:00
Volker Ruppert 38666a2cfb - PCI memory handling moved to bx_mem_c
* shadow RAM array and fetch function are now a part of the memory code
  * removed unnecessary PCI macros and functions load_ROM() and mem_read()
2002-08-31 12:24:41 +00:00
Volker Ruppert 86969b7892 - macro BX_PCI_MEM_READ() must be used in function dbg_fetch_mem() too 2002-08-18 08:53:26 +00:00
Volker Ruppert 18dc3833a9 - reverted a change in the 'else' section of the load_ROM() function 2002-08-17 09:46:27 +00:00
Volker Ruppert 46093f8a88 - i440fx structure is now a private member of bx_pci_c
- PCI configuration space of the host bridge renamed from array[] to pci_conf[]
- new functions load_ROM() and mem_read() for ROM access
- macros for PCI functions defined in bochs.h
2002-08-17 09:23:42 +00:00
Mike Lerwill b941089156 Minor change to allow load to be called with an empty path (and do nothing) 2002-07-03 17:13:29 +00:00
Gregory Alexander 5d7c6627fd I botched the linked list implementation pretty badly.
Kudos to TLD for fixing it for me.
2002-06-06 23:03:09 +00:00
Gregory Alexander 1be5b1d46c Added a linked list to further speed up icache invalidates.
These should be pretty snappy now.  It's time to generate
some actual statistics.

 Modified Files:
 	cpu/cpu.cc cpu/cpu.h cpu/init.cc memory/memory.cc
2002-06-05 21:51:30 +00:00
Gregory Alexander c41505e342 Added a RPN directory for the cache to help make invalidates
faster.  Hopefully this won't slow things down too much.

 	config.h.in cpu/cpu.cc cpu/cpu.h memory/memory.cc
2002-06-05 03:59:31 +00:00
Gregory Alexander fda1b874e9 Check in FETCHDECODE Caching, with changes.
Specific changes from the patch:

1.) renamed fdcache_eip to fdcache_ip, as it is using
the RIP instead of the EIP.

2.) added a Boolean array fdcache_is32 which uses is32
to determine icache hits.  Otherwise we could run 32-bit
code as 16-bit or vice versa.


 Modified Files:
 	config.h.in cpu/cpu.cc cpu/cpu.h memory/memory.cc
2002-06-03 22:39:11 +00:00
Bryce Denney 30aaf4088e - commit patch.wxwindows.gz in the main branch. Now you can try out
the wxwindows interface by just "configure --with-wx; make"

  Modified Files:
    Makefile.in bochs.h config.h.in configure configure.in
    load32bitOShack.cc logio.cc main.cc cpu/cpu.cc cpu/cpu.h
    debug/dbg_main.cc gui/Makefile.in gui/control.cc gui/gui.cc
    gui/siminterface.cc gui/siminterface.h gui/x.cc iodev/cdrom.cc
    iodev/keyboard.cc memory/misc_mem.cc
  Added Files:
    README-wxWindows wxbochs.rc gui/wx.cc gui/wxmain.cc
    gui/wxmain.h gui/bitmaps/cdromd.xpm
    gui/bitmaps/configbutton.xpm gui/bitmaps/copy.xpm
    gui/bitmaps/floppya.xpm gui/bitmaps/floppyb.xpm
    gui/bitmaps/mouse.xpm gui/bitmaps/paste.xpm
    gui/bitmaps/power.xpm gui/bitmaps/reset.xpm
    gui/bitmaps/snapshot.xpm
  Removed Files:
    patches/patch.wxwindows.gz
2002-04-18 00:22:20 +00:00
Bryce Denney dcc6df2f1e - fixed several instances where we had "delete array" but we needed
"delete [] array".  This led to memory leaks.  Thanks, valgrind.
2002-04-09 20:12:39 +00:00
Jeroen Janssen 8cfa8a3bba - applying patches/patch.vbe-lfb to bochs cvs tree 2002-04-03 16:48:15 +00:00
instinc 60f8987263 registers the address of the watchpoint caught to be displayed in the debugger 2002-04-01 04:43:26 +00:00
Bryce Denney fea759a204 - apply patch.pci from Volker Ruppert. See
[ #481546 ] pci patch (Volker Ruppert) for any followups.
2001-11-14 01:39:22 +00:00
Bryce Denney b0f829ecda - fix silly output problem that caused it to print "0 megs" all the time 2001-11-11 05:07:05 +00:00
Bryce Denney c99f9aa8ef - use @CPP_SUFFIX@ substitution to get the dependencies right for nmake too 2001-10-07 20:19:04 +00:00
Bryce Denney 8a21b1a9d6 - apply patches/patch.add-makefile-deps. I have added dependencies
which were generated with gcc -MM to the end of each Makefile.in
  so that make understands which files depend on which.  Basically,
  everything depends on bochs.h, which depends on everything, which
  is not ideal.
2001-10-07 00:33:21 +00:00
Bryce Denney daf2a9fb55 - add RCS Id to header of every file. This makes it easier to know what's
going on when someone sends in a modified file.
2001-10-03 13:10:38 +00:00
instinc b3ad392c65 Added support for I/O Interface to the debugger and the memory range monitoring 2001-09-14 23:02:56 +00:00
Bryce Denney f04e6fe346 - apply VPATH patch from Edouard G. Parmelan, posted to list on September 1 2001-09-14 04:19:08 +00:00
Todd T.Fries 28885e4973 some INFO->DEBUG/ERROR cleanups 2001-08-31 16:06:32 +00:00
Todd T.Fries 4f1c151520 Move Init $ to ::init() 2001-06-27 20:27:49 +00:00
Todd T.Fries a06b031dcf setprefix -> put 2001-06-27 19:16:01 +00:00
Bryce Denney 80a7541fed - used grep to search for more instances of new bx_options problems that
I have introduced, and fixed a lot.
2001-06-21 14:56:43 +00:00
Todd T.Fries 12985edb26 setprefix now uses a variable length name as a string for an argument 2001-06-19 21:36:09 +00:00
Bryce Denney f822257511 - there were cases where BX_APIC_SUPPORT were used and others where
BX_SUPPORT_APIC were used.  To follow the pattern used by other
  names like this, I changed them all to BX_SUPPORT_APIC.
  Thanks to Tom Lindström for chasing this down!
2001-06-12 13:07:43 +00:00
Bryce Denney 565fa8ea8e - another speed boost: when not using SMP, use
BX_CPU_C bx_cpu;
     BX_MEM_C bx_mem;
  and when more than one processor, use
     BX_CPU_C    *bx_cpu_array[BX_SMP_PROCESSORS];
     BX_MEM_C    *bx_mem_array[BX_ADDRESS_SPACES];
  The changeover is controlled by BX_SMP_PROCESSORS, but there are only
  a few code changes since nearly all code uses the BX_CPU(n) and BX_MEM(n)
  macros.
- This turns out to make a 10% speed difference!  With this revision,
  the CVS version now gets 95% of the performance of the 3/25/2000
  snapshot, which I've been using as my baseline.
2001-06-05 17:35:08 +00:00
Todd T.Fries 2bbb1ef8eb strip '\n' from BX_{INFO,DEBUG,ERROR,PANIC}
don't need it, moved the output of it into the general io functions.
saves space, as well as removes the confusing output if a '\n' is left off
2001-05-30 18:56:02 +00:00
Todd T.Fries e291dd17d4 demote BX_INFO to BX_ERROR 2001-05-25 22:17:51 +00:00
Todd T.Fries aa8081aff3 cleanup output more 2001-05-24 14:08:54 +00:00
Bryce Denney 564ca0a857 - within BX_MEM_C member functions, use reference to local data instead of
going out to BX_MEM to get it.
- outside of BX_CPU_C, use BX_CPU(n) instead of BX_CPU_THIS_PTR
- add memory-mapped I/O APIC and local APICs.
2001-05-23 08:02:15 +00:00
Bryce Denney d7d75a7bdc - changed some messages from BX_INFO to BX_DEBUG so that they wouldn't
show up by default.
2001-05-22 18:48:31 +00:00
Todd T.Fries a3d6cc1941 have the memory show the sim_id in the prefix, instead of adding (0) to the
log
2001-05-15 15:21:19 +00:00
Todd T.Fries bdb89cd364 merge in BRANCH-io-cleanup.
To see the commit logs for this use either cvsweb or
cvs update -r BRANCH-io-cleanup and then 'cvs log' the various files.

In general this provides a generic interface for logging.

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

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

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

Comments, bugs, flames, to me: todd@fries.net
2001-05-15 14:49:57 +00:00
Bryce Denney a6fef54678 - update copyright dates to 2001 for all mandrake headers
- for bochs files with other header, replaced with current mandrake header
2001-04-10 02:20:02 +00:00
cvs beff63eb32 - entered original Bochs snapshot bochs-2000_0325a.tar.gz from
ftp.bochs.com
2001-04-10 01:04:59 +00:00