mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
slot in utra references
This commit is contained in:
parent
6be6975c77
commit
711e5ea910
10 changed files with 37 additions and 5 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
|
@ -207,6 +207,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"embedded-graphics",
|
"embedded-graphics",
|
||||||
"minifb",
|
"minifb",
|
||||||
|
"utra",
|
||||||
"xous",
|
"xous",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -796,6 +797,10 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "utra"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vec_map"
|
name = "vec_map"
|
||||||
version = "0.8.2"
|
version = "0.8.2"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ members = [
|
||||||
"examples/graphics-server",
|
"examples/graphics-server",
|
||||||
"examples/log-server",
|
"examples/log-server",
|
||||||
"xtask",
|
"xtask",
|
||||||
|
"utra/utra"
|
||||||
]
|
]
|
||||||
default-members = [
|
default-members = [
|
||||||
"examples/shell",
|
"examples/shell",
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ description = "Manage the video output"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
xous = { path = "../../xous-rs" }
|
xous = { path = "../../xous-rs" }
|
||||||
embedded-graphics = "0.6"
|
embedded-graphics = "0.6"
|
||||||
|
utra = { path = "../../utra/utra"}
|
||||||
|
|
||||||
[target.'cfg(not(target_os = "none"))'.dependencies]
|
[target.'cfg(not(target_os = "none"))'.dependencies]
|
||||||
minifb = "0.17"
|
minifb = "0.17"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use embedded_graphics::{drawable::Pixel, geometry::Size, pixelcolor::BinaryColor, DrawTarget};
|
use embedded_graphics::{drawable::Pixel, geometry::Size, pixelcolor::BinaryColor, DrawTarget};
|
||||||
use xous::MemoryRange;
|
use xous::MemoryRange;
|
||||||
|
use utra;
|
||||||
|
|
||||||
const FB_WIDTH_WORDS: usize = 11;
|
const FB_WIDTH_WORDS: usize = 11;
|
||||||
const FB_WIDTH_PIXELS: usize = 336;
|
const FB_WIDTH_PIXELS: usize = 336;
|
||||||
|
|
@ -19,7 +20,7 @@ pub struct XousDisplay {
|
||||||
impl XousDisplay {
|
impl XousDisplay {
|
||||||
pub fn new() -> XousDisplay {
|
pub fn new() -> XousDisplay {
|
||||||
let fb = xous::syscall::map_memory(
|
let fb = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(0xb000_0000),
|
xous::MemoryAddress::new(utra::HW_MEMLCD_MEM),
|
||||||
None,
|
None,
|
||||||
((FB_WIDTH_WORDS * FB_LINES * 4) + 4096) & !4095,
|
((FB_WIDTH_WORDS * FB_LINES * 4) + 4096) & !4095,
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
|
|
@ -27,7 +28,7 @@ impl XousDisplay {
|
||||||
.expect("couldn't map control port");
|
.expect("couldn't map control port");
|
||||||
|
|
||||||
let control = xous::syscall::map_memory(
|
let control = xous::syscall::map_memory(
|
||||||
xous::MemoryAddress::new(0xf000_a000),
|
xous::MemoryAddress::new(utra::HW_MEMLCD_BASE),
|
||||||
None,
|
None,
|
||||||
4096,
|
4096,
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
|
|
|
||||||
5
kernel/Cargo.lock
generated
5
kernel/Cargo.lock
generated
|
|
@ -168,6 +168,7 @@ dependencies = [
|
||||||
"riscv",
|
"riscv",
|
||||||
"sha3",
|
"sha3",
|
||||||
"stats_alloc",
|
"stats_alloc",
|
||||||
|
"utra",
|
||||||
"xous",
|
"xous",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -361,6 +362,10 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "utra"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasi"
|
name = "wasi"
|
||||||
version = "0.9.0+wasi-snapshot-preview1"
|
version = "0.9.0+wasi-snapshot-preview1"
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ bitflags = "1.2.1"
|
||||||
xous-kernel = { package = "xous", path = "../xous-rs", features = ["forget-memory-messages"] }
|
xous-kernel = { package = "xous", path = "../xous-rs", features = ["forget-memory-messages"] }
|
||||||
stats_alloc = { version = "0.1.8", optional = true }
|
stats_alloc = { version = "0.1.8", optional = true }
|
||||||
sha3 = { default-features = false, version = "0.8.2" }
|
sha3 = { default-features = false, version = "0.8.2" }
|
||||||
|
utra = { path = "../utra/utra"}
|
||||||
|
|
||||||
[target.'cfg(target_arch = "riscv32")'.dependencies]
|
[target.'cfg(target_arch = "riscv32")'.dependencies]
|
||||||
riscv = "0.5.6"
|
riscv = "0.5.6"
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
use core::fmt::{Error, Write};
|
use core::fmt::{Error, Write};
|
||||||
|
use utra;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
#[cfg(all(not(test), any(feature = "debug-print", feature = "print-panics")))]
|
#[cfg(all(not(test), any(feature = "debug-print", feature = "print-panics")))]
|
||||||
pub mod debug_print_hardware {
|
pub mod debug_print_hardware {
|
||||||
use crate::debug::*;
|
use crate::debug::*;
|
||||||
pub const SUPERVISOR_UART: Uart = Uart {
|
pub const SUPERVISOR_UART: Uart = Uart {
|
||||||
base: 0xf000_4000 as *mut usize,
|
base: utra::HW_UART_BASE as *mut usize,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ mod syscall;
|
||||||
|
|
||||||
use services::SystemServices;
|
use services::SystemServices;
|
||||||
use xous_kernel::*;
|
use xous_kernel::*;
|
||||||
|
use utra;
|
||||||
|
|
||||||
#[cfg(baremetal)]
|
#[cfg(baremetal)]
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
@ -64,7 +65,7 @@ pub extern "C" fn init(arg_offset: *const u32, init_offset: *const u32, rpt_offs
|
||||||
mem::MemoryManager::with_mut(|memory_manager| {
|
mem::MemoryManager::with_mut(|memory_manager| {
|
||||||
memory_manager
|
memory_manager
|
||||||
.map_range(
|
.map_range(
|
||||||
0xF0004000 as *mut u8,
|
utra::HW_UART_BASE as *mut u8,
|
||||||
((debug::SUPERVISOR_UART.base as u32) & !4095) as *mut u8,
|
((debug::SUPERVISOR_UART.base as u32) & !4095) as *mut u8,
|
||||||
4096,
|
4096,
|
||||||
PID::new(1).unwrap(),
|
PID::new(1).unwrap(),
|
||||||
|
|
|
||||||
|
|
@ -16,22 +16,38 @@ fi
|
||||||
# This is handled in part by betrusted-scripts, with provision-xous.sh
|
# This is handled in part by betrusted-scripts, with provision-xous.sh
|
||||||
# stage1 and kernel are merged into xous.img by this script.
|
# stage1 and kernel are merged into xous.img by this script.
|
||||||
|
|
||||||
|
if [ ! -f ../../betrusted-soc/build/software/soc.svd ]
|
||||||
|
then
|
||||||
|
echo "Rebuilding UTRA crate..."
|
||||||
|
cd utra && ./svd2utra.py -f ../../betrusted-soc/build/software/soc.svd
|
||||||
|
else
|
||||||
|
echo "WARNING: soc.svd not found, using stock example file (should only happen for certain CI tests)"
|
||||||
|
cd utra && ./svd2utra.py -f example/soc.svd
|
||||||
|
fi
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo "Compiling top..."
|
||||||
cargo build --release --target riscv32imac-unknown-none-elf
|
cargo build --release --target riscv32imac-unknown-none-elf
|
||||||
|
echo "Compiling kernel..."
|
||||||
cd kernel && cargo build -p kernel --release --target riscv32imac-unknown-none-elf
|
cd kernel && cargo build -p kernel --release --target riscv32imac-unknown-none-elf
|
||||||
cd ..
|
cd ..
|
||||||
|
echo "Compiling loader..."
|
||||||
cd loader && cargo build -p loader --release --target riscv32imac-unknown-none-elf
|
cd loader && cargo build -p loader --release --target riscv32imac-unknown-none-elf
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
echo "Creating image..."
|
||||||
cargo run --release -p tools --bin create-image -- \
|
cargo run --release -p tools --bin create-image -- \
|
||||||
--csv emulation/csr.csv \
|
--csv emulation/csr.csv \
|
||||||
--kernel kernel/target/riscv32imac-unknown-none-elf/release/kernel \
|
--kernel kernel/target/riscv32imac-unknown-none-elf/release/kernel \
|
||||||
--init target/riscv32imac-unknown-none-elf/release/shell \
|
--init target/riscv32imac-unknown-none-elf/release/shell \
|
||||||
target/args.bin
|
target/args.bin
|
||||||
|
|
||||||
|
echo "Building binary..."
|
||||||
riscv64-unknown-elf-objcopy loader/target/riscv32imac-unknown-none-elf/release/loader -O binary loader.bin
|
riscv64-unknown-elf-objcopy loader/target/riscv32imac-unknown-none-elf/release/loader -O binary loader.bin
|
||||||
dd if=/dev/null of=loader.bin bs=1 count=1 seek=65536
|
dd if=/dev/null of=loader.bin bs=1 count=1 seek=65536
|
||||||
cat loader.bin target/args.bin > xous.img
|
cat loader.bin target/args.bin > xous.img
|
||||||
|
|
||||||
|
echo "Copying to target..."
|
||||||
if [ $# -gt 0 ]
|
if [ $# -gt 0 ]
|
||||||
then
|
then
|
||||||
if [ -z "$2" ]
|
if [ -z "$2" ]
|
||||||
|
|
|
||||||
2
utra
2
utra
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2ed30d55172356d36649086b3c13796a4e15d6f3
|
Subproject commit fe1860ebf4b386b7dc452ac08d18f8d0ec804b50
|
||||||
Loading…
Reference in a new issue