Skip to content

Commit

Permalink
Initial, buildable code and repo layout
Browse files Browse the repository at this point in the history
Two MIPS III N32 ABI executables are produced; requires this patch:
rust-lang/rust#113497

See the readme for instructions and other notes.
  • Loading branch information
xSetech committed Jul 10, 2023
1 parent 670fe01 commit 7e2bdc8
Show file tree
Hide file tree
Showing 21 changed files with 1,031 additions and 676 deletions.
58 changes: 58 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ---
# Configuration for Cargo inherited by all virtual workspaces
# ---

# The Nintendo 64 is not an officially supported platform by Rust. To target
# this platform, normally available out of the box modules and intrinsics for
# officially supported platforms (e.g. memset) must be compiled alongside the
# packages in this repo.
#
# Docs:
# - https://doc.rust-lang.org/cargo/reference/unstable.html#build-std
# - https://doc.rust-lang.org/cargo/reference/unstable.html#build-std-features
# - https://github.com/rust-lang/compiler-builtins
#
[unstable]
build-std = [
"core",
"compiler_builtins",
]
build-std-features = [
"compiler-builtins-mem",
]

# Linking "freestanding" binaries requires special incantations on most platforms,
# see: https://os.phil-opp.com/freestanding-rust-binary/#linker-errors
#
[target.'cfg(target_os = "linux")']
rustflags = [
"-C", "link-arg=-nostartfiles",
]

[target.'cfg(target_os = "macos")']
rustflags = [
"-C", "link-args=-e __start -static -nostartfiles",
]

# This project targets the platform's central processor and graphics coprocessor,
# which have different microarchitectures (despite both being MIPS processors).
# Target-specific rustc flags are defined below if they're needed. Example args
# useful for debugging code generate are left commented.
#
[target.mips-ultra64-cpu]
rustflags = [
# "--verbose",
# "--print", "link-args",
# "--emit=llvm-ir,llvm-bc",
# "-C", "save-temps",
]

[target.mips-ultra64-rcp]
rustflags = [
# "--verbose",
# "--print", "link-args",
# "--emit=llvm-ir,llvm-bc",
# "-C", "save-temps",
]

# eof
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rust-analyzer.linkedProjects": [
"${workspaceFolder}/Cargo.toml"
]
}
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[workspace]
resolver = "2"
members = [
"lib-kernel",
"rcp-kernel",
"cpu-kernel",
]

[workspace.package]
version = "0.0.1"
edition = "2021"
license = "GPL-3.0+"
repository = "https://github.com/xSetech/Summer"
authors = [
"Seth Junot <xsetech@gmail.com>",
]

[profile.dev]
panic = "abort"

[profile.release]
panic = "abort"
Loading

0 comments on commit 7e2bdc8

Please sign in to comment.