Skip to content

Commit

Permalink
distribution patches
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@44 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
bellard committed Mar 23, 2003
1 parent b03c60f commit 3ef693a
Show file tree
Hide file tree
Showing 18 changed files with 515 additions and 88 deletions.
339 changes: 339 additions & 0 deletions COPYING

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version 0.1:

- initial public release.
43 changes: 25 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,33 @@ endif

DEFINES+=-D_GNU_SOURCE
LDSCRIPT=$(ARCH).ld
LIBS+=-ldl -lm
LIBS+=-lm

# profiling code
ifdef TARGET_GPROF
LDFLAGS+=-p
main.o: CFLAGS+=-p
endif

OBJS= elfload.o main.o thunk.o syscall.o signal.o libgemu.a
OBJS= elfload.o main.o syscall.o signal.o
SRCS:= $(OBJS:.o=.c)
OBJS+= libqemu.a

LIBOBJS+=translate-i386.o op-i386.o exec-i386.o
LIBOBJS+=thunk.o translate-i386.o op-i386.o exec-i386.o
# NOTE: the disassembler code is only needed for debugging
LIBOBJS+=i386-dis.o dis-buf.o
SRCS = $(OBJS:.o=.c)

all: gemu
all: qemu qemu-doc.html

gemu: $(OBJS)
qemu: $(OBJS)
$(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS)

depend: $(SRCS)
$(CC) -MM $(CFLAGS) $^ 1>.depend

# libgemu
# libqemu

libgemu.a: $(LIBOBJS)
libqemu.a: $(LIBOBJS)
rm -f $@
$(AR) rcs $@ $(LIBOBJS)

Expand All @@ -73,36 +74,42 @@ op-i386.o: op-i386.c opreg_template.h ops_template.h

clean:
$(MAKE) -C tests clean
rm -f *.o *.a *~ gemu dyngen TAGS
rm -f *.o *.a *~ qemu dyngen TAGS

distclean: clean
rm -f config.mak config.h

install: gemu
install -m755 -s gemu $(prefix)/bin
install: qemu
install -m 755 -s qemu $(prefix)/bin

# various test targets
test speed: gemu
test speed: qemu
make -C tests $@

TAGS:
etags *.[ch] i386/*.[ch]

# documentation
qemu-doc.html: qemu-doc.texi
texi2html -monolithic -number $<

FILES= \
COPYING.LIB dyngen.c ioctls.h ops_template.h syscall_types.h\
README COPYING COPYING.LIB TODO Changelog VERSION \
dyngen.c ioctls.h ops_template.h syscall_types.h\
Makefile elf.h linux_bin.h segment.h thunk.c\
TODO elfload.c main.c signal.c thunk.h\
cpu-i386.h gemu.h op-i386.c opc-i386.h syscall-i386.h translate-i386.c\
elfload.c main.c signal.c thunk.h\
cpu-i386.h qemu.h op-i386.c opc-i386.h syscall-i386.h translate-i386.c\
dis-asm.h gen-i386.h op-i386.h syscall.c\
dis-buf.c i386-dis.c opreg_template.h syscall_defs.h\
i386.ld ppc.ld exec-i386.h exec-i386.c configure VERSION \
i386.ld ppc.ld exec-i386.h exec-i386.c configure \
tests/Makefile\
tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h\
tests/test-i386-muldiv.h tests/test-i386-code16.S\
tests/hello.c tests/hello tests/sha1.c \
tests/testsig.c tests/testclone.c tests/testthread.c
tests/testsig.c tests/testclone.c tests/testthread.c \
qemu-doc.texi qemu-doc.html

FILE=gemu-$(VERSION)
FILE=qemu-$(VERSION)

tar:
rm -rf /tmp/$(FILE)
Expand Down
27 changes: 27 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The QEMU x86 emulator
---------------------

INSTALLATION
------------

Type

./configure
make

to build qemu and libqemu.a.

Type

make install

to install qemu in /usr/local/bin


Documentation
-------------

Read the documentation in qemu-doc.html.


Fabrice Bellard.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1
16 changes: 8 additions & 8 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# gemu configure script (c) 2003 Fabrice Bellard
# qemu configure script (c) 2003 Fabrice Bellard
#
# set temporary file name
if test ! -z "$TMPDIR" ; then
Expand All @@ -11,11 +11,11 @@ else
TMPDIR1="/tmp"
fi

TMPC="${TMPDIR1}/gemu-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/gemu-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/gemu-conf-${RANDOM}-$$-${RANDOM}"
TMPS="${TMPDIR1}/gemu-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/gemu-conf-${RANDOM}-$$-${RANDOM}.h"
TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
TMPH="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.h"

# default parameters
prefix="/usr/local"
Expand Down Expand Up @@ -195,7 +195,7 @@ echo "# Automatically generated by configure - do not modify" > config.mak
echo "/* Automatically generated by configure - do not modify */" > $TMPH

