Page 1 of 1

A20

Posted: Sun Apr 04, 2010 6:19 am
by wererabit
Hi,

I was reading the demo code of Enable A20 tutorial. I see this

Code: Select all

    cli
    pusha
    
    mov al, 0xDD
    out 0x64, al
    
    popa
    ret
Why do we disable interrupt here? same for (Enables a20 line through output port). We dont have to do for the other?

Thanks

Re: A20

Posted: Sun Apr 04, 2010 9:42 am
by Andyhhp
In the code, interrupts are specifically disabled for time critical or complicated bits. In this case, the code needs to poll the Keyboard Controler until it is ready to enable the A20 line. As a result, having an interrupt would mess up the timing of the polling so we disable interrupts.

In my code, I disable interrupts at the begnning of the bootloader and dont enable them until I have set up the GDT and IDT in protected mode. This leaves me without CLIs littered all over my code.

~Andrew

Re: A20

Posted: Mon Apr 05, 2010 2:02 am
by wererabit
thank you