initial commit
This commit is contained in:
16
rdraught-pi/Cargo.toml
Normal file
16
rdraught-pi/Cargo.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "rdraught-pi"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
authors = ["Walter Oggioni <oggioni.walter@gmail.com>"]
|
||||
license = "MIT"
|
||||
rust-version = "1.87"
|
||||
|
||||
[[bin]]
|
||||
name = "hello"
|
||||
path = "src/hello.rs"
|
||||
|
||||
[dependencies]
|
||||
panic-halt = "1.0"
|
||||
libc = { version = "0.2", default-features = false }
|
||||
|
17
rdraught-pi/src/hello.rs
Normal file
17
rdraught-pi/src/hello.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use libc::printf;
|
||||
|
||||
extern crate libc;
|
||||
extern crate panic_halt;
|
||||
|
||||
#[link(name = "c", kind = "static")]
|
||||
unsafe extern "C" {}
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn main() {
|
||||
unsafe {
|
||||
printf("Hello world!!\n".as_ptr() as *const i8);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user