echo "prefix=$prefix" >> config.mak
echo "#define CONFIG_GEMU_PREFIX \"$prefix\"" >> $TMPH
echo "#define CONFIG_QEMU_PREFIX \"$prefix\"" >> $TMPH
echo "MAKE=$make" >> config.mak
echo "CC=$cc" >> config.mak
echo "GCC_MAJOR=$gcc_major" >> config.mak
Expand Down Expand Up @@ -227,7 +227,7 @@ fi
echo -n "VERSION=" >>config.mak
head $source_path/VERSION >>config.mak
echo "" >>config.mak
echo -n "#define GEMU_VERSION \"" >> $TMPH
echo -n "#define QEMU_VERSION \"" >> $TMPH
head $source_path/VERSION >> $TMPH
echo "\"" >> $TMPH
if test "$network" = "yes" ; then
Expand Down
20 changes: 18 additions & 2 deletions cpu-i386.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
/* NOTE: this header is included in op-i386.c where global register
variable are used. Care must be used when including glibc headers.
/*
* i386 virtual CPU header
*
* Copyright (c) 2003 Fabrice Bellard
*
* 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.
*
* 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.
*
* 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
*/
#ifndef CPU_I386_H
#define CPU_I386_H
Expand Down
22 changes: 11 additions & 11 deletions exec-i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
*
* Copyright (c) 2003 Fabrice Bellard
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* 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.
*
* This program 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 General Public License for more details.
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* 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
*/
#include "exec-i386.h"

Expand Down
21 changes: 19 additions & 2 deletions exec-i386.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
/* i386 execution defines */

/*
* i386 execution defines
*
* Copyright (c) 2003 Fabrice Bellard
*
* 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.
*
* 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.
*
* 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
*/
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
Expand Down
2 changes: 1 addition & 1 deletion linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>

#include "gemu.h"
#include "qemu.h"

#include "linux_bin.h"
#include "elf.h"
Expand Down
10 changes: 5 additions & 5 deletions linux-user/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* gemu main
* qemu main
*
* Copyright (c) 2003 Fabrice Bellard
*
Expand All @@ -24,11 +24,11 @@
#include <errno.h>
#include <unistd.h>

#include "gemu.h"
#include "qemu.h"

#include "cpu-i386.h"

#define DEBUG_LOGFILE "/tmp/gemu.log"
#define DEBUG_LOGFILE "/tmp/qemu.log"

FILE *logfile = NULL;
int loglevel;
Expand Down Expand Up @@ -171,8 +171,8 @@ void cpu_loop(struct CPUX86State *env)

void usage(void)
{
printf("gemu version " GEMU_VERSION ", Copyright (c) 2003 Fabrice Bellard\n"
"usage: gemu [-d] program [arguments...]\n"
printf("qemu version " QEMU_VERSION ", Copyright (c) 2003 Fabrice Bellard\n"
"usage: qemu [-d] program [arguments...]\n"
"Linux x86 emulator\n"
);
exit(1);
Expand Down
4 changes: 1 addition & 3 deletions linux-user/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#include <errno.h>
#include <sys/ucontext.h>

#include "gemu.h"

/* signal handling inspired from em86. */
#include "qemu.h"

//#define DEBUG_SIGNAL

Expand Down
2 changes: 1 addition & 1 deletion linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <linux/soundcard.h>
#include <linux/dirent.h>

#include "gemu.h"
#include "qemu.h"

//#define DEBUG

Expand Down
22 changes: 11 additions & 11 deletions op-i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
*
* Copyright (c) 2003 Fabrice Bellard
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* 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.
*
* This program 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 General Public License for more details.
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* 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
*/
#include "exec-i386.h"

Expand Down
6 changes: 3 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TESTS=testclone testsig testthread sha1-i386 test-i386
endif
TESTS+=sha1

GEMU=../gemu
QEMU=../qemu

all: $(TESTS)

Expand All @@ -34,7 +34,7 @@ test: test-i386
ifeq ($(ARCH),i386)
./test-i386 > test-i386.ref
endif
$(GEMU) test-i386 > test-i386.out
$(QEMU) test-i386 > test-i386.out
@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi

# speed test
Expand All @@ -46,7 +46,7 @@ sha1: sha1.c

speed: sha1 sha1-i386
time ./sha1
time $(GEMU) ./sha1-i386
time $(QEMU) ./sha1-i386

clean:
rm -f *~ *.o $(TESTS)
Loading

0 comments on commit 3ef693a

Please sign in to comment.