# HG changeset patch # User Pascal Bellard # Date 1394698967 0 # Node ID 3865e09ec026fcc7b9df39e80655917f2d6d97d7 # Parent 00606601418e80c80b59fc46f799af59cbcfe024 syslinux/iso2exe: add a20 support diff -r 00606601418e -r 3865e09ec026 syslinux-tools/receipt --- a/syslinux-tools/receipt Wed Mar 12 22:05:19 2014 +0100 +++ b/syslinux-tools/receipt Thu Mar 13 08:22:47 2014 +0000 @@ -20,5 +20,6 @@ done cp -a $src/iso2exe/isohybrid.exe $fs/usr/share/boot cp -a $src/iso2exe/meminfo.exe $fs/usr/share/boot + cp -a $src/iso2exe/tazboot.exe $fs/usr/share/boot find $fs/usr -exec chown root.root {} \; } diff -r 00606601418e -r 3865e09ec026 syslinux/stuff/iso2exe/Makefile --- a/syslinux/stuff/iso2exe/Makefile Wed Mar 12 22:05:19 2014 +0100 +++ b/syslinux/stuff/iso2exe/Makefile Thu Mar 13 08:22:47 2014 +0000 @@ -2,7 +2,7 @@ BCC=bcc -ansi -O -0 -C-t BCCFLAGS=-D__MSDOS__ -Md -all: isohybrid.exe iso2exe meminfo.exe +all: isohybrid.exe iso2exe meminfo.exe tazboot.exe meminfo.exe: meminfo.S cc -o meminfo.o -Wa,-a=meminfo.lst -c meminfo.S @@ -30,6 +30,9 @@ ./iso2exe.sh --exe mvcom.bin iso2exe.com iso2exe.exe > $@ chmod +x $@ +tazboot.exe: boot.com + com2exe $< > $@ + OBJS = boot.o iso9660.o libdos.o bootlinux.o boot.com: $(OBJS) $(BCC) $(BCCFLAGS) -o $@ $(OBJS) && upx --ultra-brute $@ diff -r 00606601418e -r 3865e09ec026 syslinux/stuff/iso2exe/a20.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syslinux/stuff/iso2exe/a20.c Thu Mar 13 08:22:47 2014 +0000 @@ -0,0 +1,142 @@ +#ifndef __A20 +#define __A20 + +// http://www.win.tue.nl/~aeb/linux/kbd/A20.html +static void a20enable(void) +{ +#asm + call a20test + + in al, 0x92 // fast A20 + test al, #0x2 + jnz no92 + or al, #0x2 // Enable A20 + and al, #0xFE // Do not reset machine + out 0x92, al + call a20test +no92: + call empty_8042 + mov al, #0xD1 // command write + out 0x64, al + call empty_8042 + mov al, #0xDF // Enable A20 + out 0x60, al + call empty_8042 + + mov al, #0xFF // Null command, but UHCI wants it + out 0x64, al + call empty_8042 + call a20test + + mov ax, #0x2401 + int 0x15 + call a20test + + in al, 0xEE // fast enable A20 + jmp a20test + +empty_8042: + mov ah, #-32 +wait_8042: + in al, 0x64 + inc ax // FF 32x : no kbd + jz enabled + dec ax + shr ax, #1 // Bit 0: input data + jc data + shr ax, #1 // Bit 1: buffer empty + jc wait_8042 + ret +data: + in al, 0x60 // read data + jmp wait_8042 +a20test: + push ds + xor cx, cx + xor bx, bx + mov ds, cx // ds = 0000 + dec cx + mov gs, cx // gs = FFFF + cli +a1: + mov ax, [bx] + not ax + mov dx, ax + seg gs + xchg dx, [bx+10] + cmp ax, [bx] + seg gs + mov [bx+10], dx + loopne a1 + pop ds + xchg ax, cx + sti + jne enabled + pop cx // quit a20enable +enabled: + ret // ax != 0 : enabled +#endasm +} + +#define A20HOLDBUFFER 0x80000 +static int a20buffer = 0; +static void movehia20(void) +{ + if ((mem.base - 0x100000UL) >= 0x10000UL) { + movehi(); + return; + } + a20buffer = 1; +#asm + pusha + push #A20HOLDBUFFER/16 + pop es + mov di, _mem // mem.base & 0xFFFF + mov si, #_buffer + mov cx, #BUFFERSZ/2 + cld + rep + movsw + popa +#endasm +} +#define movehi movehia20 + +#define REALMODE_SWITCH _realmode_switch_a20 +static void realmode_switch_a20(void) +{ + if (!a20buffer) return; + a20enable(); +#asm + pusha + xor di, di // 30 + mov cx, #9 // 2E..1E +a20z1: + push di + loop a20z1 + push #0x10 + push di // 1A 0x100000 + push #-1 // 18 + push di // 16 + push #A20HOLDBUFFER/0x10000 + push di // 12 A20HOLDBUFFER + push #-1 // 10 + mov cl, #8 // 0E..00 +a20z2: + push di + loop a20z2 + mov ch, #0x10000/512 + push ss + pop es + mov si, sp + mov ax, #0x8793 + mov [si+0x15], al + xchg [si+0x1D], al + xchg [si+0x1F], al // bits 24..31 + int 0x15 + add sp, #0x30 + popa +#endasm +} + +#endif diff -r 00606601418e -r 3865e09ec026 syslinux/stuff/iso2exe/bootlinux.c --- a/syslinux/stuff/iso2exe/bootlinux.c Wed Mar 12 22:05:19 2014 +0100 +++ b/syslinux/stuff/iso2exe/bootlinux.c Thu Mar 13 08:22:47 2014 +0000 @@ -19,8 +19,10 @@ #define HEAPPTR 0x224 #define CMDLINE 0x228 +#define SYSTEM_SEGMENT 0x1000 #define SETUP_SEGMENT 0x9000 #define CMDLINE_OFFSET 0x9E00 +#define SETUP_END 0x8200 #define PAGE_BITS 12 #define PAGE_SIZE 4096 @@ -92,6 +94,7 @@ #ifdef ZIMAGE_SUPPORT static unsigned zimage = 0; +#ifndef FULL_ZIMAGE static unsigned getss(void) { #asm @@ -99,6 +102,7 @@ #endasm } #endif +#endif static int versiondos; static int dosversion(void) @@ -122,15 +126,16 @@ #endasm } + +#include "a20.c" + static void load(unsigned long size) { if (vm86()) die("Need real mode"); switch (mem.align) { case 0: // kernel - switch (dosversion()) { - case 3: case 4: case 6: case 7: break; - default: + if ((unsigned) (dosversion() - 3) > 7 - 3) { printf("DOS %d not supported.\nTrying anyway...\n", versiondos); } @@ -142,6 +147,9 @@ initrd_addr = mem.base; mem.align = 4; } +#ifdef ALLOCMEM + ALLOCMEM(size); +#endif while (size) { int n, s = sizeof(buffer); for (n = 0; n < s; n++) buffer[n] = 0; @@ -229,11 +237,17 @@ } if (!setup_version || !(buffer[LOADFLAGS] & 1)) { #ifdef ZIMAGE_SUPPORT +#ifndef FULL_ZIMAGE zimage = getss() + 0x1000; mem.base = zimage * 16L; if (mem.base + syssize > SETUP_SEGMENT*16L - 32) die("Out of memory"); #else + zimage = 0x11; + mem.base = 0x110000L; // 1M + 64K HMA + +#endif +#else die("Not a bzImage format"); #endif } @@ -335,20 +349,30 @@ or bx, bx jz notzimage mov eax, _mem +#ifndef FULL_ZIMAGE shr eax, #4 // top - mov dx, #0x1000 + mov dx, #SYSTEM_SEGMENT +#else + dec eax + shr eax, #16 + inc ax + mov dx, #SYSTEM_SEGMENT/0x1000 +#endif push cs pop ds - mov es, ax + push ss + pop es push es mov si, #sysmove - xor di, di + mov di, #SETUP_END push di mov cx, #endsysmove-sysmove + cld rep movsb retf sysmove: +#ifndef FULL_ZIMAGE mov ds, bx mov es, dx xor di, di @@ -358,8 +382,36 @@ movsw inc bx inc dx - cmp ax,bx + cmp ax, bx jne sysmove +#else + xchg ax, cx + mov si, di + push es + pop ds + push cx + mov cx, #0x18 + rep + stosw + dec cx + mov [si+0x10], cx + mov [si+0x18], cx + pop cx + mov bh, #0x93 + mov dh, #0x93 +mvdown: + mov [si+0x12+2], bx // srce + mov [si+0x1A+2], dx // dest + pusha + mov cx, #0x8000 + mov ah, #0x87 + int 0x15 // catched by himem.sys: may need dos=high,umb + popa + inc bx + inc dx + cmp cl, bl + jne mvdown +#endif notzimage: #endasm #endif diff -r 00606601418e -r 3865e09ec026 udev/receipt --- a/udev/receipt Wed Mar 12 22:05:19 2014 +0100 +++ b/udev/receipt Thu Mar 13 08:22:47 2014 +0000 @@ -18,7 +18,9 @@ libgudev-dev pcre-dev liblzma-dev util-linux-uuid-dev" # Use build host: gperf -BUILD_DEPENDS="util-linux-blkid-dev kmod-dev acl-dev glib-dev" +case "$ARCH" in + arm*) BUILD_DEPENDS="util-linux-blkid-dev kmod-dev acl-dev glib-dev" +esac # Rules to configure and make the package. compile_rules()