Implement user schemes. Example in pcid. Currently deadlocks in UserInner
This commit is contained in:
parent
c512d04378
commit
791dbfa7ad
9 changed files with 231 additions and 79 deletions
|
@ -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");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::thread;
|
|||
|
||||
use keymap;
|
||||
|
||||
pub fn keyboard() {
|
||||
pub fn keyboard() {
|
||||
let mut file = File::open("irq:1").expect("ps2d: failed to open irq:1");
|
||||
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue