Index: Makefile
===================================================================
--- Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,105 @@
+include Makefile.config
+include arch/$(ARCH)/Makefile.inc
+
+sources=src/cpu/cpu.c \
+	src/main/main.c \
+	src/main/kinit.c \
+	src/main/uinit.c \
+	src/proc/scheduler.c \
+	src/proc/thread.c \
+	src/proc/task.c \
+	src/proc/the.c \
+	src/mm/heap.c \
+	src/mm/frame.c \
+	src/mm/page.c \
+	src/mm/tlb.c \
+	src/mm/vm.c \
+	src/lib/func.c \
+	src/lib/list.c \
+	src/lib/memstr.c \
+	src/lib/sort.c \
+	src/debug/print.c \
+	src/debug/symtab.c \
+	src/time/clock.c \
+	src/time/timeout.c \
+	src/time/delay.c \
+	src/preempt/preemption.c \
+	src/synch/spinlock.c \
+	src/synch/condvar.c \
+	src/synch/rwlock.c \
+	src/synch/mutex.c \
+	src/synch/semaphore.c \
+	src/synch/waitq.c \
+	src/smp/ipi.c \
+	src/fb/font-8x16.c
+
+# CFLAGS options same for all targets
+CFLAGS+=-nostdinc -Iinclude/ -Werror-implicit-function-declaration -Wmissing-prototypes -Werror
+
+ifdef DEBUG_SPINLOCK
+CFLAGS+=-D$(DEBUG_SPINLOCK)
+endif
+
+ifdef USERSPACE
+CFLAGS+=-D$(USERSPACE)
+endif
+
+ifdef TEST
+test_objects:=$(addsuffix .o,$(basename test/$(TEST_DIR)/$(TEST_FILE)))
+CFLAGS+=-D$(TEST)
+endif
+arch_objects:=$(addsuffix .o,$(basename $(arch_sources)))
+objects:=$(addsuffix .o,$(basename $(sources)))
+
+.PHONY : all config depend build clean dist-clean boot
+
+all: dist-clean config depend build
+
+-include Makefile.depend
+
+config:
+	find src/ include/ -name arch -type l -exec rm \{\} \;
+	ln -s ../arch/$(ARCH)/src/ src/arch
+	ln -s ../arch/$(ARCH)/include/ include/arch
+
+depend:
+	$(CC) $(CFLAGS) -M $(arch_sources) $(sources) >Makefile.depend
+
+build: kernel.bin boot
+
+clean:
+	find src/ arch/$(ARCH)/src/ test/ -name '*.o' -exec rm \{\} \;
+	-rm *.bin kernel.map kernel.map.pre kernel.objdump src/debug/real_map.bin
+	$(MAKE) -C arch/$(ARCH)/boot/ clean
+
+dist-clean:
+	find src/ include/ -name arch -type l -exec rm \{\} \;
+	-rm Makefile.depend
+	-$(MAKE) clean
+
+src/debug/real_map.bin: $(arch_objects) $(objects) $(test_objects) arch/$(ARCH)/_link.ld 
+	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile src/debug/empty_map.o
+	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) src/debug/empty_map.o -o $@ -Map kernel.map.pre
+	$(OBJDUMP) -t $(arch_objects) $(objects) $(test_objects) > kernel.objdump
+	tools/genmap.py kernel.map.pre kernel.objdump src/debug/real_map.bin 
+
+src/debug/real_map.o: src/debug/real_map.bin
+	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
+
+
+kernel.bin: $(arch_objects) $(objects) $(test_objects) arch/$(ARCH)/_link.ld src/debug/real_map.o
+	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) src/debug/real_map.o -o $@ -Map kernel.map
+
+%.o: %.S
+	$(CC) $(ASFLAGS) $(CFLAGS) -c $< -o $@
+
+%.o: %.s
+	$(AS) $(ASFLAGS) $< -o $@
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c $< -o $@
+
+KS=`cat kernel.bin | wc -c`
+
+boot:
+	$(MAKE) -C arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)
Index: Makefile.config
===================================================================
--- Makefile.config	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ Makefile.config	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,42 @@
+#ARCH=ia32
+#ARCH=mips32
+#ARCH=ia64
+#ARCH=ppc32
+#ARCH=amd64
+
+# If this is yes, then cross compiler will be used instead of host compiler
+CROSS_COMPILER=no
+
+# Support for symetric multiprocessors
+SMP=__SMP__
+
+# Improved support for hyperthreading
+HT=__HT__
+
+# General debuging and assert checking disable
+#NDEBUG=__NDEBUG__
+
+# Deadlock detection support for spinlocks.
+DEBUG_SPINLOCK=DEBUG_SPINLOCK
+
+# Uncomment if you want to compile in userspace support
+#USERSPACE=__USERSPACE__
+
+# Uncomment if you want to run in the test mode
+#TEST=__TEST__
+
+TEST_FILE=test.c
+
+# Select what test do you want to run
+#TEST_DIR=synch/rwlock1/
+#TEST_DIR=synch/rwlock2/
+#TEST_DIR=synch/rwlock3/
+#TEST_DIR=synch/rwlock4/
+#TEST_DIR=synch/rwlock5/
+#TEST_DIR=synch/semaphore1/
+#TEST_DIR=synch/semaphore2/
+#TEST_DIR=fpu/fpu1/
+#TEST_DIR=fpu/sse1/
+#TEST_DIR=fpu/mips1/
+#TEST_DIR=print/print1/
+#TEST_DIR=thread/thread1/
Index: arch/amd64/Makefile.inc
===================================================================
--- arch/amd64/Makefile.inc	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/amd64/Makefile.inc	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -25,39 +25,40 @@
 LFLAGS=-M 
 
