Text Mode Cursor: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content added Content deleted
Line 95: | Line 95: | ||
==Disabling The Cursor Without the BIOS== |
==Disabling The Cursor Without the BIOS== |
||
To diable the cursor without the bios we need to use vga's 0x3d4 index port and his data register located one port above it, we need to set bits 5-0 of register index 0x0a , the LOW cursor shape (we don't need to alter the HIGH cursor shape, he doesn't contain the 'cursor disable' bit inside him .), here's how it translate into code: |
|||
===Source in C=== |
===Source in C=== |
||
<source lang="c"> |
<source lang="c"> |
||
Line 105: | Line 105: | ||
{ |
{ |
||
outb(0x3D4, 0x0A); |
outb(0x3D4, 0x0A); // LOW cursor shape port to vga INDEX register |
||
outb(0x3D5, 0x3f); //bits 6-7 must be 0 , if bit 5 set the cursor is disable , bits 0-4 controll the cursor shape . |
outb(0x3D5, 0x3f); //bits 6-7 must be 0 , if bit 5 set the cursor is disable , bits 0-4 controll the cursor shape . |
||
// LOW cursor shape port to vga INDEX register |
|||
} |
} |
||
</source> |
</source> |
||
Line 114: | Line 113: | ||
<source lang="asm"> |
<source lang="asm"> |
||
; |
;written by Elad Ashkcenazi. |
||
;year - 2017 |
;year - 2017 |
||
;========================================================== |
|||
disable_cursor: pushf |
disable_cursor: pushf |
||
push rax |
push rax |