Sync computers
This commit is contained in:
@@ -16,7 +16,7 @@ use log::info;
|
||||
|
||||
use crate::{
|
||||
io::init_log,
|
||||
pci::scan_pci_for_virtio_keyboard,
|
||||
pci::{PciDeviceIterator, scan_pci_for_virtio_keyboard},
|
||||
riscv::enable_supervisor_interrupt,
|
||||
scheduler::{SCHEDULER, idle},
|
||||
user::{proc2, test},
|
||||
@@ -60,6 +60,9 @@ static HEAP_INITIALIZED: AtomicBool = AtomicBool::new(false);
|
||||
// Usize is assumed to be an u64 in the whole kernel
|
||||
const _: () = assert!(core::mem::size_of::<usize>() == core::mem::size_of::<u64>());
|
||||
|
||||
#[cfg(not(target_endian = "little"))]
|
||||
compile_error! {"This kernel implementation assume endianness is little-endian. Some memory access like PCI could not work in big-endian."}
|
||||
|
||||
// 1. Allouer de la mémoire statique alignée pour la queue
|
||||
static mut KBD_QUEUE: Virtqueue = unsafe { core::mem::zeroed() };
|
||||
pub static mut KBD_DRIVER: Option<VirtioPciDriver> = None;
|
||||
@@ -87,6 +90,10 @@ pub extern "C" fn supervisor_mode_entry() {
|
||||
|
||||
enable_supervisor_interrupt();
|
||||
|
||||
for pci in PciDeviceIterator::new() {
|
||||
println!("{:x?}", pci.vendor_and_device_id())
|
||||
}
|
||||
|
||||
unsafe {
|
||||
let pci_info = scan_pci_for_virtio_keyboard().unwrap();
|
||||
KBD_DRIVER = Some(VirtioPciDriver::new(
|
||||
|
||||
Reference in New Issue
Block a user