some cleanup
This commit is contained in:
18
echo.S
18
echo.S
@@ -1,18 +0,0 @@
|
|||||||
.section .text
|
|
||||||
.globl _start
|
|
||||||
|
|
||||||
.equ UART_DATA, 0
|
|
||||||
.equ UART_STATUS, 1
|
|
||||||
.equ UART_RX_READY, 0b10
|
|
||||||
.equ UART_TX_READY, 0b01
|
|
||||||
|
|
||||||
_start:
|
|
||||||
li a0, 0x10000
|
|
||||||
|
|
||||||
loop:
|
|
||||||
lbu t0, UART_STATUS(a0)
|
|
||||||
andi t0, t0, UART_RX_READY
|
|
||||||
beqz t0, loop
|
|
||||||
lbu t0, UART_DATA(a0)
|
|
||||||
sb t0, UART_DATA(a0)
|
|
||||||
j loop
|
|
||||||
11
src/main.rs
11
src/main.rs
@@ -4,7 +4,7 @@
|
|||||||
// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
|
// This file is part of TRVE (https://gitea.taitep.se/taitep/trve)
|
||||||
// See LICENSE file in the project root for full license text.
|
// See LICENSE file in the project root for full license text.
|
||||||
|
|
||||||
use std::{io, os::fd::AsFd, path::PathBuf, sync::Arc, time::Duration};
|
use std::{io, path::PathBuf, sync::Arc, time::Duration};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
@@ -42,16 +42,13 @@ fn main() -> Result<()> {
|
|||||||
let mut mmio_root = MmioRoot::default();
|
let mut mmio_root = MmioRoot::default();
|
||||||
mmio_root.insert(0, Arc::new(DbgOut));
|
mmio_root.insert(0, Arc::new(DbgOut));
|
||||||
|
|
||||||
if let Err(e) = fcntl(io::stdin().as_fd(), FcntlArg::F_SETFL(OFlag::O_NONBLOCK)) {
|
if let Err(e) = fcntl(io::stdin(), FcntlArg::F_SETFL(OFlag::O_NONBLOCK)) {
|
||||||
eprintln!("Could not make stdout nonblocking, skipping. Error: {e}");
|
eprintln!("Could not make stdout nonblocking, skipping. Error: {e}");
|
||||||
}
|
}
|
||||||
|
|
||||||
let uart = devices::serial::SifiveUart::new_arc();
|
let uart = devices::serial::SifiveUart::new_arc();
|
||||||
uart.clone().spawn_io_thread(
|
uart.clone()
|
||||||
std::io::stdin(),
|
.spawn_io_thread(io::stdin(), io::stdout(), Duration::from_millis(10));
|
||||||
std::io::stdout(),
|
|
||||||
Duration::from_millis(10),
|
|
||||||
);
|
|
||||||
mmio_root.insert(0x10000, uart);
|
mmio_root.insert(0x10000, uart);
|
||||||
|
|
||||||
let mem_cfg = MemConfig {
|
let mem_cfg = MemConfig {
|
||||||
|
|||||||
Reference in New Issue
Block a user