From f0d65c068e94aea096a52e6cb17151bcda88b3c4 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 20 Sep 2016 16:23:28 -0600 Subject: [PATCH] Create example userspace scheme. Remove kernel duplication of syscalls, use syscall crate instead --- pcid/src/main.rs | 19 +------------------ ps2d/src/controller.rs | 4 ---- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/pcid/src/main.rs b/pcid/src/main.rs index 976d02a683..0886bef5a9 100644 --- a/pcid/src/main.rs +++ b/pcid/src/main.rs @@ -2,10 +2,8 @@ extern crate syscall; -use std::fs::File; -use std::io::{Read, Write}; use std::thread; -use syscall::{iopl, Packet}; +use syscall::iopl; use pci::{Pci, PciBar, PciClass}; @@ -77,20 +75,5 @@ 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); - if packet.a == 5 { - println!("{}", unsafe { ::std::str::from_utf8_unchecked(::std::slice::from_raw_parts(packet.b as *const u8, packet.c)) }); - } - - packet.a = 0; - - scheme.write(&packet).expect("pcid: failed to write responses to pci scheme"); - } }); } diff --git a/ps2d/src/controller.rs b/ps2d/src/controller.rs index 8355dba7bc..e68d4f13ec 100644 --- a/ps2d/src/controller.rs +++ b/ps2d/src/controller.rs @@ -1,9 +1,5 @@ use io::{Io, Pio, ReadOnly, WriteOnly}; -pub unsafe fn init() { - Ps2::new().init(); -} - bitflags! { flags StatusFlags: u8 { const OUTPUT_FULL = 1,