1
0
Fork 0
forked from koniifer/ableos

fix cargo check std error, temporarily get rid of repbuild

This commit is contained in:
TheOddGarlic 2022-08-02 14:07:24 +03:00
parent b3721bca19
commit da42059b61
9 changed files with 5 additions and 422 deletions

189
Cargo.lock generated
View file

@ -90,12 +90,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "anyhow"
version = "1.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c91f1f46651137be86f3a2b9a8359f9ab421d04d941c62b5982e1ca21113adf9"
[[package]]
name = "asl"
version = "0.1.0"
@ -103,17 +97,6 @@ dependencies = [
"logos",
]
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi",
]
[[package]]
name = "autocfg"
version = "1.1.0"
@ -167,45 +150,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
version = "3.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3dbbb6653e7c55cc8595ad3e1f7be8f32aba4eb7ff7f0fd1163d4f3d137c0a9"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"clap_lex",
"indexmap",
"once_cell",
"strsim",
"termcolor",
"textwrap",
]
[[package]]
name = "clap_derive"
version = "3.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4"
dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "clap_lex"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
dependencies = [
"os_str_bytes",
]
[[package]]
name = "conquer-once"
version = "0.3.2"
@ -305,31 +249,6 @@ dependencies = [
"ahash",
]
[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "indexmap"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [
"autocfg",
"hashbrown",
]
[[package]]
name = "kernel"
version = "0.1.2"
@ -363,7 +282,7 @@ checksum = "da83a57f3f5ba3680950aa3cbc806fc297bc0b289d42e8942ed528ace71b8145"
[[package]]
name = "libwasm"
version = "0.1.0"
source = "git+https://git.ablecorp.us/theoddgarlic/libwasm.git#337bf84d1964ec3ffa91ee6840c15711cc1051b4"
source = "git+https://git.ablecorp.us/able/libwasm.git#e50b7beb8a2087f5a9e527c3ebac31fd3ff42aff"
[[package]]
name = "linked_list_allocator"
@ -479,12 +398,6 @@ version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
[[package]]
name = "os_str_bytes"
version = "6.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4"
[[package]]
name = "owned_ttf_parser"
version = "0.15.1"
@ -535,30 +448,6 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc5c99d529f0d30937f6f4b8a86d988047327bb88d04d2c4afc356de74722131"
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]]
name = "proc-macro2"
version = "1.0.42"
@ -622,15 +511,6 @@ version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "repbuild"
version = "0.1.1"
dependencies = [
"anyhow",
"clap",
"xshell",
]
[[package]]
name = "riscv"
version = "0.8.0"
@ -742,12 +622,6 @@ dependencies = [
"lock_api",
]
[[package]]
name = "strsim"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
version = "1.0.98"
@ -759,21 +633,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "termcolor"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
dependencies = [
"winapi-util",
]
[[package]]
name = "textwrap"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
[[package]]
name = "toml"
version = "0.5.9"
@ -903,37 +762,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d1a10e1dedffff9cfcbdd33c289c65b87da634259a460a3f23d513649fa7a8c"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "x86_64"
version = "0.14.10"
@ -958,21 +786,6 @@ dependencies = [
"x86_64",
]
[[package]]
name = "xshell"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaad2035244c56da05573d4d7fda5f903c60a5f35b9110e157a14a1df45a9f14"
dependencies = [
"xshell-macros",
]
[[package]]
name = "xshell-macros"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4916a4a3cad759e499a3620523bf9545cc162d7a06163727dde97ce9aaa4cf39"
[[package]]
name = "y-compositor-protocol"
version = "0.1.1"

View file

@ -5,5 +5,4 @@ members = [
"ext2-rs",
"kernel",
"facepalm",
"repbuild",
]

View file

@ -124,7 +124,7 @@ features = ["core"]
version = "*"
[dependencies.libwasm]
git = "https://git.ablecorp.us:443/theoddgarlic/libwasm.git"
git = "https://git.ablecorp.us:443/able/libwasm.git"
default-features = false
[dependencies.externc-libm]

View file