-../arch/$(ARCH)/_link.ld: ../arch/$(ARCH)/_link.ld.in
+arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
 	$(CC) $(CFLAGS) -C -E -x c $< | grep -v "^\#" > $@
 
-arch_sources = arch/dummy.s \
-	arch/fpu_context.c \
-	arch/boot/boot.S \
-	arch/boot/memmap.S \
-	arch/pm.c \
-	arch/context.S \
-	arch/drivers/ega.c \
-	arch/drivers/i8042.c \
-	arch/drivers/i8254.c \
-	arch/drivers/i8259.c \
-	arch/supplib.c \
-	arch/delay.S \
-	arch/amd64.c \
-	arch/bios/bios.c \
-	arch/interrupt.c \
-	arch/mm/frame.c \
-	arch/mm/page.c \
-	arch/mm/tlb.c \
-	arch/asm_utils.S \
-	arch/fmath.c \
-	arch/mm/memory_init.c \
-	arch/cpu/cpu.c \
-	arch/proc/scheduler.c \
-	arch/userspace.c \
-	arch/acpi/acpi.c \
-	arch/acpi/madt.c
+arch_sources = \
+	src/arch/dummy.s \
+	src/arch/fpu_context.c \
+	src/arch/boot/boot.S \
+	src/arch/boot/memmap.S \
+	src/arch/pm.c \
+	src/arch/context.S \
+	src/arch/drivers/ega.c \
+	src/arch/drivers/i8042.c \
+	src/arch/drivers/i8254.c \
+	src/arch/drivers/i8259.c \
+	src/arch/supplib.c \
+	src/arch/delay.S \
+	src/arch/amd64.c \
+	src/arch/bios/bios.c \
+	src/arch/interrupt.c \
+	src/arch/mm/frame.c \
+	src/arch/mm/page.c \
+	src/arch/mm/tlb.c \
+	src/arch/asm_utils.S \
+	src/arch/fmath.c \
+	src/arch/mm/memory_init.c \
+	src/arch/cpu/cpu.c \
+	src/arch/proc/scheduler.c \
+	src/arch/userspace.c \
+	src/arch/acpi/acpi.c \
+	src/arch/acpi/madt.c
 
 ifdef SMP
