MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Install

Function Install

Kernel/src/arch/x86_64/mouse.cpp:149–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 MouseDevice mouseDev("mouse0");
148
149 void Install()
150 {
151 Wait(1);
152 outportb(0x64, 0xA8); // Enable aux PS/2 input
153
154 outportb(0x64, 0xFF); // Reset Mouse
155
156 //Enable the interrupts
157 Wait(1);
158 outportb(0x64, 0x20);
159 Wait(0);
160 uint8_t status = ((inportb(0x60) & ~0x20) | 2); // Enable interrupts, enable mouse clock
161 Wait(1);
162 outportb(0x64, 0x60);
163 Wait(1);
164 outportb(0x60, status);
165
166 Write(0xF6);
167 Read();
168
169 Write(0xF4);
170 Read();
171
172 IDT::RegisterInterruptHandler(IRQ0 + 12, Handler);
173 APIC::IO::MapLegacyIRQ(12);
174
175 DeviceManager::RegisterDevice(mouseDev);
176 }
177
178 int8_t* GetData() {
179 return mouseData;

Callers 1

kmainFunction · 0.50

Calls 8

outportbFunction · 0.85
inportbFunction · 0.85
RegisterInterruptHandlerFunction · 0.85
MapLegacyIRQFunction · 0.85
RegisterDeviceFunction · 0.85
WaitFunction · 0.70
WriteFunction · 0.70
ReadFunction · 0.70

Tested by

no test coverage detected