@ -213,9 +213,6 @@ pub fn reset_pit_for_cpu() {
set_pit_3(1000);
}
pub fn bsod(src: BSODSource) -> ! {
let mut x = 1;
let mut y = 0;
let src1 = match src {
BSODSource::DoubleFault(_) => "DoubleFault".to_string(),
BSODSource::Panic(panic_info) => {
@ -231,9 +228,6 @@ pub fn bsod(src: BSODSource) -> ! {
println!("\n{}", st);
let mut x = 1;
let mut y = 34;
// let sf = format!("https://git.ablecorp.us/able/ableos/wiki/Double-Faults");
let sd = match src {

View file

@ -6,4 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
[dependencies.logos]
logos = "0.12.1"
default-features = false

View file

@ -1,13 +0,0 @@
[package]
name = "repbuild"
version = "0.1.1"
edition = "2021"
authors = ["Able", "NotAble"]
[dependencies]
xshell = "0.1.9"
anyhow = "*"
[dependencies.clap]
version = "3.1.8"
features = ["derive"]

View file

@ -1,5 +0,0 @@
# AbleOS Build system
The ableOS build system was ripped from repnops xtask build system in the risc-v kernel (hence the name)
# Release
Fail if not compiling on all platforms

View file

@ -1,50 +0,0 @@
set -eu
root_dir=root
img_file=img.ext2
user="Able"
# Create a test directory to convert to ext2.
mkdir -p "$root_dir"
mkdir -p "$root_dir/boot"
mkdir -p "$root_dir/system"
mkdir -p "$root_dir/system/bins"
mkdir -p "$root_dir/system/configs"
mkdir -p "$root_dir/shared"
mkdir -p "$root_dir/shared/bins"
mkdir -p "$root_dir/shared/configs"
mkdir -p "$root_dir/home"
mkdir -p "$root_dir/home/$user"
mkdir -p "$root_dir/home/$user/.trash"
mkdir -p "$root_dir/home/$user/bins"
mkdir -p "$root_dir/home/$user/configs"
# Build the userland here
mke2fs \
-L '' \
-N 0 \
-O ^64bit \
-d "$root_dir" \
-m 5 \
-r 1 \
-I 128 \
-t ext2 \
"$img_file" \
4M \
;

View file

@ -1,158 +0,0 @@
use std::io::stdin;
use anyhow::{Error, Ok};
use clap::Parser;
#[derive(clap::Parser, Debug)]
// #[clap(version = clap::crate_version!(), author = clap::crate_authors!("\n"))]
/// Hello Remember this is a feature
enum Command {
Run {
#[clap(long, short)]
debug: bool,
#[clap(long, short)]
profile: bool,
#[clap(long, short, arg_enum)]
machine: Option<MachineType>,
},
Doc {
#[clap(long, short, arg_enum)]
machine: Option<MachineType>,
},
Mount {
#[clap(long, short)]
path: Option<String>,
},
Unmount {
#[clap(long, short)]
path: Option<String>,
},
MakeFS {},
}
#[derive(clap::ArgEnum, Debug, Clone)]
enum MachineType {
X86,
Riscv,
Arm,
}
fn main() -> anyhow::Result<()> {
let args = Command::parse();
match args {
Command::Run {
debug,
profile,
machine,
} => {
let _dir = xshell::pushd("./ableos");
match machine.unwrap_or(MachineType::X86) {
MachineType::X86 => {
// export RUSTFLAGS=\"-Cforce-unwind-tables -Clink-arg=-Wl,eh_frame.ld\" &&
match debug {
true => xshell::cmd!("cargo run -- -S -gdb tcp::9000").run()?,
false => xshell::cmd!("cargo run --release").run()?,
}
if profile {
xshell::cmd!("python qprofiler.py --path=qmp-sock --filename=target/x86_64-ableos/release/ableos").run()?;
}
}
MachineType::Arm => {
xshell::cmd!("cargo build --release --target=json_targets/aarch64-ableos.json")
.run()?;
#[rustfmt::skip]
xshell::cmd!(
"qemu-system-aarch64
-machine virt
-m 1024M
-cpu cortex-a53
-kernel target/aarch64-ableos/release/ableos
-device virtio-keyboard
"
).run()?;
}
MachineType::Riscv => {
xshell::cmd!("cargo build --release --target=riscv64gc-unknown-none-elf")
.run()?;
#[rustfmt::skip]
xshell::cmd!(
"qemu-system-riscv64
-machine virt
-cpu rv64
-smp 8
-m 128M
-bios src/arch/riscv/firmwear/opensbi-riscv64-generic-fw_jump.bin
-kernel target/riscv64gc-unknown-none-elf/release/ableos
"
// -serial stdio
).run()?;
}
}
}
Command::Doc { machine } => {
let _dir = xshell::pushd("./ableos");
match machine.unwrap_or(MachineType::X86) {
MachineType::X86 => {
xshell::cmd!("cargo doc --open").run()?;
}
MachineType::Arm => {
xshell::cmd!("cargo doc --open --target=json_targets/aarch64-ableos.json")
.run()?;
}
MachineType::Riscv => {
xshell::cmd!("cargo doc --open --target=riscv64gc-unknown-none-elf").run()?;
}
}
}
Command::Mount { path } => {
let path = path.unwrap_or_else(|| "./userland/root_fs/mnt".to_string());
xshell::cmd!("sudo mount userland/root_fs/ext2.img {path}").run()?;
}
Command::Unmount { path } => {
let path = path.unwrap_or_else(|| "./userland/root_fs/mnt".to_string());
xshell::cmd!("sudo umount {path}").run()?;
}
Command::MakeFS {} => match make_fs() {
Result::Ok(_) => {}
Err(err) => println!("{}", err),
},
}
Ok(())
}
pub fn make_fs() -> Result<(), Error> {
xshell::cmd!("sh repbuild/assets/mkfs.sh").run()?;
println!("Make changes in root_fs");
let mut input = String::new();
println!("Press enter when ready:");
stdin().read_line(&mut input).unwrap();
// build
// xshell::cmd!("rm -rf root").run()?;
Ok(())
}
pub fn make_user(user: String) -> Result<(), Error> {
xshell::mkdir_p(user)?;
Ok(())
}