-arch_sources += arch/smp/ap.S \
-		arch/smp/apic.c \
-		arch/smp/ipi.c \
-		arch/smp/mps.c \
-		arch/smp/smp.c
+arch_sources += src/arch/smp/ap.S \
+		src/arch/smp/apic.c \
+		src/arch/smp/ipi.c \
+		src/arch/smp/mps.c \
+		src/arch/smp/smp.c
 endif
Index: arch/amd64/boot/Makefile
===================================================================
--- arch/amd64/boot/Makefile	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/amd64/boot/Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -4,7 +4,7 @@
 
 build: boot.bin
-	dd if=boot.bin of=../../../src/image.bin bs=512 conv=sync
-	-cat ../../../src/kernel.bin >>../../../src/image.bin
-	dd if=/dev/zero of=../../../src/image.bin bs=1 seek=1474559 count=1
+	dd if=boot.bin of=../../../image.bin bs=512 conv=sync
+	-cat ../../../kernel.bin >>../../../image.bin
+	dd if=/dev/zero of=../../../image.bin bs=1 seek=1474559 count=1
 
 boot.bin: boot.o
Index: arch/ia32/Makefile.inc
===================================================================
--- arch/ia32/Makefile.inc	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/ia32/Makefile.inc	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -31,42 +31,42 @@
 endif
 
-CPPFLAGS=$(DEFS) -nostdinc -I../include
+CPPFLAGS=$(DEFS) -nostdinc -Iinclude/
 CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3
 LFLAGS=-M
 
-../arch/$(ARCH)/_link.ld: ../arch/$(ARCH)/_link.ld.in
+arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
 	$(CC) $(CFLAGS) -E -x c $< | grep -v "^\#" > $@
 
 arch_sources= \
-	arch/context.s \
-	arch/debug/panic.s \
-	arch/cpuid.s \
-	arch/delay.s \
-	arch/asm.S \
-	arch/proc/scheduler.c \
-	arch/acpi/acpi.c \
-	arch/acpi/madt.c \
-	arch/bios/bios.c \
-	arch/smp/ap.S \
-	arch/smp/apic.c \
-	arch/smp/mps.c \
-	arch/smp/smp.c \
-	arch/atomic.S \
-	arch/smp/ipi.c \
-	arch/ia32.c \
-	arch/interrupt.c \
-	arch/pm.c \
-	arch/userspace.c \
-	arch/cpu/cpu.c \
-	arch/mm/frame.c \
-	arch/mm/memory_init.c \
-	arch/mm/page.c \
-	arch/mm/tlb.c \
-	arch/drivers/i8042.c \
-	arch/drivers/i8254.c \
-	arch/drivers/i8259.c \
-	arch/drivers/ega.c \
-	arch/boot/boot.S \
-	arch/boot/memmap.S\
-	arch/fpu_context.c\
-	arch/fmath.c
+	src/arch/context.s \
+	src/arch/debug/panic.s \
+	src/arch/cpuid.s \
+	src/arch/delay.s \
+	src/arch/asm.S \
+	src/arch/proc/scheduler.c \
+	src/arch/acpi/acpi.c \
+	src/arch/acpi/madt.c \
+	src/arch/bios/bios.c \
+	src/arch/smp/ap.S \
+	src/arch/smp/apic.c \
+	src/arch/smp/mps.c \
+	src/arch/smp/smp.c \
+	src/arch/atomic.S \
+	src/arch/smp/ipi.c \
+	src/arch/ia32.c \
+	src/arch/interrupt.c \
+	src/arch/pm.c \
+	src/arch/userspace.c \
+	src/arch/cpu/cpu.c \
+	src/arch/mm/frame.c \
+	src/arch/mm/memory_init.c \
+	src/arch/mm/page.c \
+	src/arch/mm/tlb.c \
+	src/arch/drivers/i8042.c \
+	src/arch/drivers/i8254.c \
+	src/arch/drivers/i8259.c \
+	src/arch/drivers/ega.c \
+	src/arch/boot/boot.S \
+	src/arch/boot/memmap.S\
+	src/arch/fpu_context.c\
+	src/arch/fmath.c
Index: arch/ia32/boot/Makefile
===================================================================
--- arch/ia32/boot/Makefile	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/ia32/boot/Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -4,7 +4,7 @@
 
 build: boot.bin
