Skip to content

Commit

Permalink
Switch to cargo cross build
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalmiel committed Sep 23, 2023
1 parent 35ada94 commit d61bf3d
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 46 deletions.
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
target = "x86_64-cykusz_os.json"

[unstable]
build-std-features = ["compiler-builtins-mem"]
build-std = ["alloc", "core", "compiler_builtins"]
63 changes: 28 additions & 35 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = ["syscall-defs", "syscall-user", "user-alloc", "userspace", "acpica", "cykusz-rs"]
resolver = "2"

[profile.release]
debug=false
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assembly_source_files := $(wildcard cykusz-rs/src/arch/$(arch)/asm/*.asm)
assembly_object_files := $(patsubst cykusz-rs/src/arch/$(arch)/asm/%.asm, \
build/arch/$(arch)/asm/%.o, $(assembly_source_files))

target ?= $(arch)-unknown-none-gnu
target ?= $(arch)-cykusz_os
ifdef dev
rust_os := target/$(target)/debug/libcykusz_rs.a
rust_shell := target/$(target)/debug/shell
Expand Down Expand Up @@ -97,9 +97,9 @@ usb: $(kernel)

cargo:
ifdef dev
RUST_TARGET_PATH=`pwd` xargo build --workspace --target $(target) --verbose
cargo build --workspace --verbose
else
RUST_TARGET_PATH=`pwd` xargo build --workspace --release --target $(target) --verbose
cargo build --workspace --release --verbose
endif

toolchain: $(cross_cpp)
Expand Down
2 changes: 0 additions & 2 deletions Xargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

cargo fix -p cykusz_rs -p user_alloc -p syscall-user -p syscall-defs --lib --allow-dirty --allow-staged
cargo fix -p cykusz-rs -p user-alloc -p syscall-user -p syscall-defs --lib --allow-dirty --allow-staged
cargo fmt
2 changes: 1 addition & 1 deletion cykusz-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Rafal Mielniczuk <rafal.mielniczuk2@gmail.com>"]
edition = "2021"
name = "cykusz_rs"
name = "cykusz-rs"
version = "0.1.0"

[lib]
Expand Down
1 change: 1 addition & 0 deletions cykusz-rs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![no_std]
#![allow(internal_features)]
#![feature(alloc_error_handler)]
#![feature(array_methods)]
#![feature(asm_const)]
Expand Down
4 changes: 2 additions & 2 deletions disk_scripts/install_os.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ PROGS="test testcpp hello stack nyancat ttytest fork stat fbdoom DOOM1.WAD"

mount /dev/loop0p2 mnt
mkdir -p mnt/bin
cp -f target/x86_64-unknown-none-gnu/release/init mnt/bin/init
cp -f target/x86_64-unknown-none-gnu/release/shell mnt/bin/shell
cp -f target/x86_64-cykusz_os/release/init mnt/bin/init
cp -f target/x86_64-cykusz_os/release/shell mnt/bin/shell

for prog in $PROGS; do
cp -f sysroot/build/$prog mnt/bin/$prog
Expand Down
2 changes: 1 addition & 1 deletion user-alloc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "user_alloc"
name = "user-alloc"
version = "0.1.0"
authors = ["Rafal Mielniczuk <rafal.mielniczuk2@gmail.com>"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion userspace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rlibc = "*"
default-features = false
version = "*"

[dependencies.user_alloc]
[dependencies.user-alloc]
path = "../user-alloc"
[dependencies.syscall-defs]
path = "../syscall-defs"
Expand Down
File renamed without changes.

0 comments on commit d61bf3d

Please sign in to comment.