Page 1 of 1

a stupid vga cursor question...

Posted: Sat May 19, 2012 9:09 pm
by sithlord2
I'm almost ashamed of asking this, but I can't find a solution for a very simple problem:

I use the VGA IO ports to update the cursor position, and this works fine. However, my cursor doesn't not blink :lol:
It's just a fixed line, and I can't seem to figure out which register I need to write to, to set it in "blink" modus...

Re: a stupid vga cursor question...

Posted: Sat May 19, 2012 9:40 pm
by sithlord2
I tried this, but now my cursor even disappears completely :?:

Code: Select all

void con_enableCursor() {
unsigned char value;
outb(0x3d4, 0x0a);
value = inb(0x3D5);
outb(0x3d4, 0x0a);
outb(0x3d5, value|0x20);
}

Re: a stupid vga cursor question...

Posted: Sat May 19, 2012 10:16 pm
by VolTeK
Image

Re: a stupid vga cursor question...

Posted: Sun May 20, 2012 1:52 am
by Combuster
I think the most interesting question to ask is: did it blink before you touched any VGA register? Can you find out what piece of code made it stop doing that?

Re: a stupid vga cursor question...

Posted: Sun May 20, 2012 6:43 am
by sithlord2
VolTeK wrote:Image
Voltak:

First link talks about the cursor and VT100/ANSI escape codes. Not what I was looking for.
Second link talks about the cursor shape, and indeed the blink rate, but no actual code on how to perform this. Also, it says there is no standard way to control the blink rate, so I'm even more surprised that the cursor is not blinking by default.

Nevertheless, a good try to insinuate that I didn't use google to check first, but trust me, I did ;-)

Combuster:

Actually, I did nothing, I use GRUB as a bootloader, and I suspect it's GRUB that modifies the cursor blink before it boots my kernel. I'm doing this in VirtualBox, so there might be a posssibility that the virtual vga-adapter defaults to a non-blinking cursor?

Re: a stupid vga cursor question...

Posted: Sun May 20, 2012 10:00 am
by VolTeK
sithlord2 wrote:Nevertheless, a good try to insinuate that I didn't use google to check first, but trust me, I did
That's what counts.

Re: a stupid vga cursor question...

Posted: Sun May 20, 2012 11:23 am
by sithlord2
Okay, I finally found this article:

https://www.virtualbox.org/ticket/7923

Seems that this is VirtualBox issue after all... weird...

Re: a stupid vga cursor question...

Posted: Sun May 20, 2012 3:06 pm
by Combuster
I'm doing this in VirtualBox, so there might be a posssibility that the virtual vga-adapter defaults to a non-blinking cursor?
Tip of the day: don't trust emulators when it comes to accurate VGA emulation. Always test those things on real hardware.

Re: a stupid vga cursor question...

Posted: Mon May 21, 2012 10:08 pm
by LindusSystem


Quote:
I'm doing this in VirtualBox, so there might be a posssibility that the virtual vga-adapter defaults to a non-blinking cursor?

Tip of the day: don't trust emulators when it comes to accurate VGA emulation. Always test those things on real hardware.
+1
ME too, I made my bootloader and used to test on Bochs, it worked fine and when I boot it on real computer I was getting Triple Fault.
One more TIP:Emulators are for testing whether the build is hazardous.But you need to test on real hardware even after you test on an emulator.