Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/arch/x68k/stand Pull up revisions:



details:   https://anonhg.NetBSD.org/src/rev/ebba81a2aaf8
branches:  netbsd-6
changeset: 775523:ebba81a2aaf8
user:      jdc <jdc%NetBSD.org@localhost>
date:      Sat Nov 24 20:20:24 2012 +0000

description:
Pull up revisions:
  src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
  src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
  src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
  src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
  src/sys/arch/x68k/stand/boot/ne.c revision 1.2
  src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
  src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
  src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
  src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
  src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
  src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
  src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
  src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
  src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
  src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
  src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/version revision 1.2
  src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
  src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in <lib/libsa/stand.h>
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
     the first entry of root directory if specified path is empty.
     Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
  per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.

diffstat:

 sys/arch/x68k/stand/boot/dp8390.c                 |    3 +-
 sys/arch/x68k/stand/boot/dp8390.h                 |    3 +-
 sys/arch/x68k/stand/boot/if_ne.c                  |    3 +-
 sys/arch/x68k/stand/boot/ne.c                     |    3 +-
 sys/arch/x68k/stand/boot_ufs/boot.S               |    4 +-
 sys/arch/x68k/stand/bootlogo/MANIFEST             |    5 -
 sys/arch/x68k/stand/bootlogo/netbsd.xpm           |   80 ----
 sys/arch/x68k/stand/bootlogo/setbootimg.c         |  237 ------------
 sys/arch/x68k/stand/bootlogo/xpm2bootimg.c        |  432 ----------------------
 sys/arch/x68k/stand/libsa/clock.c                 |    3 +-
 sys/arch/x68k/stand/libsa/sdcd.c                  |    3 +-
 sys/arch/x68k/stand/netboot/Makefile              |    3 +-
 sys/arch/x68k/stand/netboot/boot.c                |    3 +-
 sys/arch/x68k/stand/netboot/conf.c                |    3 +-
 sys/arch/x68k/stand/xxboot/boot.S                 |    8 +-
 sys/arch/x68k/stand/xxboot/bootmain.c             |   90 +++-
 sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile |    4 +-
 sys/arch/x68k/stand/xxboot/version                |    3 +-
 sys/arch/x68k/stand/xxboot/xx.c                   |   17 +-
 sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile  |    6 +-
 sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile  |    6 +-
 sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile  |    6 +-
 sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile  |    6 +-
 23 files changed, 108 insertions(+), 823 deletions(-)

diffs (truncated from 1217 to 300 lines):

diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/boot/dp8390.c
--- a/sys/arch/x68k/stand/boot/dp8390.c Sat Nov 24 19:58:04 2012 +0000
+++ b/sys/arch/x68k/stand/boot/dp8390.c Sat Nov 24 20:20:24 2012 +0000
@@ -1,5 +1,4 @@
-/*     $NetBSD: dp8390.c,v 1.2.2.2 2012/11/18 19:05:19 riz Exp $       */
-/*     Id: dp8390.c,v 1.14 2011/10/05 13:16:20 isaki Exp       */
+/*     $NetBSD: dp8390.c,v 1.2.2.3 2012/11/24 20:20:25 jdc Exp $       */
 
 /*
  * This file is derived from sys/arch/i386/stand/lib/netif/dp8390.c
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/boot/dp8390.h
--- a/sys/arch/x68k/stand/boot/dp8390.h Sat Nov 24 19:58:04 2012 +0000
+++ b/sys/arch/x68k/stand/boot/dp8390.h Sat Nov 24 20:20:24 2012 +0000
@@ -1,5 +1,4 @@
-/*     $NetBSD: dp8390.h,v 1.2.2.2 2012/11/18 19:05:19 riz Exp $       */
-/*     Id: dp8390.h,v 1.7 2011/10/05 13:16:20 isaki Exp        */
+/*     $NetBSD: dp8390.h,v 1.2.2.3 2012/11/24 20:20:25 jdc Exp $       */
 
 /*
  * This file is derived from sys/arch/i386/stand/lib/netif/dp8390.h
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/boot/if_ne.c
--- a/sys/arch/x68k/stand/boot/if_ne.c  Sat Nov 24 19:58:04 2012 +0000
+++ b/sys/arch/x68k/stand/boot/if_ne.c  Sat Nov 24 20:20:24 2012 +0000
@@ -1,5 +1,4 @@
-/* $NetBSD: if_ne.c,v 1.2.2.2 2012/11/18 19:05:19 riz Exp $ */
-/* Id: if_ne.c,v 1.28 2011/10/05 13:17:06 isaki Exp  */
+/* $NetBSD: if_ne.c,v 1.2.2.3 2012/11/24 20:20:25 jdc Exp $ */
 
 /*
  * Copyright (c) 2003 Tetsuya Isaki. All rights reserved.
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/boot/ne.c
--- a/sys/arch/x68k/stand/boot/ne.c     Sat Nov 24 19:58:04 2012 +0000
+++ b/sys/arch/x68k/stand/boot/ne.c     Sat Nov 24 20:20:24 2012 +0000
@@ -1,5 +1,4 @@
-/*     $NetBSD: ne.c,v 1.2.2.2 2012/11/18 19:05:18 riz Exp $   */
-/*     Id: ne.c,v 1.22 2011/10/05 13:16:20 isaki Exp   */
+/*     $NetBSD: ne.c,v 1.2.2.3 2012/11/24 20:20:25 jdc Exp $   */
 
 /*
  * This file is derived from sys/arch/i386/stand/lib/netif/ne.c
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/boot_ufs/boot.S
--- a/sys/arch/x68k/stand/boot_ufs/boot.S       Sat Nov 24 19:58:04 2012 +0000
+++ b/sys/arch/x68k/stand/boot_ufs/boot.S       Sat Nov 24 20:20:24 2012 +0000
@@ -2,7 +2,7 @@
 | author: chapuni(webmaster%chapuni.com@localhost)
 |         ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.9 2011/02/21 02:31:58 itohy Exp $
+| $NetBSD: boot.S,v 1.9.10.1 2012/11/24 20:20:24 jdc Exp $
 
 #include <machine/asm.h>
 #include "iocscall.h"
@@ -64,7 +64,7 @@
 
                | we use 68020 instructions, and check MPU beforehand
                |
-               | here d1.w = -1, and the above "subw a1,d0" = 0x9049, and
+               | here d0.w = -1, and the above "subw a1,d0" = 0x9049, and
                |       if MPU <= 010   loads 0x49,
                |       if MPU >= 020   loads 0x90.
                | This is a move, not a tst instruction
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/bootlogo/MANIFEST
--- a/sys/arch/x68k/stand/bootlogo/MANIFEST     Sat Nov 24 19:58:04 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#      $NetBSD: MANIFEST,v 1.1 2002/01/27 01:47:59 minoura Exp $
-
-netbsd.xpm     Default boot image.  The BSD Daemon is used by permission.
-xpm2bootimg.c  Convert *.xpm to boot title image format.
-setbootimg.c   Change boot title image of specified boot block (or file).
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/bootlogo/netbsd.xpm
--- a/sys/arch/x68k/stand/bootlogo/netbsd.xpm   Sat Nov 24 19:58:04 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/* XPM */
-static char *netbsd[] = {
-/* width height num_colors chars_per_pixel */
-"56 52 5 1 XPMEXT",
-/* colors */
-"  c None",
-"# c #000000",
-"* c #555555",
-"+ c #aaaaaa",
-". c #ffffff",
-/* pixels */
-"                  +.               +                    ",
-"                *..                 .                   ",
-"               *..+                 ++                  ",
-"               +..*                 +.*                 ",
-"              *..+**                *++*                ",
-"              +.+**.+**  ++++       *.+**               ",
-"              ..+**##*.*+++++++     *.+**               ",
-"              ..**++##.+++##****   *...+**              ",
-"              *..+##.#..##..##*****...++**              ",
-"               *+#..#..#..##.##++.....++**              ",
-"               +#...#.##....#.#*+.....++*#              ",
-"               #....#.#.....#....+...++**#              ",
-"              +#....#.#......#.+++++++**#               ",
-"              #..##.#.###....#..++*****#                ",
-"              #.####.#####...#...+++**#                 ",
-"             +#.#.##.##.##...#...++++*                  ",
-"             .#.#+##.##.##...#....+++**                 ",
-"    .       +.*###########..#.....+++**                 ",
-"    .+      ...*###...###..#*.....+++*#                 ",
-"      +    +.....#.....####*+++...+++*#                 ",
-"  ..  ++   +.....#....#*.........+++**                  ",
-"   .   +    +.##..####**.........+++*#                  ",
-"    +  .     +..##........#####.+++**                   ",
-".+   +..      *.++#.....###++..+++**#                   ",
-" .    ++.      *+++######++...+++**#                    ",
-"  +  .+*+.      *++++++++...+*****#                     ",
-"   +++  +*++.*#   *+++*...+++++**#                      ",
-"         **...*     *.........++**                      ",
-"        +..*.*#*   +...........++**                     ",
-"        ...*##+** ++............+***                    ",
-"        *.+*#*+++*#..####....+..++***                   ",
-"          ####++*++##+..+########++**                   ",
-"  ....    ....#**+**.....#.......##**  ..... ........+  ",
-"   +..     #.#**++***.....#..###...## .. ...  ..    ... ",
-"   ....    ..#*********####..#.+#..##..    .  ..     .. ",
-"   ....    ..#*########.###..#++#..# ..    .  ..     ...",
-"  +.....   .    ######..##...#+#...# ...     ...     ...",
-"  +. ...  ..   ...##.....#..###...## ....    ..      ...",
-"  ..  ..  .. .. #..##..###......##### ....   ..      ...",
-"  ..  ... .. .. #..##..###..###..#***# ....  ..      .. ",
-" +..   .... ..  ..##...##...#+*#..##++# ... ...     ... ",
-" ..    .... ....  ##..###...#++#..#.#+++#.. ..      ..+ ",
-" ..     ... ..    .#..###..####...#.###.#..#..    ....  ",
-" ..     ..  ...  . #..#.#..###...# ...##..##..# ....    ",
-"....     .   ....  ##..#........## ......##.......##**  ",
-"           ######+++###########***     ##+*#######+.++* ",
-"         ......+..######+++++++++*#       #..#***.....+*",
-"        +.....+++#.....+...++++****     *+...#   ####.++",
-"         +++++++#+....++++++++++***   *++....+++++++.+++",
-"          ****#*+#+++++++***++***#   +.+....+***+++++++*",
-"                  ##********#          #**#*++###****#*#",
-"                                           ##*+#    ### ",
-"XPMEXT copyright",
-"BSD Daemon Copyright 1988 by Marshall Kirk McKusick."
-"XPMEXT copyright_long",
-"BSD Daemon image, used for NetBSD boot by permission.",
-"",
-"BSD Daemon Copyright 1988 by Marshall Kirk McKusick.",
-"All Rights Reserved.",
-"",
-"Permission to use the daemon may be obtained from:",
-"    Marshall Kirk McKusick",
-"    1614 Oxford St",
-"    Berkeley, CA 94709-1608",
-"    USA",
-"or via email at mckusick%mckusick.com@localhost",
-"XPMEXT rcsid $NetBSD: netbsd.xpm,v 1.1 2002/01/27 01:47:59 minoura Exp $",
-"XPMENDEXT"
-};
diff -r 07507e96142b -r ebba81a2aaf8 sys/arch/x68k/stand/bootlogo/setbootimg.c
--- a/sys/arch/x68k/stand/bootlogo/setbootimg.c Sat Nov 24 19:58:04 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,237 +0,0 @@
-/*     $NetBSD: setbootimg.c,v 1.4 2011/02/21 02:31:58 itohy Exp $     */
-
-/*
- *     set boot title image (converted by xpm2bootimg)
- *     to boot file or installed boot block
- *
- *     use with care, not to destroy the existent boot or the disklabel
- *
- *     written by ITOH Yasufumi, public domain
- */
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef __NetBSD__
-#include <err.h>
-#endif
-
-/*
- * define here for cross env
- */
-#define SIZE_BOOTBLK   8192            /* <ufs/ffs/fs.h>       BBSIZE */
-#define MAGIC_DISKLABEL        0x82564557      /* <sys/disklabel.h>    DISKMAGIC */
-#define X68K_LABELOFF  64              /* <x68k/disklabel.h>   LABELOFFSET */
-
-#ifdef __STDC__
-# define PROTO(x)      x
-#else
-# define PROTO(x)      ()
-# ifndef const
-#  define const
-# endif
-#endif
-
-int main PROTO((int argc, char *argv[]));
-static unsigned get_uint16 PROTO((void *));
-static unsigned get_uint32 PROTO((void *));
-
-#ifndef __NetBSD__
-/* for cross env */
-
-#ifdef __STDC__
-# include <stdarg.h>
-# define VA_START(a, v)        va_start(a, v)
-# include <errno.h>
-#else
-# include <varargs.h>
-# define VA_START(a, v)        va_start(a)
-extern int errno;
-#endif
-
-static void err PROTO((int eval, const char *fmt, ...));
-static void errx PROTO((int eval, const char *fmt, ...));
-
-static void
-#ifdef __STDC__
-err(int eval, const char *fmt, ...)
-#else
-err(eval, fmt, va_alist)
-       int eval;
-       const char *fmt;
-       va_dcl
-#endif
-{
-       int e = errno;
-       va_list ap;
-
-       fprintf(stderr, "setbootimg: ");
-       if (fmt) {
-               VA_START(ap, fmt);
-               vfprintf(stderr, fmt, ap);
-               va_end(ap);
-               fprintf(stderr, ": ");
-       }
-       errno = e;
-       perror((char *) 0);
-       exit(eval);
-}
-
-static void
-#ifdef __STDC__
-errx(int eval, const char *fmt, ...)
-#else
-errx(eval, fmt, va_alist)
-       int eval;
-       const char *fmt;
-       va_dcl
-#endif
-{
-       va_list ap;
-
-       fprintf(stderr, "setbootimg: ");
-       if (fmt) {
-               VA_START(ap, fmt);
-               vfprintf(stderr, fmt, ap);
-               va_end(ap);
-       }
-       fprintf(stderr, "\n");
-       exit(eval);
-}
-
-#endif
-
-static unsigned
-get_uint16(void *p)
-{
-       unsigned char *q = p;
-
-       return q[0] << 8 | q[1];
-}
-
-static unsigned
-get_uint32(void *p)
-{
-       unsigned char *q = p;
-
-       return q[0] << 24 | q[1] << 16 | q[2] << 8 | q[3];
-}
-
-
-static const char boottop[] = {
-       0x60, 0x24, 0x53, 0x48, 0x41, 0x52, 0x50, 0x2F,
-       0x58, 0x36, 0x38, 0x30, 0x78, 0x30, 0x81, 0x99,
-       0x94, 0xE6, 0x82, 0xEA, 0x82, 0xBD, 0x8E, 0x9E,
-       0x82, 0xC9, 0x82, 0xCD, 0x8C, 0xBB, 0x8E, 0xC0,
-       0x93, 0xA6, 0x94, 0xF0, 0x81, 0x49
-};
-
-int
-main(int argc, char *argv[])
-{
-       char *imgfile, *bootfile;
-       char img[SIZE_BOOTBLK], boot[SIZE_BOOTBLK];
-       int size_img, size_boot;
-       int fd;
-       int labelstart, labelend, imgstart, imgend;
-
-       if (argc != 3) {
-               fprintf(stderr, "usage: %s image_file boot_block\n", argv[0]);
-               return 1;



Home | Main Index | Thread Index | Old Index