duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

a20.fs (728B) - raw


      1 \ A20 line unlocking
      2 ?f<< /asm/i386.fs
      3 
      4 \ Is A20 line enabled?
      5 : a20? $7dfe @ $107dfe @ <> ;
      6 
      7 code _wait pc al $64 i) in, al 2 i) test, abs>rel jnz, ret,
      8 code _wait2 pc al $64 i) in, al 1 i) test, abs>rel jz, ret,
      9 : _cmd ( n -- ) ['] _wait abs>rel call, al swap i) mov, al $64 i) out, ;
     10 code _unlockThroughPS2
     11   ax push, cli, $ad _cmd $d0 _cmd
     12   ' _wait2 abs>rel call,
     13   al $60 i) in, ax push,
     14   $d1 _cmd
     15   ' _wait abs>rel call,
     16   ax pop, al 2 i) or, al $60 i) out,
     17   $ae _cmd
     18   ' _wait abs>rel call,
     19   sti, ax pop, ret,
     20 
     21 32 $400 $400 * * const MEMTOP \ 32 MB ought to be enough for anybody
     22 
     23 : a20$
     24   a20? not if _unlockThroughPS2 then
     25   a20? not if abort" A20 line can't be activated" then
     26   $100000 to here MEMTOP HEREMAX ! ;