diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..47bd722 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# The System Makefile (c) 2002-2004 The UbixOS Project +# +# $Id$ + +all: kernel +#tools + +kernel: src + (cd src/sys;make) + +tools: src + (cd src/tools;make) + +install: + (cd src/sys;make install) + +clean: + (cd src/sys;make clean) diff --git a/src/Makefile.inc b/src/Makefile.inc new file mode 100644 index 0000000..6946bb9 --- /dev/null +++ b/src/Makefile.inc @@ -0,0 +1,11 @@ +# $Id$ +# +# Global 'Source' Options + +# allow you to change your default compiler without affecting your other work +CC = gcc +CXX = g++ +LD = ld +AR = ar +REMOVE = rm -rf + diff --git a/src/sys/Makefile b/src/sys/Makefile new file mode 100644 index 0000000..ee2927f --- /dev/null +++ b/src/sys/Makefile @@ -0,0 +1,82 @@ +# $Id$ +# Kernel Makefile (C) 2002 The UbixOS Project + +all: init-code kernel-img +# net-code sde-code pci-code ubixfs-code vfs-code isa-code kernel-code lib-code vmm-code sys-code boot-code devfs-code mpi-code + +boot-code: boot + (cd boot;make) + +init-code: init + (cd init;make) + +kernel-code: kernel + (cd kernel;make) + +isa-code: isa + (cd isa;make) + +pci-code: pci + (cd pci;make) + +sys-code: sys + (cd sys;make) + +vmm-code: vmm + (cd vmm;make) + +ubixfs-code: ubixfs + (cd ubixfs;make) + +devfs-code: devfs + (cd devfs;make) + +graphics-code: graphics + (cd graphics;make) + +ld-code: ld + (cd ld;make) + +lib-code: lib + (cd lib;make) + +sde-code: sde + (cd sde;make) + +vfs-code: vfs + (cd vfs;make) + +net-code: net + (cd net;make) + +mpi-code: mpi + (cd mpi;make) + +kernel-img: compile + (/bin/echo "/* " > ./compile/null.c) + (date >> ./compile/null.c) + (echo $user >> ./compile/null.c) + (/bin/echo " */" >> ./compile/null.c) + (cd compile;make) + +install: + (cd boot;make install) + (cd ../tools/;make format-dsk) + +clean: +# (cd boot;make clean) + (cd init;make clean) + (cd compile;make clean) +# (cd sys;make clean) +# (cd vmm;make clean) +# (cd lib;make clean) +# (cd kernel;make clean) +# (cd isa;make clean) +# (cd vfs;make clean) +# (cd ubixfs;make clean) +# (cd pci;make clean) +# (cd sde;make clean) +# (cd devfs;make clean) +# (cd net;make clean) +# (cd mpi;make clean) +# (cd ../tools/;make clean) diff --git a/src/sys/Makefile.inc b/src/sys/Makefile.inc new file mode 100644 index 0000000..4ff3da5 --- /dev/null +++ b/src/sys/Makefile.inc @@ -0,0 +1,7 @@ +# $Id$ +# +# global 'sys' options + +INCLUDES = -I../include +CFLAGS = -nostdlib -fno-builtin -fno-exceptions -fomit-frame-pointer +KERNEL = ubix.elf diff --git a/src/sys/compile/Makefile b/src/sys/compile/Makefile new file mode 100644 index 0000000..d01e728 --- /dev/null +++ b/src/sys/compile/Makefile @@ -0,0 +1,39 @@ +# (C) 2002-2004 The UbixOS Project +# +# $Id$ + +# Include Global 'Source' Options +include ../../Makefile.inc +include ../Makefile.inc + +#Objects +OBJS = null.o + +#Kernel Parts +KPARTS = ../init/*.o +# ../sys/*.o ../vmm/*.o ../lib/*.o ../kernel/*.o ../isa/*.o ../vfs/*.o ../ubixfs/*.o ../pci/*.o ../sde/*.o ../devfs/*.o ../net/core/*.o ../net/net/*.o ../net/api/*.o ../net/netif/*.o ../mpi/*.o + +# Link the kernel statically with fixed text+data address @1M +$(KERNEL) : $(OBJS) + $(LD) -nostdlib -nostdinc -o $@ $(OBJS) $(KPARTS) -Ttext 0x30000 +# /usr/bin/strip $@ + +# Compile the source files +.cc.o: + $(CXX) -Wall -O ${CFLAGS} $(INCLUDES) -c -o $@ $< + +.cc.s: + $(CXX) -Wall -O ${CFLAGS} -O $(INCLUDES) -S -o $@ $< + +.c.o: + $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< + +.c.s: + $(CC) -Wall -O $(INCLUDES) -S -o $@ $< + +.S.o: + $(CC) -Wall $(CFLAGS) $(INCLUDES) -c -o $@ $< + +# Clean up the junk +clean: + $(REMOVE) $(OBJS) $(KERNEL) null.c diff --git a/src/sys/init/Makefile b/src/sys/init/Makefile new file mode 100644 index 0000000..badce12 --- /dev/null +++ b/src/sys/init/Makefile @@ -0,0 +1,28 @@ +# (C) 2002-2004 The UbixOS Project +# +# $Id$ + +# Include Global 'Source' Options +include ../../Makefile.inc +include ../Makefile.inc + +# Objects +OBJS = main.o + +all: $(OBJS) + +# Compile Types +.cc.o: + $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< +.cc.s: + $(CXX) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $< +.c.o: + $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -c -o $@ $< +.c.s: + $(CC) -Wall -O $(CFLAGS) $(INCLUDES) -S -o $@ $< +.S.o: + $(CC) -Wall $(CFLAGS) $(INCLUDES) -c -o $@ $< + +# Clean up the junk +clean: + $(REMOVE) $(OBJS) diff --git a/src/sys/init/main.c b/src/sys/init/main.c new file mode 100644 index 0000000..1527052 --- /dev/null +++ b/src/sys/init/main.c @@ -0,0 +1,3 @@ +void _start() { + while (1); + }