From 52b9c8fb3838cd3fd7410f1b9b145277bcef017f Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:31:19 +0200 Subject: [PATCH] _start works kinda --- src/sys/x86_64/start.rs | 8 ++++++++ test.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sys/x86_64/start.rs b/src/sys/x86_64/start.rs index e69de29..adab5ac 100644 --- a/src/sys/x86_64/start.rs +++ b/src/sys/x86_64/start.rs @@ -0,0 +1,8 @@ + +core::arch::global_asm!( + ".global _start", + "_start:", + "mov rdi, 42", + "mov rax, 60", + "syscall" +); diff --git a/test.sh b/test.sh index 8ab49fe..2c97ffd 100755 --- a/test.sh +++ b/test.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -cargo run --manifest-path example-user/Cargo.toml +cargo run --manifest-path example-user/Cargo.toml --target x86_64-unknown-linux-gnu