-	dd if=boot.bin of=../../../src/image.bin bs=512 conv=sync
-	-cat ../../../src/kernel.bin >>../../../src/image.bin
-	dd if=/dev/zero of=../../../src/image.bin bs=1 seek=1474559 count=1
+	dd if=boot.bin of=../../../image.bin bs=512 conv=sync
+	-cat ../../../kernel.bin >>../../../image.bin
+	dd if=/dev/zero of=../../../image.bin bs=1 seek=1474559 count=1
 
 boot.bin: boot.o
Index: arch/ia64/Makefile.inc
===================================================================
--- arch/ia64/Makefile.inc	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/ia64/Makefile.inc	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -22,15 +22,15 @@
 
 arch_sources= \
-	arch/start.S \
-	arch/asm.S \
-	arch/dummy.s \
-	arch/putchar.c \
-	arch/ia64.c \
-	arch/fpu_context.c \
-	arch/context.S \
-	arch/ski/ski.c \
-	arch/cpu/cpu.c \
-	arch/ivt.S \
-	arch/interrupt_handler.c \
-	arch/fmath.c \
-	arch/mm/frame.c
+	src/arch/start.S \
+	src/arch/asm.S \
+	src/arch/dummy.s \
+	src/arch/putchar.c \
+	src/arch/ia64.c \
+	src/arch/fpu_context.c \
+	src/arch/context.S \
+	src/arch/ski/ski.c \
+	src/arch/cpu/cpu.c \
+	src/arch/ivt.S \
+	src/arch/interrupt_handler.c \
+	src/arch/fmath.c \
+	src/arch/mm/frame.c
Index: arch/ia64/boot/Makefile
===================================================================
--- arch/ia64/boot/Makefile	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/ia64/boot/Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -7,5 +7,5 @@
 
 build: boot.bin
-	cp boot.bin ../../../src/load.bin
+	cp boot.bin ../../../load.bin
 
 AS=$(IA-64_BINUTILS_DIR)/$(IA-64_TARGET)-as
Index: arch/mips32/Makefile.inc
===================================================================
--- arch/mips32/Makefile.inc	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/mips32/Makefile.inc	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -72,23 +72,23 @@
 endif
 
-../arch/$(ARCH)/_link.ld: ../arch/$(ARCH)/_link.ld.in
+arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
 	$(CC) $(CFLAGS) -C -DBFD=${BFD} -E -x c $< | grep -v "^\#" > $@
 
 arch_sources= \
-	arch/start.S \
-	arch/context.S \
-	arch/panic.S \
-	arch/mips32.c \
-	arch/dummy.S \
-	arch/console.c \
-	arch/asm.S \
-	arch/exception.c \
-	arch/interrupt.c \
-	arch/cache.c \
-	arch/cpu/cpu.c \
-	arch/mm/frame.c \
-	arch/mm/page.c \
-	arch/mm/tlb.c \
-	arch/fpu_context.c \
-	arch/fmath.c \
-	arch/drivers/arc.c
+	src/arch/start.S \
+	src/arch/context.S \
+	src/arch/panic.S \
+	src/arch/mips32.c \
+	src/arch/dummy.S \
+	src/arch/console.c \
+	src/arch/asm.S \
+	src/arch/exception.c \
+	src/arch/interrupt.c \
+	src/arch/cache.c \
+	src/arch/cpu/cpu.c \
+	src/arch/mm/frame.c \
+	src/arch/mm/page.c \
+	src/arch/mm/tlb.c \
+	src/arch/fpu_context.c \
+	src/arch/fmath.c \
+	src/arch/drivers/arc.c
Index: arch/mips32/boot/Makefile
===================================================================
--- arch/mips32/boot/Makefile	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/mips32/boot/Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -7,5 +7,5 @@
 
 build: boot.bin
