can run virtio gpu/block
This commit is contained in:
parent
07029a2e5f
commit
093db48d04
5 changed files with 17 additions and 4 deletions
|
@ -1,8 +1,8 @@
|
|||
pub const CLOCK_FREQ: usize = 12500000;
|
||||
|
||||
pub const MMIO: &[(usize, usize)] = &[
|
||||
(0x1000_0000, 0x1000), // VIRT_UART0 in virt machine
|
||||
(0x1000_1000, 0x1000), // VIRT_VIRTIO in virt machine
|
||||
(0x1000_0000, 0xa000), // VIRT_UART0 in virt machine
|
||||
// (0x1000_1000, 0x9000), // VIRT_VIRTIO with GPU in virt machine
|
||||
(0x0C00_0000, 0x40_0000), // VIRT_PLIC in virt machine
|
||||
(0x0010_0000, 0x00_2000), // VIRT_TEST/RTC in virt machine
|
||||
];
|
||||
|
|
|
@ -12,7 +12,7 @@ use lazy_static::*;
|
|||
use virtio_drivers::{BlkResp, RespStatus, VirtIOBlk, VirtIOHeader};
|
||||
|
||||
#[allow(unused)]
|
||||
const VIRTIO0: usize = 0x10001000;
|
||||
const VIRTIO0: usize = 0x10008000;
|
||||
|
||||
pub struct VirtIOBlock {
|
||||
virtio_blk: UPIntrFreeCell<VirtIOBlk<'static>>,
|
||||
|
|
|
@ -22,6 +22,7 @@ mod console;
|
|||
mod config;
|
||||
mod drivers;
|
||||
mod fs;
|
||||
mod gui;
|
||||
mod lang_items;
|
||||
mod mm;
|
||||
mod sbi;
|
||||
|
@ -30,7 +31,6 @@ mod syscall;
|
|||
mod task;
|
||||
mod timer;
|
||||
mod trap;
|
||||
mod gui;
|
||||
|
||||
core::arch::global_asm!(include_str!("entry.asm"));
|
||||
|
||||
|
@ -57,9 +57,13 @@ lazy_static! {
|
|||
pub fn rust_main() -> ! {
|
||||
clear_bss();
|
||||
mm::init();
|
||||
println!("KERN: init gpu");
|
||||
GPU_DEVICE.clone();
|
||||
println!("KERN: init keyboard");
|
||||
KEYBOARD_DEVICE.clone();
|
||||
println!("KERN: init mouse");
|
||||
MOUSE_DEVICE.clone();
|
||||
println!("KERN: init trap");
|
||||
trap::init();
|
||||
trap::enable_timer_interrupt();
|
||||
timer::set_next_trigger();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue