--- Net2/arch/i386/stand/srt0.c 2018/04/24 18:04:01 1.1.1.1 +++ Net2/arch/i386/stand/srt0.c 2018/04/24 18:20:26 1.1.1.4 @@ -33,7 +33,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)srt0.c 5.3 (Berkeley) 4/28/91 + * from: @(#)srt0.c 5.3 (Berkeley) 4/28/91 + * srt0.c,v 1.2 1993/05/22 08:02:23 cgd Exp */ /* @@ -50,15 +51,19 @@ .globl _exit .globl _bootdev .globl _cyloffset +#define NOP inb $0x84,%al ; inb $0x84,%al #ifdef SMALL /* where the disklabel goes if we have one */ .globl _disklabel _disklabel: .space 512 + .globl _scsisn + .set _scsisn, RELOC+0x60 #endif -entry: .globl entry + .globl entry + .set entry,0 .globl start #if defined(REL) && !defined(SMALL) @@ -85,9 +90,8 @@ start: #ifdef REL leal 4(%esp),%eax /* ignore old pc */ - movl $ RELOC-4*4,%esp - /* copy down boot parameters */ - movl %esp,%ebx + movl $ RELOC-3*4,%ebx + /* copy boot parameters */ pushl $3*4 pushl %ebx pushl %eax @@ -111,7 +115,7 @@ start: movl $64*1024,%ebx movl $_end,%eax # should be movl $_end-_edata but ... subl $_edata,%eax - addl %ebx,%eax + #addl %ebx,%eax pushl %eax pushl $_edata call _bzero @@ -133,15 +137,9 @@ start: pushl %esp call _bzero #endif - movl %esi,%esp - - pushl $0 - popf -#ifndef SMALL call _kbdreset /* resets keyboard and gatea20 brain damage */ -#endif - + movl %esi,%esp call _main jmp 1f @@ -150,26 +148,19 @@ _bootdev: .long 0 _cyloffset: .long 0 savearea: .long 0,0 # sp & bp to return to .text -#ifndef SMALL - .globl _getchar -#endif .globl _wait __rtt: -#ifndef SMALL - call _getchar -#else -_exit: pushl $1000000 call _wait popl %eax -#endif movl $-7,%eax jmp 1f -#ifndef SMALL + _exit: - call _getchar -#endif + pushl $1000000 + call _wait + popl %eax movl 4(%esp),%eax 1: #ifdef REL @@ -189,11 +180,13 @@ _exit: .globl _inb _inb: movl 4(%esp),%edx subl %eax,%eax # clr eax + NOP inb %dx,%al ret .globl _outb _outb: movl 4(%esp),%edx + NOP movl 8(%esp),%eax outb %al,%dx ret @@ -255,6 +248,7 @@ _insw: movw 8(%esp),%dx movl 12(%esp),%edi movl 16(%esp),%ecx + NOP cld nop .byte 0x66,0xf2,0x6d # rep insw @@ -270,6 +264,7 @@ _outsw: movw 8(%esp),%dx movl 12(%esp),%esi movl 16(%esp),%ecx + NOP cld nop .byte 0x66,0xf2,0x6f # rep outsw @@ -277,4 +272,3 @@ _outsw: movl %esi,%eax popl %esi ret -