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

A20 delay



The delay is used in two ways:

  + A20 real to protected mode transition
  + delay once kernel is up

The delay once kernel is up should be able to use a calibrated delay of
any sort.  

The one during boot time is really not a delay for time, it is a delay
for
the real to protected mode transition to stabilize.  

Something must have changed in Linux.  The kernel I am using has this
code
in arch/i386/boot/setup.S.  Notice that it is simply testing that the
segment
translation is really happening.  I think this method is more reliable
than any delay based method since it waits until it is sure it is in
protected
mode.  Needless to say, I am not sure if the boot sequence of RTEMS
supports 
this trick. :)

! that was painless, now we enable A20

        call    empty_8042
        mov     al,#0xD1                ! command write
        out     #0x64,al
        call    empty_8042
        mov     al,#0xDF                ! A20 on
        out     #0x60,al
        call    empty_8042

! wait until a20 really *is* enabled; it can take a fair amount of
! time on certain systems; Toshiba Tecras are known to have this
! problem.  The memory location used here is the int 0x1f vector,
! which should be safe to use; any *unused* memory location < 0xfff0
! should work here.

#define TEST_ADDR 0x7c

        push    ds
        xor     ax,ax                   ! segment 0x0000
        mov     ds,ax
        dec     ax                      ! segment 0xffff (HMA)
        mov     gs,ax
        mov     bx,[TEST_ADDR]          ! we want to restore the value
later
a20_wait:
        inc     ax
        mov     [TEST_ADDR],ax
        seg     gs
        cmp     ax,[TEST_ADDR+0x10]
        je      a20_wait                ! loop until no longer aliased
        mov     [TEST_ADDR],bx          ! restore original value
        pop     ds



-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985