Page 1 of 1

What is the way to start/stop Mouse driver for GNU-EFI ?

Posted: Mon Feb 15, 2021 6:44 pm
by gomidas
I need to start my mouse and keyboard drivers as I want to exit from boot services I think. I am not sure what is the way of doing it. I have no idea about drivers. First I wanted to look for GPU drivers and after diving in it I got that that is almost impossible to implement it.


I tried something like this. This can be completely wrong.

Code: Select all

USB_DEVICE_PATH* MouseDevicePath;
EFI_GUID MOUSE_GUID = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
void LocateMouse()
{
	Status = gBS->LocateProtocol(&MOUSE_GUID, NULL, (void**)&MouseDevicePath);
	CHKERR(Status, L"CAN NOT LOCATE");
}
What should I do respectively to start and stop it ?

Re: What is the way to start/stop Mouse driver for GNU-EFI ?

Posted: Mon Feb 15, 2021 7:30 pm
by Octocontrabass
What's the purpose of the code there? Are you trying to get the device path for the mouse?

Even if you do get the device path, it only tells you where the mouse was during boot. You still need to parse the ACPI tables and enumerate buses to discover installed hardware, same as you do with BIOS.

In an emulator, you can cheat and configure it to use a PS/2 controller and PS/2 mouse. Since you know exactly what hardware the emulator provides, you can skip the enumeration and go straight to writing your PS/2 mouse driver.