972
edits
[unchecked revision] | [unchecked revision] |
mNo edit summary |
m (Bot: Replace deprecated source tag with syntaxhighlight) |
||
Line 132:
mandatory options the project makefile requires:
<
# Default CFLAGS:
CFLAGS?=-O2 -g
Line 138:
# Add mandatory options to CFLAGS:
CFLAGS:=$(CFLAGS) -Wall -Wextra
</syntaxhighlight>
== Architecture Directories ==
Line 224:
You can easily download the source code using [[Git]] from the [https://gitlab.com/sortie/meaty-skeleton Meaty Skeleton Git repository]. This is preferable to doing a manual error-prone copy, as you may make a mistake or whitespace may get garbled due to bugs in our syntax highlighting. To clone the git repository, do:
<
git clone https://gitlab.com/sortie/meaty-skeleton.git
</syntaxhighlight>
Check for differences between the git revision used in this article and what you cloned (empty output means there is no difference):
<
git diff 084d1624bedaa9f9e395f055c6bd99299bd97f58..master
</syntaxhighlight>
Operating systems development is about being an expert. Take the time to read the code carefully through and understand it. Please seek further information and help if you don't understand aspects of it. This code is minimal and almost everything is done deliberately, often to pre-emptively solve future problems.
Line 499:
==== kernel/arch/i386/make.config ====
<
KERNEL_ARCH_CFLAGS=
KERNEL_ARCH_CPPFLAGS=
Line 508:
$(ARCHDIR)/boot.o \
$(ARCHDIR)/tty.o \
</syntaxhighlight>
==== kernel/arch/i386/crti.S ====
Line 686:
==== libc/include/sys/cdefs.h ====
<
#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H 1
Line 693:
#endif
</syntaxhighlight>
==== libc/include/stdlib.h ====
Line 1,030:
==== libc/arch/i386/make.config ====
<
ARCH_CFLAGS=
ARCH_CPPFLAGS=
Line 1,039:
ARCH_HOSTEDOBJS=\
</syntaxhighlight>
==== libc/.gitignore ====
Line 1,055:
==== build.sh ====
<
#!/bin/sh
set -e
Line 1,063:
(cd $PROJECT && DESTDIR="$SYSROOT" $MAKE install)
done
</syntaxhighlight>
You should make this executable script executable by running:
<
chmod +x build.sh
</syntaxhighlight>
==== clean.sh ====
<
#!/bin/sh
set -e
Line 1,084:
rm -rf isodir
rm -rf myos.iso
</syntaxhighlight>
You should make this executable script executable by running:
<
chmod +x clean.sh
</syntaxhighlight>
==== config.sh ====
<
SYSTEM_HEADER_PROJECTS="libc kernel"
PROJECTS="libc kernel"
Line 1,122:
export CC="$CC -isystem=$INCLUDEDIR"
fi
</syntaxhighlight>
==== default-host.sh ====
<
#!/bin/sh
echo i686-elf
</syntaxhighlight>
You should make this executable script executable by running:
<
chmod +x default-host.sh
</syntaxhighlight>
==== headers.sh ====
<
#!/bin/sh
set -e
Line 1,148:
(cd $PROJECT && DESTDIR="$SYSROOT" $MAKE install-headers)
done
</syntaxhighlight>
You should make this executable script executable by running:
<
chmod +x headers.sh
</syntaxhighlight>
==== iso.sh ====
Line 1,176:
You should make this executable script executable by running:
<
chmod +x iso.sh
</syntaxhighlight>
==== qemu.sh ====
<
#!/bin/sh
set -e
Line 1,188:
qemu-system-$(./target-triplet-to-arch.sh $HOST) -cdrom myos.iso
</syntaxhighlight>
You should make this executable script executable by running:
<
chmod +x qemu.sh
</syntaxhighlight>
==== target-triplet-to-arch.sh ====
<
#!/bin/sh
if echo "$1" | grep -Eq 'i[[:digit:]]86-'; then
Line 1,204:
echo "$1" | grep -Eo '^[[:alnum:]_]*'
fi
</syntaxhighlight>
You should make this executable script executable by running:
<
chmod +x target-triplet-to-arch.sh
</syntaxhighlight>
==== .gitignore ====
Line 1,228:
the source tree by invoking:
<
./clean.sh
</syntaxhighlight>
You can install all the system headers into the system root without relying on
Line 1,236:
[[Hosted GCC Cross-Compiler]], by invoking:
<
./headers.sh
</syntaxhighlight>
You can build a bootable cdrom image of the operating system by invoking:
<
./iso.sh
</syntaxhighlight>
It's probably a good idea to create a quick ''build-and-then-launch'' short-cut
like used in this example to run the system in your favorite emulator quickly:
<
./qemu.sh
</syntaxhighlight>
== Troubleshooting ==
|