head	1.7;
access;
symbols;
locks; strict;
comment	@# @;


1.7
date	2002.04.24.02.57.15;	author jm;	state Exp;
branches;
next	1.6;

1.6
date	2002.04.12.01.51.29;	author jm;	state Exp;
branches;
next	1.5;

1.5
date	2002.04.11.17.50.22;	author jm;	state Exp;
branches;
next	1.4;

1.4
date	2002.04.11.17.34.35;	author jm;	state Exp;
branches;
next	1.3;

1.3
date	2002.04.06.16.05.44;	author jm;	state Exp;
branches;
next	1.2;

1.2
date	2002.04.05.00.35.14;	author jm;	state Exp;
branches;
next	1.1;

1.1
date	2002.04.03.00.47.05;	author jm;	state Exp;
branches;
next	;


desc
@@


1.7
log
@
I moved the virtual memory manager to its own cc/h file pair.  I fixed
the interrupt handling for the page fault exception to actually
realize an error code has been pushed onto the stack, and pop it into
a global (for later examination by C++ handler), and thus also fix up
the stack which was giving me a GPF on top of the page fault because I
had failed to maintain good stack discipline (duh/whoops).  I can now
allocate address spaces (say, for e3 memory), unbacked by physical
pages, and commit the physical pages upon demand.  This includes
invalidating the TLB associated with the page.  I have yet to add the
requisite error-checking using the "available" bits in the page table
entries.  However, it seems to work for the pathetic, hard-coded test
I have written.  I shall clean this up (a non-trivial task) and
hopefully make it much simpler and clearer once I get rid of all the
ugly ifdefed test code.
@
text
@.KEEP_STATE:

NASM = nasm
#NASMOPTIONS = -f elf 
NASMOPTIONS = -f aout

ETHER_SOURCES = \
 head_ether.s86 \
 jjetherboot.cc
ETHER_HEADERS = \
 jjetherboot.h
ETHER_PRE_OBJECTS = \
 head_ether.o \
 jjidt.o
ETHER_POST_OBJECTS = \
 jjetherboot.o


GRUB_SOURCES = \
 head_grub.s86 \
 jjmultiboot.cc
GRUB_HEADERS = \
 jjmultiboot.h
GRUB_PRE_OBJECTS = \
 head_grub.o \
 jjidt.o
GRUB_POST_OBJECTS = \
 jjmultiboot.o


TARGET_HEADERS = \
 builtins.h \
 fstream.h \
 iostream.h \
 jj386int.h \
 jjconsole.h \
 jjeflags.h \
 jjfb.h \
 jjidtent.h \
 jjmachin.h \
 jjtimer.h \
 jjvm.h \
 stdio.h \
 stdlib.h \
 streambuf.h

TARGET_SOURCES = \
 builtins.cc \
 entry.cc \
 fstream.cc \
 iostream.cc \
 jj386int.cc \
 jjconsol.cc \
 jjeflags.cc \
 jjfb.cc \
 jjidtent.cc \
 jjmachin.cc \
 jjfinfo.cc \
 jjvinfo.cc \
 jjtimer.cc \
 jjvm.cc \
 stdio.cc \
 stdlib.cc

TARGET_OBJECTS = $(TARGET_SOURCES:.cc=.o)

%.o : %.cc
	$(CC) $(CFLAGS) -c $<

%.o : %.s86
	$(NASM) $(NASMOPTIONS) -o $*.o -l $*.txt $*.s86

CC = g++
IFLAGS = -I. -I../../common -I../../
# The problem here is if anything aside from
# entry.cc depends on ETHERBOOT or MULTIBOOT
# being defined; this current solution is a hack,
# because it also requires manually undefining
# all the other alternatives.  *sigh*
# -fno-exceptions
CFLAGS = \
 -Wall -fno-builtin -fno-exceptions \
 -DPARANOID \
 $(IFLAGS) \
 -DETHERBOOT

# -DETHERBOOT \

OBJCOPY_OPTIONS = -O binary
OBJDUMP_OPTIONS = -b binary --architecture=i386 --disassemble-all 

MKNBI = mke3nbi

NBIIMAGE = jjos-nbi
BINARYIMAGE = jjos-binary
ELFIMAGE = jjos-elf
GRUBIMAGE = jjos-grub

JAVAC = javac

all: $(NBIIMAGE)

include ../../common/Makefile
include ../../common/Makefile.gc
include ../../Makefile.inc

TARGET_SOURCE_FILES = \
 $(TARGET_HEADERS) \
 $(TARGET_SOURCES) \
 $(ETHER_HEADERS) \
 $(ETHER_SOURCES) \
 $(GRUB_SOURCES) \
 $(GRUB_HEADERS)

ALL_SOURCE_FILES = \
 $(TARGET_SOURCE_FILES) \
 $(COMMON_SOURCES) \
 $(GC_SOURCES) \
 $(E3_SOURCES)

OBJECTS = $(ASM_OBJECTS) $(TARGET_OBJECTS) $(COMMON_OBJECTS) $(GC_OBJECTS) $(E3_OBJECTS)

###########
# ETHERBOOT
ETHER_OBJECTS = $(ETHER_PRE_OBJECTS) $(OBJECTS) $(ETHER_POST_OBJECTS)

$(NBIIMAGE): $(BINARYIMAGE) Makefile mke3nbi
#	$(MKNBI) < $(BINARYIMAGE) > $(NBIIMAGE)
	$(MKNBI) 
	cp $(NBIIMAGE) /tftpboot/

$(BINARYIMAGE): $(ELFIMAGE) Makefile
	objcopy $(OBJCOPY_OPTIONS) $(ELFIMAGE) $(BINARYIMAGE)

$(ELFIMAGE): $(ETHER_OBJECTS) Makefile
#	@@echo compiling entry.cc ...
#	$(CC) $(CFLAGS) -UMULTIBOOT -DETHERBOOT -c -o entry.o entry.cc
#	@@echo ... done.  building etherboot image...
	ld -Bstatic -m elf_i386 -Ttext 11000 -e _start -o $(ELFIMAGE) $(ETHER_OBJECTS)
	@@echo ... done.


###########
# MULTIBOOT

GRUB_OBJECTS = $(GRUB_PRE_OBJECTS) $(OBJECTS) $(GRUB_POST_OBJECTS)

$(GRUBIMAGE): $(GRUB_OBJECTS) entry.cc Makefile
	@@echo compiling entry.cc ...
	$(CC) $(CFLAGS) -UETHERBOOT -DMULTIBOOT -c -o entry.o entry.cc
	@@echo ... done.  building grub image...
	ld -Bstatic -m elf_i386 -Ttext 100000 -e _start -o $(GRUBIMAGE) entry.o $(GRUB_OBJECTS)
	@@echo ... done.

##############
# MISCELANEOUS

depend.mk: $(ALL_SOURCE_FILES)
	makedepend -f depend.mk -o o $(IFLAGS) $(ALL_SOURCE_FILES)

Makefile: depend.mk

#depend:
#	makedepend -f depend.mk -o o $(IFLAGS) $(ALL_SOURCE_FILES)

native : $(OBJECTS) $(ETHER_PRE_OBJECTS) $(GRUB_PRE_OBJECTS) $(ETHER_POST_OBJECTS) $(GRUB_POST_OBJECTS)

native_clean:
	rm -f $(OBJECTS) $(ETHER_PRE_OBJECTS) $(GRUB_PRE_OBJECTS) $(ETHER_POST_OBJECTS) $(GRUB_POST_OBJECTS)

clean:
	rm -f $(NBIIMAGE) $(BINARYIMAGE) $(ELFIMAGE) $(GRUBIMAGE) $(OBJECTS) $(ETHER_PRE_OBJECTS) $(GRUB_PRE_OBJECTS) $(ETHER_POST_OBJECTS) $(GRUB_POST_OBJECTS)

.SUFFIXES:
.SUFFIXES: .o .s86 .s .cc


.s86.o:
	$(NASM) $(NASMOPTIONS) -o $*.o -l $*.txt $*.s86

.cc.o:
	$(CC) $(CFLAGS) -c -o $*.o $*.cc

.s.cc:
	$(CCOPTIONS) -c -S $*.cc

etags:
	etags -t $(ALL_SOURCE_FILES)

install-grub: $(GRUBIMAGE)
	cp jjos-grub /josboot/jjos2a-g
	cp ../bytecode/jjos.zip /josboot/jjos2a.zip

mke3nbi: mke3nbi.cc
	g++ -o mke3nbi mke3nbi.cc

include depend.mk
@


1.6
log
@

