From df083e306a53e6a45a5730e7059032be43cc75ff Mon Sep 17 00:00:00 2001 From: Nick Shipp Date: Sun, 30 Sep 2018 17:05:47 -0400 Subject: Dirty rotten commit full of badness Milestone: Got SMP cores booting and into long mode. The rest is all trash, but maybe trash worth a future archaeological dig. --- bunny/src/io.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 bunny/src/io.rs (limited to 'bunny/src/io.rs') diff --git a/bunny/src/io.rs b/bunny/src/io.rs new file mode 100644 index 0000000..2fae55a --- /dev/null +++ b/bunny/src/io.rs @@ -0,0 +1,18 @@ +use x86_64::instructions::port::{Port, PortReadWrite}; + +const PIC1 : u16 = 0x20; +const PIC2 : u16 = 0xa0; +#[allow(unused)] +pub const PIC1_COMMAND : u16 = PIC1; +pub const PIC1_DATA : u16 = PIC1; +#[allow(unused)] +pub const PIC2_COMMAND : u16 = PIC2 + 1; +pub const PIC2_DATA : u16 = PIC2 + 1; + +pub const PIC_DISABLE : u8 = 0xff; + +#[inline(always)] +pub unsafe fn out(port: u16, value: T) { + let mut p = Port::new(port); + p.write(value) +} -- cgit v1.2.3-70-g09d2