wok-next diff syslinux/stuff/iso2exe/bootiso.S @ rev 17562
syslinux/iso2exe: use iso size to compute md5sum
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 07 15:39:46 2015 +0100 (2015-02-07) |
parents | 26654c1a7ca7 |
children | 6a2e6eb35735 |
line diff
1.1 --- a/syslinux/stuff/iso2exe/bootiso.S Mon Jan 05 12:38:18 2015 +0100 1.2 +++ b/syslinux/stuff/iso2exe/bootiso.S Sat Feb 07 15:39:46 2015 +0100 1.3 @@ -119,7 +119,7 @@ 1.4 jmp halt 1.5 .org 0x01BE 1.6 1.7 - .org 0x7F10 1.8 + .org 0x7F26 1.9 ////////////////////////////// DOS EXE code /////////////////////////////////// 1.10 1.11 exestart: 1.12 @@ -134,14 +134,16 @@ 1.13 cwd // clear dx 1.14 pushw %dx // dos exit() 1.15 je abort 1.16 + pushw %si 1.17 int $0x21 // get DOS version 1.18 - cmpb $3, %al 1.19 + popw %di // %di = 0x100: .COM start address 1.20 + addb $-3, %al 1.21 movb $EXESTR(noDOS3), %al 1.22 - jb abort 1.23 + jnc abort 1.24 movw $(EXELOC(0x8000))/2, %cx 1.25 chklp: 1.26 lodsw 1.27 - addw %ax, %dx 1.28 + addw %ax, %dx // break C 1.29 loop chklp 1.30 chked: 1.31 movw $0x1000+EXESTR(chkerr), %ax 1.32 @@ -164,15 +166,11 @@ 1.33 addb %ah, %bh // test F0 and 00 cases 1.34 cmpb %ah, %bh 1.35 movb $EXESTR(no386), %al 1.36 -#undef NEED386 1.37 -#ifdef NEED386 1.38 - jbe abort // C=8086/80186, Z=80286 1.39 -#else 1.40 jbe is86 // C=8086/80186, Z=80286 1.41 -#endif 1.42 is386: 1.43 smsww %ax // not privileged 1.44 andb $1, %al 1.45 + movw $10, %si 1.46 jne tstvcpi 1.47 movl %cr0, %eax // privileged 1.48 incl %eax 1.49 @@ -182,7 +180,6 @@ 1.50 realmode: 1.51 is86: 1.52 call puts 1.53 - movw $0x0100, %di 1.54 movw comstart-end_header(%di), %si // .com address 1.55 pushw %di 1.56 movb $0x7C/2, %ch // 31K-31.5K, > com length 1.57 @@ -191,15 +188,13 @@ 1.58 ret 1.59 1.60 VersionVCPI: 1.61 - cmpb $0x40, %dl // >= 4.0 ? 1.62 - jb NoVCPI 1.63 xchgw %ax, %si // movb $EXESTR(vm86modemsg), %al 1.64 - jmp realmode 1.65 + cmpb $0x40, %cl // EMM386 / VCPI 4.0 mini 1.66 + jnc realmode // %si = 0 1.67 tstvcpi: 1.68 pushw %ds 1.69 movw %dx, %ds // %dx = 0 1.70 movw 0x67*4+2, %ds 1.71 - movw $10, %si 1.72 lodsw 1.73 xorw $0x4D45, %ax // EM(MX) or EM(MQ) 1.74 lodsw 1.75 @@ -217,7 +212,7 @@ 1.76 je VersionVCPI 1.77 int $0x67 1.78 testb %ah, %ah 1.79 - xchgw %ax, %dx 1.80 + xchgw %ax, %cx 1.81 jmp ChkVCPI 1.82 CmdVCPI: 1.83 .byte 0x40 // status 1.84 @@ -227,39 +222,36 @@ 1.85 1.86 vm86modemsg: 1.87 // --------------- Must be in 7F40 7FFF range ------------------------ 1.88 - .ascii "vm" // vm86 1.89 - .byte EXESTR(_86) 1.90 + .ascii "vm86" // vm86 mode 1.91 + .byte EXESTR(mode) 1.92 ERRvcpi: 1.93 - .ascii "No VCPI-4.0/EMM" // No VCPI-4.0/EMM386 1.94 - .byte EXESTR(_386) 1.95 -noDOS3: 1.96 - .ascii "No DOS 3" // No DOS 3 1.97 - .byte EXESTR(eol) 1.98 + .ascii "EMM" // EMM386 need 1.99 +no386: 1.100 + .ascii "386" // 386 need 1.101 + .byte EXESTR(need) 1.102 chkerr: 1.103 - .ascii "Broken c" // Broken code 1.104 + .ascii "Bad c" // Bad code 1.105 .byte EXESTR(ode) 1.106 rmPaging: 1.107 .ascii "Un" // Unreal mode 1.108 realmodemsg: 1.109 - .ascii "real m" // real mode 1.110 + .ascii "real" // real mode 1.111 // --------------- Must be in 7FC0 7FFF range ------------------------ 1.112 +mode: 1.113 + .ascii " m" 1.114 ode: 1.115 - .ascii "od" 1.116 -eeol: 1.117 - .ascii "e" 1.118 + .ascii "ode" 1.119 .byte EXESTR(eol) 1.120 -no386: 1.121 - .ascii "No " // No 386 1.122 -_386: 1.123 - .ascii "3" 1.124 -_86: 1.125 - .ascii "86" 1.126 +noDOS3: 1.127 + .ascii "DOS3" // DOS3 need 1.128 +need: 1.129 + .ascii " need" 1.130 .byte EXESTR(eol) 1.131 help: 1.132 - .ascii "SliTaz boot loader" // SliTaz boot loader 1.133 + .ascii "SliTaz iso boot" // SliTaz iso boot 1.134 eol: 1.135 .ascii "\r\n" 1.136 - .byte 1 1.137 + .byte 1 // putstr will return 1.138 1.139 .space 16,0 // ISO md5 1.140 .org 0x8000