mirror of
https://github.com/Leonmmcoset/cleonos.git
synced 2026-04-21 18:44:01 +00:00
2.4 KiB
2.4 KiB
CLeonOS Stage25
Stage Goal
- Make
tty2(Alt+F2) enter a basic desktop environment. - Add first-step mouse support (PS/2 mouse IRQ and on-screen pointer).
- Keep kernel shell on
tty1(Alt+F1) unchanged.
What Was Implemented
- New kernel modules:
clks/kernel/mouse.cclks/kernel/desktop.c
- New public headers:
clks/include/clks/mouse.hclks/include/clks/desktop.h
- Interrupt and PIC updates:
- Enable PIC cascade + mouse IRQ line.
- Route IRQ12 (
vector 44) to mouse byte handler.
- PS/2 mouse bring-up:
- Enable aux device.
- Set controller config for mouse IRQ.
- Send mouse commands (
F6,F4) and verify ACK. - Decode 3-byte PS/2 packets into X/Y/buttons.
- Desktop on tty2:
clks_desktop_tick()renders a simple graphical desktop scene.- Draw software mouse cursor and button state indicator.
- Refresh when pointer changes and periodically to keep desktop clean.
- TTY adjustments:
- Disable text cursor blinking on
tty2to avoid desktop overlay artifacts.
- Disable text cursor blinking on
- Keyboard routing adjustment:
- Shell input queue only accepts character input while active TTY is
tty1(index 0). - Alt+F1..F4 switching remains available globally.
- Shell input queue only accepts character input while active TTY is
- Framebuffer primitives:
- Added
clks_fb_draw_pixel()andclks_fb_fill_rect()for desktop rendering.
- Added
- Kernel flow integration:
- Stage banner ->
CLEONOS Stage25 START. - Initialize mouse + desktop during boot.
- Call desktop tick in
usrdtask.
- Stage banner ->
Acceptance Criteria
- Boot log shows
CLEONOS Stage25 START. - Alt+F1 enters shell TTY; shell input works as before.
- Alt+F2 switches to desktop view (non-text UI).
- Mouse movement updates on-screen pointer in tty2.
- Left mouse button changes pointer/indicator state.
Build Targets
make setupmake userappsmake isomake runmake debug
QEMU Command
qemu-system-x86_64 -M q35 -m 1024M -cdrom build/CLeonOS-x86_64.iso -serial stdio
Common Bugs and Debugging
- Desktop not visible after Alt+F2:
- Check
clks_desktop_init()log lines and confirm framebuffer is ready.
- Check
- Mouse pointer does not move:
- Check mouse init logs (
PS2 POINTER ONLINE) and IRQ12 routing ininterrupts.c.
- Check mouse init logs (
- Frequent text artifacts on desktop:
- Ensure desktop periodic redraw is active in
clks_desktop_tick().
- Ensure desktop periodic redraw is active in
- Shell unexpectedly receives input while on desktop:
- Verify keyboard routing guard uses
clks_tty_active() == 0.
- Verify keyboard routing guard uses