mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
Kernel: Add support for vmmouse
We add this feature together with the VMWareBackdoor class. VMWareBackdoor class is responsible for enabling the vmmouse, and then controlling it from the PS2 mouse IRQ handler.
This commit is contained in:
parent
44ddfd2bf5
commit
47978a5828
8 changed files with 328 additions and 3 deletions
12
Kernel/IO.h
12
Kernel/IO.h
|
@ -27,6 +27,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Arch/i386/CPU.h>
|
||||
#include <Kernel/Devices/VMWareBackdoor.h>
|
||||
|
||||
namespace IO {
|
||||
|
||||
|
@ -87,6 +89,16 @@ inline void repeated_out16(u16 port, const u8* data, int data_size)
|
|||
: "d"(port));
|
||||
}
|
||||
|
||||
inline void vmware_out(VMWareCommand& command)
|
||||
{
|
||||
command.magic = VMWARE_MAGIC;
|
||||
command.port = VMWARE_PORT;
|
||||
command.si = 0;
|
||||
command.di = 0;
|
||||
asm volatile("in %%dx, %0"
|
||||
: "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
|
||||
}
|
||||
|
||||
inline void delay()
|
||||
{
|
||||
// ~3 microsecs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue