This commit is contained in:
NGnius (Graham) 2024-01-10 20:24:29 -05:00
parent 93ef2b931b
commit 23209f13e0
3 changed files with 7 additions and 3 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
/target **/target
/Cargo.lock /Cargo.lock

View file

@ -1,3 +1,4 @@
workspace = { members = ["ecplorer"] }
[package] [package]
name = "smokepatio" name = "smokepatio"
version = "0.1.0" version = "0.1.0"

View file

@ -1,8 +1,10 @@
// x86 and x86_64 // x86 and x86_64
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub(crate) fn outb(port: u16, val: u8) { pub(crate) fn outb(port: u16, val: u8) {
//let val: i16 = val.into();
unsafe { unsafe {
std::arch::asm!("outb", in("dx") port, in("al") val); std::arch::asm!("out dx, al", in("dx") port, in("al") val);
//std::arch::asm!("outb %al, %dx", in("al") val, in("dx") port, options(att_syntax));
} }
} }
@ -10,7 +12,8 @@ pub(crate) fn outb(port: u16, val: u8) {
pub(crate) fn inb(port: u16) -> u8 { pub(crate) fn inb(port: u16) -> u8 {
let out: u8; let out: u8;
unsafe { unsafe {
std::arch::asm!("inb", in("dx") port, lateout("al") out); std::arch::asm!("in al, dx", in("dx") port, lateout("al") out);
// asm!("inb %dx, %al", in("dx") port, out("al") ret, options(att_syntax));
} }
out out
} }