Text Mode Cursor: Difference between revisions

Jump to navigation Jump to search
Added section Setting the Cursor Start and End Scanlines
[unchecked revision][unchecked revision]
(Added section Setting the Cursor Start and End Scanlines)
Line 83:
ret
</source>
 
==Setting the Cursor Start and End Scanlines==
Use the Cursor Start Register (0x0A) and the Cursor End Register (0x0B). The highest scanline is 0 and the lowest scanline is the maximum scanline (15 worked for me).
 
===Source in C===
<source lang="c">
// enable the cursor and set the cursor start and end scanlines
void enable_cursor(uint8_t cursor_start, uint8_t cursor_end)
{
outb(0x3D4, 0x0A);
outb(0x3D5, (inb(0x3D5) & 0xC0) | cursor_start);
 
outb(0x3D4, 0x0B);
outb(0x3D5, (inb(0x3E0) & 0xE0) | cursor_end);
}
</source>
 
To make the cursor be a block instead of a line, try enable_cursor(0, 15).
 
==Disabling The Cursor With the BIOS==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu