move dev routines into ../stand/dev.c
[unix-history] / usr / src / sys / tahoe / stand / srt0.c
index 20a54fc..def3f7d 100644 (file)
@@ -1,6 +1,4 @@
-/*     srt0.c  1.1     86/01/12        */
-/*     srt0.c  4.8     81/04/03        */
-/*  Tahoe version.     82/11/09        */
+/*     srt0.c  1.6     87/04/02        */
 
 #include "../machine/mtpr.h"
 #define        LOCORE
 
 #include "../machine/mtpr.h"
 #define        LOCORE
  */
 
        .globl  _end
  */
 
        .globl  _end
-       .globl  _edata
        .globl  _main
        .globl  __rtt
        .globl  _openfirst
        .globl  _start
        .globl  _main
        .globl  __rtt
        .globl  _openfirst
        .globl  _start
+       .globl  _boothowto
+       .globl  _bootdev
 
        .set    HIGH,31         # mask for total disable
 
 #ifndef        REL
 
        .set    HIGH,31         # mask for total disable
 
 #ifndef        REL
+       .globl  _device_space
+_device_space:                 # Tapemaster config block, etc.
+       .space  0x1000-RELOC
+
+       .globl  _entry
+_entry:
        .word   0x00                    # 'call' by relsrt0.
 #endif
 _start:
        mtpr    $HIGH,$IPL              # just in case
        .word   0x00                    # 'call' by relsrt0.
 #endif
 _start:
        mtpr    $HIGH,$IPL              # just in case
-       movl    $(RELOC),sp
-       movl    $RELOC,r0
-       subl2   aedata,r0
-       shar    $2,r0,r0
-       clrl    r1              /* used to clear the memory */
-clr:
-       pushl   r1
-       decl    r0              /* decrement counter */
-       jgeq    clr             /* more to clear */
+#ifdef REL
+       movl    $BOOTRELOC,sp
 
 
-       movl    $RELOC,sp
-       movl    $0x800,r0       /* source address to copy from */
-       movl    $RELOC,r1       /* destination address */
-       movl    aend,r2         /* length */
-       subl2   $0x800,r2
- #     movblk
- # simple loop replaces movblk - until hardware people are ready
+       movl    $RELOC,r0       /* source address to copy from */
+       movl    $BOOTRELOC,r1   /* destination address */
+       movl    tdlen,r2        /* length to copy */
+       addl2   r2,r0
+       addl2   r2,r1
 mvloop:
 mvloop:
+       decl    r0
+       decl    r1
        movb    (r0),(r1)
        movb    (r0),(r1)
-       incl    r0
+       decl    r2
+       bgeq    mvloop
+
+/*
+ * zero bss
+ */
+       movl    aedata,r1               /* destination address */
+       subl3   $_edata,$_end,r2        /* length to zero */
+zloop:
+       movb    $0,(r1)
        incl    r1
        decl    r2
        incl    r1
        decl    r2
-       bneq    mvloop
-       .globl  goup
-       mtpr    $0,$PACC
-jumphigh:
-       .set    goup,jumphigh+0x800-RELOC
+       bgeq    zloop
+
+       mtpr    $1,$PACC
+       mtpr    $1,$PADC
        jmp     *abegin
        jmp     *abegin
+#endif
+
 begin:
 begin:
+       movl    fp,ofp
+       movl    r11,_boothowto
+       movl    r10,_bootdev
        movl    $1,_openfirst
        callf   $4,_main
        movl    $1,_openfirst
        callf   $4,_main
-       jmp     begin
+#ifdef REL
+       halt
+#endif
+       ret
 
 __rtt:
        .word   0x0
 
 __rtt:
        .word   0x0
-       jmp     begin
+#ifdef REL
+       halt
+#endif
+       movl    ofp,fp
+       ret
 
        .data
 abegin:        .long   begin
 
        .data
 abegin:        .long   begin
-aend:  .long   _end-RELOC+0x800
-aedata:        .long   _edata-RELOC+0x800
-       .globl  _entry
-       .set    _entry,0x800
+#ifdef REL
+aedata:        .long   _edata
+tdlen: .long   _edata-BOOTRELOC
+#endif
+ofp:   .long   0
+_boothowto:    .long   0
+_bootdev:      .long   0