A just-in-time compiler for MIT 6.004's "Beta" processor.
C++ C Assembly Perl Shell Makefile Python
Permalink
Failed to load latest commit information.
tests Add a test case for faulting on LDR. Aug 7, 2012
uasm uasm: Align size of ROM to 4-byte boundary Jun 1, 2011
.gitignore Makefile: Add implicit header and make-variable dependencies. Jun 26, 2012
.travis.yml
COPYING Add COPYING and README Jul 4, 2008
Makefile
Makefile.lib Makefile: Add implicit header and make-variable dependencies. Jun 26, 2012
README Update source link. Jan 20, 2009
SConstruct Default to -O2, since I'm now thinking about performance Jul 2, 2008
TODO Remove two TODO items. Apr 16, 2009
arch.h Darwin i386 fixes Mar 12, 2015
bclock.cpp Convert beta_cpu into a C++ class. Nov 29, 2010
bclock.h Implement timer interrupts. Currently only supported from emulated code. Jun 30, 2008
bconsole.cpp Merge branch 'master' into cpp Jun 1, 2011
bconsole.h Compile with -Wall and fix all the warnings it reports. Jul 4, 2008
bcpu.cpp Convert beta_cpu into a C++ class. Nov 29, 2010
bcpu.h Make explicit that PC_SUPERVISOR is a 32-bit quantity. Aug 2, 2012
bdecode.cpp Convert codebase to be legal C++ Nov 29, 2010
bdecode.h OS X support for amd64. Mar 10, 2015
bemu.cpp OS X support for amd64. Mar 10, 2015
bemu.h ASSERT(): abort() on failure to assist debugging. Aug 2, 2012
bt.cpp Remaining 32-bit Darwin fixes. Mar 12, 2015
bt.h OS X support for amd64. Mar 10, 2015
bt_helper_32.S Remaining 32-bit Darwin fixes. Mar 12, 2015
bt_helper_64.S OS X support for amd64. Mar 10, 2015
insts.pl Rip out old codegen macros. Nov 29, 2010
run-tests.sh Add a test case for faulting on LDR. Aug 7, 2012
x86.h Switch around the order of arguments to create a SIB reference. Aug 7, 2012

README

This code implements a working Just-In-Time binary translator from the
Beta [1] processor to the i386. It supports clock and keyboard
interrupts, and correctly executes lab6.uasm, bench[1-4].uasm, and
litmus.uasm, as well as Lab 8's operating system [2].

This source is canonically available from github at
<http://github.com/nelhage/bemu/>.

It should work on just about any modern Linux or Intel OS X system,
although it's better tested on Linux. I've tested it on Athena and it
works fine there.

To run the self-tests, `make test'; To run the lab8 OS, `make
run-lab8'.

It alsos includes a somewhat hacked version of `uasm' from
http://web.mit.edu/6.004/src/posix-src/uasm/, modified to deal with
relative includes slightly better, and to support arbitrary-sized
ROMs.

[1] http://6004.csail.mit.edu/currentsemester/handouts/beta.pdf
[2] http://web.mit.edu/6.004/bsim/lab8.uasm