summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-01-22 22:38:47 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2014-01-22 22:38:47 -0800
commit27aefbd40e8723a841344e2ef0320c10f05f69e3 (patch)
tree5b3dc53d77e3da74c74a4bd6840d545c1cbbc69d
parent07f5ce75794e7afe97204d5291db30c9f8e0bef8 (diff)
downloadtest16-27aefbd40e8723a841344e2ef0320c10f05f69e3.tar.gz
test16-27aefbd40e8723a841344e2ef0320c10f05f69e3.tar.xz
test16-27aefbd40e8723a841344e2ef0320c10f05f69e3.zip
lib16: pass argc and argv to main(), convert crt0 to C
Pass the usual arguments to main(). Right now there is no strong reason to write _start in assembly, so don't. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--lib16/crt0.S7
-rw-r--r--lib16/crt0.c8
2 files changed, 8 insertions, 7 deletions
diff --git a/lib16/crt0.S b/lib16/crt0.S
deleted file mode 100644
index 447e002..0000000
--- a/lib16/crt0.S
+++ /dev/null
@@ -1,7 +0,0 @@
- .code16
- .section ".init","ax"
- .globl _start
-_start:
- jmp main
- .type _start,@function
- .size _start,.-_start
diff --git a/lib16/crt0.c b/lib16/crt0.c
new file mode 100644
index 0000000..acc21c3
--- /dev/null
+++ b/lib16/crt0.c
@@ -0,0 +1,8 @@
+#include <sys16.h>
+
+extern int main(int, char **);
+
+int __attribute__((section(".init"))) _start(void)
+{
+ return main(SYS->argc, SYS->argv);
+}