[Prev][Next][Index][Thread]

Re: moving the hardware cursor



> static void
> set_cursor(unsigned int pos)
> {
>         /* set cursor position high byte */
>         outb_p(video_port_reg, 0xe);
>         outb_p(video_port_val, (unsigned char)((pos >> 8)) & 0xff);
> 
>         /* set cursor position low byte */
>         outb_p(video_port_reg, 0xf);
>         outb_p(video_port_val, (unsigned char)(pos & 0xff));
> }
OK, thank you very much.
After looking after the code, I wrote this:

void
actualizar_cursor ()
{
unsigned int pos = (consola.y*80)+consola.x;
outb_p(0x3d4,0xE);
outb_p(0x3d5,(unsigned char)((pos >> 8))&0xff);
outb_p(0x3d4,0xF);
outb_p(0x03d5,(unsigned char)(pos & 0xff));
}

The value of pos is correct? (row*80)+column?

Thank you very much!

*> Panic? My kernel doesn't panic! We are doomed! DustDustDust!!!!
*> Get PGP KEY: use pgpk -a hkp://horowitz.surfnet.nl/buanzox@usa.net
*> System Fork BBS, en Argentina! LocoList! - Dedaparamaxxaginos rules!




References: