Page 5 of 5

Re: Mouse Location Always Zero

Posted: Fri Jul 22, 2016 4:24 am
by Octacone
Ch4ozz wrote:Your unmasking for all interrupts looks wrong to me:

Code: Select all

outportb(0x21, 0x0);
outportb(0xA1, 0x0);
Change it to:

Code: Select all

outportb(0x20, 0x0);
outportb(0xA0, 0x0);
Nothing. :/ 0000000
Also I've followed one timer related tutorial.
And I get this "not passed" message.

Code: Select all

int timer_ticks = 0;

void timer_phase(int hz)
{
    int divisor = 1193180 / hz;       /* Calculate our divisor */
    outportb(0x43, 0x36);             /* Set our command byte 0x36 */
    outportb(0x40, divisor & 0xFF);   /* Set low byte of divisor */
    outportb(0x40, divisor >> 8);     /* Set high byte of divisor */
}

void timer_handler(struct regs *r)
{
    timer_ticks++;

    /* Every 18 clocks (approximately 1 second), we will
    *  display a message on the screen */
    if (timer_ticks % 18 == 0) {
        writeOutput("One second has passed");
    } else {
    	writeOutput("not passed...");
    }
}

void timer_install()
{
    irq_install_handler(0, timer_handler);
}

void timer_wait(int ticks)
{
    unsigned long eticks;

    eticks = timer_ticks + ticks;
    while(timer_ticks < eticks);
}

Could that be related? I am supposed to get "1 second has passed" message. IRQ troubles?

IDT output from Bochs:
Interrupt Descriptor Table (base=0x0000000000000000, limit=0):

Error I am getting:
(0).[259291843] [0x0000000000115148] 0008:0000000000115148 (unk. ctxt): mov dword ptr ss:[esp], 0x00114c30 ; c70424304c1100

Re: Mouse Location Always Zero

Posted: Fri Jul 22, 2016 7:51 am
by Octacone
Still getting 3rd exception 13 no resolution with Bochs. :(

Re: Mouse Location Always Zero

Posted: Fri Jul 22, 2016 7:57 am
by Combuster
<Insert all the response from the previous time you got that error here>