Pineconium / ChoacuryOS

A WIP custom built OS
GNU General Public License v3.0
24 stars 6 forks source link

Implement PS/2 mouse driver using the existing PS/2 controller code #22

Closed Bananymous closed 2 months ago

Bananymous commented 2 months ago

PS/2 controller already initialized interrupt handlers, forwarded bytes and handled command queues for PS/2 devices. This PR implements PS/2 mouse using the existing structure. This allows us to easily query for mouse extensions without messing up command send order.

VGA code is also cleaned up and fixed. The old VGA text mode initialization code did not initialize the text mode properly (did not load a font), so you could not return back to text mode after graphics mode was initialized.

All cursor code is moved to gui/ directory as that is the place where it should be handled. There is no reason for VGA code to even know about the existence of a cursor. All that VGA driver should do is to move between different graphics and text modes and plot pixels and characters.

chstat command memory output is also fixed. The old implementation looked only at the last memory map entry, which may or may not be the biggest or even usable memory. Now the code is looking at all memory regions and adding up the lengths of usable regions.

Desktop mode can now be exited using ESC key. Pressing ESC key reloads VGA text mode and re-renders the terminal screen.

Please give feedback or suggestions about code improvements and get familiar with the changes.