Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x68k/stand/boot_ustar CPU is not (yet) checkd.



details:   https://anonhg.NetBSD.org/src/rev/7af8def6c473
branches:  trunk
changeset: 515671:7af8def6c473
user:      minoura <minoura%NetBSD.org@localhost>
date:      Mon Oct 01 16:58:01 2001 +0000

description:
CPU is not (yet) checkd.
Use 68000 instructions only.

diffstat:

 sys/arch/x68k/stand/boot_ustar/Makefile     |   3 +-
 sys/arch/x68k/stand/boot_ustar/boot_ustar.S |  73 ++++++++++++----------------
 2 files changed, 33 insertions(+), 43 deletions(-)

diffs (147 lines):

diff -r 3efae42674fb -r 7af8def6c473 sys/arch/x68k/stand/boot_ustar/Makefile
--- a/sys/arch/x68k/stand/boot_ustar/Makefile   Mon Oct 01 14:41:09 2001 +0000
+++ b/sys/arch/x68k/stand/boot_ustar/Makefile   Mon Oct 01 16:58:01 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.1 2001/09/28 15:22:21 minoura Exp $
+#      $NetBSD: Makefile,v 1.2 2001/10/01 16:58:01 minoura Exp $
 
 .include <bsd.own.mk>
 
@@ -27,6 +27,7 @@
 CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
 CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS}
 AFLAGS=           ${CFLAGS:M-[ID]*}
+AFLAGS+=   -Wa,-mc68000
 .if ${OBJECT_FMT} == "ELF"
 LDFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
 LDFLAGS+=  -noinhibit-exec     # XXX
diff -r 3efae42674fb -r 7af8def6c473 sys/arch/x68k/stand/boot_ustar/boot_ustar.S
--- a/sys/arch/x68k/stand/boot_ustar/boot_ustar.S       Mon Oct 01 14:41:09 2001 +0000
+++ b/sys/arch/x68k/stand/boot_ustar/boot_ustar.S       Mon Oct 01 16:58:01 2001 +0000
@@ -3,7 +3,7 @@
 |         Yasha(itohy%netbsd.org@localhost)
 |        minoura%netbsd.org@localhost
 |
-| $NetBSD: boot_ustar.S,v 1.1 2001/09/28 15:22:22 minoura Exp $
+| $NetBSD: boot_ustar.S,v 1.2 2001/10/01 16:58:01 minoura Exp $
 
 | supports floppy only
 
@@ -13,7 +13,7 @@
 #include "iocscall.h"
 
 #define BOOT_ERROR(s)  jbsr boot_error; .asciz s; .even
-#define READ_BUFFER    0x000e0000
+#define SRAM_MEMSIZE   (0x00ed0008)
 
        .text
 ASENTRY_NOPROFILE(start)
@@ -54,7 +54,7 @@
                |
                | SASI or Floppy
                |
-               movel   %d0,%d4
+               movel   %d0,%d6
                andib   #0xFC,%d0
                cmpib   #0x90,%d0
                jne     boot_dev_unsupported    | boot from SASI?
@@ -64,7 +64,7 @@
                |
                andib   #0x03,%d0       | drive # (head=0)
                jbsr    check_fd_format
-               moveb   %d4,%d2
+               moveb   %d6,%d2
                lslw    #8,%d2
                moveq   #0x70,%d1
                orw     %d2,%d1         | PDA*256 + MODE
@@ -103,10 +103,8 @@
 
 boot_read_done:
                lea     %a4@(8192),%a1          | USTAR header
-#if 0  /* too big to fit */
                cmpl    #0x55535441,%a1@        | filename `USTA
                bne     error_invalidname
-#endif
                cmpl    #0x522e766f,%a1@(4)     |           R.vo...'
                bne     error_invalidname
                cmpl    #0x00757374,%a1@(256)   | magic `\0ust'
@@ -118,10 +116,8 @@
                movml   %a2@+,%d0-%d4/%a5
                addal   #8,%a2                  | start of text
 
-#if 0
                cmpal   #BOOT_TEXTADDR,%a5
                bne     error_invalidboot
-#endif
 
                cmpl    #0x00870107,%d0         | a.out magic
                bne     error_invalidmagic
@@ -136,41 +132,34 @@
                subl    #1,%d4
                bne     1b
 
-               andil   #3,%d4
-               swap    %d4
-               addil   #(B_DEVMAGIC+X68K_MAJOR_FD),%d4
-               movl    #RB_SINGLE,%sp@-        | boothowto
-               movl    %d4,%sp@-               | bootdev
-               movl    %d3,%sp@-               | size
-               pea     %a5@                    | entry
-               pea     %a5@                    | executed
-               pea     %a5@                    | loaded
-
-               jbsr    _C_LABEL(exec_image)
-
-error_invalidname:
-error_invalidfs:
-error_invalidmagic:    BOOT_ERROR("Invalid boot disk")
+       /* set args for /boot */
+               pea     %a2@(%d3)               | esym (unused)
+               movel   SRAM_MEMSIZE,%sp@-      | lastpa (unused)
+               pea     %a2@                    | firstpa (unused)
 
-|
-| void memcpy(void *dst, const void *src, size_t count);
-|
-|      small and slow memcpy...
-|      THIS FUNCTION DOES NOT CONFORM THE ANSI STANDARD
-|
-ENTRY_NOPROFILE(memcpy)
-       lea     %sp@(12),%a1
-       movel   %a1@,%d1        | count
-|      jeq     Lmcpret
-       moveal  %a1@-,%a0       | src
-       moveal  %a1@-,%a1       | dest
-1:     moveb   %a0@+,%a1@+
-       subql   #1,%d1
-       jne     1b
-Lmcpret:
-|      movel   %sp@(8),%d0     | uncomment this to conform ANSI
-       rts
+               movq    #0,%d0                  | unused
+               movq    #0,%d1                  | unused
+               movq    #0,%d2                  | unused
+               movq    #0,%d3                  | unused
+               movq    #0,%d4                  | unused
+               movq    #0,%d5                  | unused
+               andil   #3,%d6                  | bootdev
+               swap    %d6
+               addil   #(B_DEVMAGIC+X68K_MAJOR_FD),%d6
+               movl    #RB_SINGLE,%d7          | boothowto (unused)
+               moval   %a2,%a0                 | entry
+               moval   %d0,%a1                 | unused
+               moval   %d0,%a2                 | unused
+               moval   %d0,%a3                 | unused
+               moval   %d0,%a4                 | unused
+               moval   %d0,%a5                 | unused
+               moval   %d0,%a6                 | unused
 
-#include "exec_image.S"
+               jmp     %a0@                    | here we go
+
+error_invalidboot:     BOOT_ERROR("Illegal secondary boot");
+error_invalidname:     BOOT_ERROR("Invalid filename");
+error_invalidfs:       BOOT_ERROR("Not a ustarfs");
+error_invalidmagic:    BOOT_ERROR("Not an OMAGIC a.out")
 
 ASGLOBAL(first_kbyte)



Home | Main Index | Thread Index | Old Index