cpuio 0.3.0

Bare metal (no_std) inb, outb, inw, outw, inl, outw instructions with Rust-like API
1
2
3
4
5
6
7
8
9
10
11
12
13
//! An example program showing how to read a single scancode from a PS/2
//! keyboard.

extern crate cpuio;

use cpuio::Port;

fn main() {
    let mut keyboard: Port<u8> = unsafe { Port::new(0x60) };
    // If you run this as an ordinary user in user space it will fail with
    // a SIGSEGV.
    println!("scancode: {}", keyboard.read());
}