summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml3
-rw-r--r--build.rs7
-rw-r--r--src/main.rs2
-rw-r--r--src/start.s22
4 files changed, 33 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a9c6d62..4d2f3dd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,4 +13,7 @@ opt-level = "s"
panic = "abort"
opt-level = "s"
+[build-dependencies]
+cc = "1.0.67"
+
[dependencies]
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..5a33378
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,7 @@
+fn main() {
+ cc::Build::new()
+ .target("arm-none-eabihf")
+ .compiler("clang")
+ .file("src/start.s")
+ .compile("start");
+}
diff --git a/src/main.rs b/src/main.rs
index 716751a..029937f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,7 +4,7 @@
use core::panic::PanicInfo;
#[no_mangle]
-pub extern "C" fn _start() -> ! {
+pub extern "C" fn pre_main() -> ! {
loop {}
}
diff --git a/src/start.s b/src/start.s
new file mode 100644
index 0000000..158feef
--- /dev/null
+++ b/src/start.s
@@ -0,0 +1,22 @@
+.cpu mpcore
+.section ".crt0","ax"
+
+.align 2
+.arm
+
+_start:
+ b pre_main
+
+.ascii "_prm"
+__service_ptr:
+ .word 0
+__apt_appid:
+ .word 0x300
+__heap_size:
+ .word 24*1024*1024
+__linear_heap_size:
+ .word 32*1024*1024
+__system_arglist:
+ .word 0
+__system_runflags:
+ .word 0