summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-08 12:43:53 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-08 12:43:53 +0200
commit1230afc0aaef07b03f09d3725f459df07b982de8 (patch)
treece0f127319285a010547bfb3695a9a634f778684 /src/kernel
parent70266efd6fbe9a12a19cbec451eec536266ffb5e (diff)
downloadabaos-1230afc0aaef07b03f09d3725f459df07b982de8.tar.gz
abaos-1230afc0aaef07b03f09d3725f459df07b982de8.tar.bz2
added dedicated kernel entry to avoid address reordering under compiler optimization
affect the entry poin 0x8800 of kernel_main (now kernel_entry)
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/entry.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/kernel/entry.c b/src/kernel/entry.c
new file mode 100644
index 0000000..d0e75a7
--- /dev/null
+++ b/src/kernel/entry.c
@@ -0,0 +1,16 @@
+#include "kernel.h"
+
+// must be first entry in kernel.bin (0x8800) as stage 2 of
+// the boot loader expects the entry point to b here!
+//
+// compilers (at least gcc) mess with the order of functions when
+// compiling with optimization levels, so kernel_main ends up somewhere
+// in the first compilation unit. I didn't find an elegand way (but for
+// an ld script with custom section and some compiler specific attributes
+// how to solve this issue). This solution here is sort of a nice
+// workaround working no matter what the compilers try to do (of course
+// till we get optimization across compilation units that is)
+void kernel_entry( void )
+{
+ kernel_main( );
+}