| Crates.io | amiga-sys |
| lib.rs | amiga-sys |
| version | 0.0.1 |
| created_at | 2025-07-23 15:22:08.134207+00 |
| updated_at | 2025-07-23 15:22:08.134207+00 |
| description | Rust FFI bindings for the Amiga (m68k) system libraries |
| homepage | |
| repository | https://github.com/retrokp/amiga-sys |
| max_upload_size | |
| id | 1764910 |
| size | 1,897,193 |
Unofficial unsafe bindings for the Amiga (m68k) system libraries.
🎁 🎉 Amiga was released 40 years ago! Happy birthday Amiga! 🎉 🎁
Note: if you want to build high performance games or demos, have a look at amiga-rust.
It is likely that Rust programs developed for Amiga will crash or simply refuse to compile, because the Rust toolchain for Amiga is still missing many pieces:
std library for AmigaIf you still want to try this out, then read on..
no_std (no dependency to std or alloc)test_rawdofmt().FileInfoBlock and InfoData should be aligned to 4 bytes, but they don't have
alignment modifiers, because it would change the size of AnchorPath and AChain.
Proper alignment can be achieved by wrapping FileInfoBlock and InfoData:
#[repr(C, align(4))] pub struct AlignedFileInfoBlock { data: FileInfoBlock }The crate includes pregenerated bindings. If someone wants to regenerate them, follow these steps. These steps have been tested with nightly-2025-07-06.
amiga-sys parent folder, so that it is next to the amiga-sys foldercd amiga-sysgenerate.sh
These steps have been tested on Ubuntu 24.04 LTS.
Prerequisites:
m68k-amiga-elf-gcc, m68k-amiga-elf-ld, elf2hunk and their related files installed,
executables need to be found in PATH.Building:
cd examples/hello-cli
cargo build --release
elf2hunk target/m68k-bare-metal/release/hello-cli.elf target/m68k-bare-metal/release/hello-cli
# Amiga executable: target/m68k-bare-metal/release/hello-cli
The release build is usually more successful than the debug build.
The .cargo/config.toml file has some configurations. The rust-roolchain.toml file isn't
necessary if nightly is the default toolchain.
To build the tester example, follow the steps above by replacing hello-cli with tester.
could not compile .. (signal: 5, SIGTRAP: trace/breakpoint trap)
__mulsi3 or similar functions: the compiler is missing
some internal functions ?memset, memcpy or similar functions are missing: these errors occur because
compiler_builtins hasn't been completed for Amiga ?Often function string parameters are null-terminated. Sometimes they are not
null-terminated and the length is given as an extra parameter. Structs mostly use null-terminated
strings (STRPTR). Amiga uses the
ECMA-94 encoding,
which is the same as ISO-8859-1 and Latin1.
Licensed under either of Apache License, Version 2.0 or 0BSD license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.