Yikes.  Lots of I/O and file-rearranging related changes.  Have moved
lots of stuff from common to arch/i386, and now the top-level e3 and
the arch/unix build targets rely on standard, vanilla, stuff.  The
arch/i386 contains my faked-up stuff.  Since I'm now using the serial
port as a console instead of the VGA text mode stuff, I nuked a whole
lot of code dealing with screen attributes, cursor positions, and
such.  Lots simpler now.
@
text
@d42 1
d61 1
d74 1
a74 1
IFLAGS = -I. -I../../common 
@


1.5
log
@
Added two rules to each makefile that, with any luck (ha), will cause
the depend.mk to be built if either it doesn't exist or if it's older
than any of the sources.  james said he'll take care of CVS issues
with depend.mk, but this should help a little bit.
@
text
@d14 1
a14 2
 jjidt.o \
 entry.o
d32 3
d41 4
a44 1
 jjtimer.h
d47 4
d59 3
a61 1
 jjtimer.cc
d105 1
a105 1
TARGET_SOURCE_FILES = Makefile \
d133 4
a136 4
$(ELFIMAGE): $(ETHER_OBJECTS) entry.cc $(TARGET_ZIP) Makefile
	@@echo compiling entry.cc ...
	$(CC) $(CFLAGS) -UMULTIBOOT -DETHERBOOT -c -o entry.o entry.cc
	@@echo ... done.  building etherboot image...
d146 1
a146 1
$(GRUBIMAGE): $(GRUB_OBJECTS) entry.cc $(TARGET_ZIP) Makefile
d170 1
a170 1
	rm -f $(NBIIMAGE) $(BINARYIMAGE) $(ELFIMAGE) $(GRUBIMAGE) $(OBJECTS) $(TARGET_ZIP)  $(ETHER_PRE_OBJECTS) $(GRUB_PRE_OBJECTS) $(ETHER_POST_OBJECTS) $(GRUB_POST_OBJECTS)
@


1.4
log
@
Add forgotten file to Makefile.inc.  In order to make it easier to
fake up i/o stream stuff, change "hex" to "ios::hex" in several
files.  Moved global (another issue) "lispm" pointer to lispm from e3
to ease integrating upon bare iron.  For band loading, I separated out
the stream stuff from the band to ease integration on bare iron -- am
not finished yet however.
@
text
@d145 1
a145 1
depend:
d147 5
@


