1
0
Fork 0

Merge branch 'nix'

This commit is contained in:
Astro 2020-01-26 01:46:22 +01:00
commit 266b0dec1a
7 changed files with 1726 additions and 2004 deletions

29
Cargo.lock generated
View File

@ -15,10 +15,27 @@ name = "byteorder"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "compiler_builtins"
version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "experiments"
version = "0.0.0"
dependencies = [
"libboard_zc706 0.0.0",
"libboard_zynq 0.0.0",
"libcortex_a9 0.0.0",
"libregister 0.0.0",
"smoltcp 0.5.0 (git+https://github.com/m-labs/smoltcp.git?rev=8eb01aca364aefe5f823d68d552d62c76c9be4a3)",
]
[[package]]
name = "libboard_zc706"
version = "0.0.0"
dependencies = [
"compiler_builtins 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"libboard_zynq 0.0.0",
"libcortex_a9 0.0.0",
"libregister 0.0.0",
@ -100,21 +117,11 @@ dependencies = [
"vcell 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "zc706-experiments"
version = "0.0.0"
dependencies = [
"libboard_zc706 0.0.0",
"libboard_zynq 0.0.0",
"libcortex_a9 0.0.0",
"libregister 0.0.0",
"smoltcp 0.5.0 (git+https://github.com/m-labs/smoltcp.git?rev=8eb01aca364aefe5f823d68d552d62c76c9be4a3)",
]
[metadata]
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd"
"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
"checksum compiler_builtins 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b9975aefa63997ef75ca9cf013ff1bb81487aaa0b622c21053afd3b92979a7af"
"checksum linked_list_allocator 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "47314ec1d29aa869ee7cb5a5be57be9b1055c56567d59c3fb6689926743e0bea"
"checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6"
"checksum r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f"

View File

@ -4,7 +4,7 @@
nix-shell --command "cargo xbuild --release"
```
Currently the ELF output is placed at `target/armv7-none-eabihf/release/zc706-experiments`
Currently the ELF output is placed at `target/armv7-none-eabihf/release/experiments`
# Debug

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,9 @@ let
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
rustcSrc = pkgs.fetchgit {
url = https://github.com/rust-lang/rust.git;
# master of 2019-11-09
rev = "ac162c6abe34cdf965afc0389f6cefa79653c63b";
sha256 = "06c5gws1mrpr69z1gzs358zf7hcsg6ky8n4ha0vv2s9d9w93x1kj";
# master of 2020-01-25
rev = "c2d141df59703393c0c683abc259f9a8c3be041a";
sha256 = "0v23ia4sp436yjksbq5m5vdarj481w2z8q3px51kidabdd2282yr";
fetchSubmodules = true;
};
targets = [];
@ -24,7 +24,7 @@ let
cargo = rust;
});
gcc = pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc;
xbuildRustPackage = attrs:
xbuildRustPackage = { cargoFeatures, crateSubdir, ... } @ attrs:
let
buildPkg = rustPlatform.buildRustPackage attrs;
in
@ -32,23 +32,32 @@ let
nativeBuildInputs =
nativeBuildInputs ++ [ pkgs.cargo-xbuild ];
buildPhase = ''
cargo xbuild --release --frozen
set -x
pushd ${crateSubdir}
cargo xbuild --release --frozen \
--no-default-features \
--features=${cargoFeatures}
popd
'';
XARGO_RUST_SRC = "${rustcSrc}/src";
installPhase = ''
mkdir $out
ls -la target/armv7-none-eabihf/release/
cp target/armv7-none-eabihf/release/${name} $out/${name}.elf
'';
});
zc706 = xbuildRustPackage {
name = "zc706";
xbuildCrate = crate: features: xbuildRustPackage rec {
name = "${crate}";
src = ./.;
cargoSha256 = "15icqy72dck82czpsqz41yjsdar17vpi15v22j6z0zxhzf517rf7";
nativeBuildInputs = [
gcc
];
crateSubdir = crate;
cargoSha256 = "1wvj585vylbjlab7cxbkr4f60km5y7s8knxxvcixmqywdldnh7g2";
cargoFeatures = features;
doCheck = false;
};
in {
inherit pkgs rustPlatform rustcSrc zc706 gcc;
inherit pkgs rustPlatform rustcSrc gcc;
zc706 = {
zc706-experiments = xbuildCrate "experiments" "target_zc706";
cora-experiments = xbuildCrate "experiments" "target_cora_z7_10";
};
}

View File

@ -1,5 +1,5 @@
[package]
name = "zc706-experiments"
name = "experiments"
description = "Developing bare-metal Rust on Zynq"
version = "0.0.0"
authors = ["Astro <astro@spaceboyz.net>"]

View File

@ -11,6 +11,7 @@ target_cora_z7_10 = ["libboard_zynq/target_cora_z7_10"]
[dependencies]
r0 = "0.2"
compiler_builtins = "0.1"
linked_list_allocator = { version = "0.6", default-features = false }
libregister = { path = "../libregister" }
libcortex_a9 = { path = "../libcortex_a9" }

View File

@ -5,6 +5,7 @@
#![feature(panic_info_message)]
pub extern crate alloc;
pub extern crate compiler_builtins;
pub mod boot;
mod abort;