mirror of
https://github.com/xomboverlord/xomb-bare-bones.git
synced 2026-01-11 18:33:15 +01:00
A configure script has been created. Right now it simply selects the platform to target.
Use any one of these: ./configure x86_64 ./configure x86 While in the build directory. Signed-off-by: The XOmB Overlord <overlord@xomb.net>
This commit is contained in:
committed by
The XOmB Overlord
parent
54614b27f6
commit
36543aa80f
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,4 +4,5 @@ build/dsss.last
|
||||
build/xomb.dump
|
||||
build/xomb.iso
|
||||
build/iso/boot/xomb
|
||||
build/dsss.conf
|
||||
*.swp
|
||||
|
||||
22
build/configure.sh
Executable file
22
build/configure.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
render_usage()
|
||||
{
|
||||
echo "USAGE: ./configure --target=[TARGET]"
|
||||
echo ""
|
||||
echo "TARGET - one of the following values: "
|
||||
for item in confs/*.conf;
|
||||
do
|
||||
echo "$item" | sed -e 's/confs\/\(.*\)\.conf/\1/';
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
render_usage
|
||||
else
|
||||
FILE=confs/$1.conf
|
||||
echo "Targetting $1"
|
||||
cp $FILE dsss.conf
|
||||
fi
|
||||
71
build/confs/x86_64.conf
Normal file
71
build/confs/x86_64.conf
Normal file
@@ -0,0 +1,71 @@
|
||||
name = xomb
|
||||
|
||||
CC = x86_64-pc-elf-gcc
|
||||
CFLAGS = -nostdlib -nodefaultlibs -g -DUSE_ASSERT -mcmodel=kernel
|
||||
|
||||
[*]
|
||||
buildflags=-dc=ldc-xomb
|
||||
|
||||
[../kernel/core/kmain.d]
|
||||
|
||||
buildflags=-dc=ldc-xomb -I..
|
||||
|
||||
# compile the assembly for the target
|
||||
|
||||
prebuild= \
|
||||
\
|
||||
\
|
||||
echo ; \
|
||||
echo Setting up Architecture Dependence: x86_64; \
|
||||
echo '--> architecture.d';\
|
||||
mkdir -p dsss_imports;\
|
||||
cp ../kernel/arch/x86_64/imports/architecture.d dsss_imports/.;\
|
||||
echo ; \
|
||||
echo Compiling Assembly for target: x86_64 ;\
|
||||
echo '--> boot.S';\
|
||||
yasm -o dsss_objs/G/kernel.arch.x86_64.boot.boot.o ../kernel/arch/x86_64/boot/boot.s -felf64;\
|
||||
echo '--> load.S';\
|
||||
yasm -o dsss_objs/G/kernel.arch.x86_64.load.load.o ../kernel/arch/x86_64/boot/load.s -felf64;\
|
||||
\
|
||||
\
|
||||
echo ; \
|
||||
echo Compiling Kernel Runtime ; \
|
||||
echo '--> kernel/runtime/object.d';\
|
||||
ldc -nodefaultlib -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/object.d -ofdsss_objs/G/kernel.runtime.object.o; \
|
||||
echo '--> kernel/runtime/invariant.d';\
|
||||
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/invariant.d -ofdsss_objs/G/kernel.runtime.invariant.o; \
|
||||
echo '--> kernel/runtime/std/typeinfo/*';\
|
||||
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c `ls ../kernel/runtime/std/typeinfo/*.d` -oddsss_objs/G/. ;\
|
||||
echo '--> kernel/runtime/dstubs.d';\
|
||||
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/dstubs.d -ofdsss_objs/G/kernel.runtime.dstubs.o ;\
|
||||
echo '--> kernel/runtime/util.d';\
|
||||
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/util.d -ofdsss_objs/G/kernel.runtime.util.o ;\
|
||||
echo '--> kernel/runtime/std/moduleinit.d';\
|
||||
ldc -nodefaultlib -g -I.. -I../kernel/runtime/. -code-model=kernel -c ../kernel/runtime/std/moduleinit.d -ofdsss_objs/G/kernel.runtime.std.moduleinit.o ;\
|
||||
\
|
||||
echo ; \
|
||||
echo Compiling Kernel Proper ;
|
||||
|
||||
# what the target is
|
||||
|
||||
target = xomb.iso
|
||||
|
||||
# we will need some post build foo to link and create the iso
|
||||
|
||||
postbuild = \
|
||||
\
|
||||
echo ; \
|
||||
echo Creating Kernel Executable; \
|
||||
echo '--> xomb';\
|
||||
#llvm-ld -native -Xlinker=-nostdlib -Xlinker=-Tlinker.ld -Xlinker="-b elf64-x86-64" `ls dsss_objs/G/*.o` -o iso/boot/xomb ; \
|
||||
#llvm-ld -nodefaultlib -g -I.. -I../kernel/runtime/. `ls dsss_objs/G/*.o` ;\
|
||||
ld -nostdlib -nodefaultlibs -b elf64-x86-64 -T ../kernel/arch/x86_64/linker.ld -o iso/boot/xomb `ls dsss_objs/G/*.o`;\
|
||||
\
|
||||
echo ;\
|
||||
echo Creating Kernel Dump; \
|
||||
echo '--> xomb.dump';\
|
||||
rm -f xomb.dump && x86_64-pc-elf-objdump -d -S -r iso/boot/xomb > xomb.dump;\
|
||||
\
|
||||
echo ;\
|
||||
echo Compiling ISO; \
|
||||
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 16 -boot-info-table -input-charset UTF-8 -o xomb.iso ./iso
|
||||
Reference in New Issue
Block a user