-	cp boot.bin ../../../src/load.bin
+	cp boot.bin ../../../load.bin
 
 AS=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-as
Index: arch/ppc32/Makefile.inc
===================================================================
--- arch/ppc32/Makefile.inc	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/ppc32/Makefile.inc	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -19,15 +19,15 @@
 
 arch_sources= \
-	arch/context.S \
-	arch/debug/panic.s \
-	arch/fpu_context.c \
-	arch/ppc32.c \
-	arch/dummy.s \
-	arch/start.S \
-	arch/asm.S \
-	arch/cpu/cpu.c \
-	arch/mm/frame.c \
-	arch/mm/memory_init.c \
-	arch/mm/page.c \
-	arch/drivers/ofw.c \
-	arch/fmath.c
+	src/arch/context.S \
+	src/arch/debug/panic.s \
+	src/arch/fpu_context.c \
+	src/arch/ppc32.c \
+	src/arch/dummy.s \
+	src/arch/start.S \
+	src/arch/asm.S \
+	src/arch/cpu/cpu.c \
+	src/arch/mm/frame.c \
+	src/arch/mm/memory_init.c \
+	src/arch/mm/page.c \
+	src/arch/drivers/ofw.c \
+	src/arch/fmath.c
Index: arch/ppc32/boot/Makefile
===================================================================
--- arch/ppc32/boot/Makefile	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ arch/ppc32/boot/Makefile	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -7,5 +7,5 @@
 
 build: boot.bin
-	cp boot.bin ../../../src/load.bin
+	cp boot.bin ../../../load.bin
 
 CC=$(PPC_BINUTILS_DIR)/$(PPC_TARGET)-gcc
Index: build.amd64
===================================================================
--- build.amd64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ build.amd64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+set -e
+# Generate context_offset.h
+(cd tools/amd64/;make gencontext;./gencontext)
+# Create links to ia32 architecture
+
+(
+set -e
+cd arch
+for a in drivers bios fmath.c mm/frame.c mm/tlb.c mm/memory_init.c boot/memmap.S smp/apic.c smp/ipi.c smp/mps.c smp/smp.c acpi; do
+  if [ \! -e amd64/src/$a ]; then
+    echo ln -sf `pwd`/ia32/src/$a amd64/src/$a
+    ln -sf `pwd`/ia32/src/$a amd64/src/$a
+  fi
+done
+
+for a in atomic.h ega.h fpu_context.h i8042.h i8259.h i8254.h interrupt.h bios mm/memory_init.h boot/memmap.h boot/memmapasm.h smp acpi barrier.h; do
+  if [ \! -e amd64/include/$a ]; then
+    echo ln -sf `pwd`/ia32/include/$a amd64/include/$a
+    ln -sf `pwd`/ia32/include/$a amd64/include/$a
+  fi
+done
+)
+make dist-clean ARCH=ia32
+make all ARCH=amd64
Index: build.ia32
===================================================================
--- build.ia32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ build.ia32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+COMPILER=""
+
+if [ $1 == "cross" ];
+then
+	COMPILER="CROSS_COMPILER=yes";
+fi;
+
+make all ARCH=ia32 $COMPILER
Index: build.ia64
===================================================================
--- build.ia64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ build.ia64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+make all ARCH=ia64
Index: build.mips32
===================================================================
--- build.mips32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ build.mips32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+if [ -z "$1" ]; then
+  echo "Usage: $0 [msim|msim4kc|simics|lgxemul|bgxemul|indy]"
+  exit 1
+else
+  MACHINE=$1
+fi
+
+# Generate context_offset.h
+(cd tools/mips32/;make gencontext;./gencontext)
+
+make all ARCH=mips32 MACHINE=$MACHINE
Index: build.ppc32
===================================================================
--- build.ppc32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ build.ppc32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+make all ARCH=ppc32
Index: clean.amd64
===================================================================
--- clean.amd64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ clean.amd64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+make dist-clean ARCH=amd64
+make dist-clean ARCH=ia32
+
+find arch/amd64 -type l | xargs rm
+rm arch/amd64/include/context_offset.h
+rm arch/amd64/_link.ld
+rm tools/amd64/gencontext
Index: clean.ia32
===================================================================
--- clean.ia32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ clean.ia32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+make dist-clean ARCH=ia32
+
+rm arch/ia32/_link.ld
Index: clean.ia64
===================================================================
--- clean.ia64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ clean.ia64	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+make dist-clean ARCH=ia64
Index: clean.mips32
===================================================================
--- clean.mips32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ clean.mips32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+make dist-clean ARCH=mips32
+
+rm tools/mips32/gencontext
+rm arch/mips32/include/context_offset.h
+rm arch/mips32/_link.ld
Index: clean.ppc32
===================================================================
--- clean.ppc32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
+++ clean.ppc32	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+make dist-clean ARCH=ppc32
Index: contrib/conf/SPMIPS.simics
===================================================================
--- contrib/conf/SPMIPS.simics	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ contrib/conf/SPMIPS.simics	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -4,5 +4,5 @@
 read-configuration spmips.conf
 
