get and set cursor position in long mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
nicola
Member
Member
Posts: 32
Joined: Mon May 16, 2011 2:05 pm
Location: hanoi

get and set cursor position in long mode

Post by nicola »

i've followed the articles on osdev wiki and successfully entered
long mode, however this long mode doesn't allow calling to BIOS
interrupts

so how to get and set cursor position (text screen) in long mode?
(like we used to use int 10h)
I'm using AMD Sempron 140 Single core 2.7GHz
User avatar
nicola
Member
Member
Posts: 32
Joined: Mon May 16, 2011 2:05 pm
Location: hanoi

Re: get and set cursor position in long mode

Post by nicola »

tks berkus

i found this article in osdev wiki http://wiki.osdev.org/Text_Mode_Cursor
which shows how to set cursor position in text 80x25 mode but
it doesn't suggest how to read cursor position

any useful links?
I'm using AMD Sempron 140 Single core 2.7GHz
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: get and set cursor position in long mode

Post by gerryg400 »

Do you really need to read the cursor position ? If you take over the cursor, your program will always know where it last put the cursor.
If a trainstation is where trains stop, what is a workstation ?
User avatar
nicola
Member
Member
Posts: 32
Joined: Mon May 16, 2011 2:05 pm
Location: hanoi

Re: get and set cursor position in long mode

Post by nicola »

yeah, but then i have to store the cursor position in my program's memory
i just don't want to let everything be confused between 2 locations storing the same values
so there must be some similar method as setting cursor position in the osdev wiki article?
I'm using AMD Sempron 140 Single core 2.7GHz
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: get and set cursor position in long mode

Post by Combuster »

I suggest you start reading VGA documentation. If you can write a register, you can just as well read it. It just requires some effort from your side to figure out the details, and well within the required programming qualities for this forum.

That said, writing vga registers is slow, reading vga registers is even slower. You want to touch them as little as possible so keeping a local copy is a whole factor faster.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply