]> git.lizzy.rs Git - plan9front.git/commitdiff
9boot: oops, it all was just a20 gate not being enabled
authorcinap_lenrek <cinap_lenrek@localhost>
Wed, 20 Apr 2011 13:19:06 +0000 (13:19 +0000)
committercinap_lenrek <cinap_lenrek@localhost>
Wed, 20 Apr 2011 13:19:06 +0000 (13:19 +0000)
sys/src/boot/pc/a20.s
sys/src/boot/pc/pxe.c
sys/src/boot/pc/sub.c

index 53b7af5cb6e697eabd78cb378afe5ef8b715bdf2..0455a595294cf28e41d0d1ba1a942795fb943b06 100644 (file)
@@ -14,6 +14,14 @@ TEXT a20(SB), $0
 _biosfail:
        CALL16(pmode32(SB))
 
+       /* fast a20 */
+       MOVL $0x92, DX
+       INB
+       ANDB $0xFE, AX
+       ORB $0x02, AX
+       OUTB
+
+       /* slow a20 */
        CALL a20wait(SB)
        MOVL $0x64, DX
        MOVB $0xAD, AL
index 5fefd72b0e765d57d72b7fc75886396eacb54d2e..a950b2579b34b1db74b450db2696927abdc48c09 100644 (file)
@@ -113,8 +113,14 @@ unload(void)
                uchar status[2];
                uchar junk[10];
        } buf;
-       memset(&buf, 0, sizeof(buf));
-       pxecall(0x70, &buf);
+       static uchar shutdown[] = { 0x05, 0x070, 0x02, 0 };
+       uchar *o;
+
+       for(o = shutdown; *o; o++){ 
+               memset(&buf, 0, sizeof(buf));
+               if(pxecall(*o, &buf))
+                       break;
+       }
 }
 
 static int
index 40a77fd3bc9b6b92c9a188cf936c3ede4fe24384..02d75aed569313689dabe630929814594b43617a 100644 (file)
@@ -212,30 +212,17 @@ bootkern(void *f)
        if(beswal(ex.magic) != I_MAGIC)
                return "bad magic";
 
-       /* load address */
        e = (uchar*)(beswal(ex.entry) & ~0xF0000000UL);
-
-       /*
-        * the kernels load addess (entry) might overlap
-        * with some bios memory (pxe) that is needed to load
-        * it. so we read it to this address and after
-        * we finished, move it to final location.
-        */
-       t = (uchar*)0x200000;
-
+       t = e;
        n = beswal(ex.text);
        if(readn(f, t, n) != n)
                goto Error;
-       d = t + ((uchar*)PGROUND((ulong)e + n) - e);
+       d = (uchar*)PGROUND((ulong)t + n);
        n = beswal(ex.data);
        if(readn(f, d, n) != n)
                goto Error;
        close(f);
-
        unload();
-
-       n = (d + n) - t;
-       memmove(e, t, n);
        jump(e);
 Error:         
        return "i/o error";