-set-pc (cpu0.load-binary ../../../SPARTAN/src/kernel.bin)
+set-pc (cpu0.load-binary ../../../SPARTAN/kernel.bin)
 
 # Setup uart to use 8 bits
Index: contrib/conf/dot.bochsrc
===================================================================
--- contrib/conf/dot.bochsrc	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ contrib/conf/dot.bochsrc	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -131,5 +131,5 @@
 # supported on Windows 95 and 98.
 #=======================================================================
-floppya: 1_44=SPARTAN/src/image.bin, status=inserted
+floppya: 1_44=SPARTAN/image.bin, status=inserted
 #floppya: 1_44=/dev/fd0, status=inserted
 
Index: contrib/conf/ski.conf
===================================================================
--- contrib/conf/ski.conf	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ contrib/conf/ski.conf	(revision c9ed17634e974ba95fa199e9c3305bd5a0837439)
@@ -1,2 +1,2 @@
-load SPARTAN/src/kernel.bin
-load SPARTAN/src/load.bin
+load SPARTAN/kernel.bin
+load SPARTAN/load.bin
Index: c/Makefile
===================================================================
--- src/Makefile	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,105 +1,0 @@
-include Makefile.config
-include ../arch/$(ARCH)/Makefile.inc
-
-sources=cpu/cpu.c \
-	main/main.c \
-	main/kinit.c \
-	main/uinit.c \
-	proc/scheduler.c \
-	proc/thread.c \
-	proc/task.c \
-	proc/the.c \
-	mm/heap.c \
-	mm/frame.c \
-	mm/page.c \
-	mm/tlb.c \
-	mm/vm.c \
-	lib/func.c \
-	lib/list.c \
-	lib/memstr.c \
-	lib/sort.c \
-	debug/print.c \
-	debug/symtab.c \
-	time/clock.c \
-	time/timeout.c \
-	time/delay.c \
-	preempt/preemption.c \
-	synch/spinlock.c \
-	synch/condvar.c \
-	synch/rwlock.c \
-	synch/mutex.c \
-	synch/semaphore.c \
-	synch/waitq.c \
-	smp/ipi.c \
-	fb/font-8x16.c
-
-# CFLAGS options same for all targets
-CFLAGS+=-nostdinc -I../include -Werror-implicit-function-declaration -Wmissing-prototypes -Werror
-
-ifdef DEBUG_SPINLOCK
-CFLAGS+=-D$(DEBUG_SPINLOCK)
-endif
-
-ifdef USERSPACE
-CFLAGS+=-D$(USERSPACE)
-endif
-
-ifdef TEST
-test_objects:=$(addsuffix .o,$(basename ../test/$(TEST_DIR)/$(TEST_FILE)))
-CFLAGS+=-D$(TEST)
-endif
-arch_objects:=$(addsuffix .o,$(basename $(arch_sources)))
-objects:=$(addsuffix .o,$(basename $(sources)))
-
-.PHONY : all config depend build clean dist-clean boot
-
-all: dist-clean config depend build
-
--include Makefile.depend
-
-config:
-	find . ../include -name arch -type l -exec rm \{\} \;
-	ln -s ../arch/$(ARCH)/src arch
-	ln -s ../arch/$(ARCH)/include ../include/arch
-
-depend:
-	$(CC) $(CFLAGS) -M $(arch_sources) $(sources) >Makefile.depend
-
-build: kernel.bin boot
-
-clean:
-	find . ../arch/$(ARCH)/src ../test -name '*.o' -exec rm \{\} \;
-	-rm *.bin kernel.map kernel.map.pre kernel.objdump debug/real_map.bin
-	$(MAKE) -C ../arch/$(ARCH)/boot clean
-
-dist-clean:
-	find . ../include -name arch -type l -exec rm \{\} \;
-	-rm Makefile.depend
-	-$(MAKE) clean
-
-debug/real_map.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld 
-	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab Makefile debug/empty_map.o
-	$(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/empty_map.o -o $@ -Map kernel.map.pre
-	$(OBJDUMP) -t $(arch_objects) $(objects) $(test_objects) > kernel.objdump
-	../tools/genmap.py kernel.map.pre kernel.objdump debug/real_map.bin 
-
-debug/real_map.o: debug/real_map.bin
-	$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) --prefix-sections=symtab $< $@
-
-
-kernel.bin: $(arch_objects) $(objects) $(test_objects) ../arch/$(ARCH)/_link.ld debug/real_map.o
-	$(LD) -T ../arch/$(ARCH)/_link.ld $(LFLAGS) $(arch_objects) $(objects) $(test_objects) debug/real_map.o -o $@ -Map kernel.map
-
-%.o: %.S
-	$(CC) $(ASFLAGS) $(CFLAGS) -c $< -o $@
-
-%.o: %.s
-	$(AS) $(ASFLAGS) $< -o $@
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c $< -o $@
-
-KS=`cat kernel.bin | wc -c`
-
-boot:
-	$(MAKE) -C ../arch/$(ARCH)/boot build KERNEL_SIZE=$(KS)
Index: c/Makefile.config
===================================================================
--- src/Makefile.config	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#ARCH=ia32
-#ARCH=mips32
-#ARCH=ia64
-#ARCH=ppc32
-#ARCH=amd64
-
-# If this is yes, then cross compiler will be used instead of host compiler
-CROSS_COMPILER=no
-
-# Support for symetric multiprocessors
-SMP=__SMP__
-
-# Improved support for hyperthreading
-HT=__HT__
-
-# General debuging and assert checking disable
-#NDEBUG=__NDEBUG__
-
-# Deadlock detection support for spinlocks.
-DEBUG_SPINLOCK=DEBUG_SPINLOCK
-
-# Uncomment if you want to compile in userspace support
-#USERSPACE=__USERSPACE__
-
-# Uncomment if you want to run in the test mode
-#TEST=__TEST__
-
-TEST_FILE=test.c
-
-# Select what test do you want to run
-#TEST_DIR=synch/rwlock1/
-#TEST_DIR=synch/rwlock2/
-#TEST_DIR=synch/rwlock3/
-#TEST_DIR=synch/rwlock4/
-#TEST_DIR=synch/rwlock5/
-#TEST_DIR=synch/semaphore1/
-#TEST_DIR=synch/semaphore2/
-#TEST_DIR=fpu/fpu1
-#TEST_DIR=fpu/sse1
-#TEST_DIR=fpu/mips1
-#TEST_DIR=print/print1
-#TEST_DIR=thread/thread1
Index: c/build.amd64
===================================================================
--- src/build.amd64	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,26 +1,0 @@
-#! /bin/sh
-
-set -e
-# Generate context_offset.h
-(cd ../tools/amd64/;make gencontext;./gencontext)
-# Create links to ia32 architecture
-
-(
-set -e
-cd ../arch
-for a in drivers bios fmath.c mm/frame.c mm/tlb.c mm/memory_init.c boot/memmap.S smp/apic.c smp/ipi.c smp/mps.c smp/smp.c acpi; do
-  if [ \! -e amd64/src/$a ]; then
-    echo ln -sf `pwd`/ia32/src/$a amd64/src/$a
-    ln -sf `pwd`/ia32/src/$a amd64/src/$a
-  fi
-done
-
-for a in atomic.h ega.h fpu_context.h i8042.h i8259.h i8254.h interrupt.h bios mm/memory_init.h boot/memmap.h boot/memmapasm.h smp acpi barrier.h; do
-  if [ \! -e amd64/include/$a ]; then
-    echo ln -sf `pwd`/ia32/include/$a amd64/include/$a
-    ln -sf `pwd`/ia32/include/$a amd64/include/$a
-  fi
-done
-)
-make dist-clean ARCH=ia32
-make all ARCH=amd64
Index: c/build.ia32
===================================================================
--- src/build.ia32	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,10 +1,0 @@
-#! /bin/sh
-
-COMPILER=""
-
-if [ $1 == "cross" ];
-then
-	COMPILER="CROSS_COMPILER=yes";
-fi;
-
-make all ARCH=ia32 $COMPILER
Index: c/build.ia64
===================================================================
--- src/build.ia64	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#! /bin/sh
-
-make all ARCH=ia64
Index: c/build.mips32
===================================================================
--- src/build.mips32	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#! /bin/sh
-
-if [ -z "$1" ]; then
-  echo "Usage: $0 [msim|msim4kc|simics|lgxemul|bgxemul|indy]"
-  exit 1
-else
-  MACHINE=$1
-fi
-
-# Generate context_offset.h
-(cd ../tools/mips32/;make gencontext;./gencontext)
-rm ../arch/mips32/_link.ld
-
-make all ARCH=mips32 MACHINE=$MACHINE
Index: c/build.ppc32
===================================================================
--- src/build.ppc32	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#! /bin/sh
-
-make all ARCH=ppc32
Index: c/clean.amd64
===================================================================
--- src/clean.amd64	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#! /bin/sh
-
-make dist-clean ARCH=amd64
-make dist-clean ARCH=ia32
-
-find ../arch/amd64 -type l | xargs rm
-rm ../arch/amd64/include/context_offset.h
-rm ../arch/amd64/_link.ld
-rm ../tools/amd64/gencontext
Index: c/clean.ia32
===================================================================
--- src/clean.ia32	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,5 +1,0 @@
-#! /bin/sh
-
-make dist-clean ARCH=ia32
-
-rm ../arch/ia32/_link.ld
Index: c/clean.ia64
===================================================================
--- src/clean.ia64	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#! /bin/sh
-
-make dist-clean ARCH=ia64
Index: c/clean.mips32
===================================================================
--- src/clean.mips32	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,7 +1,0 @@
-#! /bin/sh
-
-make dist-clean ARCH=mips32
-
-rm ../tools/mips32/gencontext
-rm ../arch/mips32/include/context_offset.h
-rm ../arch/mips32/_link.ld
Index: c/clean.ppc32
===================================================================
--- src/clean.ppc32	(revision 48a02ef768c590f2a4980735e493666d8fc2c22e)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#! /bin/sh
-
-make dist-clean ARCH=ppc32
