mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +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 = [
|
||||
"embedded-graphics",
|
||||
"minifb",
|
||||
"utra",
|
||||
"xous",
|
||||
]
|
||||
|
||||
|
|
@ -796,6 +797,10 @@ version = "0.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||
|
||||
[[package]]
|
||||
name = "utra"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "vec_map"
|
||||
version = "0.8.2"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ members = [
|
|||
"examples/graphics-server",
|
||||
"examples/log-server",
|
||||
"xtask",
|
||||
"utra/utra"
|
||||
]
|
||||
default-members = [
|
||||
"examples/shell",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ description = "Manage the video output"
|
|||
[dependencies]
|
||||
xous = { path = "../../xous-rs" }
|
||||
embedded-graphics = "0.6"
|
||||
utra = { path = "../../utra/utra"}
|
||||
|
||||
[target.'cfg(not(target_os = "none"))'.dependencies]
|
||||
minifb = "0.17"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use embedded_graphics::{drawable::Pixel, geometry::Size, pixelcolor::BinaryColor, DrawTarget};
|
||||
use xous::MemoryRange;
|
||||
use utra;
|
||||
|
||||
const FB_WIDTH_WORDS: usize = 11;
|
||||
const FB_WIDTH_PIXELS: usize = 336;
|
||||
|
|
@ -19,7 +20,7 @@ pub struct XousDisplay {
|
|||
impl XousDisplay {
|
||||
pub fn new() -> XousDisplay {
|
||||
let fb = xous::syscall::map_memory(
|
||||
xous::MemoryAddress::new(0xb000_0000),
|
||||
xous::MemoryAddress::new(utra::HW_MEMLCD_MEM),
|
||||
None,
|
||||
((FB_WIDTH_WORDS * FB_LINES * 4) + 4096) & !4095,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
|
|
@ -27,7 +28,7 @@ impl XousDisplay {
|
|||
.expect("couldn't map control port");
|
||||
|
||||
let control = xous::syscall::map_memory(
|
||||
xous::MemoryAddress::new(0xf000_a000),
|
||||
xous::MemoryAddress::new(utra::HW_MEMLCD_BASE),
|
||||
None,
|
||||
4096,
|
||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||
|
|
|
|||
5
kernel/Cargo.lock
generated
5
kernel/Cargo.lock
generated
|
|
@ -168,6 +168,7 @@ dependencies = [
|
|||
"riscv",
|
||||
"sha3",
|
||||
"stats_alloc",
|
||||
"utra",
|
||||
"xous",
|
||||
]
|
||||
|
||||
|
|
@ -361,6 +362,10 @@ version = "0.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
|
||||
|
||||
[[package]]
|
||||
name = "utra"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
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"] }
|
||||
stats_alloc = { version = "0.1.8", optional = true }
|
||||
sha3 = { default-features = false, version = "0.8.2" }
|
||||
utra = { path = "../utra/utra"}
|
||||
|
||||
[target.'cfg(target_arch = "riscv32")'.dependencies]
|
||||
riscv = "0.5.6"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
use core::fmt::{Error, Write};
|
||||
use utra;
|
||||
#[macro_use]
|
||||
#[cfg(all(not(test), any(feature = "debug-print", feature = "print-panics")))]
|
||||
pub mod debug_print_hardware {
|
||||
use crate::debug::*;
|
||||
pub const SUPERVISOR_UART: Uart = Uart {
|
||||
base: 0xf000_4000 as *mut usize,
|
||||
base: utra::HW_UART_BASE as *mut usize,
|
||||
};
|
||||
|
||||
#[macro_export]
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ mod syscall;
|
|||
|
||||
use services::SystemServices;
|
||||
use xous_kernel::*;
|
||||
use utra;
|
||||
|
||||
#[cfg(baremetal)]
|
||||
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| {
|
||||
memory_manager
|
||||
.map_range(
|
||||
0xF0004000 as *mut u8,
|
||||
utra::HW_UART_BASE as *mut u8,
|
||||
((debug::SUPERVISOR_UART.base as u32) & !4095) as *mut u8,
|
||||
4096,
|
||||
PID::new(1).unwrap(),
|
||||
|
|
|
|||
|
|
@ -16,22 +16,38 @@ fi
|
|||
# This is handled in part by betrusted-scripts, with provision-xous.sh
|
||||
# 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
|
||||
echo "Compiling kernel..."
|
||||
cd kernel && cargo build -p kernel --release --target riscv32imac-unknown-none-elf
|
||||
cd ..
|
||||
echo "Compiling loader..."
|
||||
cd loader && cargo build -p loader --release --target riscv32imac-unknown-none-elf
|
||||
cd ..
|
||||
|
||||
echo "Creating image..."
|
||||
cargo run --release -p tools --bin create-image -- \
|
||||
--csv emulation/csr.csv \
|
||||
--kernel kernel/target/riscv32imac-unknown-none-elf/release/kernel \
|
||||
--init target/riscv32imac-unknown-none-elf/release/shell \
|
||||
target/args.bin
|
||||
|
||||
echo "Building binary..."
|
||||
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
|
||||
cat loader.bin target/args.bin > xous.img
|
||||
|
||||
echo "Copying to target..."
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
if [ -z "$2" ]
|
||||
|
|
|
|||
2
utra
2
utra
|
|
@ -1 +1 @@
|
|||
Subproject commit 2ed30d55172356d36649086b3c13796a4e15d6f3
|
||||
Subproject commit fe1860ebf4b386b7dc452ac08d18f8d0ec804b50
|
||||
Loading…
Reference in a new issue