A20

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
wererabit
Posts:30
Joined:Wed Sep 03, 2008 2:50 am
A20

Post by wererabit » Sun Apr 04, 2010 6:19 am

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

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Re: A20

Post by Andyhhp » Sun Apr 04, 2010 9:42 am

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
Image

wererabit
Posts:30
Joined:Wed Sep 03, 2008 2:50 am

Re: A20

Post by wererabit » Mon Apr 05, 2010 2:02 am

thank you

Post Reply