aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Borner2020-08-01 16:01:29 +0200
committerMarvin Borner2020-08-01 16:01:29 +0200
commitaf80895e50ddacbbe68b47650f29d0f8edbc82d7 (patch)
tree83da98cd808df0e615ad93713a09f077a2d4c0d8
parent115f4ff541839f7a97f9413e1ac3ff7695c24c9e (diff)
Switched to main
-rw-r--r--apps/link.ld2
-rw-r--r--apps/test.c2
-rw-r--r--src/features/load.c3
-rw-r--r--src/inc/load.h2
4 files changed, 5 insertions, 4 deletions
diff --git a/apps/link.ld b/apps/link.ld
index 14fe1e3..d977c19 100644
--- a/apps/link.ld
+++ b/apps/link.ld
@@ -1,6 +1,6 @@
OUTPUT_FORMAT("elf32-i386")
OUTPUT_ARCH(i386)
-ENTRY(start)
+ENTRY(main)
SECTIONS
{
diff --git a/apps/test.c b/apps/test.c
index 592f35b..c5e6468 100644
--- a/apps/test.c
+++ b/apps/test.c
@@ -81,7 +81,7 @@ void serial_print(const char *data)
serial_put(data[i]);
}
-void start()
+void main()
{
serial_install();
serial_print("Follow the white rabbit.");
diff --git a/src/features/load.c b/src/features/load.c
index 37ed6ad..47beb9b 100644
--- a/src/features/load.c
+++ b/src/features/load.c
@@ -1,5 +1,6 @@
#include <def.h>
#include <fs.h>
+#include <load.h>
#include <print.h>
void bin_load(char *path)
@@ -7,7 +8,7 @@ void bin_load(char *path)
char *data = read_file(path);
void (*entry)();
- *(void **)(&entry) = data + 0xfe;
+ *(void **)(&entry) = data + MAIN_OFFSET;
entry();
}
diff --git a/src/inc/load.h b/src/inc/load.h
index afca249..8ba026b 100644
--- a/src/inc/load.h
+++ b/src/inc/load.h
@@ -3,7 +3,7 @@
#ifndef LOAD_H
#define LOAD_H
-#include <def.h>
+#define MAIN_OFFSET 0xfe
void bin_load(char *path);