flat assembler
Message board for the users of flat assembler.

Index > Heap > Disable hardware cursor (C)

Author
Thread Post new topic Reply to topic
DataHunter2009



Joined: 10 Jun 2005
Posts: 144
DataHunter2009
Alrighty, I'm working on an operating system. So far, it's been going very well. No stalls, no restarts, no errors.

But now, I want to get rid of the blinking cursor that displays at the top of the screen after it prints text.

I tried asking about it in #osdev on irc.wyldryde.org, but they started bashing me for being an idiot and not knowing bit manipulation. From past experience, I know people here are alot nicer. So I figured I would ask here.

I have the kernel written in C, and I have added an outportb() function. I know the port (0Ah), but I just don't know what value to pass to it. Can someone help please???

Thanks,
David
Post 12 Mar 2006, 22:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17248
Location: In your JS exploiting you and your system
revolution
I think the easiest way is to place the cursor off the screen so it is not visible. eg, at a position like x=0,y=26 assuming 25 line text mode.
Post 13 Mar 2006, 04:28
View user's profile Send private message Visit poster's website Reply with quote
kake_zinger



Joined: 15 Jul 2004
Posts: 51
kake_zinger
Or set the cursor height to zero, there are docs which show how to do this. When using the off screen location method use the end of screen memory in order to save yourself from possible trouble relating to screen size changes.

Note that the position given to the cursor placement is in terms of words, that is character plus attribute pairs. This is a factor if you're keeping track of screen position in bytes.

What I use:

Code:
updatecursorpos:                        ;Update cursor to where edi points
        push    eax ebx edx
        mov     ebx,edi                 ;Copy current videomem location
        shr     ebx,1                   ;Position on screen = edi/2
        cli                             ;Ints off while doing this
        mov     dx,3d4h                 ;VGA CRT controller address register
        mov     al,0eh                  ;Cursor location high register
        out     dx,al
        mov     dx,3d5h                 ;VGA CRTC data register ;inc dx
        mov     al,bh                   ;Cursor high byte
        out     dx,al
        mov     dx,3d4h                 ;Address
        mov     al,0fh                  ;Cursor location low register
        out     dx,al
        mov     dx,3d5h                 ;Data
        mov     al,bl                   ;Cursor low byte
        out     dx,al
        sti                             ;Ints on again
        pop     edx ebx eax
        ret
;updatecursorpos_end:
    
Post 13 Mar 2006, 06:51
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.