WIP: Predictable naming

This commit is contained in:
Jeremy Soller 2016-11-21 12:23:17 -07:00
parent 86d676b540
commit 9d37f38849
8 changed files with 26 additions and 11 deletions

View file

@ -7,7 +7,7 @@ pub mod disk;
pub mod fis;
pub mod hba;
pub fn disks(base: usize) -> Vec<Disk> {
pub fn disks(base: usize, name: &str) -> Vec<Disk> {
unsafe { &mut *(base as *mut HbaMem) }.init();
let pi = unsafe { &mut *(base as *mut HbaMem) }.pi.read();
let ret: Vec<Disk> = (0..32)
@ -15,7 +15,7 @@ pub fn disks(base: usize) -> Vec<Disk> {
.filter_map(|i| {
let port = &mut unsafe { &mut *(base as *mut HbaMem) }.ports[i];
let port_type = port.probe();
print!("{}", format!("{}: {:?}\n", i, port_type));
print!("{}", format!("{}-{}: {:?}\n", name, i, port_type));
match port_type {
HbaPortType::SATA => {
match Disk::new(i, port) {