1.3
log
@
All right.  Lotsa changes.  Changed how makefiles called makedepend
and maintained dependency files -- the old way added an extra period
in the suffix, so it was essentially useless on my RH7.2 installation
-- let me know if this is platform-specific and I inadvertantly broke
something on you (FreeBSD guys, etc.). I added a Makefile.inc to the
top-level directory so the e3 sources could be referenced from each of
the build-target directories (one might want to build many targets on
one box -- especially when cross-compiling for bare iron, and
therefore I store the build-target-specific object files in the build
target directory).  I tried to reduce the number of platform-specific
include files in band.h/cc etc -- if stdlib.h sufficed, then I removed
all the other ones (this may have broken something on other platforms
-- let me know).  I also told cpp for the i386 build target to NOT
search the standard include file directories so I could get it to grab
the workalike system include files from the build-target-specific
directory -- however I may have to change this for the stdarg.h
because that is compiler-specific rather than target-specific (remains
to be seen).  I also added Makefile.gc so that the conservative GC
files could be referenced from the build target directories although
that whole thing might never be used (but it is used right now, and
I'd prefer to make incremental changes and pull it out later).
Finally, I added stubs for the fstream.h stuff used to load the band
although that may be changed later (I am pretty sure I do not want to
read the band a byte at a time when Etherboot has already put it in
memory for the i386 platform, and GRUB-like loaders that go to disk
might not support C++ streams, so I'd have to change that anyways).
@
text
@a11 7

GRUB_SOURCES = \
 head_grub.s86 \
 jjmultiboot.cc
GRUB_HEADERS = \
 jjmultiboot.h

d19 6
a30 3
ASM_SOURCE = \
 jjidt.s86
ASM_OBJECTS = 
d52 1
a52 3
TARGET_OBJECTS = $(TARGET_SOURCES:.cc=.o)\

TARGET_SOURCE_FILES = Makefile $(ASMHEADERS) $(ASMSOURCES) $(TARGET_SOURCES) $(TARGET_HEADERS)
d69 1
a69 1
 -Wall -fno-builtin -fno-exceptions -nostdinc \
d71 1
a71 3
 -DHANDLE_CLOCK -DNATIVE_CLOCK \
 -DNEW_INTERRUPT_HANDLING \
 -DTEST_A20 $(IFLAGS) \
d94 13
a106 1
ALL_SOURCE_FILES = $(TARGET_SOURCE_FILES) $(COMMON_SOURCES) $(E3_SOURCES) $(GC_SOURCES)
d108 1
a108 1
OBJECTS = $(ASM_OBJECTS) $(TARGET_OBJECTS) $(COMMON_OBJECTS) $(E3_OBJECTS) $(GC_OBJECTS)
d168 3
@


1.2
log
@

Am trying to integrate the existing UNIX-centric e3 with the x86 PC
stuff.  Split the DPMT entry stuff out from the band proper, which
resulted in two new files.  Added a Makefile.inc in e3 which will be
included from the build target directories.  Changed the i386 console
stuff to not write to a text-mode VGA screen but instead write to the
COM1 serial port.
@
text
@d56 1
a56 10
TARGET_OBJECTS = \
 jj386int.o \
 jjconsol.o \
 jjeflags.o \
 jjfb.o \
 jjidtent.o \
 jjmachin.o \
 jjfinfo.o \
 jjvinfo.o \
 jjtimer.o
d75 1
a75 1
 -Wall -fno-builtin -fno-exceptions \
d100 1
a100 1
#include ../../Makefile.inc
d102 1
a102 1
ALL_SOURCE_FILES = $(TARGET_SOURCE_FILES) $(COMMON_SOURCES) $(GC_SOURCES)
d104 1
a104 1
OBJECTS = $(ASM_OBJECTS) $(TARGET_OBJECTS) $(COMMON_OBJECTS) $(GC_OBJECTS)
d142 1
a142 1
	makedepend $(IFLAGS) $(ALL_SOURCE_FILES)
d172 1
a172 44
# DO NOT DELETE


../../common/jbheap..o: jj386int.h jjmachin.h
../../common/stdlib..o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
jj386int..o: ../../common/jbconsol.h
jj386int.o: ../../common/jbconsol.h
jj386int..o: ../../common/jbfifo.cc ../../common/jbfifo.h
jj386int.o: ../../common/jbfifo.h
jj386int..o: ../../common/jbheap.h
jj386int.o: ../../common/jbheap.h
jj386int..o: ../../common/jbmachin.h
jj386int.o: ../../common/jbmachin.h
jj386int..o: ../../common/jjtypes.h
jj386int.o: ../../common/jjtypes.h
jj386int..o: ../../common/stdlib.h jj386int.h jjidtent.h jjmachin.h
jjconsole.o: ../../common/jbconsol.h ../../common/jjtypes.h
jjconsol..o: ../../common/jbconsol.h ../../common/jbdebug.h
jjconsol..o: ../../common/jbfifo.h ../../common/jbheap.h
jjconsol..o: ../../common/jbmachin.h ../../common/jjtypes.h
jjconsol..o: ../../common/stdlib.h jj386int.h jjconsole.h jjmachin.h
jjeflags..o: ../../common/jbdebug.h ../../common/jjtypes.h
jjeflags.o: ../../common/jjtypes.h
jjeflags..o: ../../common/stdlib.h jjeflags.h
jjfb..o: ../../common/jjtypes.h
jjfb.o: ../../common/jjtypes.h
jjfb..o: ../../common/stdlib.h jjfb.h
jjfinfo..o: ../../common/jjtypes.h jjfinfo.h
jjidtent..o: ../../common/jjtypes.h ../../common/stdlib.h jjidtent.h
jjmachin..o: ../../common/jbconsol.h
jjmachin.o: ../../common/jbconsol.h
jjmachin..o: ../../common/jbdebug.h ../../common/jbfifo.h
jjmachin.o: ../../common/jbfifo.h
jjmachin..o: ../../common/jbheap.h
jjmachin.o: ../../common/jbheap.h
jjmachin..o: ../../common/jbmachin.h
jjmachin.o: ../../common/jbmachin.h
jjmachin..o: ../../common/jjtypes.h
jjmachin.o: ../../common/jjtypes.h
jjmachin..o: ../../common/stdlib.h jj386int.h
jjmachin.o: jj386int.h
jjmachin..o: jjeflags.h jjetherboot.h jjfinfo.h jjmachin.h jjvinfo.h
jjtimer..o: jjtimer.h
jjvinfo..o: ../../common/jjtypes.h jjvinfo.h
@


1.1
log
@
Whoops.
@
text
@d109 1
d180 45
@

