wok-6.x view syslinux/stuff/iso2exe/a20.c @ rev 17161
syslinux/iso2exe: full zImage support (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Sep 17 15:21:35 2014 +0200 (2014-09-17) |
parents | 3e7ad70145ce |
children | 799c2ec31b04 |
line source
1 #ifndef __A20
2 #define __A20
4 #define A20HOLDBUFFER 0x80000
5 static int a20buffer = 0;
6 static void movehia20(void)
7 {
8 if ((mem.base >> 16) != 0x10) {
9 movehi();
10 return;
11 }
12 a20buffer = 1;
13 #asm
14 pusha // more than 1Mb => 286+
15 push #A20HOLDBUFFER/16
16 pop es
17 mov di, _mem // mem.base & 0xFFFF
18 mov si, #_buffer
19 mov cx, #BUFFERSZ/2
20 cld
21 rep
22 movsw
23 popa
24 #endasm
25 }
26 #define movehi movehia20
28 static void dosshutdowna20(void)
29 {
30 if (a20buffer) {
31 #asm
32 pusha // more than 1Mb => 286+
33 xor di, di // 30
34 mov cx, #9 // 2E..1E
35 a20z1:
36 push di
37 loop a20z1
38 push #0x10
39 push di // 1A 0x100000
40 push #-1 // 18
41 push di // 16
42 push #A20HOLDBUFFER/0x10000
43 push di // 12 A20HOLDBUFFER
44 push #-1 // 10
45 mov cl, #8 // 0E..00
46 a20z2:
47 push di
48 loop a20z2
49 mov ch, #0x10000/512
50 push ss
51 pop es
52 mov si, sp
53 mov ax, #0x8793
54 mov [si+0x15], al
55 xchg [si+0x1D], al
56 xchg [si+0x1F], al // bits 24..31
57 int 0x15
58 add sp, #0x30
59 popa
60 #endasm
61 }
62 dosshutdown();
63 }
65 #define dosshutdown dosshutdowna20
67 #endif