wok-current diff memtest/stuff/bootloader.S @ rev 17982
pavucontrol: remove patch
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Sun Apr 19 16:50:55 2015 -0400 (2015-04-19) |
parents | d038b033c321 |
children | 5797509d0229 |
line diff
1.1 --- a/memtest/stuff/bootloader.S Mon Nov 11 07:22:44 2013 +0000 1.2 +++ b/memtest/stuff/bootloader.S Sun Apr 19 16:50:55 2015 -0400 1.3 @@ -2,9 +2,6 @@ 1.4 INITSEG = 0x9000 1.5 SETUPSEG = 0x9020 1.6 1.7 -setup_sects = 497 1.8 -syssize = 500 1.9 - 1.10 .text 1.11 .code16 1.12 .org 0 1.13 @@ -82,7 +79,6 @@ 1.14 #ifdef CHECK_REALMODE 1.15 #define PUTS 1.16 movw $EXEADRS(realmode_expected), %si 1.17 - pushfw // save flags 1.18 // bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 1.19 // flags 0 NT IOPL OF DF IF TF SF ZF 0 AF 0 PF 1 CF 1.20 //movb $0x10, %ah // DF = IF = TF = 0 1.21 @@ -90,18 +86,23 @@ 1.22 popfw // < 286 : flags[12..15] are forced 1 1.23 pushfw // = 286 : flags[12..15] are forced 0 1.24 popw %dx // > 286 : only flags[15] is forced 0 1.25 - popfw // restore flags 1.26 cmpb %ah, %dh // test Fx and 0x cases 1.27 jsputs: 1.28 js puts // S= not 386+ 1.29 smsww %dx 1.30 shrw $1, %dx 1.31 jc puts 1.32 + //movw syssize-realmode_expected(%si), %bp 1.33 + .byte 0x8B, 0x6C, syssize-realmode_expected 1.34 + //movb setup_sects-realmode_expected(%si), %ch 1.35 + .byte 0x8A, 0x6C, setup_sects-realmode_expected 1.36 +#else 1.37 + movw EXEADRS(syssize), %bp 1.38 + movb EXEADRS(setup_sects), %ch 1.39 #endif 1.40 + movb $(512-(end_header-_start))/2, %cl 1.41 movw $0x100, %si 1.42 movw $end_header, %di 1.43 - movb EXEADRS(setup_sects), %ch 1.44 - movb $(512-(end_header-_start))/2, %cl 1.45 rep 1.46 movsw 1.47 ljmp $INITSEG, $movesys 1.48 @@ -174,8 +175,9 @@ 1.49 1.50 popw %bx # clear %bx 1.51 movw syssize, %di 1.52 - addw $(512/16)-1, %di 1.53 + decw %di 1.54 shrw $9-4, %di 1.55 + incw %di 1.56 movw $SYSSEG, %cx 1.57 call read_sectorsCX 1.58 1.59 @@ -205,29 +207,27 @@ 1.60 int $0x20 // dos exit 1.61 #endif 1.62 #ifdef EXE_SUPPORT 1.63 -movesys: 1.64 +movesys: // %ax = SYSSEG 1.65 pushw %es 1.66 popw %ss 1.67 - movw EXEADRS(syssize), %bp // %ds untouched 1.68 movw %ds, %bx 1.69 - cwd 1.70 - incw %dx 1.71 - cmpw %ax, %bx 1.72 + subw %ax, %bx 1.73 jnc forward 1.74 - negw %dx 1.75 addw %bp, %ax 1.76 - addw %bp, %bx 1.77 forward: 1.78 movw %ax, %es 1.79 - movw %bx, %ds 1.80 + movw %ax, %dx 1.81 + addw %bx, %dx 1.82 + movw %dx, %ds 1.83 + sbbw %dx, %dx // %dx = 0 : -1 1.84 + cmc // C = 1 : 0 1.85 + adcw %dx, %ax 1.86 xorw %di, %di 1.87 movb $8, %cl 1.88 pushw %si 1.89 rep 1.90 movsw 1.91 popw %si 1.92 - addw %dx, %ax 1.93 - addw %dx, %bx 1.94 decw %bp 1.95 jns forward 1.96 #ifndef NO_CURSOR_DEFINITION 1.97 @@ -380,15 +380,23 @@ 1.98 bdendlp: 1.99 jmp read_sectorslp 1.100 1.101 -#ifdef CHECK_REALMODE 1.102 -realmode_expected: 1.103 - .ascii "386+ real mode only." 1.104 - .byte 13,10,0 1.105 -#endif 1.106 #ifdef HELP 1.107 helpmsg: 1.108 .ascii "No help available." 1.109 .byte 13,10 1.110 .byte 0 1.111 #endif 1.112 +#ifdef CHECK_REALMODE 1.113 + .org 475 1.114 +realmode_expected: 1.115 +helpend: 1.116 + .ascii "386 real mode only." 1.117 + .byte 13,10,0 1.118 +#endif 1.119 .org 497 1.120 +setup_sects: 1.121 + .byte 0 1.122 + .org 500 1.123 +syssize: 1.124 + .word 0 1.125 +