Implementing a PS/2 Mouse Driver in my Custom OS (PoragOS)

2026-11-11来源 dev.to GitHubEnglish
Implementing a PS/2 Mouse Driver in my Custom OS (PoragOS)

I am building a 32-bit x86 Operating System from scratch as a 7th-grade student. Today, I successfully implemented a PS/2 mouse driver!

What I did:

Enabled the auxiliary PS/2 port.

Handled IRQ12 interrupts.

Decoded the 3-byte movement packets (handling X/Y sign extension).

Wrote a custom rendering function to draw a cursor directly to the VESA Framebuffer.

Here is the screenshot of the cursor working in QEMU.

Next, I am going to fix the cursor trails using a backbuffer and move on to implementing User Space (Ring 3) and Syscalls.

Check out the code on GitHub:
 https://github.com/porag2025-glitch/PoragOS. #osdev #c #programming #showdev

原文:https://www.a8q9.cn/en/article/implementing-a-ps-2-mouse-driver-in-my-custom-os-poragos-2e2a4a.html

相关文章