Implement user schemes. Example in pcid. Currently deadlocks in UserInner

This commit is contained in:
Jeremy Soller 2016-09-20 08:47:16 -06:00
parent c512d04378
commit 791dbfa7ad
9 changed files with 231 additions and 79 deletions

View file

@ -2,8 +2,10 @@
extern crate syscall;
use std::fs::File;
use std::io::{Read, Write};
use std::thread;
use syscall::iopl;
use syscall::{iopl, Packet};
use pci::{Pci, PciBar, PciClass};
@ -75,5 +77,17 @@ fn main() {
unsafe { iopl(3).unwrap() };
enumerate_pci();
let mut scheme = File::create(":pci").expect("pcid: failed to create pci scheme");
loop {
let mut packet = Packet::default();
scheme.read(&mut packet).expect("pcid: failed to read events from pci scheme");
println!("{:?}", packet);
packet.a = 0;
scheme.write(&packet).expect("pcid: failed to write responses to pci scheme");
}
});
}