Merge branch 'fix_vmmouse' into 'master'
Fix and re-enable vmmouse support Closes #39 See merge request redox-os/drivers!125
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ impl<F: Fn(u8,bool) -> char> Ps2d<F> {
|
||||
let extra_packet = ps2.init().expect("ps2d: failed to initialize");
|
||||
|
||||
let vmmouse_relative = true;
|
||||
let vmmouse = false; //vm::enable(vmmouse_relative);
|
||||
let vmmouse = vm::enable(vmmouse_relative);
|
||||
|
||||
let mut ps2d = Ps2d {
|
||||
ps2,
|
||||
|
||||
@@ -9,6 +9,7 @@ use core::arch::global_asm;
|
||||
const MAGIC: u32 = 0x564D5868;
|
||||
const PORT: u16 = 0x5658;
|
||||
|
||||
pub const GETVERSION: u32 = 10;
|
||||
pub const ABSPOINTER_DATA: u32 = 39;
|
||||
pub const ABSPOINTER_STATUS: u32 = 40;
|
||||
pub const ABSPOINTER_COMMAND: u32 = 41;
|
||||
@@ -50,6 +51,8 @@ cmd_inner:
|
||||
mov DWORD PTR [rdi + 0x0C], edx
|
||||
mov DWORD PTR [rdi + 0x10], esi
|
||||
mov DWORD PTR [rdi + 0x14], r8d
|
||||
|
||||
ret
|
||||
",
|
||||
MAGIC = const MAGIC,
|
||||
PORT = const PORT,
|
||||
@@ -80,6 +83,12 @@ pub fn enable(relative: bool) -> bool {
|
||||
eprintln!("ps2d: Enable vmmouse");
|
||||
|
||||
unsafe {
|
||||
let (eax, ebx, _, _, _, _) = cmd(GETVERSION, 0);
|
||||
if ebx != MAGIC || eax == 0xFFFFFFFF {
|
||||
eprintln!("ps2d: No vmmouse support");
|
||||
return false;
|
||||
}
|
||||
|
||||
let _ = cmd(ABSPOINTER_COMMAND, CMD_ENABLE);
|
||||
|
||||
let (status, _, _, _, _, _) = cmd(ABSPOINTER_STATUS, 0);
|
||||
|
||||
Reference in New Issue
Block a user