CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Jun 15 18:54:34 UTC 2021 Modified Files: src/sys/arch/luna68k/stand/boot: trap.c Log Message: constify To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/trap.c diff -u src/sys/arch/luna68k/stand/boot/trap.c:1.1 src/sys/arch/luna68k/stand/boot/trap.c:1.2 --- src/sys/arch/luna68k/stand/boot/trap.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/trap.c Tue Jun 15 18:54:34 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: trap.c,v 1.2 2021/06/15 18:54:34 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -77,7 +77,7 @@ #define USER 040 /* user-mode flag added to type */ -char *trap_type[] = { +const char *trap_type[] = { "Bus error", "Address error", "Illegal instruction",
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Jun 15 17:17:57 UTC 2021 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile Log Message: Specify -fno-unwind-tables to shrink binary size. Tested on nono. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/luna68k/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.17 src/sys/arch/luna68k/stand/boot/Makefile:1.18 --- src/sys/arch/luna68k/stand/boot/Makefile:1.17 Fri May 24 15:52:35 2019 +++ src/sys/arch/luna68k/stand/boot/Makefile Tue Jun 15 17:17:57 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.17 2019/05/24 15:52:35 tsutsui Exp $ +# $NetBSD: Makefile,v 1.18 2021/06/15 17:17:57 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -22,7 +22,7 @@ CPPFLAGS+= -DLIBSA_ENABLE_LS_OP CPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT CPPFLAGS+= -DLIBSA_CREAD_NOCRC -CFLAGS= -Os -msoft-float +CFLAGS= -Os -fno-unwind-tables -msoft-float CFLAGS+= -ffreestanding CFLAGS+= -Wall -Werror CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Jun 15 17:16:16 UTC 2021 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c version Log Message: Fix off-by-one of a number of blocks of probed disks. The SCSI READ_CAPACITY command returns the last logical data block address, so we have to increment it to get a number of blocks as src/sys/dev/scsipi/sd.c does. Bump revision to denote the change. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/luna68k/stand/boot/sc.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.17 src/sys/arch/luna68k/stand/boot/sc.c:1.18 --- src/sys/arch/luna68k/stand/boot/sc.c:1.17 Fri Feb 9 22:08:28 2018 +++ src/sys/arch/luna68k/stand/boot/sc.c Tue Jun 15 17:16:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.17 2018/02/09 22:08:28 jakllsch Exp $ */ +/* $NetBSD: sc.c,v 1.18 2021/06/15 17:16:16 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -240,13 +240,17 @@ static void scprobe(struct scsi_softc *hs, uint target, uint lun) { struct scsi_inquiry inqbuf; - uint32_t capbuf[2]; + uint32_t capbuf[2], blocks, blksize; char idstr[32]; int i; if (!scident(hs->sc_ctlr, target, lun, &inqbuf, capbuf)) return; + /* CMD_READ_CAPACITY returns the last logical data block address. */ + blocks = capbuf[0] + 1; + blksize = capbuf[1]; + memcpy(idstr, &inqbuf.vendor_id, 28); for (i = 27; i > 23; --i) if (idstr[i] != ' ') @@ -262,7 +266,7 @@ scprobe(struct scsi_softc *hs, uint targ idstr[i + 1] = '\0'; printf(" ID %d: %s %s rev %s", target, idstr, &idstr[8], &idstr[24]); - printf(", %d bytes/sect x %d sectors\n", capbuf[1], capbuf[0]); + printf(", %d bytes/sect x %d sectors\n", blksize, blocks); } Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.12 src/sys/arch/luna68k/stand/boot/version:1.13 --- src/sys/arch/luna68k/stand/boot/version:1.12 Sun Jan 17 04:40:10 2016 +++ src/sys/arch/luna68k/stand/boot/version Tue Jun 15 17:16:16 2021 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.12 2016/01/17 04:40:10 tsutsui Exp $ +$NetBSD: version,v 1.13 2021/06/15 17:16:16 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -17,3 +17,4 @@ is taken as the current. 1.9: Parse boot flags and pass boothowto and bootdev info to kernel. 1.10: Use booted device unit by default if no unit number is specified. 1.11: Disable slow gunzip CRC32 calculation. +1.12: Fix off-by-one of a number of blocks of probed disks.
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: christos Date: Wed Jan 2 00:50:02 UTC 2019 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile Log Message: use the right version of ELF2AOUT To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/luna68k/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.15 src/sys/arch/luna68k/stand/boot/Makefile:1.16 --- src/sys/arch/luna68k/stand/boot/Makefile:1.15 Thu Sep 27 23:51:34 2018 +++ src/sys/arch/luna68k/stand/boot/Makefile Tue Jan 1 19:50:02 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2018/09/28 03:51:34 isaki Exp $ +# $NetBSD: Makefile,v 1.16 2019/01/02 00:50:02 christos Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -80,7 +80,7 @@ LIBS= ${SALIB} ${ZLIB} ${KERNLIB} ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS} ${_MKTARGET_LINK} ${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS} - ${ELF2AOUT} ${PROG}.elf ${PROG}.aout + ${M68K_ELF2AOUT} ${PROG}.elf ${PROG}.aout mv ${PROG}.aout ${PROG} CLEANFILES+= ${PROG}.aout ${PROG}.elf
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: isaki Date: Fri Sep 28 04:34:02 UTC 2018 Modified Files: src/sys/arch/luna68k/stand/boot: locore.S Log Message: Improve codes. No functional changes intended. Confirmed on LUNA-I. OK'ed by tsutsui@. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.13 src/sys/arch/luna68k/stand/boot/locore.S:1.14 --- src/sys/arch/luna68k/stand/boot/locore.S:1.13 Fri Sep 28 04:13:24 2018 +++ src/sys/arch/luna68k/stand/boot/locore.S Fri Sep 28 04:34:02 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.13 2018/09/28 04:13:24 isaki Exp $ */ +/* $NetBSD: locore.S,v 1.14 2018/09/28 04:34:02 isaki Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -137,7 +137,7 @@ ASGLOBAL(Reset) VECTOR(badtrap) /* 28: level 4 interrupt autovector */ VECTOR(lev5intr) /* 29: level 5 interrupt autovector */ VECTOR(lev6intr) /* 30: level 6 interrupt autovector */ - VECTOR(badtrap) /* 31: level 7 interrupt autovector */ + VECTOR(exit) /* 31: level 7 interrupt autovector */ VECTOR(illinst) /* 32: syscalls */ VECTOR(illinst) /* 33: sigreturn syscall or breakpoint */ VECTOR(illinst) /* 34: breakpoint or sigreturn syscall */ @@ -211,32 +211,21 @@ Lbssclr: bne Lbssclr | no, keep going /* save address to goto ROM monitor */ - movec %vbr,%a0 | ROM vbr to %a0 - movl %a0@(NMIVEC),%d0 | restore NMIVEC - movl #_ASM_LABEL(gotoROM),%a0 | save to _gotoROM - movl %d0,%a0@ | + movec %vbr,%a0 | save ROM vbr + movl %a0,_ASM_LABEL(romvbr) movl #_ASM_LABEL(Reset),%a0 | BP vbr to %a0 - movl #_C_LABEL(exit),%a0@(NMIVEC) | save address - - -/* switch vector tabel */ - movec %vbr,%a0 - movl %a0@(ILLGINST),%sp@- | save ILLINST vector for BrkPtr - movl %a0@(EVTRAPF),%sp@- - - movl #_ASM_LABEL(Reset),%a0 - movl %sp@+,%a0@(EVTRAPF) - movl %sp@+,%a0@(ILLGINST) | restore ILLINST vector +/* copy ROM vectors */ + movl %a0@(ILLGINST),_ASM_LABEL(Reset) + ILLGINST + movl %a0@(EVTRAPF),_ASM_LABEL(Reset) + EVTRAPF movec %a0,%vbr - movl #DIPSW,%a0 - movw %a0@,%d0 - lsrl #8,%d0 - andl #0xFF,%d0 - movl %d0,_C_LABEL(dipsw1) - movw %a0@,%d0 - andl #0xFF,%d0 - movl %d0,_C_LABEL(dipsw2) + movw DIPSW,%d0 + clrl %d1 + movw %d0,%d1 + lsrl #8,%d1 + movl %d1,_C_LABEL(dipsw1) + movb %d0,%d1 + movl %d1,_C_LABEL(dipsw2) /* determine our CPU */ @@ -268,16 +257,12 @@ Lstart0: /* * exit to ROM monitor */ - - ROM_VBR = 0 - ENTRY_NOPROFILE(exit) GLOBAL(_rtt) movw #PSL_HIGHIPL,%sr | no interrupts - movl #ROM_VBR,%a0 + movl _ASM_LABEL(romvbr),%a0 movec %a0,%vbr - movl #_ASM_LABEL(gotoROM),%a0 - movl %a0@,%a1 + movl %a0@(NMIVEC),%a1 jmp %a1@ /* @@ -760,7 +745,7 @@ ENTRY(spl7) * Memory Information Field for secondary booter memory allocator */ -ASLOCAL(gotoROM) +ASLOCAL(romvbr) .long 0 GLOBAL(dipsw1)
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: isaki Date: Fri Sep 28 04:13:24 UTC 2018 Modified Files: src/sys/arch/luna68k/stand/boot: locore.S Log Message: Remove unused variable. OK'ed by tsutsui@. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.12 src/sys/arch/luna68k/stand/boot/locore.S:1.13 --- src/sys/arch/luna68k/stand/boot/locore.S:1.12 Fri Sep 28 03:53:59 2018 +++ src/sys/arch/luna68k/stand/boot/locore.S Fri Sep 28 04:13:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.12 2018/09/28 03:53:59 isaki Exp $ */ +/* $NetBSD: locore.S,v 1.13 2018/09/28 04:13:24 isaki Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -202,11 +202,6 @@ ASENTRY_NOPROFILE(start1) movw #PSL_HIGHIPL,%sr | no interrupts movl #STACK,%sp | set SP - movl #_C_LABEL(prgcore), %a2 | save program address - movl #_ASM_LABEL(Reset), %a2@+ | save start of core - movl #_C_LABEL(end), %a2@+ | save end of core - movl #STACK, %a2@ | save initial stack addr - /* clear BSS area */ movl #_C_LABEL(edata),%a2 | start of BSS movl #_C_LABEL(end),%a3 | end @@ -765,11 +760,6 @@ ENTRY(spl7) * Memory Information Field for secondary booter memory allocator */ -GLOBAL(prgcore) - .long 0 - .long 0 - .long 0 - ASLOCAL(gotoROM) .long 0
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: isaki Date: Fri Sep 28 03:53:59 UTC 2018 Modified Files: src/sys/arch/luna68k/stand/boot: locore.S Log Message: Fix a wrong comment. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.11 src/sys/arch/luna68k/stand/boot/locore.S:1.12 --- src/sys/arch/luna68k/stand/boot/locore.S:1.11 Mon Mar 24 10:46:58 2014 +++ src/sys/arch/luna68k/stand/boot/locore.S Fri Sep 28 03:53:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.11 2014/03/24 10:46:58 martin Exp $ */ +/* $NetBSD: locore.S,v 1.12 2018/09/28 03:53:59 isaki Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -266,7 +266,7 @@ Lstart0: movl %d0,_C_LABEL(cputype) /* final setup for C code */ - movw #PSL_LOWIPL,%sr | no interrupts + movw #PSL_LOWIPL,%sr | enable interrupts jsr _C_LABEL(main) | lets go jsr start
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: isaki Date: Fri Sep 28 03:51:34 UTC 2018 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile Log Message: Add missing link message. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.14 src/sys/arch/luna68k/stand/boot/Makefile:1.15 --- src/sys/arch/luna68k/stand/boot/Makefile:1.14 Sun Nov 12 08:24:37 2017 +++ src/sys/arch/luna68k/stand/boot/Makefile Fri Sep 28 03:51:34 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2017/11/12 08:24:37 tsutsui Exp $ +# $NetBSD: Makefile,v 1.15 2018/09/28 03:51:34 isaki Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -78,6 +78,7 @@ LIBS= ${SALIB} ${ZLIB} ${KERNLIB} .include "${S}/conf/newvers_stand.mk" ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS} + ${_MKTARGET_LINK} ${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS} ${ELF2AOUT} ${PROG}.elf ${PROG}.aout mv ${PROG}.aout ${PROG}
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: jakllsch Date: Fri Feb 9 22:08:28 UTC 2018 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c Log Message: Explain what may seem to be a non-sensical assignment, but isn't. closes PR 53000 To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/luna68k/stand/boot/sc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.16 src/sys/arch/luna68k/stand/boot/sc.c:1.17 --- src/sys/arch/luna68k/stand/boot/sc.c:1.16 Tue Oct 31 15:10:28 2017 +++ src/sys/arch/luna68k/stand/boot/sc.c Fri Feb 9 22:08:28 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.16 2017/10/31 15:10:28 christos Exp $ */ +/* $NetBSD: sc.c,v 1.17 2018/02/09 22:08:28 jakllsch Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -408,6 +408,7 @@ scabort(struct scsi_softc *hs) hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, hd->scsi_ints); if (hd->scsi_ints != 0) + /* write register value back to register */ hd->scsi_ints = hd->scsi_ints; if (hd->scsi_psns == 0 || (hd->scsi_ssts & SSTS_INITIATOR) == 0)
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Nov 12 08:24:37 UTC 2017 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile Log Message: Explicitly set NOPIE. GOT seems problematic on elf2aout(1) conversion. Fixes silent hangup of luna68k boot. Should be pulled up to netbsd-8. Current bsd.own.mk sets NOPIE in case of BINDIR=/usr/mdec for standalone programs and in luna68k case it's defined in ../Makefile.inc. However, many bootloader Makefiles include bsd.own.mk first to override CFLAGS etc. and Makefile.inc is not included (so BINDIR is not set) yet at the point. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.13 src/sys/arch/luna68k/stand/boot/Makefile:1.14 --- src/sys/arch/luna68k/stand/boot/Makefile:1.13 Sat Apr 8 19:53:21 2017 +++ src/sys/arch/luna68k/stand/boot/Makefile Sun Nov 12 08:24:37 2017 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.13 2017/04/08 19:53:21 christos Exp $ +# $NetBSD: Makefile,v 1.14 2017/11/12 08:24:37 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined +NOPIE= # defined .include
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: christos Date: Tue Oct 31 15:10:28 UTC 2017 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c Log Message: undo - pointed out this is a register assignment. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/luna68k/stand/boot/sc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.15 src/sys/arch/luna68k/stand/boot/sc.c:1.16 --- src/sys/arch/luna68k/stand/boot/sc.c:1.15 Tue Oct 31 10:55:45 2017 +++ src/sys/arch/luna68k/stand/boot/sc.c Tue Oct 31 11:10:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.15 2017/10/31 14:55:45 christos Exp $ */ +/* $NetBSD: sc.c,v 1.16 2017/10/31 15:10:28 christos Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -407,6 +407,9 @@ scabort(struct scsi_softc *hs) printf("sc%d: abort phase=0x%x, ssts=0x%x, ints=0x%x\n", hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, hd->scsi_ints); + if (hd->scsi_ints != 0) + hd->scsi_ints = hd->scsi_ints; + if (hd->scsi_psns == 0 || (hd->scsi_ssts & SSTS_INITIATOR) == 0) /* no longer connected to scsi target */ return;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: christos Date: Tue Oct 31 14:55:45 UTC 2017 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c Log Message: PR/52680: David Binderman: Remove dedundant assignment. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/sc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.14 src/sys/arch/luna68k/stand/boot/sc.c:1.15 --- src/sys/arch/luna68k/stand/boot/sc.c:1.14 Sat Feb 14 08:07:39 2015 +++ src/sys/arch/luna68k/stand/boot/sc.c Tue Oct 31 10:55:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.14 2015/02/14 13:07:39 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.15 2017/10/31 14:55:45 christos Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -407,9 +407,6 @@ scabort(struct scsi_softc *hs) printf("sc%d: abort phase=0x%x, ssts=0x%x, ints=0x%x\n", hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, hd->scsi_ints); - if (hd->scsi_ints != 0) - hd->scsi_ints = hd->scsi_ints; - if (hd->scsi_psns == 0 || (hd->scsi_ssts & SSTS_INITIATOR) == 0) /* no longer connected to scsi target */ return;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Nov 25 17:37:04 UTC 2016 Modified Files: src/sys/arch/luna68k/stand/boot: parse.c Log Message: Add a missing newline in help message. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/parse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/parse.c diff -u src/sys/arch/luna68k/stand/boot/parse.c:1.7 src/sys/arch/luna68k/stand/boot/parse.c:1.8 --- src/sys/arch/luna68k/stand/boot/parse.c:1.7 Sat Feb 14 13:06:28 2015 +++ src/sys/arch/luna68k/stand/boot/parse.c Fri Nov 25 17:37:04 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.7 2015/02/14 13:06:28 tsutsui Exp $ */ +/* $NetBSD: parse.c,v 1.8 2016/11/25 17:37:04 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -103,7 +103,7 @@ static const char helpmsg[] = "commands are:\n" "boot [device(unit,part)filename] [-ads]\n" " (ex. \"boot sd(6,0)netbsd\", \"boot le()netbsd.old\" etc.)\n" - " Note unit number for SCSI device is (ctlr) * 10 + (id)." + " Note unit number for SCSI device is (ctlr) * 10 + (id).\n" "ls [device(unit, part)[path]]\n" " (ex. \"ls sd(0,0)/bin\")\n" "help\n"
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 17 04:40:10 UTC 2016 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile version Log Message: Enable LIBSA_CREAD_NOCRC. PR/50638 Also bump version to denote user visible change. Tested on LUNA-II. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/Makefile \ src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.11 src/sys/arch/luna68k/stand/boot/Makefile:1.12 --- src/sys/arch/luna68k/stand/boot/Makefile:1.11 Thu Jan 16 01:15:34 2014 +++ src/sys/arch/luna68k/stand/boot/Makefile Sun Jan 17 04:40:10 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.11 2014/01/16 01:15:34 christos Exp $ +# $NetBSD: Makefile,v 1.12 2016/01/17 04:40:10 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -19,6 +19,7 @@ CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOT #CPPFLAGS+= -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID CPPFLAGS+= -DLIBSA_ENABLE_LS_OP CPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT +CPPFLAGS+= -DLIBSA_CREAD_NOCRC CFLAGS= -Os -msoft-float CFLAGS+= -ffreestanding Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.11 src/sys/arch/luna68k/stand/boot/version:1.12 --- src/sys/arch/luna68k/stand/boot/version:1.11 Wed Apr 16 13:43:02 2014 +++ src/sys/arch/luna68k/stand/boot/version Sun Jan 17 04:40:10 2016 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.11 2014/04/16 13:43:02 tsutsui Exp $ +$NetBSD: version,v 1.12 2016/01/17 04:40:10 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -16,3 +16,4 @@ is taken as the current. controller number and target ID to specify the boot disk. 1.9: Parse boot flags and pass boothowto and bootdev info to kernel. 1.10: Use booted device unit by default if no unit number is specified. +1.11: Disable slow gunzip CRC32 calculation.
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Sep 1 13:55:26 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: devopen.c Log Message: Use the default boot device if a kernel name without device is specificed. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/devopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.10 src/sys/arch/luna68k/stand/boot/devopen.c:1.11 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.10 Tue Sep 1 13:46:50 2015 +++ src/sys/arch/luna68k/stand/boot/devopen.c Tue Sep 1 13:55:25 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.10 2015/09/01 13:46:50 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.11 2015/09/01 13:55:25 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -138,58 +138,71 @@ make_device(const char *str, int *devp, for (cp = str, i = 0; *cp != '\0' && *cp != '(' && i < MAXDEVNAME; i++) devname[i] = *cp++; if (*cp != '(') { - return -1; - } - devname[i] = '\0'; - /* compare dev type name */ - for (dp = devsw; dp->dv_name; dp++) - if (!strcmp(devname, dp->dv_name)) - break; - cp++; - if (dp->dv_name == NULL) { - return -1; - } - dev = dp - devsw; - /* get mixed controller and unit number */ - haveunit = false; - for (; *cp != ',' && *cp != ')'; cp++) { - if (*cp == '\0') + /* no device name is specified; assume default */ + cp = str; + /* compare dev type name */ + for (dp = devsw; dp->dv_name; dp++) + if (!strcmp(default_bootdev, dp->dv_name)) +break; + if (dp->dv_name == NULL) { return -1; - if (*cp >= '0' && *cp <= '9') { - unit = unit * 10 + *cp - '0'; - haveunit = true; } - } - if (unit < 0 || CTLR(unit) >= 2 || TARGET(unit) > 7) { -#ifdef DEBUG - printf("%s: invalid unit number (%d)\n", __func__, unit); -#endif - return -1; - } - if (!haveunit && strcmp(devname, default_bootdev) == 0) + dev = dp - devsw; unit = default_unit; - /* get optional partition number */ - if (*cp == ',') + } else { + devname[i] = '\0'; + /* compare dev type name */ + for (dp = devsw; dp->dv_name; dp++) + if (!strcmp(devname, dp->dv_name)) +break; cp++; - - for (; /* *cp != ',' && */ *cp != ')'; cp++) { - if (*cp == '\0') + if (dp->dv_name == NULL) { return -1; - if (*cp >= '0' && *cp <= '9') - part = part * 10 + *cp - '0'; - } - if (part < 0 || part >= MAXPARTITIONS) { + } + dev = dp - devsw; + /* get mixed controller and unit number */ + haveunit = false; + for (; *cp != ',' && *cp != ')'; cp++) { + if (*cp == '\0') +return -1; + if (*cp >= '0' && *cp <= '9') { +unit = unit * 10 + *cp - '0'; +haveunit = true; + } + } + if (unit < 0 || CTLR(unit) >= 2 || TARGET(unit) > 7) { +#ifdef DEBUG + printf("%s: invalid unit number (%d)\n", + __func__, unit); +#endif + return -1; + } + if (!haveunit && strcmp(devname, default_bootdev) == 0) + unit = default_unit; + /* get optional partition number */ + if (*cp == ',') + cp++; + + for (; /* *cp != ',' && */ *cp != ')'; cp++) { + if (*cp == '\0') +return -1; + if (*cp >= '0' && *cp <= '9') +part = part * 10 + *cp - '0'; + } + if (part < 0 || part >= MAXPARTITIONS) { #ifdef DEBUG - printf("%s: invalid partition number (%d)\n", __func__, part); + printf("%s: invalid partition number (%d)\n", + __func__, part); #endif - return -1; + return -1; + } + cp++; } /* check out end of dev spec */ *devp = dev; *unitp = unit; *partp = part; if (fname != NULL) { - cp++; if (*cp == '\0') *fname = "netbsd"; else
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Sep 1 13:46:50 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: devopen.c Log Message: Fix indent. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/devopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.9 src/sys/arch/luna68k/stand/boot/devopen.c:1.10 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.9 Sat Feb 14 05:58:02 2015 +++ src/sys/arch/luna68k/stand/boot/devopen.c Tue Sep 1 13:46:50 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.9 2015/02/14 05:58:02 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.10 2015/09/01 13:46:50 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -136,7 +136,7 @@ make_device(const char *str, int *devp, */ /* find end of dev type name */ for (cp = str, i = 0; *cp != '\0' && *cp != '(' && i < MAXDEVNAME; i++) - devname[i] = *cp++; + devname[i] = *cp++; if (*cp != '(') { return -1; }
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Feb 14 13:07:39 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: disklabel.c init_main.c machdep.c sc.c sd.c Log Message: Explicitly denote static functions. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/disklabel.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/machdep.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/sc.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/sd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/disklabel.c diff -u src/sys/arch/luna68k/stand/boot/disklabel.c:1.9 src/sys/arch/luna68k/stand/boot/disklabel.c:1.10 --- src/sys/arch/luna68k/stand/boot/disklabel.c:1.9 Sat Feb 14 06:16:29 2015 +++ src/sys/arch/luna68k/stand/boot/disklabel.c Sat Feb 14 13:07:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.9 2015/02/14 06:16:29 tsutsui Exp $ */ +/* $NetBSD: disklabel.c,v 1.10 2015/02/14 13:07:39 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -329,7 +329,7 @@ disklabel(int argc, char *argv[]) return ST_NORMAL; } -void +static void display(struct disklabel *lp) { int i, j; Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.15 src/sys/arch/luna68k/stand/boot/init_main.c:1.16 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.15 Mon Apr 21 11:06:55 2014 +++ src/sys/arch/luna68k/stand/boot/init_main.c Sat Feb 14 13:07:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.15 2014/04/21 11:06:55 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.16 2015/02/14 13:07:39 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -328,7 +328,7 @@ main(void) exit(0); } -int +static int get_plane_numbers(void) { int r = ROM_plane; @@ -341,7 +341,7 @@ get_plane_numbers(void) return n; } -int +static int reorder_dipsw(int dipsw) { int i, sw = 0; Index: src/sys/arch/luna68k/stand/boot/machdep.c diff -u src/sys/arch/luna68k/stand/boot/machdep.c:1.4 src/sys/arch/luna68k/stand/boot/machdep.c:1.5 --- src/sys/arch/luna68k/stand/boot/machdep.c:1.4 Sat Feb 14 05:58:02 2015 +++ src/sys/arch/luna68k/stand/boot/machdep.c Sat Feb 14 13:07:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.4 2015/02/14 05:58:02 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.5 2015/02/14 13:07:39 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -157,7 +157,7 @@ regdump(int *rp /* must not be register /* #define KSADDR ((int *)&(((char *)&u)[(UPAGES-1)*NBPG])) */ -void +static void dumpmem(int *ptr, int sz, int ustack) { int i, val; Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.13 src/sys/arch/luna68k/stand/boot/sc.c:1.14 --- src/sys/arch/luna68k/stand/boot/sc.c:1.13 Sat Feb 14 05:58:02 2015 +++ src/sys/arch/luna68k/stand/boot/sc.c Sat Feb 14 13:07:39 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.13 2015/02/14 05:58:02 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.14 2015/02/14 13:07:39 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -135,7 +135,7 @@ scinit(int ctlr, void *addr) return 1; } -void +static void screset(struct scsi_softc *hs) { struct scsidevice *hd = hs->sc_spc; @@ -270,7 +270,7 @@ scprobe(struct scsi_softc *hs, uint targ * SPC Arbitration/Selection routine */ -int +static int issue_select(struct scsidevice *hd, uint8_t target) { @@ -299,7 +299,7 @@ issue_select(struct scsidevice *hd, uint * SPC Program Transfer routines */ -void +static void ixfer_start(struct scsidevice *hd, int len, uint8_t phase, int wait) { @@ -310,7 +310,7 @@ ixfer_start(struct scsidevice *hd, int l hd->scsi_scmd = SCMD_XFR | SCMD_PROG_XFR; } -void +static void ixfer_out(struct scsidevice *hd, int len, uint8_t *buf) { @@ -322,7 +322,7 @@ ixfer_out(struct scsidevice *hd, int len } } -void +static void ixfer_in(struct scsidevice *hd, int len, uint8_t *buf) { @@ -339,7 +339,7 @@ ixfer_in(struct scsidevice *hd, int len, * SPC drive routines */ -int +static int scrun(int ctlr, int target, uint8_t *cdb, int cdblen, uint8_t *buf, int len, volatile int *lock) { @@ -376,7 +376,7 @@ scrun(int ctlr, int target, uint8_t *cdb return 1; } -int +static int scfinish(int ctlr) { struct scsi_softc *hs = &scsi_softc[ctlr]; @@ -398,7 +398,7 @@ scfinish(int ctlr) return status; } -void +static void scabort(struct scsi_softc *hs) { struct scsidevice *hd = hs->sc_spc; Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.11 src/sys/arch/luna68k/stand/boot/sd.c:1.12 --- src/sys/arch/luna68k/stand/boot/sd.c:1.11 Wed Apr 16 12:01:53 2014 +++ src/sys/arch/luna68k/stand/boot/sd.c Sat Feb 14 13:07:39 2015 @@ -1,
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Feb 14 13:06:28 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: kbd.c parse.c Log Message: Make local readonly arrays static const. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/kbd.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/parse.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/kbd.c diff -u src/sys/arch/luna68k/stand/boot/kbd.c:1.3 src/sys/arch/luna68k/stand/boot/kbd.c:1.4 --- src/sys/arch/luna68k/stand/boot/kbd.c:1.3 Sat Feb 14 05:03:09 2015 +++ src/sys/arch/luna68k/stand/boot/kbd.c Sat Feb 14 13:06:28 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kbd.c,v 1.3 2015/02/14 05:03:09 tsutsui Exp $ */ +/* $NetBSD: kbd.c,v 1.4 2015/02/14 13:06:28 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -79,7 +79,7 @@ #include #include -struct kbd_keymap kbd_keymap[] = { +static const struct kbd_keymap kbd_keymap[] = { { KC_IGNORE, { 0, 0} }, /* 0 [0x00] */ { KC_IGNORE, { 0, 0} }, /* 1 [0x01] */ { KC_IGNORE, { 0, 0} }, /* 2 [0x02] */ Index: src/sys/arch/luna68k/stand/boot/parse.c diff -u src/sys/arch/luna68k/stand/boot/parse.c:1.6 src/sys/arch/luna68k/stand/boot/parse.c:1.7 --- src/sys/arch/luna68k/stand/boot/parse.c:1.6 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/parse.c Sat Feb 14 13:06:28 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.6 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: parse.c,v 1.7 2015/02/14 13:06:28 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -130,7 +130,7 @@ struct command_entry { int (*func)(int, char **); }; -struct command_entry entries[] = { +static const struct command_entry entries[] = { { "b", boot }, { "boot", boot }, { "chkargs", check_args },
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Feb 14 06:31:31 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: bmd.c Log Message: Make local functions and variables static. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/bmd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmd.c diff -u src/sys/arch/luna68k/stand/boot/bmd.c:1.6 src/sys/arch/luna68k/stand/boot/bmd.c:1.7 --- src/sys/arch/luna68k/stand/boot/bmd.c:1.6 Sat Feb 14 05:58:02 2015 +++ src/sys/arch/luna68k/stand/boot/bmd.c Sat Feb 14 06:31:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bmd.c,v 1.6 2015/02/14 05:58:02 tsutsui Exp $ */ +/* $NetBSD: bmd.c,v 1.7 2015/02/14 06:31:31 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -117,12 +117,12 @@ union bmd_rfcnt { #define SKIP_NEXT_LINE(addr) (addr += (PL_WIDTH - SL_WIDTH)) -void bmd_draw_char(uint8_t *, uint8_t *, int, int, int); -void bmd_reverse_char(uint8_t *, uint8_t *, int, int); -void bmd_erase_char(uint8_t *, uint8_t *, int, int); -void bmd_erase_screen(volatile uint32_t *); -void bmd_scroll_screen(volatile uint32_t *, volatile uint32_t *, - int, int, int, int); +static void bmd_draw_char(uint8_t *, uint8_t *, int, int, int); +static void bmd_reverse_char(uint8_t *, uint8_t *, int, int); +static void bmd_erase_char(uint8_t *, uint8_t *, int, int); +static void bmd_erase_screen(volatile uint32_t *); +static void bmd_scroll_screen(volatile uint32_t *, volatile uint32_t *, + int, int, int, int); struct bmd_linec { @@ -153,19 +153,21 @@ struct bmd_softc { #define STAT_ESCAPE 0x0001 #define STAT_INSERT 0x0100 -struct bmd_softc bmd_softc; -struct bmd_linec bmd_linec[52]; +static struct bmd_softc bmd_softc; +static struct bmd_linec bmd_linec[52]; -void bmd_escape(int); -void bmd_escape_0(int); -void bmd_escape_1(int); +static void bmd_escape(int); +static void bmd_escape_0(int); +#if 0 +static void bmd_escape_1(int); +#endif /* * Escape-Sequence */ -void +static void bmd_escape(int c) { struct bmd_softc *bp = &bmd_softc; @@ -184,7 +186,7 @@ bmd_escape(int c) } } -void +static void bmd_escape_0(int c) { struct bmd_softc *bp = &bmd_softc; @@ -234,7 +236,8 @@ bmd_escape_0(int c) bp->bc_escape = bmd_escape; } -void +#if 0 +static void bmd_escape_1(int c) { struct bmd_softc *bp = &bmd_softc; @@ -270,7 +273,7 @@ bmd_escape_1(int c) break; } } - +#endif /* * Entry Routine @@ -468,7 +471,7 @@ bmdclear(void) * charactor operation routines */ -void +static void bmd_draw_char(uint8_t *raddr, uint8_t *waddr, int col, int row, int c) { volatile uint16_t *p, *q; @@ -539,7 +542,7 @@ bmd_draw_char(uint8_t *raddr, uint8_t *w } } -void +static void bmd_reverse_char(uint8_t *raddr, uint8_t *waddr, int col, int row) { volatile uint16_t *p, *q; @@ -601,7 +604,7 @@ bmd_reverse_char(uint8_t *raddr, uint8_t } } -void +static void bmd_erase_char(uint8_t *raddr, uint8_t *waddr, int col, int row) { @@ -613,7 +616,7 @@ bmd_erase_char(uint8_t *raddr, uint8_t * * screen operation routines */ -void +static void bmd_erase_screen(volatile uint32_t *lp) { int i, j; @@ -625,7 +628,7 @@ bmd_erase_screen(volatile uint32_t *lp) } } -void +static void bmd_scroll_screen(volatile uint32_t *lp, volatile uint32_t *lq, int xmin, int xmax, int ymin, int ymax) {
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Feb 14 06:16:29 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: disklabel.c Log Message: Don't use cnputc() directly in an application layer. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/stand/boot/disklabel.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/disklabel.c diff -u src/sys/arch/luna68k/stand/boot/disklabel.c:1.8 src/sys/arch/luna68k/stand/boot/disklabel.c:1.9 --- src/sys/arch/luna68k/stand/boot/disklabel.c:1.8 Sat Feb 14 05:58:02 2015 +++ src/sys/arch/luna68k/stand/boot/disklabel.c Sat Feb 14 06:16:29 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.8 2015/02/14 05:58:02 tsutsui Exp $ */ +/* $NetBSD: disklabel.c,v 1.9 2015/02/14 06:16:29 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -399,15 +399,15 @@ display(struct disklabel *lp) printf("\t# (Cyl. %d", pp->p_offset / lp->d_secpercyl); if (pp->p_offset % lp->d_secpercyl) -cnputc('*'); +putchar('*'); else -cnputc(' '); +putchar(' '); printf("- %d", (pp->p_offset + pp->p_size + lp->d_secpercyl - 1) / lp->d_secpercyl - 1); if (pp->p_size % lp->d_secpercyl) -cnputc('*'); +putchar('*'); printf(")\n"); } }
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Feb 14 05:58:03 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: bmc.c bmd.c cons.c devopen.c disklabel.c machdep.c sc.c scsi.c Log Message: Misc KNF and cosmetics. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/bmc.c \ src/sys/arch/luna68k/stand/boot/bmd.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/cons.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/stand/boot/devopen.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/disklabel.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/machdep.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/sc.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/scsi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmc.c diff -u src/sys/arch/luna68k/stand/boot/bmc.c:1.5 src/sys/arch/luna68k/stand/boot/bmc.c:1.6 --- src/sys/arch/luna68k/stand/boot/bmc.c:1.5 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/bmc.c Sat Feb 14 05:58:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bmc.c,v 1.5 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: bmc.c,v 1.6 2015/02/14 05:58:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -124,7 +124,7 @@ bmccngetc(dev_t dev) POP_RBUF(unit, c); #if 1 - return c ; + return c; #else return siocngetc(dev); #endif Index: src/sys/arch/luna68k/stand/boot/bmd.c diff -u src/sys/arch/luna68k/stand/boot/bmd.c:1.5 src/sys/arch/luna68k/stand/boot/bmd.c:1.6 --- src/sys/arch/luna68k/stand/boot/bmd.c:1.5 Sat Feb 14 05:03:09 2015 +++ src/sys/arch/luna68k/stand/boot/bmd.c Sat Feb 14 05:58:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bmd.c,v 1.5 2015/02/14 05:03:09 tsutsui Exp $ */ +/* $NetBSD: bmd.c,v 1.6 2015/02/14 05:58:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -290,8 +290,11 @@ bmdinit(void) * adjust plane position */ - bp->bc_raddr = (uint8_t *)0xB10C0008; /* plane-0 hardware address */ - bp->bc_waddr = (uint8_t *)0xB1080008; /* common bitmap hardware address */ + /* plane-0 hardware address */ + bp->bc_raddr = (uint8_t *)0xB10C0008; + /* common bitmap hardware address */ + bp->bc_waddr = (uint8_t *)0xB1080008; + rfcnt.p.rfc_hcnt = 7; /* shift left 16 dot */ rfcnt.p.rfc_vcnt = -27; /* shift down1 dot */ *bmd_rfcnt = rfcnt.u; @@ -324,7 +327,7 @@ bmdinit(void) bmd_erase_screen((uint32_t *)bp->bc_waddr); /* clear screen */ *bmd_bmsel = 0x01;/* 1 plane */ - /* turn on cursole */ + /* turn on cursor */ bmd_reverse_char(bp->bc_raddr, bp->bc_waddr, bq->bl_col, bp->bc_row); @@ -352,11 +355,13 @@ bmdputc(int c) int i; c &= 0x7F; - /* turn off cursole */ + + /* turn off cursor */ bmd_reverse_char(bp->bc_raddr, bp->bc_waddr, bq->bl_col, bp->bc_row); - /* do escape-sequence */ + + /* do escape-sequence */ if (bp->bc_stat & STAT_ESCAPE) { *bp->bc_esc++ = c; (*bp->bc_escape)(c); @@ -412,7 +417,7 @@ bmdputc(int c) bq->bl_col = bp->bc_xmin; break; - case 0x1b:/* ESC */ + case 0x1B:/* ESC */ bp->bc_stat |= STAT_ESCAPE; *bp->bc_esc++ = 0x1b; break; @@ -432,7 +437,7 @@ bmdputc(int c) } done: - /* turn on cursole */ + /* turn on cursor */ bmd_reverse_char(bp->bc_raddr, bp->bc_waddr, bq->bl_col, bp->bc_row); @@ -446,14 +451,16 @@ bmdclear(void) struct bmd_softc *bp = &bmd_softc; struct bmd_linec *bq = bp->bc_bl; - bmd_erase_screen((uint32_t *)bp->bc_waddr); /* clear screen */ + /* clear screen */ + bmd_erase_screen((uint32_t *)bp->bc_waddr); bq->bl_col = bq->bl_end = bp->bc_xmin; bp->bc_row = bp->bc_ymin; + /* turn on cursor */ bmd_reverse_char(bp->bc_raddr, bp->bc_waddr, - bq->bl_col, bp->bc_row); /* turn on cursole */ + bq->bl_col, bp->bc_row); } Index: src/sys/arch/luna68k/stand/boot/cons.c diff -u src/sys/arch/luna68k/stand/boot/cons.c:1.2 src/sys/arch/luna68k/stand/boot/cons.c:1.3 --- src/sys/arch/luna68k/stand/boot/cons.c:1.2 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/cons.c Sat Feb 14 05:58:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cons.c,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: cons.c,v 1.3 2015/02/14 05:58:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -126,6 +126,7 @@ cninit(void) int cngetc(void) { + if (cn_tab == NULL) return 0; return (*cn_tab->cn_getc)(cn_tab->cn_dev); @@ -134,9 +135,10 @@ cngetc(void) void cnputc(int c) { + if (cn_tab == NULL) return; - if (c) { + if (c != 0) { (*cn_tab->cn_putc)(cn_tab->cn_dev, c); if (c == '\n') (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r'); Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.8 src/sys/arch/luna68k/stand/boot/devopen.c:1.9 --- src/sys/arch/luna68k/stand/b
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Feb 14 05:03:09 UTC 2015 Modified Files: src/sys/arch/luna68k/stand/boot: bmd.c disklabel.c kbd.c rcvbuf.h samachdep.h sc.c scsi.c scsireg.h scsivar.h sioreg.h ufs_disksubr.c Log Message: Use proper signedness and exact-width interger types. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/bmd.c \ src/sys/arch/luna68k/stand/boot/ufs_disksubr.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/disklabel.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/kbd.c \ src/sys/arch/luna68k/stand/boot/rcvbuf.h \ src/sys/arch/luna68k/stand/boot/scsivar.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/sc.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/scsi.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/scsireg.h \ src/sys/arch/luna68k/stand/boot/sioreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmd.c diff -u src/sys/arch/luna68k/stand/boot/bmd.c:1.4 src/sys/arch/luna68k/stand/boot/bmd.c:1.5 --- src/sys/arch/luna68k/stand/boot/bmd.c:1.4 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/bmd.c Sat Feb 14 05:03:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: bmd.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: bmd.c,v 1.5 2015/02/14 05:03:09 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -86,8 +86,8 @@ union bmd_rfcnt { struct { - short rfc_hcnt; - short rfc_vcnt; + int16_t rfc_hcnt; + int16_t rfc_vcnt; } p; uint32_t u; }; @@ -117,9 +117,9 @@ union bmd_rfcnt { #define SKIP_NEXT_LINE(addr) (addr += (PL_WIDTH - SL_WIDTH)) -void bmd_draw_char(char *, char *, int, int, int); -void bmd_reverse_char(char *, char *, int, int); -void bmd_erase_char(char *, char *, int, int); +void bmd_draw_char(uint8_t *, uint8_t *, int, int, int); +void bmd_reverse_char(uint8_t *, uint8_t *, int, int); +void bmd_erase_char(uint8_t *, uint8_t *, int, int); void bmd_erase_screen(volatile uint32_t *); void bmd_scroll_screen(volatile uint32_t *, volatile uint32_t *, int, int, int, int); @@ -130,13 +130,13 @@ struct bmd_linec { struct bmd_linec *bl_prev; int bl_col; int bl_end; - u_char bl_line[128]; + uint8_t bl_line[128]; }; struct bmd_softc { int bc_stat; - char *bc_raddr; - char *bc_waddr; + uint8_t *bc_raddr; + uint8_t *bc_waddr; int bc_xmin; int bc_xmax; int bc_ymin; @@ -280,7 +280,7 @@ void bmdinit(void) { volatile uint32_t *bmd_rfcnt = (uint32_t *)0xB100; - volatile long *bmd_bmsel = (long *)0xB104; + volatile uint32_t *bmd_bmsel = (uint32_t *)0xB104; struct bmd_softc *bp = &bmd_softc; struct bmd_linec *bq; int i; @@ -290,8 +290,8 @@ bmdinit(void) * adjust plane position */ - bp->bc_raddr = (char *)0xB10C0008; /* plane-0 hardware address */ - bp->bc_waddr = (char *)0xB1080008; /* common bitmap hardware address */ + bp->bc_raddr = (uint8_t *)0xB10C0008; /* plane-0 hardware address */ + bp->bc_waddr = (uint8_t *)0xB1080008; /* common bitmap hardware address */ rfcnt.p.rfc_hcnt = 7; /* shift left 16 dot */ rfcnt.p.rfc_vcnt = -27; /* shift down1 dot */ *bmd_rfcnt = rfcnt.u; @@ -331,7 +331,7 @@ bmdinit(void) } void -bmdadjust(short hcnt, short vcnt) +bmdadjust(int16_t hcnt, int16_t vcnt) { volatile uint32_t *bmd_rfcnt = (uint32_t *)0xB100; union bmd_rfcnt rfcnt; @@ -462,7 +462,7 @@ bmdclear(void) */ void -bmd_draw_char(char *raddr, char *waddr, int col, int row, int c) +bmd_draw_char(uint8_t *raddr, uint8_t *waddr, int col, int row, int c) { volatile uint16_t *p, *q; volatile uint32_t *lp, *lq; @@ -533,7 +533,7 @@ bmd_draw_char(char *raddr, char *waddr, } void -bmd_reverse_char(char *raddr, char *waddr, int col, int row) +bmd_reverse_char(uint8_t *raddr, uint8_t *waddr, int col, int row) { volatile uint16_t *p, *q; volatile uint32_t *lp, *lq; @@ -595,7 +595,7 @@ bmd_reverse_char(char *raddr, char *wadd } void -bmd_erase_char(char *raddr, char *waddr, int col, int row) +bmd_erase_char(uint8_t *raddr, uint8_t *waddr, int col, int row) { bmd_draw_char(raddr, waddr, col, row, 0); Index: src/sys/arch/luna68k/stand/boot/ufs_disksubr.c diff -u src/sys/arch/luna68k/stand/boot/ufs_disksubr.c:1.4 src/sys/arch/luna68k/stand/boot/ufs_disksubr.c:1.5 --- src/sys/arch/luna68k/stand/boot/ufs_disksubr.c:1.4 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/ufs_disksubr.c Sat Feb 14 05:03:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_disksubr.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: ufs_disksubr.c,v 1.5 2015/02/14 05:03:09 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -91,7 +91,7 @@ char * readdisklabel(int ctlr, int id, struct disklabel *lp) { - u_char *bp = lb
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: christos Date: Fri Nov 21 01:16:04 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: getsecs.c Log Message: need clock_subr.h for bcdtobin() To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/getsecs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/getsecs.c diff -u src/sys/arch/luna68k/stand/boot/getsecs.c:1.1 src/sys/arch/luna68k/stand/boot/getsecs.c:1.2 --- src/sys/arch/luna68k/stand/boot/getsecs.c:1.1 Sun Jan 13 09:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/getsecs.c Thu Nov 20 20:16:04 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: getsecs.c,v 1.1 2013/01/13 14:10:55 tsutsui Exp $ */ +/* $NetBSD: getsecs.c,v 1.2 2014/11/21 01:16:04 christos Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -35,6 +35,8 @@ #include #include +#include + #include #include
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Apr 21 11:06:55 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: devopen.c init_main.c samachdep.h Log Message: Fix stupid botches in previous. Use a proper device unit number if a unit number or non-default device is specified on the boot command. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/devopen.c cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.7 src/sys/arch/luna68k/stand/boot/devopen.c:1.8 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.7 Wed Apr 16 13:43:02 2014 +++ src/sys/arch/luna68k/stand/boot/devopen.c Mon Apr 21 11:06:55 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.7 2014/04/16 13:43:02 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.8 2014/04/21 11:06:55 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -126,8 +126,9 @@ make_device(const char *str, int *devp, int dev, unit, part; int i; char devname[MAXDEVNAME + 1]; + bool haveunit; - unit = default_unit; + unit = 0; part = 0; /* @@ -150,11 +151,14 @@ make_device(const char *str, int *devp, } dev = dp - devsw; /* get mixed controller and unit number */ + haveunit = false; for (; *cp != ',' && *cp != ')'; cp++) { if (*cp == '\0') return -1; - if (*cp >= '0' && *cp <= '9') + if (*cp >= '0' && *cp <= '9') { unit = unit * 10 + *cp - '0'; + haveunit = true; + } } if (unit < 0 || CTLR(unit) >= 2 || TARGET(unit) > 7) { #ifdef DEBUG @@ -162,6 +166,8 @@ make_device(const char *str, int *devp, #endif return (-1); } + if (!haveunit && strcmp(devname, default_bootdev) == 0) + unit = default_unit; /* get optional partition number */ if (*cp == ',') cp++; Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.14 src/sys/arch/luna68k/stand/boot/init_main.c:1.15 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.14 Wed Apr 16 13:43:02 2014 +++ src/sys/arch/luna68k/stand/boot/init_main.c Mon Apr 21 11:06:55 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.14 2014/04/16 13:43:02 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.15 2014/04/21 11:06:55 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -88,6 +88,7 @@ int cpuspeed; /* for DELAY() macro */ int hz = 60; int machtype; char default_file[64]; +const char *default_bootdev; int default_unit; #define VERS_LOCAL "Phase-31" @@ -287,6 +288,7 @@ main(void) snprintf(default_file, sizeof(default_file), "%s(%d,%d)%s", bootdev, unit, part, "netbsd"); + default_bootdev = bootdev; default_unit = unit; howto = reorder_dipsw(dipsw2); Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.18 src/sys/arch/luna68k/stand/boot/samachdep.h:1.19 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.18 Wed Apr 16 13:43:02 2014 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Mon Apr 21 11:06:55 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.18 2014/04/16 13:43:02 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.19 2014/04/21 11:06:55 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -103,6 +103,7 @@ extern int hz; extern int nplane; extern int machtype; extern char default_file[]; +extern const char *default_bootdev; extern int default_unit; /* kbd.c */
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Wed Apr 16 13:43:02 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: devopen.c init_main.c samachdep.h version Log Message: Use booted device unit if no unit number is specified on boot command. Bump version to denote a visible change. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/devopen.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.6 src/sys/arch/luna68k/stand/boot/devopen.c:1.7 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.6 Sat Jan 11 08:08:23 2014 +++ src/sys/arch/luna68k/stand/boot/devopen.c Wed Apr 16 13:43:02 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.6 2014/01/11 08:08:23 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.7 2014/04/16 13:43:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -123,10 +123,13 @@ make_device(const char *str, int *devp, { const char *cp; struct devsw *dp; - int dev, unit = 0, part = 0; + int dev, unit, part; int i; char devname[MAXDEVNAME + 1]; + unit = default_unit; + part = 0; + /* * parse path strings */ Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.13 src/sys/arch/luna68k/stand/boot/init_main.c:1.14 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.13 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/init_main.c Wed Apr 16 13:43:02 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.13 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.14 2014/04/16 13:43:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -88,6 +88,7 @@ int cpuspeed; /* for DELAY() macro */ int hz = 60; int machtype; char default_file[64]; +int default_unit; #define VERS_LOCAL "Phase-31" @@ -286,6 +287,7 @@ main(void) snprintf(default_file, sizeof(default_file), "%s(%d,%d)%s", bootdev, unit, part, "netbsd"); + default_unit = unit; howto = reorder_dipsw(dipsw2); Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.17 src/sys/arch/luna68k/stand/boot/samachdep.h:1.18 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.17 Sat Jan 11 17:00:37 2014 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Wed Apr 16 13:43:02 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.17 2014/01/11 17:00:37 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.18 2014/04/16 13:43:02 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -103,6 +103,7 @@ extern int hz; extern int nplane; extern int machtype; extern char default_file[]; +extern int default_unit; /* kbd.c */ int kbd_decode(u_char); Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.10 src/sys/arch/luna68k/stand/boot/version:1.11 --- src/sys/arch/luna68k/stand/boot/version:1.10 Sat Jan 11 08:20:51 2014 +++ src/sys/arch/luna68k/stand/boot/version Wed Apr 16 13:43:02 2014 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.10 2014/01/11 08:20:51 tsutsui Exp $ +$NetBSD: version,v 1.11 2014/04/16 13:43:02 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -15,3 +15,4 @@ is taken as the current. 1.8: Probe SCSI devices at any IDs and change boot command to use SCSI controller number and target ID to specify the boot disk. 1.9: Parse boot flags and pass boothowto and bootdev info to kernel. +1.10: Use booted device unit by default if no unit number is specified.
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Wed Apr 16 12:01:53 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: sd.c Log Message: Check a status code and return proper errno in sdstrategy(). Suggested by gcc 4.8 -Wunused-but-set-variable warning to use the variable. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/sd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.10 src/sys/arch/luna68k/stand/boot/sd.c:1.11 --- src/sys/arch/luna68k/stand/boot/sd.c:1.10 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/sd.c Wed Apr 16 12:01:53 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.10 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: sd.c,v 1.11 2014/04/16 12:01:53 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -266,6 +266,9 @@ sdstrategy(void *devdata, int func, dadd #endif stat = scsi_immed_command(sc->sc_ctlr, sc->sc_tgt, sc->sc_lun, cdb, buf, size); + if (stat != 0) + return EIO; + if (rsize) *rsize = size;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Wed Apr 16 11:18:00 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: lance.c machdep.c sc.c Log Message: Appease gcc 4.8 -Wunused-but-set-variable warnings. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/lance.c \ src/sys/arch/luna68k/stand/boot/machdep.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/sc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/lance.c diff -u src/sys/arch/luna68k/stand/boot/lance.c:1.2 src/sys/arch/luna68k/stand/boot/lance.c:1.3 --- src/sys/arch/luna68k/stand/boot/lance.c:1.2 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/lance.c Wed Apr 16 11:18:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: lance.c,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: lance.c,v 1.3 2014/04/16 11:18:00 tsutsui Exp $ */ /* * Copyright (c) 2013 Izumi Tsutsui. All rights reserved. @@ -145,7 +145,7 @@ lance_get(void *cookie, void *data, size struct lereg *lereg = sc->sc_reg; struct lemem *lemem = sc->sc_mem; struct lermd_v *rmd; - uint16_t csr; + uint16_t csr __unused; int len = -1; lereg->ler_rap = LE_CSR0; Index: src/sys/arch/luna68k/stand/boot/machdep.c diff -u src/sys/arch/luna68k/stand/boot/machdep.c:1.2 src/sys/arch/luna68k/stand/boot/machdep.c:1.3 --- src/sys/arch/luna68k/stand/boot/machdep.c:1.2 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/machdep.c Wed Apr 16 11:18:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: machdep.c,v 1.3 2014/04/16 11:18:00 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -87,10 +87,10 @@ int *nofault = 0; int badaddr(volatile void *addr) { - int i; label_t faultbuf; #ifdef lint + int i; i = *addr; if (i) return 0; #endif nofault = (int *) &faultbuf; @@ -98,7 +98,7 @@ badaddr(volatile void *addr) nofault = NULL; return 1; } - i = *(volatile short *)addr; + (void)*(volatile short *)addr; nofault = NULL; return 0; } Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.10 src/sys/arch/luna68k/stand/boot/sc.c:1.11 --- src/sys/arch/luna68k/stand/boot/sc.c:1.10 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/sc.c Wed Apr 16 11:18:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.10 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.11 2014/04/16 11:18:00 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -403,7 +403,6 @@ scabort(struct scsi_softc *hs) { struct scsidevice *hd = hs->sc_spc; int len; - u_char junk; printf("sc%d: abort phase=0x%x, ssts=0x%x, ints=0x%x\n", hs->sc_ctlr, hd->scsi_psns, hd->scsi_ssts, @@ -438,7 +437,7 @@ scabort(struct scsi_softc *hs) hd->scsi_scmd = SCMD_SET_ACK; while (hd->scsi_psns & PSNS_REQ) DELAY(1); - junk = hd->scsi_temp; + (void)hd->scsi_temp; } else { /* one of the output phases - send an abort msg */ hd->scsi_temp = MSG_ABORT;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: martin Date: Mon Mar 24 10:46:58 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: disklabel.c locore.S preset.h Log Message: PR port-luna68k/48677: fix some typos. >From shinnashi takeshi. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/disklabel.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/locore.S cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/preset.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/disklabel.c diff -u src/sys/arch/luna68k/stand/boot/disklabel.c:1.4 src/sys/arch/luna68k/stand/boot/disklabel.c:1.5 --- src/sys/arch/luna68k/stand/boot/disklabel.c:1.4 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/disklabel.c Mon Mar 24 10:46:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: disklabel.c,v 1.5 2014/03/24 10:46:58 martin Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -129,12 +129,12 @@ disklabel(int argc, char *argv[]) printf("\thelp:\t\tthis command\n"); printf("\tread:\t\tread disklabel from scsi_device\n"); printf("\twrite:\t\twrite disklabel to scsi_device\n"); - printf("\tomron:\t\tshow OMRON disklabel infomation\n"); - printf("\tbsd:\t\tshow BSD disklabel infomation\n"); - printf("\tcopy:\t\tcopy disklabel infomation from OMRON" + printf("\tomron:\t\tshow OMRON disklabel information\n"); + printf("\tbsd:\t\tshow BSD disklabel information\n"); + printf("\tcopy:\t\tcopy disklabel information from OMRON" " to BSD\n"); printf("\tchecksum:\tdoing checksum\n"); - printf("\tset:\t\tchange BSD disklabel infomation\n"); + printf("\tset:\t\tchange BSD disklabel information\n"); printf("\n\n"); } else if (!strcmp(argv[1], "read")) { if (scsi_read( 0, lbl_buff, LABEL_SIZE)) { Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.10 src/sys/arch/luna68k/stand/boot/locore.S:1.11 --- src/sys/arch/luna68k/stand/boot/locore.S:1.10 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/locore.S Mon Mar 24 10:46:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.10 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: locore.S,v 1.11 2014/03/24 10:46:58 martin Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -762,7 +762,7 @@ ENTRY(spl7) .data /* - * Memory Infomation Field for secondary booter memory allocator + * Memory Information Field for secondary booter memory allocator */ GLOBAL(prgcore) Index: src/sys/arch/luna68k/stand/boot/preset.h diff -u src/sys/arch/luna68k/stand/boot/preset.h:1.2 src/sys/arch/luna68k/stand/boot/preset.h:1.3 --- src/sys/arch/luna68k/stand/boot/preset.h:1.2 Sat Jan 11 15:51:02 2014 +++ src/sys/arch/luna68k/stand/boot/preset.h Mon Mar 24 10:46:58 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: preset.h,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */ +/* $NetBSD: preset.h,v 1.3 2014/03/24 10:46:58 martin Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -71,7 +71,7 @@ */ /* - * preset.h -- preset infomation + * preset.h -- preset information * by A.Fujita, Dec-12-1992 */
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 11 17:00:37 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: samachdep.h Log Message: Remove unused declarations. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.16 src/sys/arch/luna68k/stand/boot/samachdep.h:1.17 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.16 Sat Jan 11 08:08:23 2014 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Sat Jan 11 17:00:37 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.16 2014/01/11 08:08:23 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.17 2014/01/11 17:00:37 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -36,8 +36,6 @@ #include #define NSCSI 2 -#define NSD 8 -#define DK_NDRIVE 8 #define MHZ_8 1 #define MHZ_16 2 @@ -52,7 +50,6 @@ typedef struct label_t { } label_t; /* autoconf.c */ -void configure(void); void find_devs(void); extern const int dev2adpt[]; @@ -75,9 +72,6 @@ void bmdclear(void); int boot(int, char **); int bootnetbsd(char *, int); -/* clock.c */ -/* not yet */ - /* cons.c */ void cninit(void); int cngetc(void); @@ -90,9 +84,6 @@ int make_device(const char *, int *, int extern u_char lbl_buff[]; int disklabel(int, char **); -/* exec.c */ -void exec_hp300(char *, u_long, int); - /* font.c */ extern const uint16_t bmdfont[][20]; @@ -127,7 +118,6 @@ bool lance_end(void *); int lance_intr(void); /* locore.S */ -extern u_int bootdev; extern int dipsw1, dipsw2; extern int cputype; extern volatile uint32_t tick;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 11 15:51:02 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: bmc.c bmd.c cons.c disklabel.c getline.c if_le.c init_main.c kbd.c kbdreg.h lance.c locore.S machdep.c omron_disklabel.h parse.c preset.h rcvbuf.h romcons.c sc.c screen.c scsi.c sd.c sioreg.h ufs_disksubr.c Log Message: Misc KNF and cosmetics. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/bmc.c \ src/sys/arch/luna68k/stand/boot/scsi.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/bmd.c \ src/sys/arch/luna68k/stand/boot/disklabel.c \ src/sys/arch/luna68k/stand/boot/getline.c \ src/sys/arch/luna68k/stand/boot/omron_disklabel.h \ src/sys/arch/luna68k/stand/boot/ufs_disksubr.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/cons.c \ src/sys/arch/luna68k/stand/boot/kbd.c \ src/sys/arch/luna68k/stand/boot/kbdreg.h \ src/sys/arch/luna68k/stand/boot/lance.c \ src/sys/arch/luna68k/stand/boot/machdep.c \ src/sys/arch/luna68k/stand/boot/preset.h \ src/sys/arch/luna68k/stand/boot/rcvbuf.h \ src/sys/arch/luna68k/stand/boot/romcons.c \ src/sys/arch/luna68k/stand/boot/screen.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/if_le.c \ src/sys/arch/luna68k/stand/boot/parse.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/locore.S \ src/sys/arch/luna68k/stand/boot/sc.c src/sys/arch/luna68k/stand/boot/sd.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/sioreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmc.c diff -u src/sys/arch/luna68k/stand/boot/bmc.c:1.4 src/sys/arch/luna68k/stand/boot/bmc.c:1.5 --- src/sys/arch/luna68k/stand/boot/bmc.c:1.4 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/bmc.c Sat Jan 11 15:51:02 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bmc.c,v 1.4 2013/01/21 11:58:12 tsutsui Exp $ */ +/* $NetBSD: bmc.c,v 1.5 2014/01/11 15:51:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -88,6 +88,7 @@ void bmccnprobe(struct consdev *cp) { + if ((dipsw1 & PS_BMC_CONS) == 0) { cp->cn_pri = CN_DEAD; return; @@ -106,6 +107,7 @@ bmccnprobe(struct consdev *cp) void bmccninit(struct consdev *cp) { + sioinit(); bmdinit(); } @@ -121,14 +123,16 @@ bmccngetc(dev_t dev) POP_RBUF(unit, c); - return(c); -/* - return(siocngetc(dev)); - */ +#if 1 + return c ; +#else + return siocngetc(dev); +#endif } void bmccnputc(dev_t dev, int c) { + bmdputc(c); } Index: src/sys/arch/luna68k/stand/boot/scsi.c diff -u src/sys/arch/luna68k/stand/boot/scsi.c:1.4 src/sys/arch/luna68k/stand/boot/scsi.c:1.5 --- src/sys/arch/luna68k/stand/boot/scsi.c:1.4 Fri Jan 3 07:17:19 2014 +++ src/sys/arch/luna68k/stand/boot/scsi.c Sat Jan 11 15:51:02 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi.c,v 1.4 2014/01/03 07:17:19 tsutsui Exp $ */ +/* $NetBSD: scsi.c,v 1.5 2014/01/11 15:51:02 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -109,7 +109,7 @@ scsi(int argc, char *argv[]) if (argc < 2) { printf("This command is required subcommand !!\n"); - return(ST_ERROR); + return ST_ERROR; } if (!strcmp(argv[1], "device")) { @@ -131,22 +131,22 @@ scsi(int argc, char *argv[]) scsi_request_sense( 0, scsi_device, 0, sensbuff, SENSBUFF); } else if (!strcmp(argv[1], "inquiry")) { if (scsi_immed_command( 0, scsi_device, 0, &inquiry, - (u_char *) &inquirybuf, sizeof(inquirybuf)) == 0) { + (u_char *)&inquirybuf, sizeof(inquirybuf)) == 0) { printf("Type:\t0x%x\n", inquirybuf.type); printf("Qualifier:\t0x%x\n", inquirybuf.qual); printf("Version:\t0x%x\n", inquirybuf.version); printf("RDF:\t0x%x\n", inquirybuf.rsvd); - + printf("Vender ID:\t"); for (i = 0; i < 8; i++) printf("%c", inquirybuf.vendor_id[i]); printf("\n"); - + printf("Product ID:\t"); for (i = 0; i < 16; i++) printf("%c", inquirybuf.product_id[i]); printf("\n"); - + printf("Revision:\t"); for (i = 0; i < 4; i++) printf("%c", inquirybuf.rev[i]); @@ -154,7 +154,7 @@ scsi(int argc, char *argv[]) } } else if (!strcmp(argv[1], "read_capacity")) { if (scsi_immed_command( 0, scsi_device, 0, &capacity, - (u_char *) &capacitybuf, sizeof(capacitybuf)) == 0) { + (u_char *)&capacitybuf, sizeof(capacitybuf)) == 0) { printf("Logical Block Address:\t%ld (0x%lx)\n", capacitybuf[0], capacitybuf[0]); printf("Block Length:\t\t%ld (0x%lx)\n", @@ -172,11 +172,12 @@ scsi(int argc, char *argv[]) } else if (!strcmp(argv[1], "format_unit")) { i = 0; while (i == 0) { - printf("Do you really want to format SCSI %d device ? [y/n]: ", - scsi_device); + printf("
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 11 14:35:15 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: boot.c init_main.c Log Message: ctually remove all references to obsolete stinger.h. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/boot.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/init_main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/boot.c diff -u src/sys/arch/luna68k/stand/boot/boot.c:1.6 src/sys/arch/luna68k/stand/boot/boot.c:1.7 --- src/sys/arch/luna68k/stand/boot/boot.c:1.6 Sat Jan 11 08:08:23 2014 +++ src/sys/arch/luna68k/stand/boot/boot.c Sat Jan 11 14:35:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.6 2014/01/11 08:08:23 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.7 2014/01/11 14:35:15 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -80,7 +80,6 @@ #include #include #include -#include #include #include Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.11 src/sys/arch/luna68k/stand/boot/init_main.c:1.12 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.11 Sat Jan 11 14:09:13 2014 +++ src/sys/arch/luna68k/stand/boot/init_main.c Sat Jan 11 14:35:15 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.11 2014/01/11 14:09:13 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.12 2014/01/11 14:35:15 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -74,7 +74,6 @@ #include #include #include -#include #include #include #include
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 11 14:09:13 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: init_main.c Removed Files: src/sys/arch/luna68k/stand/boot: stinger.h Log Message: Remove unused KernInter stuff. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.1 -r0 src/sys/arch/luna68k/stand/boot/stinger.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.10 src/sys/arch/luna68k/stand/boot/init_main.c:1.11 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.10 Sat Jan 11 08:08:23 2014 +++ src/sys/arch/luna68k/stand/boot/init_main.c Sat Jan 11 14:09:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.10 2014/01/11 08:08:23 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.11 2014/01/11 14:09:13 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -94,11 +94,6 @@ char default_file[64]; int nplane; -/* KIFF */ - -struct KernInter KIFF; -struct KernInter *kiff = &KIFF; - /* for command parser */ #define BUFFSIZE 100 @@ -207,11 +202,7 @@ main(void) printf(">> (based on Stinger ver 0.0 [%s])\n", VERS_LOCAL); printf("\n"); - kiff->maxaddr = (void *) (ROM_memsize -1); - kiff->dipsw = ~((dipsw2 << 8) | dipsw1) & 0x; - kiff->plane = nplane; - - i = (int) kiff->maxaddr + 1; + i = ROM_memsize; printf("Machine model = %s\n", machstr); printf("Physical Memory = 0x%x ", i); i >>= 20;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 11 08:20:51 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: version Log Message: Bump version to denote support to pass boothowto and bootdev to kernel. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.9 src/sys/arch/luna68k/stand/boot/version:1.10 --- src/sys/arch/luna68k/stand/boot/version:1.9 Fri Jan 10 11:12:03 2014 +++ src/sys/arch/luna68k/stand/boot/version Sat Jan 11 08:20:51 2014 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.9 2014/01/10 11:12:03 tsutsui Exp $ +$NetBSD: version,v 1.10 2014/01/11 08:20:51 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -14,3 +14,4 @@ is taken as the current. 1.7: Check boot device on PROM and set proper default boot device and unit. 1.8: Probe SCSI devices at any IDs and change boot command to use SCSI controller number and target ID to specify the boot disk. +1.9: Parse boot flags and pass boothowto and bootdev info to kernel.
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 11 08:08:23 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: boot.c conf.c devopen.c init_main.c parse.c samachdep.h Log Message: Add support to pass boothowto and bootdev info from bootloader to kernel. Bootloader side changes: - make boot command parse boothowto flags (-ads etc.) - pass boothowto and bootdev info to the kernel via %d7 and %d6 as the old 4.4BSD/luna68k kernel expected - remove unused and now unnecessary "howto" (how_to_boot) command - export and tweak make_device() in devopen.c to prepare bootdev info - remove unused and commented out get_boot_device() To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/boot.c \ src/sys/arch/luna68k/stand/boot/devopen.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/conf.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/parse.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/boot.c diff -u src/sys/arch/luna68k/stand/boot/boot.c:1.5 src/sys/arch/luna68k/stand/boot/boot.c:1.6 --- src/sys/arch/luna68k/stand/boot/boot.c:1.5 Fri Jan 10 11:12:03 2014 +++ src/sys/arch/luna68k/stand/boot/boot.c Sat Jan 11 08:08:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.5 2014/01/10 11:12:03 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.6 2014/01/11 08:08:23 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -76,6 +76,7 @@ */ #include +#include #include #include #include @@ -83,142 +84,68 @@ #include #include -int howto; - -#if 0 -static int get_boot_device(const char *, int *, int *, int *); -#endif - -struct exec header; - -char *how_to_info[] = { - "RB_ASKNAME ask for file name to reboot from", - "RB_SINGLE reboot to single user only", - "RB_NOSYNC dont sync before reboot", - "RB_HALT don't reboot, just halt", - "RB_INITNAME name given for /etc/init (unused)", - "RB_DFLTROOT use compiled-in rootdev", - "RB_KDB give control to kernel debugger", - "RB_RDONLY mount root fs read-only" -}; - -int -how_to_boot(int argc, char *argv[]) -{ - int i, h = howto; - - if (argc < 2) { - printf("howto: 0x%s\n\n", hexstr(howto, 2)); - - if (h == 0) { - printf("\t%s\n", "RB_AUTOBOOT flags for system auto-booting itself"); - } else { - for (i = 0; i < 8; i++, h >>= 1) { -if (h & 0x01) { - printf("\t%s\n", how_to_info[i]); -} - } - } - - printf("\n"); - } - return ST_NORMAL; -} - -#if 0 -int -get_boot_device(const char *s, int *devp, int *unitp, int *partp) -{ - const char *p = s; - int unit, part; - - uint = 0; - part = 0; - - while (*p != '(') { - if (*p == '\0') - goto error; - p++; - } - - p++; - for (; *p != ',' && *p != ')') { - if (*p == '\0') - goto error; - if (*p >= '0' && *p <= '9') - unit = (unit * 10) + (*p - '0'); - } - - if (*p == ',') - p++; - for (; *p != ')'; p++) { - if (*p == '\0') - goto error; - if (*p >= '0' && *p <= '9') - part = (part * 10) + (*p - '0'); - } - - *devp = 0; /* XXX not yet */ - *unitp = unit; - *partp = part; - - return 0; - -error: - return -1; -} -#endif - int boot(int argc, char *argv[]) { - char *line; - - if (argc < 2) + char *line, *opts; + int i, howto; + char c; + + line = NULL; + howto = 0; + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + opts = argv[i]; + while ((c = *++opts) && c != '\0') +BOOT_FLAG(c, howto); + } else if (line == NULL) + line = argv[i]; + } + if (line == NULL) line = default_file; - else - line = argv[1]; - printf("Booting %s\n", line); + printf("Booting %s", line); + if (howto != 0) + printf(" (howto 0x%x)", howto); + printf("\n"); - return bootnetbsd(line); + return bootnetbsd(line, howto); } int -bootnetbsd(char *line) +bootnetbsd(char *line, int howto) { int io; -#if 0 - int dev, unit, part; -#endif u_long marks[MARK_MAX]; - void (*entry)(void); - -#if 0 - if (get_boot_device(line, &dev, &unit, &part) != 0) { - printf("Bad file name %s\n", line); - return ST_ERROR; - } -#endif /* Note marks[MARK_START] is passed as an load address offset */ memset(marks, 0, sizeof(marks)); io = loadfile(line, marks, LOAD_KERNEL); if (io >= 0) { + int dev = 0, unit = 0, part = 0; + uint adpt, ctlr, id; + uint32_t bootdev; + + make_device(line, &dev, &unit, &part, NULL); + adpt = dev2adpt[dev]; + ctlr = CTLR(unit); + id = TARGET(unit); + bootdev = MAKEBOOTDEV(0, adpt, ctlr, id, part); #ifdef DEBUG printf("entry = 0x%lx\n", marks[MARK_ENTRY]); printf("ssym = 0x%lx\n", marks[MARK_SYM]); printf("esym = 0x%lx\n", marks[MARK_END]); #endif - - /* - * XXX TODO: fill bootinfo about symbols, boot device etc. - */ - - entry = (void *)marks[MARK_ENTRY]; - - (*entry)(); +
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 10 11:12:03 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile autoconf.c boot.c devopen.c if_le.c init_main.c samachdep.h sc.c scsivar.h sd.c version Removed Files: src/sys/arch/luna68k/stand/boot: device.h ioconf.c Log Message: Reorgenize boot device configuration. The idea is taken from OpenBSD/luna88k. - remove kernel-like autoconfiguration to probe bootable devices - initialize SCSI and Ethernet controllers statically instead - reorganize device softc structures per autoconf removal - probe and print all SCSI disks (but don't assign unit numbers) - make sdopen() to recheck the device and allocate softc dynamically - use controller number and SCSI target ID (ctlr * 10 + id) to specify the boot disk on the "boot" command arg - bump version to denote changes Now bootloader works as the following: --- >> NetBSD/luna68k boot, Revision 1.8 (Wed Jan 8 22:13:12 JST 2014) >> (based on Stinger ver 0.0 [Phase-31]) Machine model = LUNA-II Physical Memory = 0x400 (64 MB) sc0 at 0xe100: async, parity, ID 7 ID 3: TEAC FC-1 HGF 10 rev , 512 bytes/sect x 2879 sectors ID 6: IBM DPES-31080 rev S31Q, 512 bytes/sect x 2118143 sectors sc1 at 0xe140: async, parity, ID 7 ID 6: MELCO DSC-G rev 1.00, 512 bytes/sect x 62533295 sectors le0: Am7990 LANCE Ethernet, mem at 0x7101 le0: Ethernet address = 00:00:0a:03:42:77 Press return to boot now, any other key for boot menu booting sd(16,0)netbsd - starting in 0 seconds. auto-boot sd(16,0)netbsd 1911696+96040 [280480+159179]=0x255a30 : To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/Makefile \ src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/boot.c \ src/sys/arch/luna68k/stand/boot/devopen.c \ src/sys/arch/luna68k/stand/boot/if_le.c cvs rdiff -u -r1.7 -r0 src/sys/arch/luna68k/stand/boot/device.h cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/sc.c src/sys/arch/luna68k/stand/boot/sd.c \ src/sys/arch/luna68k/stand/boot/version cvs rdiff -u -r1.5 -r0 src/sys/arch/luna68k/stand/boot/ioconf.c cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/scsivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.9 src/sys/arch/luna68k/stand/boot/Makefile:1.10 --- src/sys/arch/luna68k/stand/boot/Makefile:1.9 Tue Jan 22 15:48:40 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Fri Jan 10 11:12:03 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2013/01/22 15:48:40 tsutsui Exp $ +# $NetBSD: Makefile,v 1.10 2014/01/10 11:12:03 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -32,7 +32,7 @@ LDSCRIPT= ${.CURDIR}/boot.ldscript LINKFORMAT= -static -N -Ttext ${TEXTADDR} -T ${LDSCRIPT} SRCS= locore.S -SRCS+= init_main.c autoconf.c ioconf.c +SRCS+= init_main.c autoconf.c SRCS+= trap.c SRCS+= devopen.c SRCS+= conf.c Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.9 src/sys/arch/luna68k/stand/boot/autoconf.c:1.10 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.9 Fri Jan 3 03:25:25 2014 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Fri Jan 10 11:12:03 2014 @@ -1,10 +1,7 @@ -/* $NetBSD: autoconf.c,v 1.9 2014/01/03 03:25:25 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.10 2014/01/10 11:12:03 tsutsui Exp $ */ -/* - * Copyright (c) 1992 OMRON Corporation. - * - * This code is derived from software contributed to Berkeley by - * OMRON Corporation. +/*- + * Copyright (c) 2013 Izumi Tsutsui. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -14,437 +11,32 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 5 06:56:22 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: init_main.c version Log Message: Detect boot device on PROM load command and set proper default boot device. Also remove now unnecessary the old netboot check. Note all addresses of boot device info set by monitor are checked by memory dump on several LUNA ROM versions, and these addres might be different on earlier monitor ROM versions. Bump version to denote the visible change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.7 src/sys/arch/luna68k/stand/boot/init_main.c:1.8 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.7 Fri Jan 3 06:37:13 2014 +++ src/sys/arch/luna68k/stand/boot/init_main.c Sun Jan 5 06:56:22 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.7 2014/01/03 06:37:13 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.8 2014/01/05 06:56:22 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -114,14 +114,71 @@ int boot_timeout = BOOT_TIMEOUT; static const char prompt[] = "boot> "; +/* + * PROM monitor's boot device info + */ + +/* LUNA-I monitor's bootinfo structure */ +/* This bootinfo data address is investigated on ROM Ver4.22 and Ver4.25 */ +#define LUNA1_BOOTINFOADDR 0x08c0 +struct luna1_bootinfo { + uint8_t bi_xxx1[3]; /* 0x08c0: ??? */ + uint8_t bi_device; /* 0x08c3: boot device */ +#define LUNA1_BTDEV_DK 0 /* Hard-Disk */ +#define LUNA1_BTDEV_FB 1 /* Floppy-Disk */ +#define LUNA1_BTDEV_SD 2 /* Streamer-Tape */ +#define LUNA1_BTDEV_P0 3 /* RS232c */ +#define LUNA1_BTDEV_ET 4 /* Ether-net */ +#define LUNA1_NBTDEV 5 + + struct { + uint8_t bd_xxx1; /* 0: ??? */ + uint8_t bd_boot; /* 1: 1 == booted */ + char bd_name[2]; /* 2: device name (dk, fb, sd ... ) */ + uint8_t bd_unit; /* 4: unit number (not ID) */ + uint8_t bd_xxx2; /* 5: ??? */ + uint8_t bd_xxx3; /* 6: ??? */ + uint8_t bd_part; /* 7: dk partition / st record # */ + uint8_t bd_xxx4[4]; /* 8: ??? */ + uint8_t bd_xxx5[4]; /* 12: ??? */ + } bi_devinfo[LUNA1_NBTDEV]; +} __packed; + +/* LUNA-II monitor's bootinfo structure */ +/* This bootinfo data address is investigated on ROM Version 1.11 */ +#define LUNA2_BOOTINFOADDR 0x1d80 +struct luna2_bootinfo { + uint8_t bi_xxx1[13]; /* 0x1d80: ??? */ + uint8_t bi_device; /* 0x1d8d: boot device */ +#define LUNA2_BTDEV_DK 0 /* Hard-Disk */ +#define LUNA2_BTDEV_FT 1 /* Floppy-Disk */ +#define LUNA2_BTDEV_SD 2 /* Streamer-Tape */ +#define LUNA2_BTDEV_P0 3 /* RS232c */ +#define LUNA2_NBTDEV 4 + + struct { + uint8_t bd_xxx1; /* 0: ??? */ + uint8_t bd_boot; /* 1: 1 == booted */ + char bd_name[4]; /* 2: device name (dk, ft, sd ... ) */ + uint8_t bd_xxx2; /* 6: ??? */ + uint8_t bd_ctlr; /* 7: SCSI controller number */ + uint8_t bd_unit; /* 8: SCSI ID number */ + uint8_t bd_xxx3; /* 9: device number index? */ + uint8_t bd_xxx4; /* 10: ??? */ + uint8_t bd_part; /* 11: dk partition / st record # */ + uint8_t bd_xxx5[4]; /* 12: ??? */ + uint8_t bd_xxx6[4]; /* 16: ??? */ + } bi_devinfo[LUNA2_NBTDEV]; +} __packed; + +/* #define BTINFO_DEBUG */ + void main(void) { int i, status = 0; const char *machstr; - const char *cp; - char bootarg[64]; - bool netboot = false; + const char *bootdev; int unit, part; /* @@ -132,25 +189,11 @@ main(void) machstr = "LUNA-I"; cpuspeed = MHZ_25; hz = 60; - memcpy(bootarg, (char *)*RVPtr->vec53, sizeof(bootarg)); - - /* check netboot */ - for (i = 0, cp = bootarg; i < sizeof(bootarg); i++, cp++) { - if (*cp == '\0') -break; - if (*cp == 'E' && memcmp("ENADDR=", cp, 7) == 0) { -netboot = true; -break; - } - } } else { machtype = LUNA_II; machstr = "LUNA-II"; cpuspeed = MHZ_25 * 2; /* XXX */ hz = 100; - memcpy(bootarg, (char *)*RVPtr->vec02, sizeof(bootarg)); - - /* LUNA-II's boot monitor doesn't support netboot */ } nplane = get_plane_numbers(); @@ -185,10 +228,78 @@ main(void) configure(); printf("\n"); - unit = 0; /* XXX should parse monitor's Boot-file constant */ + /* use sd(0,0) for the default boot device */ + bootdev = "sd"; + unit = 0; part = 0; + + if (machtype == LUNA_I) { + const struct luna1_bootinfo *bi1 = (void *)LUNA1_BOOTINFOADDR; + int dev = bi1->bi_device; + + switch (dev) { + case LUNA1_BTDEV_DK: + /* XXX: should check hp_dinfo in ioconf.c */ + /* note: bd_unit is not SCSI ID */ + unit = bi1->bi_devinfo[dev].bd_unit; + break; + case LUNA1_BTDEV_ET: + bootdev = "le"; + unit = 0; + break; + default: + /* not supported */ + break; + } +#ifdef BTINFO_DEBUG + printf("bi1->bi_device = 0x%02x\n", bi1->bi_device);
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 3 07:17:19 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: samachdep.h sc.c scsi.c scsireg.h sd.c ufs_disksubr.c Log Message: Pull more cleanups from OpenBSD/luna88k: - remove unused declarations - rename struct scsi_fmt_cdb to scsi_generic_cdb To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/sc.c \ src/sys/arch/luna68k/stand/boot/sd.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/scsi.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/scsireg.h \ src/sys/arch/luna68k/stand/boot/ufs_disksubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.13 src/sys/arch/luna68k/stand/boot/samachdep.h:1.14 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.13 Fri Jan 3 06:37:13 2014 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Fri Jan 3 07:17:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.13 2014/01/03 06:37:13 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.14 2014/01/03 07:17:19 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -84,10 +84,6 @@ void cninit(void); int cngetc(void); void cnputc(int); -/* devopen.c */ -extern u_int opendev; -int atoi(char *); - /* disklabel.c */ extern u_char lbl_buff[]; int disklabel(int, char **); @@ -171,8 +167,8 @@ int romcngetc(dev_t); void romcnputc(dev_t, int); /* sc.c */ -struct scsi_fmt_cdb; -int scsi_immed_command(int, int, int, struct scsi_fmt_cdb *, u_char *, +struct scsi_generic_cdb; +int scsi_immed_command(int, int, int, struct scsi_generic_cdb *, u_char *, unsigned int); int scsi_request_sense(int, int, int, u_char *, unsigned int); int scsi_test_unit_rdy(int, int, int); Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.7 src/sys/arch/luna68k/stand/boot/sc.c:1.8 --- src/sys/arch/luna68k/stand/boot/sc.c:1.7 Thu Jan 2 19:50:03 2014 +++ src/sys/arch/luna68k/stand/boot/sc.c Fri Jan 3 07:17:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.7 2014/01/02 19:50:03 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.8 2014/01/03 07:17:19 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -453,7 +453,7 @@ scsi_request_sense(int ctlr, int slave, } int -scsi_immed_command(int ctlr, int slave, int unit, struct scsi_fmt_cdb *cdb, +scsi_immed_command(int ctlr, int slave, int unit, struct scsi_generic_cdb *cdb, u_char *buf, unsigned int len) { int status; Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.7 src/sys/arch/luna68k/stand/boot/sd.c:1.8 --- src/sys/arch/luna68k/stand/boot/sd.c:1.7 Fri Jan 3 03:25:25 2014 +++ src/sys/arch/luna68k/stand/boot/sd.c Fri Jan 3 07:17:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.7 2014/01/03 03:25:25 tsutsui Exp $ */ +/* $NetBSD: sd.c,v 1.8 2014/01/03 07:17:19 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -119,13 +119,13 @@ struct sd_devdata sd_devdata[NSD]; #define sdpart(x) (minor(x) & 0x7) static struct scsi_inquiry inqbuf; -static struct scsi_fmt_cdb inq = { +static struct scsi_generic_cdb inq = { 6, { CMD_INQUIRY, 0, 0, 0, sizeof(inqbuf), 0 } }; static u_long capbuf[2]; -struct scsi_fmt_cdb cap = { +struct scsi_generic_cdb cap = { 10, { CMD_READ_CAPACITY, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -292,12 +292,12 @@ sdclose(struct open_file *f) return 0; } -static struct scsi_fmt_cdb cdb_read = { +static struct scsi_generic_cdb cdb_read = { 10, { CMD_READ_EXT, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -static struct scsi_fmt_cdb cdb_write = { +static struct scsi_generic_cdb cdb_write = { 6, { CMD_WRITE_EXT, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; @@ -312,7 +312,7 @@ sdstrategy(void *devdata, int func, dadd int unit = sd->unit; int part = sd->part; struct sd_softc *sc = &sd_softc[unit]; - struct scsi_fmt_cdb *cdb; + struct scsi_generic_cdb *cdb; daddr_t blk; u_int nblk = size >> sc->sc_bshift; int stat, ctlr, slave; Index: src/sys/arch/luna68k/stand/boot/scsi.c diff -u src/sys/arch/luna68k/stand/boot/scsi.c:1.3 src/sys/arch/luna68k/stand/boot/scsi.c:1.4 --- src/sys/arch/luna68k/stand/boot/scsi.c:1.3 Thu Jan 2 19:50:03 2014 +++ src/sys/arch/luna68k/stand/boot/scsi.c Fri Jan 3 07:17:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi.c,v 1.3 2014/01/02 19:50:03 tsutsui Exp $ */ +/* $NetBSD: scsi.c,v 1.4 2014/01/03 07:17:19 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -89,13 +89,13 @@ int scsi_device = 6; u_char sensbuff[SENSBUFF];/* 8以上は無意味である。 */ static struct scsi_inquiry inquirybuf; -static struct scsi_fmt_cdb inquiry = { +static struct scsi_generic_cdb inquiry = { 6, { CMD_INQUIRY, 0, 0, 0, sizeof(inquirybuf), 0 }
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 3 06:37:13 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: getline.c init_main.c samachdep.h Log Message: Pull more fixes from OpenBSD/luna88k: - Bring getline() - a.k.a libsa gets() with a prompt prefix - in par with libsa gets(), featurewise; this means support for ^u to clear the input. - constify To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/getline.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/init_main.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/getline.c diff -u src/sys/arch/luna68k/stand/boot/getline.c:1.2 src/sys/arch/luna68k/stand/boot/getline.c:1.3 --- src/sys/arch/luna68k/stand/boot/getline.c:1.2 Sun Jan 20 07:32:45 2013 +++ src/sys/arch/luna68k/stand/boot/getline.c Fri Jan 3 06:37:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: getline.c,v 1.2 2013/01/20 07:32:45 tsutsui Exp $ */ +/* $NetBSD: getline.c,v 1.3 2014/01/03 06:37:13 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -79,40 +79,54 @@ #include int -getline(char *prompt, char *buff) +getline(const char *prompt, char *buff) { int c; - char *p = buff; + char *p, *lp = buff; printf("%s", prompt); - for(;;) { - c = getchar() & 0x7F; + for (;;) { + c = getchar() & 0x7f; switch (c) { - case 0x0a: - case 0x0d: + case '\n': + case '\r': + *lp = '\0'; putchar('\n'); - *p = '\0'; goto outloop; - case 0x08: + case '\b': case 0x7f: - if (p > buff) { -putchar(0x08); + if (lp > buff) { +lp--; +putchar('\b'); putchar(' '); -putchar(0x08); -p--; +putchar('\b'); } break; + case 'r' & 0x1f: + putchar('\n'); + printf("%s", prompt); + for (p = buff; p < lp; ++p) +putchar(*p); + break; + + case 'u' & 0x1f: + case 'w' & 0x1f: + lp = buff; + printf("\n%s", prompt); + break; + default: - *p++ = c; + *lp++ = c; putchar(c); break; } } outloop: - return(strlen(buff)); + *lp = '\0'; + return lp - buff; } Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.6 src/sys/arch/luna68k/stand/boot/init_main.c:1.7 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.6 Tue Mar 5 15:34:53 2013 +++ src/sys/arch/luna68k/stand/boot/init_main.c Fri Jan 3 06:37:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.6 2013/03/05 15:34:53 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.7 2014/01/03 06:37:13 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -112,7 +112,7 @@ char *argv[MAXARGS]; #define BOOT_TIMEOUT 10 int boot_timeout = BOOT_TIMEOUT; -char prompt[16] = "boot> "; +static const char prompt[] = "boot> "; void main(void) Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.12 src/sys/arch/luna68k/stand/boot/samachdep.h:1.13 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.12 Fri Jan 3 06:15:10 2014 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Fri Jan 3 06:37:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.12 2014/01/03 06:15:10 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.13 2014/01/03 06:37:13 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -103,7 +103,7 @@ int fsdump(int, char **); int fsrestore(int, char **); /* getline.c */ -int getline(char *, char *); +int getline(const char *, char *); /* if_le.c */ int leinit(void *);
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 3 06:15:10 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: devopen.c samachdep.h version Log Message: Pull more fixes from OpenBSD/luna88k: - accept empty controller and partition numbers, as well as empty filenames, and use defaults (0, 0 and "netbsd") instead of complaining the boot path is invalid - move a macro where actually necessary Also bump version to denote the user visible change. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/devopen.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.3 src/sys/arch/luna68k/stand/boot/devopen.c:1.4 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.3 Wed Jan 16 15:46:20 2013 +++ src/sys/arch/luna68k/stand/boot/devopen.c Fri Jan 3 06:15:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.3 2013/01/16 15:46:20 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.4 2014/01/03 06:15:10 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -74,6 +74,8 @@ #include #include +#define MAXDEVNAME 16 + static int make_device(const char *, int *, int *, int *, char **); int @@ -123,21 +125,21 @@ make_device(const char *str, int *devp, { const char *cp; struct devsw *dp; - int major, unit, part; + int major, unit = 0, part = 0; int i; char devname[MAXDEVNAME + 1]; /* * parse path strings */ - /* find end of dev type name */ + /* find end of dev type name */ for (cp = str, i = 0; *cp != '\0' && *cp != '(' && i < MAXDEVNAME; i++) devname[i] = *cp++; if (*cp != '(') { return (-1); } devname[i] = '\0'; - /* compare dev type name */ + /* compare dev type name */ for (dp = devsw; dp->dv_name; dp++) if (!strcmp(devname, dp->dv_name)) break; @@ -146,40 +148,44 @@ make_device(const char *str, int *devp, return (-1); } major = dp - devsw; - /* get unit number */ - unit = *cp++ - '0'; - if (*cp >= '0' && *cp <= '9') - unit = unit * 10 + *cp++ - '0'; - if (unit < 0 || unit > 63) { + /* get mixed controller and unit number */ + for (; *cp != ',' && *cp != ')'; cp++) { + if (*cp == '\0') + return -1; + if (*cp >= '0' && *cp <= '9') + unit = unit * 10 + *cp - '0'; + } + if (unit < 0 || unit >= 20 || (unit % 10) > 7) { #ifdef DEBUG printf("%s: invalid unit number (%d)\n", __func__, unit); #endif return (-1); } - /* get partition offset */ - if (*cp++ != ',') { - return (-1); - } - part = *cp - '0'; - /* check out end of dev spec */ - for (;;) { - if (*cp == ')') - break; - if (*cp++) - continue; - return (-1); + /* get optional partition number */ + if (*cp == ',') + cp++; + + for (; /* *cp != ',' && */ *cp != ')'; cp++) { + if (*cp == '\0') + return -1; + if (*cp >= '0' && *cp <= '9') + part = part * 10 + *cp - '0'; } - if (part < 0 || part > MAXPARTITIONS) { + if (part < 0 || part >= MAXPARTITIONS) { #ifdef DEBUG printf("%s: invalid partition number (%d)\n", __func__, part); #endif return (-1); } - + /* check out end of dev spec */ *devp = major; *unitp = unit; *partp = part; - *fname = __UNCONST(cp + 1); + cp++; + if (*cp == '\0') + *fname = "netbsd"; + else + *fname = __UNCONST(cp); /* XXX */ #ifdef DEBUG printf("%s: major = %d, unit = %d, part = %d, fname = %s\n", __func__, major, unit, part, *fname); Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.11 src/sys/arch/luna68k/stand/boot/samachdep.h:1.12 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.11 Thu Jan 2 20:02:00 2014 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Fri Jan 3 06:15:10 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.11 2014/01/02 20:02:00 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.12 2014/01/03 06:15:10 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -45,8 +45,6 @@ #define MHZ_33 4 #define MHZ_50 6 -#define MAXDEVNAME 16 - struct consdev; struct frame; typedef struct label_t { Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.6 src/sys/arch/luna68k/stand/boot/version:1.7 --- src/sys/arch/luna68k/stand/boot/version:1.6 Tue Mar 5 15:34:53 2013 +++ src/sys/arch/luna68k/stand/boot/version Fri Jan 3 06:15:10 2014 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.6 2013/03/05 15:34:53 tsutsui Exp $ +$NetBSD: version,v 1.7 2014/01/03 06:15:10 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -10,3 +10,4 @@ is taken as the current. 1.3: Add UFS2 support. 1.4: Add support for "await
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 3 03:44:41 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: boot.c Log Message: Disable unnecessary boot device check. From OpenBSD/luna88k. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/boot.c diff -u src/sys/arch/luna68k/stand/boot/boot.c:1.3 src/sys/arch/luna68k/stand/boot/boot.c:1.4 --- src/sys/arch/luna68k/stand/boot/boot.c:1.3 Tue Mar 5 15:34:53 2013 +++ src/sys/arch/luna68k/stand/boot/boot.c Fri Jan 3 03:44:41 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.3 2013/03/05 15:34:53 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.4 2014/01/03 03:44:41 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -85,7 +85,9 @@ int howto; +#if 0 static int get_boot_device(const char *, int *, int *, int *); +#endif struct exec header; @@ -123,26 +125,33 @@ how_to_boot(int argc, char *argv[]) return ST_NORMAL; } +#if 0 int get_boot_device(const char *s, int *devp, int *unitp, int *partp) { const char *p = s; int unit, part; + uint = 0; + part = 0; + while (*p != '(') { if (*p == '\0') goto error; p++; } - while (*++p != ',') { + p++; + for (; *p != ',' && *p != ')') { if (*p == '\0') goto error; if (*p >= '0' && *p <= '9') unit = (unit * 10) + (*p - '0'); } - while (*++p != ')') { + if (*p == ',') + p++; + for (; *p != ')'; p++) { if (*p == '\0') goto error; if (*p >= '0' && *p <= '9') @@ -158,6 +167,7 @@ get_boot_device(const char *s, int *devp error: return -1; } +#endif int boot(int argc, char *argv[]) @@ -178,14 +188,18 @@ int bootnetbsd(char *line) { int io; +#if 0 int dev, unit, part; +#endif u_long marks[MARK_MAX]; void (*entry)(void); +#if 0 if (get_boot_device(line, &dev, &unit, &part) != 0) { printf("Bad file name %s\n", line); return ST_ERROR; } +#endif /* Note marks[MARK_START] is passed as an load address offset */ memset(marks, 0, sizeof(marks));
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 3 03:25:25 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c device.h if_le.c ioconf.c sd.c Log Message: Misc cleanup from OpenBSD/luna88k. - remove unused code - use proper prefix for structure members for readability To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/device.h \ src/sys/arch/luna68k/stand/boot/sd.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/if_le.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/ioconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.8 src/sys/arch/luna68k/stand/boot/autoconf.c:1.9 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.8 Fri Jan 3 02:03:12 2014 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Fri Jan 3 03:25:25 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.8 2014/01/03 02:03:12 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.9 2014/01/03 03:25:25 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -195,10 +195,7 @@ find_controller(struct hp_hw *hw) hc->hp_alive = 1; printf("%s%d", hc->hp_driver->d_name, hc->hp_unit); printf(" at %p,", hc->hp_addr); - printf(" ipl %d", hc->hp_ipl); - if (hc->hp_flags) - printf(" flags 0x%x", hc->hp_flags); - printf("\n"); + printf(" ipl %d\n", hc->hp_ipl); find_slaves(hc); } else hc->hp_addr = oaddr; @@ -218,13 +215,13 @@ find_device(struct hp_hw *hw) hw->hw_name, hw->hw_sc, (u_int)hw->hw_addr, hw->hw_type); #endif match_d = NULL; - for (hd = hp_dinit; hd->hp_driver; hd++) { - if (hd->hp_alive) + for (hd = hp_dinit; hd->hpd_driver; hd++) { + if (hd->hpd_alive) continue; /* Must not be a slave */ - if (hd->hp_cdriver) + if (hd->hpd_cdriver) continue; - addr = hd->hp_addr; + addr = hd->hpd_addr; /* * Exact match; all done. */ @@ -243,8 +240,8 @@ find_device(struct hp_hw *hw) if (acdebug) { if (match_d) printf("found %s%d\n", - match_d->hp_driver->d_name, - match_d->hp_unit); + match_d->hpd_driver->d_name, + match_d->hpd_unit); else printf("not found\n"); } @@ -260,19 +257,14 @@ find_device(struct hp_hw *hw) * Note, we can still fail if HW won't initialize. */ hd = match_d; - oaddr = hd->hp_addr; - hd->hp_addr = hw->hw_addr; - if ((*hd->hp_driver->d_init)(hd)) { - hd->hp_alive = 1; - printf("%s%d", hd->hp_driver->d_name, hd->hp_unit); - printf(" at %p", hd->hp_addr); - if (hd->hp_ipl) - printf(", ipl %d", hd->hp_ipl); - if (hd->hp_flags) - printf(", flags 0x%x", hd->hp_flags); - printf("\n"); + oaddr = hd->hpd_addr; + hd->hpd_addr = hw->hw_addr; + if ((*hd->hpd_driver->d_init)(hd)) { + hd->hpd_alive = 1; + printf("%s%d", hd->hpd_driver->d_name, hd->hpd_unit); + printf(" at %p\n", hd->hpd_addr); } else - hd->hp_addr = oaddr; + hd->hpd_addr = oaddr; return(1); } @@ -303,7 +295,7 @@ find_slaves(struct hp_ctlr *hc) for (s = 0; s < maxslaves; s++) { rescan = 1; match_s = NULL; - for (hd = hp_dinit; hd->hp_driver; hd++) { + for (hd = hp_dinit; hd->hpd_driver; hd++) { /* * Rule out the easy ones: * 1. slave already assigned or not a slave @@ -311,13 +303,13 @@ find_slaves(struct hp_ctlr *hc) * 3. controller specified but not this one * 4. slave specified but not this one */ - if (hd->hp_alive || hd->hp_cdriver == NULL) + if (hd->hpd_alive || hd->hpd_cdriver == NULL) continue; - if (!dr_type(hc->hp_driver, hd->hp_cdriver->d_name)) + if (!dr_type(hc->hp_driver, hd->hpd_cdriver->d_name)) continue; - if (hd->hp_ctlr >= 0 && hd->hp_ctlr != hc->hp_unit) + if (hd->hpd_ctlr >= 0 && hd->hpd_ctlr != hc->hp_unit) continue; - if (hd->hp_slave >= 0 && hd->hp_slave != s) + if (hd->hpd_slave >= 0 && hd->hpd_slave != s) continue; /* * Case 0: first possible match. @@ -336,7 +328,7 @@ find_slaves(struct hp_ctlr *hc) * "reserve" locations for dynamic addition of * disk/tape drives by fully qualifing the location. */ - if (hd->hp_slave == s && hd->hp_ctlr == hc->hp_unit) { + if (hd->hpd_slave == s && hd->hpd_ctlr == hc->hp_unit) { match_s = hd; rescan = 0; break; @@ -345,8 +337,8 @@ find_slaves(struct hp_ctlr *hc) * Case 2: right controller, wildcarded slave. * Remember first and keep looking for an exact match. */ - if (hd->hp_ctlr == hc->hp_unit && - match_s->hp_ctlr < 0) { + if (hd->hpd_ctlr == hc->hp_unit && + match_s->hpd_ctlr < 0) { match_s = hd; new_s = s; continue; @@ -355,8 +347,8 @@ find_slaves(struct hp_ctlr *hc) * Case 3: right slave, wildcarded controller. * Remember and keep looking fo
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Fri Jan 3 02:03:12 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c device.h ioconf.c sd.c sio.c Log Message: Remove unused code (from OpenBSD/luna88k). Some KNF. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/device.h \ src/sys/arch/luna68k/stand/boot/sd.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/ioconf.c \ src/sys/arch/luna68k/stand/boot/sio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.7 src/sys/arch/luna68k/stand/boot/autoconf.c:1.8 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.7 Tue Jan 22 15:48:40 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Fri Jan 3 02:03:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.7 2013/01/22 15:48:40 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.8 2014/01/03 02:03:12 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -470,9 +470,6 @@ same_hw_device(struct hp_hw *hw, struct case SCSI: found = dr_type(hd->hp_driver, "scsi"); break; - case VME: - case MISC: - break; } return(found); } Index: src/sys/arch/luna68k/stand/boot/device.h diff -u src/sys/arch/luna68k/stand/boot/device.h:1.5 src/sys/arch/luna68k/stand/boot/device.h:1.6 --- src/sys/arch/luna68k/stand/boot/device.h:1.5 Mon Jan 14 12:28:11 2013 +++ src/sys/arch/luna68k/stand/boot/device.h Fri Jan 3 02:03:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.5 2013/01/14 12:28:11 tsutsui Exp $ */ +/* $NetBSD: device.h,v 1.6 2014/01/03 02:03:12 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -98,49 +98,25 @@ struct hp_device { int hp_ipl; }; -struct devqueue { - struct devqueue *dq_forw; - struct devqueue *dq_back; - int dq_ctlr; - int dq_unit; - int dq_slave; - struct driver *dq_driver; -}; - struct hp_hw { uint8_t *hw_addr; /* physical address of registers */ short hw_type; /* type (defined below) */ char *hw_name; /* HP product name */ }; -#define MAX_CTLR 16 /* Totally arbitrary */ -#define MAXSLAVES 8 /* Currently the HPIB limit */ +#define MAX_CTLR 8 /* Totally arbitrary */ +#define MAXSLAVES 8 /* Currently the SCSI limit */ #define WILD_CARD_CTLR 0 /* A controller is a card which can have one or more slaves attached */ #define CONTROLLER 0x10 -#define HPIB 0x16 -#define SCSI 0x17 -#define VME 0x18 -#define FLINK 0x19 - -/* Slaves are devices which attach to controllers, e.g. disks, tapes */ -#define RD 0x2a -#define PPI 0x2b -#define CT 0x2c - -/* These are not controllers, but may have their own HPIB address */ -#define BITMAP 1 -#define NET 2 -#define FPA 4 -#define MISC 5 -#define KEYBOARD 6 -#define COMMDCA 7 -#define COMMDCM 8 -#define COMMDCL 9 -#define PPORT 10 -#define SIO 11 +#define SCSI (CONTROLLER | 0) + +/* Non-disk device types */ +#define NET 1 +#define KEYBOARD 2 +#define SIO 3 extern struct hp_ctlr hp_cinit[]; extern struct hp_device hp_dinit[]; Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.5 src/sys/arch/luna68k/stand/boot/sd.c:1.6 --- src/sys/arch/luna68k/stand/boot/sd.c:1.5 Tue Jan 22 15:48:40 2013 +++ src/sys/arch/luna68k/stand/boot/sd.c Fri Jan 3 02:03:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.5 2013/01/22 15:48:40 tsutsui Exp $ */ +/* $NetBSD: sd.c,v 1.6 2014/01/03 02:03:12 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -89,15 +89,12 @@ struct disklabel sdlabel[NSD]; struct sd_softc { struct hp_device *sc_hd; - struct devqueue sc_dq; - int sc_format_pid; /* process using "format" mode */ short sc_flags; short sc_type; /* drive type */ short sc_punit; /* physical unit (scsi lun) */ u_short sc_bshift; /* convert device blocks to DEV_BSIZE blks */ u_int sc_blks; /* number of blocks on device */ int sc_blksize; /* device block size in bytes */ - u_int sc_wpms; /* average xfer rate in 16 bit wds/sec. */ }; struct sd_devdata { @@ -120,7 +117,6 @@ struct sd_devdata sd_devdata[NSD]; #define sdunit(x) ((minor(x) >> 3) & 0x7) #define sdpart(x) (minor(x) & 0x7) -#define sdpunit(x) ((x) & 7) static struct scsi_inquiry inqbuf; static struct scsi_fmt_cdb inq = { @@ -210,7 +206,6 @@ sdident(struct sd_softc *sc, struct hp_d ++sc->sc_bshift; sc->sc_blks <<= sc->sc_bshift; } - sc->sc_wpms = 32 * (60 * DEV_BSIZE / 2); /* XXX */ return(inqbuf.type); } @@ -228,7 +223,7 @@ sdinit(void *arg) hd->hp_ctlr, hd->hp_slave); #endif sc->sc_hd = hd; - sc->sc_punit = sdpunit(hd->hp_flags); + sc->sc_punit = 0; /* XXX no LUN support yet */ sc->sc_type = sdident(sc, hd); if (sc->sc_type < 0) return(0); Index: src/sys/arch/luna68k/stand/boot/ioconf.c diff -u src/sys/a
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 2 20:02:00 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: bmd.c font.c samachdep.h Log Message: Misc cleanup. Mostly from OpenBSD/luna88k. - fix isprint() macro - hight -> height - remove an unused function - adjust tabs/spaces - constify the bitmap font - consistently use #define - use #if 0/#endif to disable code block - u_long -> uint32_t, u_short -> uint16_t - some KNF To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/bmd.c \ src/sys/arch/luna68k/stand/boot/font.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmd.c diff -u src/sys/arch/luna68k/stand/boot/bmd.c:1.2 src/sys/arch/luna68k/stand/boot/bmd.c:1.3 --- src/sys/arch/luna68k/stand/boot/bmd.c:1.2 Sun Jan 20 13:35:43 2013 +++ src/sys/arch/luna68k/stand/boot/bmd.c Thu Jan 2 20:02:00 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bmd.c,v 1.2 2013/01/20 13:35:43 tsutsui Exp $ */ +/* $NetBSD: bmd.c,v 1.3 2014/01/02 20:02:00 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -80,8 +80,6 @@ #include #include -#define isprint(c) ( c < 0x20 ? 0 : 1) - /* * RFCNT register */ @@ -94,37 +92,36 @@ union bmd_rfcnt { uint32_t u; }; +#define isprint(c) ((c) >= 0x20 && (c) < 0x7f) /* - * Width & Hight + * Width & Height */ -#define PB_WIDTH 2048/* Plane Width (Bit) */ -#define PB_HIGHT 1024/* Plane Hight (Bit) */ -#define PL_WIDTH 64/* Plane Width (long) */ -#define PS_WIDTH 128/* Plane Width (long) */ -#define P_WIDTH 256/* Plane Width (Byte) */ - -#define SB_WIDTH 1280/* Screen Width (Bit) */ -#define SB_HIGHT 1024/* Screen Hight (Bit) */ -#define SL_WIDTH 40/* Screen Width (Long) */ -#define S_WIDTH 160/* Screen Width (Byte) */ +#define PB_WIDTH 2048 /* Plane Width (Bit) */ +#define PB_HEIGHT 1024 /* Plane Hight (Bit) */ +#define PL_WIDTH 64 /* Plane Width (long) */ +#define PS_WIDTH 128 /* Plane Width (long) */ +#define P_WIDTH 256 /* Plane Width (Byte) */ -#define FB_WIDTH 12/* Font Width(Bit) */ -#define FB_HIGHT 20/* Font Hight(Bit) */ +#define SB_WIDTH 1280 /* Screen Width (Bit) */ +#define SB_HEIGHT 1024 /* Screen Hight (Bit) */ +#define SL_WIDTH 40 /* Screen Width (Long) */ +#define S_WIDTH 160 /* Screen Width (Byte) */ +#define FB_WIDTH 12 /* Font Width(Bit) */ +#define FB_HEIGHT 20 /* Font Hight(Bit) */ -#define NEXT_LINE(addr)( addr + (PL_WIDTH * FB_HIGHT) ) -#define SKIP_NEXT_LINE(addr) ( addr += (PL_WIDTH - SL_WIDTH) ) +#define NEXT_LINE(addr) ( addr + (PL_WIDTH * FB_HEIGHT) ) +#define SKIP_NEXT_LINE(addr) ( addr += (PL_WIDTH - SL_WIDTH) ) -void bmd_add_new_line(void); void bmd_draw_char(char *, char *, int, int, int); void bmd_reverse_char(char *, char *, int, int); void bmd_erase_char(char *, char *, int, int); -void bmd_erase_screen(volatile u_long *); -void bmd_scroll_screen(volatile u_long *, volatile u_long *, +void bmd_erase_screen(volatile uint32_t *); +void bmd_scroll_screen(volatile uint32_t *, volatile uint32_t *, int, int, int, int); @@ -152,9 +149,9 @@ struct bmd_softc { void (*bc_escape)(int); }; -#define STAT_NORMAL 0x -#define STAT_ESCAPE 0x0001 -#define STAT_INSERT 0x0100 +#define STAT_NORMAL 0x +#define STAT_ESCAPE 0x0001 +#define STAT_INSERT 0x0100 struct bmd_softc bmd_softc; struct bmd_linec bmd_linec[52]; @@ -224,11 +221,11 @@ bmd_escape_0(int c) break; default: -/* +#if 0 *bp->bc_esc++ = c; bp->bc_escape = bmd_escape_1; return; - */ +#endif break; } @@ -293,10 +290,10 @@ bmdinit(void) * adjust plane position */ - bp->bc_raddr = (char *) 0xB10C0008; /* plane-0 hardware address */ - bp->bc_waddr = (char *) 0xB1080008; /* common bitmap hardware address */ - rfcnt.p.rfc_hcnt = 7;/* shift left 16 dot */ - rfcnt.p.rfc_vcnt = -27;/* shift down1 dot */ + bp->bc_raddr = (char *) 0xB10C0008; /* plane-0 hardware address */ + bp->bc_waddr = (char *) 0xB1080008; /* common bitmap hardware address */ + rfcnt.p.rfc_hcnt = 7; /* shift left 16 dot */ + rfcnt.p.rfc_vcnt = -27; /* shift down1 dot */ *bmd_rfcnt = rfcnt.u; bp->bc_stat = STAT_NORMAL; @@ -324,7 +321,7 @@ bmdinit(void) bp->bc_escape = bmd_escape; *bmd_bmsel = 0xff;/* all planes */ - bmd_erase_screen((u_long *) bp->bc_waddr); /* clear screen */ + bmd_erase_screen((uint32_t *)bp->bc_waddr); /* clear screen */ *bmd_bmsel = 0x01;/* 1 plane */ /* turn on cursole */ @@ -375,8 +372,8 @@ bmdputc(int c) bq->bl_col = bq->bl_end = bp->bc_xmin; bp->bc_row++; if (bp->bc_row >= bp->bc_ymax) { -bmd_scroll_screen((u_long *) bp->bc_raddr, - (u_long *) bp->bc_waddr, +bmd_scr
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 2 19:50:03 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c scsi.c Log Message: Replace broken (by SCCS) ISO-2022-JP comments with UTF-8. Recovered and decoded by isaki@. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/sc.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/scsi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.6 src/sys/arch/luna68k/stand/boot/sc.c:1.7 --- src/sys/arch/luna68k/stand/boot/sc.c:1.6 Thu Jan 2 18:45:24 2014 +++ src/sys/arch/luna68k/stand/boot/sc.c Thu Jan 2 19:50:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.6 2014/01/02 18:45:24 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.7 2014/01/02 19:50:03 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -419,13 +419,13 @@ scsi_request_sense(int ctlr, int slave, printf("scsi_request_sense: Start\n"); #endif - /* Request Sense$N>l9g!"E>Aw$5$l$k%G!<%?D9$O%?!<%2368H$K0MB8$7!"*/ - /* %;%s%9%G!<%?$N#8/usr/src/sys/luna68k/stand/SCCS/s.sc.c$%HL\$NAddtional Sens Length$K$h$jF0E*$K7hDj$9$k!#*/ - /* $3$3$G$O%G!<%?!Aw?t$rcdb$NAllocation Length$K:GDcD9$G$"$k#8/usr/src/sys/luna68k/stand/SCCS/s.sc.c$%H */ - /* $r8GDj$7$F!"#S#P#C$N=hM}%7!<%1%s%9$rJx$5$J$$$h$&$K$7$F$$$k!# */ + /* Request Senseの場合、転送されるデータ長はターゲットに依存し、*/ + /* センスデータの8バイト目のAdditional Sens Lengthにより動的に決定する。*/ + /* ここではデーター転送数をcdbのAllocation Lengthに最低長である8バイト */ + /* を固定して、SPCの処理シーケンスを崩さないようにしている。 */ - /* %F!<@(#)sc.c 8.1f%K373H$N>uBV$rD4$Y$k$?$a!"Addtional Sens Field$r%"%/%;%9$9$k */ - /* I,MW$,$"$k$N$G6/10/93P%$%98.1i%$%PB&$Glen$r7hDj$9$k$3$H$K$9$k*/ + /* テープユニットの状態を調べるため、Addtional Sens Fieldをアクセスする */ + /* 必要があるのでデバイスドライバ側でlenを決定することにする*/ cdb.lun = unit; cdb.len = len; Index: src/sys/arch/luna68k/stand/boot/scsi.c diff -u src/sys/arch/luna68k/stand/boot/scsi.c:1.2 src/sys/arch/luna68k/stand/boot/scsi.c:1.3 --- src/sys/arch/luna68k/stand/boot/scsi.c:1.2 Sun Jan 20 07:32:45 2013 +++ src/sys/arch/luna68k/stand/boot/scsi.c Thu Jan 2 19:50:03 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi.c,v 1.2 2013/01/20 07:32:45 tsutsui Exp $ */ +/* $NetBSD: scsi.c,v 1.3 2014/01/02 19:50:03 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -84,9 +84,9 @@ int scsi_device = 6; -#define SENSBUFF 8 /* 6/10/93P%$%98.1i%$%P$G%;%s%9%G!<%? */ - /* $ND9$5$r#8/usr/src/sys/luna68k/stand/SCCS/s.scsi.c$%H0JFb$K8GDj$7$F */ -u_char sensbuff[SENSBUFF];/* #80J>e$OL50UL#$G$"$k!# */ +#define SENSBUFF 8 /* デバイスドライバでセンスデータ */ + /* の長さを8バイト以内に固定して */ +u_char sensbuff[SENSBUFF];/* 8以上は無意味である。 */ static struct scsi_inquiry inquirybuf; static struct scsi_fmt_cdb inquiry = {
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 2 18:45:24 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c Log Message: Add bound check of a controller number in scrun(). Noticed by miod@openbsd. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/sc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.5 src/sys/arch/luna68k/stand/boot/sc.c:1.6 --- src/sys/arch/luna68k/stand/boot/sc.c:1.5 Thu Jan 2 17:47:23 2014 +++ src/sys/arch/luna68k/stand/boot/sc.c Thu Jan 2 18:45:24 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.5 2014/01/02 17:47:23 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.6 2014/01/02 18:45:24 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -254,8 +254,14 @@ int scrun(int ctlr, int slave, u_char *cdb, int cdblen, u_char *buf, int len, volatile int *lock) { - struct scsi_softc *hs = &scsi_softc[ctlr]; - struct scsidevice *hd = (struct scsidevice *) hs->sc_hc->hp_addr; + struct scsi_softc *hs; + struct scsidevice *hd; + + if (ctlr < 0 || ctlr >= NSC) + return 0; + + hs = &scsi_softc[ctlr]; + hd = (struct scsidevice *)hs->sc_hc->hp_addr; if (hd->scsi_ssts & (SSTS_INITIATOR|SSTS_TARGET|SSTS_BUSY)) return(0);
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 2 17:47:23 UTC 2014 Modified Files: src/sys/arch/luna68k/stand/boot: sc.c Log Message: Change the SCSI select timeout from 2ms to 250ms as kernel spc(4) driver does. Noticed by miod@openbsd. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/sc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.4 src/sys/arch/luna68k/stand/boot/sc.c:1.5 --- src/sys/arch/luna68k/stand/boot/sc.c:1.4 Tue Jan 22 15:48:40 2013 +++ src/sys/arch/luna68k/stand/boot/sc.c Thu Jan 2 17:47:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.4 2013/01/22 15:48:40 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.5 2014/01/02 17:47:23 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -191,10 +191,10 @@ issue_select(struct scsidevice *hd, u_ch hd->scsi_pctl = 0; hd->scsi_temp = (1 << SCSI_ID) | (1 << target); - /* select timeout is hardcoded to 2ms */ - hd->scsi_tch = 0; - hd->scsi_tcm = 32; - hd->scsi_tcl = 4; + /* select timeout is hardcoded to 250ms */ + hd->scsi_tch = 2; + hd->scsi_tcm = 113; + hd->scsi_tcl = 3; hd->scsi_scmd = SCMD_SELECT;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Mar 5 15:34:53 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: boot.c init_main.c samachdep.h version Log Message: Check netboot and set proper default boot device. Also bump version. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/boot.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/version cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/boot.c diff -u src/sys/arch/luna68k/stand/boot/boot.c:1.2 src/sys/arch/luna68k/stand/boot/boot.c:1.3 --- src/sys/arch/luna68k/stand/boot/boot.c:1.2 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/boot.c Tue Mar 5 15:34:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.2 2013/01/21 11:58:12 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.3 2013/03/05 15:34:53 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -88,7 +88,6 @@ int howto; static int get_boot_device(const char *, int *, int *, int *); struct exec header; -char default_file[] = "sd(0,0)netbsd"; char *how_to_info[] = { "RB_ASKNAME ask for file name to reboot from", Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.5 src/sys/arch/luna68k/stand/boot/init_main.c:1.6 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.5 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/init_main.c Tue Mar 5 15:34:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.5 2013/01/21 11:58:12 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.6 2013/03/05 15:34:53 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -71,6 +71,7 @@ */ #include +#include #include #include #include @@ -87,6 +88,7 @@ static int reorder_dipsw(int); int cpuspeed; /* for DELAY() macro */ int hz = 60; int machtype; +char default_file[64]; #define VERS_LOCAL "Phase-31" @@ -117,6 +119,10 @@ main(void) { int i, status = 0; const char *machstr; + const char *cp; + char bootarg[64]; + bool netboot = false; + int unit, part; /* * Initialize the console before we print anything out. @@ -126,11 +132,25 @@ main(void) machstr = "LUNA-I"; cpuspeed = MHZ_25; hz = 60; + memcpy(bootarg, (char *)*RVPtr->vec53, sizeof(bootarg)); + + /* check netboot */ + for (i = 0, cp = bootarg; i < sizeof(bootarg); i++, cp++) { + if (*cp == '\0') +break; + if (*cp == 'E' && memcmp("ENADDR=", cp, 7) == 0) { +netboot = true; +break; + } + } } else { machtype = LUNA_II; machstr = "LUNA-II"; cpuspeed = MHZ_25 * 2; /* XXX */ hz = 100; + memcpy(bootarg, (char *)*RVPtr->vec02, sizeof(bootarg)); + + /* LUNA-II's boot monitor doesn't support netboot */ } nplane = get_plane_numbers(); @@ -165,6 +185,11 @@ main(void) configure(); printf("\n"); + unit = 0; /* XXX should parse monitor's Boot-file constant */ + part = 0; + snprintf(default_file, sizeof(default_file), + "%s(%d,%d)%s", netboot ? "le" : "sd", unit, part, "netbsd"); + howto = reorder_dipsw(dipsw2); if ((howto & 0xFE) == 0) { Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.5 src/sys/arch/luna68k/stand/boot/version:1.6 --- src/sys/arch/luna68k/stand/boot/version:1.5 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/version Tue Mar 5 15:34:53 2013 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.5 2013/01/21 11:58:12 tsutsui Exp $ +$NetBSD: version,v 1.6 2013/03/05 15:34:53 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -9,3 +9,4 @@ is taken as the current. 1.2: Add support for secondary SPC SCSI on LUNA-II. 1.3: Add UFS2 support. 1.4: Add support for "awaiting key" to abort autoboot and get boot menu. +1.5: Check netboot and set proper default boot device. Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.9 src/sys/arch/luna68k/stand/boot/samachdep.h:1.10 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.9 Tue Jan 22 15:48:40 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Tue Mar 5 15:34:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.9 2013/01/22 15:48:40 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.10 2013/03/05 15:34:53 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -74,7 +74,6 @@ void bmdclear(void); /* boot.c */ extern int howto; -extern char default_file[]; int how_to_boot(int, char **); int boot(int, char **); int bootnetbsd(char *); @@ -116,6 +115,7 @@ extern int cpuspeed; extern int hz; extern int nplane; extern int machtype; +extern char default_file[]; /* kbd.c */ int kbd_decode(u_char);
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 26 16:00:04 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: boot.ldscript Log Message: Add proper padding to text section for elf2aout conversion. The data and bss sections are 8 byte aligned on m68k ELF format, but a.out header doesn't have section addresses and only contains size values, so we have to pad size of text section to make data section get aligned even after elf2aout. Note elf2aout merges ELF data section into a.out text section if binary is OMAGIC (i.e. text is writable too) so only BSS section address was affected (and was almost harmless). To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/boot.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/boot.ldscript diff -u src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4 src/sys/arch/luna68k/stand/boot/boot.ldscript:1.5 --- src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4 Sun Jan 20 02:35:13 2013 +++ src/sys/arch/luna68k/stand/boot/boot.ldscript Sat Jan 26 16:00:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.ldscript,v 1.4 2013/01/20 02:35:13 tsutsui Exp $ */ +/* $NetBSD: boot.ldscript,v 1.5 2013/01/26 16:00:04 tsutsui Exp $ */ OUTPUT_FORMAT("elf32-m68k") OUTPUT_ARCH(m68k) @@ -11,7 +11,11 @@ SECTIONS *(.text) *(.text.*) *(.rodata) *(.rodata.*) -. = ALIGN(4); +/* The data and bss sections are 8 byte aligned on ELF format, + but a.out header doesn't have section addresses and only + contains size values, so we have to pad size of text section + to make data section get aligned even after elf2aout. */ +. = ALIGN(8); } =0 PROVIDE (__etext = .); PROVIDE (_etext = .);
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Tue Jan 22 15:48:40 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile autoconf.c disklabel.c if_le.c locore.S omron_disklabel.h parse.c prf.c samachdep.h sc.c scsireg.h sd.c Log Message: Whitespace cleanup. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/luna68k/stand/boot/Makefile \ src/sys/arch/luna68k/stand/boot/locore.S \ src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/disklabel.c \ src/sys/arch/luna68k/stand/boot/if_le.c \ src/sys/arch/luna68k/stand/boot/omron_disklabel.h \ src/sys/arch/luna68k/stand/boot/prf.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/parse.c \ src/sys/arch/luna68k/stand/boot/sc.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/scsireg.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/sd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.8 src/sys/arch/luna68k/stand/boot/Makefile:1.9 --- src/sys/arch/luna68k/stand/boot/Makefile:1.8 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Tue Jan 22 15:48:40 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2013/01/21 11:58:12 tsutsui Exp $ +# $NetBSD: Makefile,v 1.9 2013/01/22 15:48:40 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -37,7 +37,7 @@ SRCS+= trap.c SRCS+= devopen.c SRCS+= conf.c SRCS+= machdep.c -SRCS+= getline.c parse.c +SRCS+= getline.c parse.c SRCS+= boot.c SRCS+= cons.c prf.c awaitkey.c SRCS+= romcons.c Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.8 src/sys/arch/luna68k/stand/boot/locore.S:1.9 --- src/sys/arch/luna68k/stand/boot/locore.S:1.8 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Tue Jan 22 15:48:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.8 2013/01/21 11:58:12 tsutsui Exp $ */ +/* $NetBSD: locore.S,v 1.9 2013/01/22 15:48:40 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -287,7 +287,7 @@ GLOBAL(_rtt) /* * Trap/interrupt vector routines - */ + */ ENTRY_NOPROFILE(buserr) tstl _C_LABEL(nofault) | device probe? Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.8 src/sys/arch/luna68k/stand/boot/samachdep.h:1.9 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.8 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Tue Jan 22 15:48:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.8 2013/01/21 11:58:12 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.9 2013/01/22 15:48:40 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -127,7 +127,7 @@ uint8_t *lance_eaddr(void *); bool lance_init(void *); int lance_get(void *, void *, size_t); bool lance_put(void *, void *, size_t); -bool lance_end(void *); +bool lance_end(void *); int lance_intr(void); /* locore.S */ Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.6 src/sys/arch/luna68k/stand/boot/autoconf.c:1.7 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.6 Mon Jan 14 12:28:11 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Tue Jan 22 15:48:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.6 2013/01/14 12:28:11 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.7 2013/01/22 15:48:40 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -70,7 +70,7 @@ * @(#)autoconf.c 8.1 (Berkeley) 6/10/93 */ -/* +/* * autoconf.c -- Determine mass storage and memory configuration for a machine. * by A.Fujita, NOV-30-1991 * Index: src/sys/arch/luna68k/stand/boot/disklabel.c diff -u src/sys/arch/luna68k/stand/boot/disklabel.c:1.2 src/sys/arch/luna68k/stand/boot/disklabel.c:1.3 --- src/sys/arch/luna68k/stand/boot/disklabel.c:1.2 Thu Jan 10 16:20:11 2013 +++ src/sys/arch/luna68k/stand/boot/disklabel.c Tue Jan 22 15:48:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.2 2013/01/10 16:20:11 tsutsui Exp $ */ +/* $NetBSD: disklabel.c,v 1.3 2013/01/22 15:48:40 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -391,7 +391,7 @@ display(struct disklabel *lp) else cnputc(' '); printf("- %d", - (pp->p_offset + + (pp->p_offset + pp->p_size + lp->d_secpercyl - 1) / lp->d_secpercyl - 1); if (pp->p_size % lp->d_secpercyl) Index: src/sys/arch/luna68k/stand/boot/if_le.c diff -u src/sys/arch/luna68k/stand/boot/if_le.c:1.2 src/sys/arch/luna68k/stand/boot/if_le.c:1.3 --- src/sys/arch/luna68k/stand/boot/if_le.c:1.2 Sun Jan 20 13:35:43 2013 +++ src/sys/arch/luna68k/stand/boot/if_le.c Tue Jan 22 15:48:40 2013 @@ -1,4 +1
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Jan 21 13:21:05 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: sd.c Log Message: Slightly modify sd attach message, as kernel does. before: sd0: HITACHI DK315C-14 rev H7H6, 2807459 512 byte blocks after: sd0: HITACHI DK315C-14 rev H7H6, 512 bytes/sect x 2807459 sectors To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/sd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.3 src/sys/arch/luna68k/stand/boot/sd.c:1.4 --- src/sys/arch/luna68k/stand/boot/sd.c:1.3 Mon Jan 14 01:37:57 2013 +++ src/sys/arch/luna68k/stand/boot/sd.c Mon Jan 21 13:21:04 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */ +/* $NetBSD: sd.c,v 1.4 2013/01/21 13:21:04 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -199,7 +199,7 @@ sdident(struct sd_softc *sc, struct hp_d printf("sd%d: %s %s rev %s", hd->hp_unit, idstr, &idstr[8], &idstr[24]); - printf(", %d %d byte blocks\n", sc->sc_blks, sc->sc_blksize); + printf(", %d bytes/sect x %d sectors\n", sc->sc_blksize, sc->sc_blks); if (sc->sc_blksize != DEV_BSIZE) { if (sc->sc_blksize < DEV_BSIZE) { printf("sd%d: need %d byte blocks - drive ignored\n",
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Jan 21 11:58:12 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile bmc.c boot.c init_main.c locore.S parse.c prf.c samachdep.h sio.c version Added Files: src/sys/arch/luna68k/stand/boot: awaitkey.c Log Message: Add support for "await key" to abort autoboot and get boot menu. Also add command help. Bump version. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/stand/boot/Makefile \ src/sys/arch/luna68k/stand/boot/locore.S \ src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r0 -r1.1 src/sys/arch/luna68k/stand/boot/awaitkey.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/bmc.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/boot.c \ src/sys/arch/luna68k/stand/boot/prf.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/version cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/parse.c \ src/sys/arch/luna68k/stand/boot/sio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.7 src/sys/arch/luna68k/stand/boot/Makefile:1.8 --- src/sys/arch/luna68k/stand/boot/Makefile:1.7 Sun Jan 20 02:35:13 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Mon Jan 21 11:58:12 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2013/01/20 02:35:13 tsutsui Exp $ +# $NetBSD: Makefile,v 1.8 2013/01/21 11:58:12 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -39,7 +39,7 @@ SRCS+= conf.c SRCS+= machdep.c SRCS+= getline.c parse.c SRCS+= boot.c -SRCS+= cons.c prf.c +SRCS+= cons.c prf.c awaitkey.c SRCS+= romcons.c SRCS+= sio.c SRCS+= bmc.c bmd.c screen.c font.c kbd.c Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.7 src/sys/arch/luna68k/stand/boot/locore.S:1.8 --- src/sys/arch/luna68k/stand/boot/locore.S:1.7 Sun Jan 20 03:40:55 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Mon Jan 21 11:58:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.7 2013/01/20 03:40:55 tsutsui Exp $ */ +/* $NetBSD: locore.S,v 1.8 2013/01/21 11:58:12 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -535,9 +535,13 @@ ENTRY_NOPROFILE(lev5intr) moveml %sp@+,#0x0303 | restore scratch regs addql #2,%sp | pop pad word jra _ASM_LABEL(rei) | all done + ENTRY_NOPROFILE(hardclock) + addql #1,_C_LABEL(tick) rts +BSS(tick,4) + ENTRY_NOPROFILE(lev6intr) clrw %sp@- moveml #0xC0C0,%sp@- Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.7 src/sys/arch/luna68k/stand/boot/samachdep.h:1.8 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.7 Sun Jan 20 14:03:40 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Mon Jan 21 11:58:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.7 2013/01/20 14:03:40 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.8 2013/01/21 11:58:12 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -54,10 +54,12 @@ typedef struct label_t { } label_t; /* autoconf.c */ -extern int cpuspeed; void configure(void); void find_devs(void); +/* awaitkey.c */ +char awaitkey(const char *, int, bool); + /* bmc.c */ void bmccnprobe(struct consdev *); void bmccninit(struct consdev *); @@ -110,6 +112,8 @@ int getline(char *, char *); int leinit(void *); /* init_main.c */ +extern int cpuspeed; +extern int hz; extern int nplane; extern int machtype; @@ -130,6 +134,7 @@ int lance_intr(void); extern u_int bootdev; extern int dipsw1, dipsw2; extern int cputype; +extern volatile uint32_t tick; int setjmp(label_t *); int splhigh(void); void splx(int); @@ -153,9 +158,7 @@ void regdump(int *, int); char *hexstr(int, int); /* prf.c */ -#if 0 int tgetchar(void); -#endif /* parse.c */ int check_args(int, char **); Index: src/sys/arch/luna68k/stand/boot/bmc.c diff -u src/sys/arch/luna68k/stand/boot/bmc.c:1.3 src/sys/arch/luna68k/stand/boot/bmc.c:1.4 --- src/sys/arch/luna68k/stand/boot/bmc.c:1.3 Sun Jan 20 14:03:40 2013 +++ src/sys/arch/luna68k/stand/boot/bmc.c Mon Jan 21 11:58:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bmc.c,v 1.3 2013/01/20 14:03:40 tsutsui Exp $ */ +/* $NetBSD: bmc.c,v 1.4 2013/01/21 11:58:12 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -116,9 +116,8 @@ bmccngetc(dev_t dev) int c; int unit = 1; - while (RBUF_EMPTY(unit)) { - DELAY(10); - } + if (RBUF_EMPTY(unit)) + return 0; POP_RBUF(unit, c); Index: src/sys/arch/luna68k/stand/boot/boot.c diff -u src/sys/arch/luna68k/stand/boot/boot.c:1.1 src/sys/arch/luna68k/stand/boot/boot.c:1.2 --- src/sys/arch/luna68k/stand/boot/boot.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/boot.c Mon Jan 21 11:58:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: b
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 20 14:03:40 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: bmc.c samachdep.h Log Message: Remove unused bmcintr() function. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/bmc.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmc.c diff -u src/sys/arch/luna68k/stand/boot/bmc.c:1.2 src/sys/arch/luna68k/stand/boot/bmc.c:1.3 --- src/sys/arch/luna68k/stand/boot/bmc.c:1.2 Sun Jan 20 13:35:43 2013 +++ src/sys/arch/luna68k/stand/boot/bmc.c Sun Jan 20 14:03:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bmc.c,v 1.2 2013/01/20 13:35:43 tsutsui Exp $ */ +/* $NetBSD: bmc.c,v 1.3 2013/01/20 14:03:40 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -80,11 +80,6 @@ #include #include -void -bmcintr(void) -{ -} - /* * Following are all routines needed for SIO to act as console */ Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.6 src/sys/arch/luna68k/stand/boot/samachdep.h:1.7 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.6 Wed Jan 16 15:46:20 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Sun Jan 20 14:03:40 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.6 2013/01/16 15:46:20 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.7 2013/01/20 14:03:40 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -59,7 +59,6 @@ void configure(void); void find_devs(void); /* bmc.c */ -void bmcintr(void); void bmccnprobe(struct consdev *); void bmccninit(struct consdev *); int bmccngetc(dev_t);
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 20 13:35:43 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: bmc.c bmd.c font.c if_le.c init_main.c Log Message: No need to include in standalone sources. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/bmc.c \ src/sys/arch/luna68k/stand/boot/bmd.c \ src/sys/arch/luna68k/stand/boot/font.c \ src/sys/arch/luna68k/stand/boot/if_le.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/init_main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/bmc.c diff -u src/sys/arch/luna68k/stand/boot/bmc.c:1.1 src/sys/arch/luna68k/stand/boot/bmc.c:1.2 --- src/sys/arch/luna68k/stand/boot/bmc.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/bmc.c Sun Jan 20 13:35:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bmc.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: bmc.c,v 1.2 2013/01/20 13:35:43 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -76,7 +76,6 @@ */ #include -#include #include #include #include Index: src/sys/arch/luna68k/stand/boot/bmd.c diff -u src/sys/arch/luna68k/stand/boot/bmd.c:1.1 src/sys/arch/luna68k/stand/boot/bmd.c:1.2 --- src/sys/arch/luna68k/stand/boot/bmd.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/bmd.c Sun Jan 20 13:35:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bmd.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: bmd.c,v 1.2 2013/01/20 13:35:43 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -78,7 +78,6 @@ #include -#include #include #define isprint(c) ( c < 0x20 ? 0 : 1) Index: src/sys/arch/luna68k/stand/boot/font.c diff -u src/sys/arch/luna68k/stand/boot/font.c:1.1 src/sys/arch/luna68k/stand/boot/font.c:1.2 --- src/sys/arch/luna68k/stand/boot/font.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/font.c Sun Jan 20 13:35:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: font.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: font.c,v 1.2 2013/01/20 13:35:43 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -77,7 +77,6 @@ */ #include -#include u_short bmdfont[][20] = { { /* 0x00 */ Index: src/sys/arch/luna68k/stand/boot/if_le.c diff -u src/sys/arch/luna68k/stand/boot/if_le.c:1.1 src/sys/arch/luna68k/stand/boot/if_le.c:1.2 --- src/sys/arch/luna68k/stand/boot/if_le.c:1.1 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/if_le.c Sun Jan 20 13:35:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_le.c,v 1.1 2013/01/13 14:10:55 tsutsui Exp $ */ +/* $NetBSD: if_le.c,v 1.2 2013/01/20 13:35:43 tsutsui Exp $ */ /* * Copyright (c) 2013 Izumi Tsutsui. All rights reserved. @@ -59,7 +59,6 @@ */ #include -#include #include Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.3 src/sys/arch/luna68k/stand/boot/init_main.c:1.4 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.3 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/init_main.c Sun Jan 20 13:35:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.3 2013/01/13 14:10:55 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.4 2013/01/20 13:35:43 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -71,7 +71,6 @@ */ #include -#include #include #include #include
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 20 07:32:46 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: getline.c scsi.c Log Message: Don't call internal cngetc() and cnputc() directly. Use public getchar() and puthchar() instead. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/getline.c \ src/sys/arch/luna68k/stand/boot/scsi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/getline.c diff -u src/sys/arch/luna68k/stand/boot/getline.c:1.1 src/sys/arch/luna68k/stand/boot/getline.c:1.2 --- src/sys/arch/luna68k/stand/boot/getline.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/getline.c Sun Jan 20 07:32:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: getline.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: getline.c,v 1.2 2013/01/20 07:32:45 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -87,29 +87,28 @@ getline(char *prompt, char *buff) printf("%s", prompt); for(;;) { - c = cngetc() & 0x7F; + c = getchar() & 0x7F; switch (c) { case 0x0a: case 0x0d: - cnputc('\r'); - cnputc('\n'); + putchar('\n'); *p = '\0'; goto outloop; case 0x08: case 0x7f: if (p > buff) { -cnputc(0x08); -cnputc(' '); -cnputc(0x08); +putchar(0x08); +putchar(' '); +putchar(0x08); p--; } break; default: *p++ = c; - cnputc(c); + putchar(c); break; } } Index: src/sys/arch/luna68k/stand/boot/scsi.c diff -u src/sys/arch/luna68k/stand/boot/scsi.c:1.1 src/sys/arch/luna68k/stand/boot/scsi.c:1.2 --- src/sys/arch/luna68k/stand/boot/scsi.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/scsi.c Sun Jan 20 07:32:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: scsi.c,v 1.2 2013/01/20 07:32:45 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -174,7 +174,7 @@ scsi(int argc, char *argv[]) while (i == 0) { printf("Do you really want to format SCSI %d device ? [y/n]: ", scsi_device); - i = cngetc(); + i = getchar(); printf("\n"); if ((i != 'y') && (i != 'Y') && (i != 'n') && (i != 'N')) i = 0;
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 20 03:40:56 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: locore.S Log Message: Use hex value rather than decimal for register and device macro. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.6 src/sys/arch/luna68k/stand/boot/locore.S:1.7 --- src/sys/arch/luna68k/stand/boot/locore.S:1.6 Sun Jan 20 03:01:13 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Sun Jan 20 03:40:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.6 2013/01/20 03:01:13 tsutsui Exp $ */ +/* $NetBSD: locore.S,v 1.7 2013/01/20 03:40:55 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -85,17 +85,17 @@ #define T_FPERR 11 #define T_COPERR 12 -#define PSL_LOWIPL 8192 -#define PSL_HIGHIPL 9984 +#define PSL_LOWIPL 0x2000 /* PSL_S | PSL_IPL0 */ +#define PSL_HIGHIPL 0x2700 /* PSL_S | PSL_IPL7 */ -#define SPL1 8448 -#define SPL2 8704 -#define SPL3 8960 -#define SPL4 9216 -#define SPL5 9472 -#define SPL6 9728 +#define SPL1 0x2100 /* PSL_S | PSL_IPL1 */ +#define SPL2 0x2200 /* PSL_S | PSL_IPL2 */ +#define SPL3 0x2300 /* PSL_S | PSL_IPL3 */ +#define SPL4 0x2400 /* PSL_S | PSL_IPL4 */ +#define SPL5 0x2500 /* PSL_S | PSL_IPL5 */ +#define SPL6 0x2600 /* PSL_S | PSL_IPL6 */ -#define CLOCK_REG 1660944384 +#define CLOCK_REG 0x6300 #define CLK_CLR 1 #define ILLGINST 16
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 20 03:01:13 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: locore.S Log Message: Add RCS Id. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.5 src/sys/arch/luna68k/stand/boot/locore.S:1.6 --- src/sys/arch/luna68k/stand/boot/locore.S:1.5 Sun Jan 20 02:35:13 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Sun Jan 20 03:01:13 2013 @@ -1,3 +1,5 @@ +/* $NetBSD: locore.S,v 1.6 2013/01/20 03:01:13 tsutsui Exp $ */ + /* * Copyright (c) 1992 OMRON Corporation. *
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 20 02:35:14 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile boot.ldscript locore.S Log Message: Specify text address via Makefile rather than hardcoding in boot.ldscript. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/luna68k/stand/boot/Makefile cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/boot.ldscript cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.6 src/sys/arch/luna68k/stand/boot/Makefile:1.7 --- src/sys/arch/luna68k/stand/boot/Makefile:1.6 Wed Jan 16 15:15:01 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Sun Jan 20 02:35:13 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2013/01/16 15:15:01 tsutsui Exp $ +# $NetBSD: Makefile,v 1.7 2013/01/20 02:35:13 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -27,8 +27,9 @@ CFLAGS+= -Wall -Werror CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith CFLAGS+= -Wno-pointer-sign +TEXTADDR= 70 LDSCRIPT= ${.CURDIR}/boot.ldscript -LINKFORMAT= -static -N -T ${LDSCRIPT} +LINKFORMAT= -static -N -Ttext ${TEXTADDR} -T ${LDSCRIPT} SRCS= locore.S SRCS+= init_main.c autoconf.c ioconf.c Index: src/sys/arch/luna68k/stand/boot/boot.ldscript diff -u src/sys/arch/luna68k/stand/boot/boot.ldscript:1.3 src/sys/arch/luna68k/stand/boot/boot.ldscript:1.4 --- src/sys/arch/luna68k/stand/boot/boot.ldscript:1.3 Thu Jan 10 15:51:32 2013 +++ src/sys/arch/luna68k/stand/boot/boot.ldscript Sun Jan 20 02:35:13 2013 @@ -1,12 +1,10 @@ -/* $NetBSD: boot.ldscript,v 1.3 2013/01/10 15:51:32 tsutsui Exp $ */ +/* $NetBSD: boot.ldscript,v 1.4 2013/01/20 02:35:13 tsutsui Exp $ */ OUTPUT_FORMAT("elf32-m68k") OUTPUT_ARCH(m68k) ENTRY(start) SECTIONS { - . = 0x0070; - /* Read-only sections, merged into text segment: */ .text : { Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.4 src/sys/arch/luna68k/stand/boot/locore.S:1.5 --- src/sys/arch/luna68k/stand/boot/locore.S:1.4 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Sun Jan 20 02:35:13 2013 @@ -193,7 +193,6 @@ ASGLOBAL(Reset) BADTRAP16 /* 64-255: user interrupt vectors */ - START = 0x70 STACK = 0x80 DIPSW = 0x4900
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Wed Jan 16 15:46:20 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: conf.c devopen.c samachdep.h version Log Message: Add UFS2 support. Also bump version. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/conf.c \ src/sys/arch/luna68k/stand/boot/devopen.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/conf.c diff -u src/sys/arch/luna68k/stand/boot/conf.c:1.2 src/sys/arch/luna68k/stand/boot/conf.c:1.3 --- src/sys/arch/luna68k/stand/boot/conf.c:1.2 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/conf.c Wed Jan 16 15:46:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: conf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */ +/* $NetBSD: conf.c,v 1.3 2013/01/16 15:46:20 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -92,11 +92,16 @@ int n_netif_drivers = __arraycount(netif * Filesystem configuration */ #ifdef SUPPORT_DISK -struct fs_ops file_system_ufs[] = { FS_OPS(ufs) }; +struct fs_ops file_system_disk[] = { + FS_OPS(ffsv1), + FS_OPS(ffsv2) +}; +int nfsys_disk = __arraycount(file_system_disk); #endif #ifdef SUPPORT_ETHERNET struct fs_ops file_system_nfs[] = { FS_OPS(nfs) }; #endif -struct fs_ops file_system[1]; +#define MAX_NFSYS 5 +struct fs_ops file_system[MAX_NFSYS]; int nfsys = 1; /* we always know which one we want */ Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.2 src/sys/arch/luna68k/stand/boot/devopen.c:1.3 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.2 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/devopen.c Wed Jan 16 15:46:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.3 2013/01/16 15:46:20 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -82,6 +82,7 @@ devopen(struct open_file *f, const char int dev, unit, part; int error; struct devsw *dp; + int i; if (make_device(fname, &dev, &unit, &part, file) != 0) return ENXIO; @@ -100,11 +101,15 @@ devopen(struct open_file *f, const char return error; } - file_system[0] = file_system_ufs[0]; + for (i = 0; i < nfsys_disk; i++) + file_system[i] = file_system_disk[i]; + nfsys = nfsys_disk; + #ifdef SUPPORT_ETHERNET if (strcmp(dp->dv_name, "le") == 0) { /* XXX mixing local fs_ops on netboot could be troublesome */ file_system[0] = file_system_nfs[0]; + nfsys = 1; } #endif Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.5 src/sys/arch/luna68k/stand/boot/samachdep.h:1.6 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.5 Wed Jan 16 15:15:01 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Wed Jan 16 15:46:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.5 2013/01/16 15:15:01 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.6 2013/01/16 15:46:20 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -222,7 +222,8 @@ do { \ } while (__N > 0); \ } while (/* CONSTCOND */ 0) -extern struct fs_ops file_system_ufs[]; +extern struct fs_ops file_system_disk[]; +extern int nfsys_disk; extern struct fs_ops file_system_nfs[]; extern const char bootprog_name[], bootprog_rev[], bootprog_kernrev[]; Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.3 src/sys/arch/luna68k/stand/boot/version:1.4 --- src/sys/arch/luna68k/stand/boot/version:1.3 Mon Jan 14 01:37:57 2013 +++ src/sys/arch/luna68k/stand/boot/version Wed Jan 16 15:46:20 2013 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ +$NetBSD: version,v 1.4 2013/01/16 15:46:20 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -7,3 +7,4 @@ is taken as the current. 1.0: Initial revision, based on 4.4BSD-Lite2/luna68k and NetBSD/hp300 1.1: Add netboot support. 1.2: Add support for secondary SPC SCSI on LUNA-II. +1.3: Add UFS2 support.
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Wed Jan 16 15:15:02 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile parse.c samachdep.h Added Files: src/sys/arch/luna68k/stand/boot: ls.c Log Message: Enable and add ls command for ufs. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/Makefile cvs rdiff -u -r0 -r1.1 src/sys/arch/luna68k/stand/boot/ls.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/parse.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.5 src/sys/arch/luna68k/stand/boot/Makefile:1.6 --- src/sys/arch/luna68k/stand/boot/Makefile:1.5 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Wed Jan 16 15:15:01 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2013/01/13 14:10:55 tsutsui Exp $ +# $NetBSD: Makefile,v 1.6 2013/01/16 15:15:01 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -18,6 +18,7 @@ CPPFLAGS+= -DSUPPORT_ETHERNET CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOTP #CPPFLAGS+= -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG #CPPFLAGS+= -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID +CPPFLAGS+= -DLIBSA_ENABLE_LS_OP CPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT CFLAGS= -Os -msoft-float @@ -46,6 +47,7 @@ SRCS+= scsi.c sc.c sd.c SRCS+= disklabel.c #SRCS+= fsdump.c SRCS+= ufs_disksubr.c +SRCS+= ls.c # netboot support SRCS+= if_le.c lance.c getsecs.c @@ -69,7 +71,7 @@ Z_AS= library ### find out what to use for libsa SA_AS= library -SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes +SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes SA_ENABLE_LS_OP=yes .include "${S}/lib/libsa/Makefile.inc" LIBS= ${SALIB} ${ZLIB} ${KERNLIB} Index: src/sys/arch/luna68k/stand/boot/parse.c diff -u src/sys/arch/luna68k/stand/boot/parse.c:1.1 src/sys/arch/luna68k/stand/boot/parse.c:1.2 --- src/sys/arch/luna68k/stand/boot/parse.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/parse.c Wed Jan 16 15:15:01 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: parse.c,v 1.2 2013/01/16 15:15:01 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -112,6 +112,7 @@ struct command_entry entries[] = { { "fsrestore", fsrestore}, #endif { "howto", how_to_boot }, + { "ls", cmd_ls }, { "screen", screen }, #ifdef notyet { "tape", tape }, Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.4 src/sys/arch/luna68k/stand/boot/samachdep.h:1.5 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.4 Mon Jan 14 01:37:57 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Wed Jan 16 15:15:01 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.4 2013/01/14 01:37:57 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.5 2013/01/16 15:15:01 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -144,6 +144,9 @@ int spl4(void); int spl5(void); int spl6(void); +/* ls.c */ +int cmd_ls(int, char **); + /* machdep.c */ void straytrap(int); int badaddr(volatile void *); Added files: Index: src/sys/arch/luna68k/stand/boot/ls.c diff -u /dev/null src/sys/arch/luna68k/stand/boot/ls.c:1.1 --- /dev/null Wed Jan 16 15:15:02 2013 +++ src/sys/arch/luna68k/stand/boot/ls.c Wed Jan 16 15:15:01 2013 @@ -0,0 +1,53 @@ +/* $NetBSD: ls.c,v 1.1 2013/01/16 15:15:01 tsutsui Exp $ */ + +/* + * Copyright (c) 2001 Minoura Makoto + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, E
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Jan 14 12:28:11 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c device.h Log Message: Use unsigned for device address. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.5 src/sys/arch/luna68k/stand/boot/autoconf.c:1.6 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.5 Mon Jan 14 12:17:17 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Mon Jan 14 12:28:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.5 2013/01/14 12:17:17 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.6 2013/01/14 12:28:11 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -136,8 +136,7 @@ find_controller(struct hp_hw *hw) { struct hp_ctlr *hc; struct hp_ctlr *match_c; - uint8_t *oaddr; - char *addr; + uint8_t *addr, *oaddr; #ifdef DEBUG if (acdebug) @@ -211,8 +210,7 @@ find_device(struct hp_hw *hw) { struct hp_device *hd; struct hp_device *match_d; - uint8_t *oaddr; - char *addr; + uint8_t *addr, *oaddr; #ifdef DEBUG if (acdebug) @@ -489,21 +487,21 @@ find_devs(void) { struct hp_hw *hw = sc_table; - setup_hw(hw, (char *) 0x5100, SIO, "uPD7201A (SIO)"); + setup_hw(hw, (uint8_t *)0x5100, SIO, "uPD7201A (SIO)"); hw++; - setup_hw(hw, (char *) 0x5104, KEYBOARD, "uPD7201A (KBD)"); + setup_hw(hw, (uint8_t *)0x5104, KEYBOARD, "uPD7201A (KBD)"); hw++; - setup_hw(hw, (char *) 0xe100, SCSI, "MB89352 (SPC)"); + setup_hw(hw, (uint8_t *)0xe100, SCSI, "MB89352 (SPC)"); hw++; if (machtype == LUNA_II && !badaddr((void *) 0xe140)) { - setup_hw(hw, (char *) 0xe140, SCSI, "MB89352 (SPC)"); + setup_hw(hw, (uint8_t *)0xe140, SCSI, "MB89352 (SPC)"); hw++; } if (!badaddr((void *) 0xf100)) { - setup_hw(hw, (char *) 0xf100, NET, "Am7990 (LANCE)"); + setup_hw(hw, (uint8_t *)0xf100, NET, "Am7990 (LANCE)"); hw++; } } Index: src/sys/arch/luna68k/stand/boot/device.h diff -u src/sys/arch/luna68k/stand/boot/device.h:1.4 src/sys/arch/luna68k/stand/boot/device.h:1.5 --- src/sys/arch/luna68k/stand/boot/device.h:1.4 Mon Jan 14 12:17:17 2013 +++ src/sys/arch/luna68k/stand/boot/device.h Mon Jan 14 12:28:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.4 2013/01/14 12:17:17 tsutsui Exp $ */ +/* $NetBSD: device.h,v 1.5 2013/01/14 12:28:11 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -80,7 +80,7 @@ struct hp_ctlr { struct driver *hp_driver; int hp_unit; int hp_alive; - char *hp_addr; + uint8_t *hp_addr; int hp_flags; int hp_ipl; }; @@ -91,7 +91,7 @@ struct hp_device { int hp_unit; int hp_ctlr; int hp_slave; - char *hp_addr; + uint8_t *hp_addr; int hp_dk; int hp_flags; int hp_alive; @@ -108,7 +108,7 @@ struct devqueue { }; struct hp_hw { - char *hw_addr; /* physical address of registers */ + uint8_t *hw_addr; /* physical address of registers */ short hw_type; /* type (defined below) */ char *hw_name; /* HP product name */ };
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Jan 14 12:17:17 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c device.h Log Message: Remove hp300 specific select code and use proper hw address to match device. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.4 src/sys/arch/luna68k/stand/boot/autoconf.c:1.5 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.4 Mon Jan 14 11:59:18 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Mon Jan 14 12:17:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.4 2013/01/14 11:59:18 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.5 2013/01/14 12:17:17 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -137,14 +137,14 @@ find_controller(struct hp_hw *hw) struct hp_ctlr *hc; struct hp_ctlr *match_c; uint8_t *oaddr; - int sc; + char *addr; #ifdef DEBUG if (acdebug) printf("find_controller: hw: %s at sc%d (%x), type %x...", hw->hw_name, hw->hw_sc, (u_int)hw->hw_addr, hw->hw_type); #endif - sc = hw->hw_sc; + addr = hw->hw_addr; match_c = NULL; for (hc = hp_cinit; hc->hp_driver; hc++) { if (hc->hp_alive) @@ -158,7 +158,7 @@ find_controller(struct hp_hw *hw) /* * Exact match; all done */ - if ((int)hc->hp_addr == sc) { + if (hc->hp_addr == addr) { match_c = hc; break; } @@ -212,7 +212,7 @@ find_device(struct hp_hw *hw) struct hp_device *hd; struct hp_device *match_d; uint8_t *oaddr; - int sc; + char *addr; #ifdef DEBUG if (acdebug) @@ -226,11 +226,11 @@ find_device(struct hp_hw *hw) /* Must not be a slave */ if (hd->hp_cdriver) continue; - sc = (int) hd->hp_addr; + addr = hd->hp_addr; /* * Exact match; all done. */ - if (sc > 0 && sc == hw->hw_sc) { + if (addr != NULL && addr == hw->hw_addr) { match_d = hd; break; } @@ -238,7 +238,7 @@ find_device(struct hp_hw *hw) * Wildcard; possible match so remember first instance * but continue looking for exact match. */ - if (sc == 0 && same_hw_device(hw, hd) && match_d == NULL) + if (addr == NULL && same_hw_device(hw, hd) && match_d == NULL) match_d = hd; } #ifdef DEBUG @@ -479,9 +479,8 @@ same_hw_device(struct hp_hw *hw, struct return(found); } -#define setup_hw(hw, addr, sc, type, name) \ +#define setup_hw(hw, addr, type, name) \ (hw)->hw_addr = addr; \ - (hw)->hw_sc = sc; \ (hw)->hw_type = type; \ (hw)->hw_name = name @@ -490,21 +489,21 @@ find_devs(void) { struct hp_hw *hw = sc_table; - setup_hw(hw, (char *) 0x5100, 0x5, SIO, "uPD7201A (SIO)"); + setup_hw(hw, (char *) 0x5100, SIO, "uPD7201A (SIO)"); hw++; - setup_hw(hw, (char *) 0x5104, 0x5, KEYBOARD, "uPD7201A (KBD)"); + setup_hw(hw, (char *) 0x5104, KEYBOARD, "uPD7201A (KBD)"); hw++; - setup_hw(hw, (char *) 0xe100, 0xe, SCSI, "MB89352 (SPC)"); + setup_hw(hw, (char *) 0xe100, SCSI, "MB89352 (SPC)"); hw++; if (machtype == LUNA_II && !badaddr((void *) 0xe140)) { - setup_hw(hw, (char *) 0xe140, 0xe, SCSI, "MB89352 (SPC)"); + setup_hw(hw, (char *) 0xe140, SCSI, "MB89352 (SPC)"); hw++; } if (!badaddr((void *) 0xf100)) { - setup_hw(hw, (char *) 0xf100, 0xf, NET, "Am7990 (LANCE)"); + setup_hw(hw, (char *) 0xf100, NET, "Am7990 (LANCE)"); hw++; } } Index: src/sys/arch/luna68k/stand/boot/device.h diff -u src/sys/arch/luna68k/stand/boot/device.h:1.3 src/sys/arch/luna68k/stand/boot/device.h:1.4 --- src/sys/arch/luna68k/stand/boot/device.h:1.3 Mon Jan 14 11:59:18 2013 +++ src/sys/arch/luna68k/stand/boot/device.h Mon Jan 14 12:17:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.3 2013/01/14 11:59:18 tsutsui Exp $ */ +/* $NetBSD: device.h,v 1.4 2013/01/14 12:17:17 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -109,7 +109,6 @@ struct devqueue { struct hp_hw { char *hw_addr; /* physical address of registers */ - short hw_sc; /* select code (if applicable) */ short hw_type; /* type (defined below) */ char *hw_name; /* HP product name */ };
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Jan 14 11:59:18 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c device.h Log Message: Remove unused hw_id and hw_id2 members from device info. They are valid only on hp300. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/autoconf.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.3 src/sys/arch/luna68k/stand/boot/autoconf.c:1.4 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.3 Mon Jan 14 01:37:57 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Mon Jan 14 11:59:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.4 2013/01/14 11:59:18 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -479,11 +479,10 @@ same_hw_device(struct hp_hw *hw, struct return(found); } -#define setup_hw(hw, addr, sc, type, id, name) \ +#define setup_hw(hw, addr, sc, type, name) \ (hw)->hw_addr = addr; \ (hw)->hw_sc = sc; \ (hw)->hw_type = type; \ - (hw)->hw_id = id; \ (hw)->hw_name = name void @@ -491,21 +490,21 @@ find_devs(void) { struct hp_hw *hw = sc_table; - setup_hw(hw, (char *) 0x5100, 0x5, SIO, 0x5, "uPD7201A (SIO)"); - hw->hw_id2 = 0; hw++; + setup_hw(hw, (char *) 0x5100, 0x5, SIO, "uPD7201A (SIO)"); + hw++; - setup_hw(hw, (char *) 0x5104, 0x5, KEYBOARD, 0x5, "uPD7201A (KBD)"); - hw->hw_id2 = 1; hw++; + setup_hw(hw, (char *) 0x5104, 0x5, KEYBOARD, "uPD7201A (KBD)"); + hw++; - setup_hw(hw, (char *) 0xe100, 0xe, SCSI, 0xe, "MB89352 (SPC)"); + setup_hw(hw, (char *) 0xe100, 0xe, SCSI, "MB89352 (SPC)"); hw++; if (machtype == LUNA_II && !badaddr((void *) 0xe140)) { - setup_hw(hw, (char *) 0xe140, 0xe, SCSI, 0xe, "MB89352 (SPC)"); + setup_hw(hw, (char *) 0xe140, 0xe, SCSI, "MB89352 (SPC)"); hw++; } if (!badaddr((void *) 0xf100)) { - setup_hw(hw, (char *) 0xf100, 0xf, NET, 0xf, "Am7990 (LANCE)"); + setup_hw(hw, (char *) 0xf100, 0xf, NET, "Am7990 (LANCE)"); hw++; } } Index: src/sys/arch/luna68k/stand/boot/device.h diff -u src/sys/arch/luna68k/stand/boot/device.h:1.2 src/sys/arch/luna68k/stand/boot/device.h:1.3 --- src/sys/arch/luna68k/stand/boot/device.h:1.2 Sun Jan 13 04:39:28 2013 +++ src/sys/arch/luna68k/stand/boot/device.h Mon Jan 14 11:59:18 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */ +/* $NetBSD: device.h,v 1.3 2013/01/14 11:59:18 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -111,8 +111,6 @@ struct hp_hw { char *hw_addr; /* physical address of registers */ short hw_sc; /* select code (if applicable) */ short hw_type; /* type (defined below) */ - short hw_id; /* HW returned id */ - short hw_id2; /* secondary HW id (displays) */ char *hw_name; /* HP product name */ };
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Mon Jan 14 01:37:58 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c ioconf.c samachdep.h sc.c sd.c ufs_disksubr.c version Log Message: Fix drivers to make secondary SPC SCSI on LUNA-II work properly. Also bump version. Now we can load a NetBSD kernel from external SCSI disks on LUNA-II. (and netboot on LUNA-II also works) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/autoconf.c \ src/sys/arch/luna68k/stand/boot/ioconf.c \ src/sys/arch/luna68k/stand/boot/sc.c src/sys/arch/luna68k/stand/boot/sd.c \ src/sys/arch/luna68k/stand/boot/version cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/ufs_disksubr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.2 src/sys/arch/luna68k/stand/boot/autoconf.c:1.3 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.2 Sat Jan 12 13:39:47 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Mon Jan 14 01:37:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.2 2013/01/12 13:39:47 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -80,6 +80,7 @@ #include #include +#include #include #include #include @@ -499,6 +500,10 @@ find_devs(void) setup_hw(hw, (char *) 0xe100, 0xe, SCSI, 0xe, "MB89352 (SPC)"); hw++; + if (machtype == LUNA_II && !badaddr((void *) 0xe140)) { + setup_hw(hw, (char *) 0xe140, 0xe, SCSI, 0xe, "MB89352 (SPC)"); + hw++; + } if (!badaddr((void *) 0xf100)) { setup_hw(hw, (char *) 0xf100, 0xf, NET, 0xf, "Am7990 (LANCE)"); hw++; Index: src/sys/arch/luna68k/stand/boot/ioconf.c diff -u src/sys/arch/luna68k/stand/boot/ioconf.c:1.2 src/sys/arch/luna68k/stand/boot/ioconf.c:1.3 --- src/sys/arch/luna68k/stand/boot/ioconf.c:1.2 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/ioconf.c Mon Jan 14 01:37:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ioconf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */ +/* $NetBSD: ioconf.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -86,6 +86,7 @@ extern struct driver stdriver; struct hp_ctlr hp_cinit[] = { /* driver, unit, alive, addr, flags */ { &scdriver, 0, 0, C 0x0, 0x0 }, + { &scdriver, 1, 0, C 0x0, 0x0 }, {0}, }; @@ -93,6 +94,8 @@ struct hp_device hp_dinit[] = { /*driver, cdriver, unit, ctlr, slave, addr, dk, flags*/ { &sddriver, &scdriver, 0, 0, 6, C 0x0, 1, 0x0 }, { &sddriver, &scdriver, 1, 0, 5, C 0x0, 1, 0x0 }, +{ &sddriver, &scdriver, 2, 1, 6, C 0x0, 1, 0x0 }, +{ &sddriver, &scdriver, 3, 1, 5, C 0x0, 1, 0x0 }, { &ledriver, NULL, 0, 0, 0, C 0x0, 0, 0x0 }, #ifdef notyet { &stdriver, &scdriver, 0, 0, 4, C 0x0, 0, 0x0 }, Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.2 src/sys/arch/luna68k/stand/boot/sc.c:1.3 --- src/sys/arch/luna68k/stand/boot/sc.c:1.2 Sun Jan 13 04:39:28 2013 +++ src/sys/arch/luna68k/stand/boot/sc.c Mon Jan 14 01:37:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -76,7 +76,7 @@ */ -#define NSC 1 +#define NSC 2 #include #include @@ -111,7 +111,14 @@ int scinit(void *arg) { struct hp_ctlr *hc = arg; - struct scsi_softc *hs = &scsi_softc[hc->hp_unit]; + struct scsi_softc *hs; + int unit; + + unit = hc->hp_unit; + if (unit < 0 || unit >= NSC) + return 0; + + hs = &scsi_softc[unit]; hc->hp_ipl= SCSI_IPL; hs->sc_hc = hc; Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.2 src/sys/arch/luna68k/stand/boot/sd.c:1.3 --- src/sys/arch/luna68k/stand/boot/sd.c:1.2 Sun Jan 13 04:39:28 2013 +++ src/sys/arch/luna68k/stand/boot/sd.c Mon Jan 14 01:37:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */ +/* $NetBSD: sd.c,v 1.3 2013/01/14 01:37:57 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -252,7 +252,7 @@ sdinit(void *arg) /* * read disklabel */ - msg = readdisklabel(hd->hp_slave, sdstrategy, lp); + msg = readdisklabel(hd->hp_ctlr, hd->hp_slave, lp); if (msg != NULL) printf("sd%d: %s\n", hd->hp_unit, msg); Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.2 src/sys/arch/luna68k/stand/boot/version:1.3 --- src/sys/arch/luna68k/stand/boot/version:1.2 Sun Jan 13 14:10:55 2013 +++ src/sys/arch/luna68k/stand/boot/version Mon Jan 14 01:37:57 2013 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ +$NetBSD: version,v 1.3 2
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 13 14:10:55 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile conf.c devopen.c init_main.c ioconf.c locore.S samachdep.h version Added Files: src/sys/arch/luna68k/stand/boot: getsecs.c if_le.c lance.c lance.h Log Message: Add netboot support. Based on ews4800mips, mvme68k, and x68k standalone drivers. Also bump version. Tested on LUNA-I. XXX: We really need proper documents about libsa APIs. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/luna68k/stand/boot/Makefile cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/conf.c \ src/sys/arch/luna68k/stand/boot/devopen.c \ src/sys/arch/luna68k/stand/boot/ioconf.c \ src/sys/arch/luna68k/stand/boot/version cvs rdiff -u -r0 -r1.1 src/sys/arch/luna68k/stand/boot/getsecs.c \ src/sys/arch/luna68k/stand/boot/if_le.c \ src/sys/arch/luna68k/stand/boot/lance.c \ src/sys/arch/luna68k/stand/boot/lance.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.4 src/sys/arch/luna68k/stand/boot/Makefile:1.5 --- src/sys/arch/luna68k/stand/boot/Makefile:1.4 Thu Jan 10 15:51:32 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Sun Jan 13 14:10:55 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2013/01/10 15:51:32 tsutsui Exp $ +# $NetBSD: Makefile,v 1.5 2013/01/13 14:10:55 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -7,16 +7,18 @@ NOMAN= # defined .include S= ${.CURDIR}/../../../.. +LIBSADIR= ${S}/lib/libsa CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch CPPFLAGS+= -DSUPPORT_DISK #CPPFLAGS+= -DSUPPORT_TAPE -#CPPFLAGS+= -DSUPPORT_ETHERNET -#CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOTP +CPPFLAGS+= -DSUPPORT_ETHERNET +CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOTP #CPPFLAGS+= -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG #CPPFLAGS+= -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID +CPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT CFLAGS= -Os -msoft-float CFLAGS+= -ffreestanding @@ -45,6 +47,11 @@ SRCS+= disklabel.c #SRCS+= fsdump.c SRCS+= ufs_disksubr.c +# netboot support +SRCS+= if_le.c lance.c getsecs.c +.PATH: ${LIBSADIR} +SRCS+= dev_net.c + PROG= boot NEWVERSWHAT= "${PROG}" Index: src/sys/arch/luna68k/stand/boot/conf.c diff -u src/sys/arch/luna68k/stand/boot/conf.c:1.1 src/sys/arch/luna68k/stand/boot/conf.c:1.2 --- src/sys/arch/luna68k/stand/boot/conf.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/conf.c Sun Jan 13 14:10:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: conf.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: conf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -56,6 +57,10 @@ #define netstrategy xxstrategy #define netopen xxopen #define netclose xxclose +#else +#define netstrategy net_strategy +#define netopen net_open +#define netclose net_close #endif #define netioctl noioctl @@ -76,8 +81,9 @@ struct devsw devsw[] = { int ndevs = __arraycount(devsw); #ifdef SUPPORT_ETHERNET +extern struct netif_driver le_netif_driver; struct netif_driver *netif_drivers[] = { - &le_driver, + &le_netif_driver, }; int n_netif_drivers = __arraycount(netif_drivers); #endif Index: src/sys/arch/luna68k/stand/boot/devopen.c diff -u src/sys/arch/luna68k/stand/boot/devopen.c:1.1 src/sys/arch/luna68k/stand/boot/devopen.c:1.2 --- src/sys/arch/luna68k/stand/boot/devopen.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/devopen.c Sun Jan 13 14:10:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: devopen.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -101,6 +101,13 @@ devopen(struct open_file *f, const char } file_system[0] = file_system_ufs[0]; +#ifdef SUPPORT_ETHERNET + if (strcmp(dp->dv_name, "le") == 0) { + /* XXX mixing local fs_ops on netboot could be troublesome */ + file_system[0] = file_system_nfs[0]; + } +#endif + f->f_dev = dp; return 0; Index: src/sys/arch/luna68k/stand/boot/ioconf.c diff -u src/sys/arch/luna68k/stand/boot/ioconf.c:1.1 src/sys/arch/luna68k/stand/boot/ioconf.c:1.2 --- src/sys/arch/luna68k/stand/boot/ioconf.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/ioconf.c Sun Jan 13 14:10:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ioconf.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: ioconf.c,v 1.2 2013/01/13 14:10:55 tsutsui Exp $ */ /*
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Jan 13 04:39:28 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: device.h sc.c sd.c Log Message: Remove unused function members from struct driver. This makes adding other drivers easier. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/device.h \ src/sys/arch/luna68k/stand/boot/sc.c src/sys/arch/luna68k/stand/boot/sd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/device.h diff -u src/sys/arch/luna68k/stand/boot/device.h:1.1 src/sys/arch/luna68k/stand/boot/device.h:1.2 --- src/sys/arch/luna68k/stand/boot/device.h:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/device.h Sun Jan 13 04:39:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: device.h,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: device.h,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -73,10 +73,7 @@ struct driver { int (*d_init)(void *); char *d_name; - int (*d_start)(void); - int (*d_go)(void); int (*d_intr)(void); - int (*d_done)(void); }; struct hp_ctlr { Index: src/sys/arch/luna68k/stand/boot/sc.c diff -u src/sys/arch/luna68k/stand/boot/sc.c:1.1 src/sys/arch/luna68k/stand/boot/sc.c:1.2 --- src/sys/arch/luna68k/stand/boot/sc.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/sc.c Sun Jan 13 04:39:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sc.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: sc.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -96,12 +96,9 @@ static void ixfer_in(struct scsidevice * static int scrun(int, int, u_char *, int, u_char *, int, volatile int *); static int scfinish(int); static void scabort(struct scsi_softc *, struct scsidevice *); -static int scstart(void); -static int scgo(void); -static int scdone(void); struct driver scdriver = { - scinit, "sc", scstart, scgo, scintr, scdone + scinit, "sc", scintr, }; struct scsi_softc scsi_softc[NSC]; @@ -523,32 +520,6 @@ scsi_format_unit(int ctlr, int slave, in /* - * - */ - -int -scstart(void) -{ - - return 0; -} - -int -scgo(void) -{ - - return 0; -} - -int -scdone(void) -{ - - return 0; -} - - -/* * Interrupt Routine */ Index: src/sys/arch/luna68k/stand/boot/sd.c diff -u src/sys/arch/luna68k/stand/boot/sd.c:1.1 src/sys/arch/luna68k/stand/boot/sd.c:1.2 --- src/sys/arch/luna68k/stand/boot/sd.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/sd.c Sun Jan 13 04:39:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sd.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: sd.c,v 1.2 2013/01/13 04:39:28 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -106,13 +106,10 @@ struct sd_devdata { }; static int sdinit(void *); -static int sdstart(void); -static int sdgo(void); -static int sdintr(void); static int sdident(struct sd_softc *, struct hp_device *); struct driver sddriver = { - sdinit, "sd", sdstart, sdgo, sdintr, + sdinit, "sd", NULL, }; struct sd_softc sd_softc[NSD]; @@ -364,27 +361,6 @@ sdstrategy(void *devdata, int func, dadd return 0; } -int -sdstart(void) -{ - - return 0; -} - -int -sdgo(void) -{ - - return 0; -} - -int -sdintr(void) -{ - - return 0; -} - #if 0 int sdread(dev_t dev, u_int blk, u_int nblk, u_char *buff, u_int len)
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 12 13:39:47 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: autoconf.c Log Message: Fix warnings on DEBUG build. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/autoconf.c diff -u src/sys/arch/luna68k/stand/boot/autoconf.c:1.1 src/sys/arch/luna68k/stand/boot/autoconf.c:1.2 --- src/sys/arch/luna68k/stand/boot/autoconf.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/autoconf.c Sat Jan 12 13:39:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.2 2013/01/12 13:39:47 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -117,7 +117,7 @@ configure(void) #ifdef DEBUG if (!found) { printf("unconfigured %s ", hw->hw_name); - printf("at 0x%x\n", hw->hw_addr); + printf("at 0x%x\n", (u_int)hw->hw_addr); } #endif } @@ -141,7 +141,7 @@ find_controller(struct hp_hw *hw) #ifdef DEBUG if (acdebug) printf("find_controller: hw: %s at sc%d (%x), type %x...", - hw->hw_name, hw->hw_sc, hw->hw_addr, hw->hw_type); + hw->hw_name, hw->hw_sc, (u_int)hw->hw_addr, hw->hw_type); #endif sc = hw->hw_sc; match_c = NULL; @@ -216,7 +216,7 @@ find_device(struct hp_hw *hw) #ifdef DEBUG if (acdebug) printf("find_device: hw: %s at sc%d (%x), type %x...", - hw->hw_name, hw->hw_sc, hw->hw_addr, hw->hw_type); + hw->hw_name, hw->hw_sc, (u_int)hw->hw_addr, hw->hw_type); #endif match_d = NULL; for (hd = hp_dinit; hd->hp_driver; hd++) {
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 12 07:12:00 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: init_main.c locore.S samachdep.h Log Message: Check cputype and set machine type (LUNA-I or LUNA-II). Tested on only LUNA-I for now. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/samachdep.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.1 src/sys/arch/luna68k/stand/boot/init_main.c:1.2 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/init_main.c Sat Jan 12 07:11:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: init_main.c,v 1.2 2013/01/12 07:11:59 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -82,7 +82,8 @@ static int get_plane_numbers(void); static int reorder_dipsw(int); -int cpuspeed; +int cpuspeed; /* for DELAY() macro */ +int machtype; #define VERS_LOCAL "Phase-31" @@ -109,11 +110,20 @@ void main(void) { int i, status = 0; + const char *machstr; /* * Initialize the console before we print anything out. */ - cpuspeed = MHZ_25;/* for DELAY() macro */ + if (cputype == CPU_68030) { + machtype = LUNA_I; + machstr = "LUNA-I"; + cpuspeed = MHZ_25; + } else { + machtype = LUNA_II; + machstr = "LUNA-II"; + cpuspeed = MHZ_25 * 2; /* XXX */ + } nplane = get_plane_numbers(); @@ -129,6 +139,7 @@ main(void) kiff->plane = nplane; i = (int) kiff->maxaddr + 1; + printf("Machine model = %s\n", machstr); printf("Physical Memory = 0x%x ", i); i >>= 20; printf("(%d MB)\n", i); Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.1 src/sys/arch/luna68k/stand/boot/samachdep.h:1.2 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Sat Jan 12 07:11:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: samachdep.h,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: samachdep.h,v 1.2 2013/01/12 07:11:59 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -109,6 +109,7 @@ int getline(char *, char *); /* init_main.c */ extern int nplane; +extern int machtype; /* kbd.c */ int kbd_decode(u_char); @@ -116,6 +117,7 @@ int kbd_decode(u_char); /* locore.S */ extern u_int bootdev; extern int dipsw1, dipsw2; +extern int cputype; int setjmp(label_t *); int splhigh(void); void splx(int); Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.2 src/sys/arch/luna68k/stand/boot/locore.S:1.3 --- src/sys/arch/luna68k/stand/boot/locore.S:1.2 Thu Jan 10 16:03:49 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Sat Jan 12 07:11:59 2013 @@ -242,6 +242,28 @@ Lbssclr: andl #0xFF,%d0 movl %d0,_C_LABEL(dipsw2) +/* determine our CPU */ + + /* XXX should be generated via assym.h */ + CACHE_OFF = 0x0808 + DC_FREEZE = 0x0200 + CPU_68030 = 1 + CPU_68040 = 2 + + movl #CACHE_OFF,%d0 + movc %d0,%cacr | clear and disable on-chip cache(s) + movl #DC_FREEZE,%d0 | data freeze bit + movc %d0,%cacr | only exists on 68030 + movc %cacr,%d0 | read it back + tstl %d0 | zero? + jeq Lnot68030 | yes, we have 68040 + movl #CPU_68030,%d0 + jra Lstart0 +Lnot68030: + movl #CPU_68040,%d0 +Lstart0: + movl %d0,_C_LABEL(cputype) + /* final setup for C code */ movw #PSL_LOWIPL,%sr | no interrupts jsr _C_LABEL(main) | lets go @@ -750,3 +772,6 @@ GLOBAL(dipsw1) GLOBAL(dipsw2) .long 0 + +GLOBAL(cputype) + .long CPU_68030
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Sat Jan 12 07:04:58 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: sio.c sioreg.h Log Message: Make sure to enable DTR and RTS on TX initialization for SIO console. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/sio.c \ src/sys/arch/luna68k/stand/boot/sioreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/sio.c diff -u src/sys/arch/luna68k/stand/boot/sio.c:1.1 src/sys/arch/luna68k/stand/boot/sio.c:1.2 --- src/sys/arch/luna68k/stand/boot/sio.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/sio.c Sat Jan 12 07:04:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sio.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: sio.c,v 1.2 2013/01/12 07:04:57 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -220,7 +220,7 @@ sioinit(void) sioreg(REG(0, WR0), WR0_RSTINT); /* Reset E/S Interrupt */ sioreg(REG(0, WR4), WR4_BAUD96 | WR4_STOP1 | WR4_NPARITY); /* Tx/Rx */ sioreg(REG(0, WR3), WR3_RX8BIT | WR3_RXENBL); /* Rx */ - sioreg(REG(0, WR5), WR5_TX8BIT | WR5_TXENBL); /* Tx */ + sioreg(REG(0, WR5), WR5_TX8BIT | WR5_TXENBL | WR5_DTR | WR5_RTS); /* Tx */ sioreg(REG(0, WR0), WR0_RSTINT); /* Reset E/S Interrupt */ sioreg(REG(0, WR1), WR1_RXALLS); /* Interrupted All Char. */ Index: src/sys/arch/luna68k/stand/boot/sioreg.h diff -u src/sys/arch/luna68k/stand/boot/sioreg.h:1.1 src/sys/arch/luna68k/stand/boot/sioreg.h:1.2 --- src/sys/arch/luna68k/stand/boot/sioreg.h:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/sioreg.h Sat Jan 12 07:04:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sioreg.h,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: sioreg.h,v 1.2 2013/01/12 07:04:57 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -153,13 +153,14 @@ struct siodevice { #define WR4_BAUD24 0xc0 /* Clock Rate (2400 BAUD) */ #define WR5_TXCRC 0x01 /* Tx CRC Check */ -#define WR5_REQSND 0x02 /* Request To Send (LOW) */ +#define WR5_RTS 0x02 /* Request To Send [RTS] */ #define WR5_TXENBL 0x08 /* Transmit Enable */ #define WR5_BREAK 0x10 /* Send Break */ #define WR5_TX5BIT 0x00 /* Tx Bits/Character: 5 Bits */ #define WR5_TX7BIT 0x20 /* Tx Bits/Character: 7 Bits */ #define WR5_TX6BIT 0x40 /* Tx Bits/Character: 6 Bits */ #define WR5_TX8BIT 0x60 /* Tx Bits/Character: 8 Bits */ +#define WR5_DTR 0x80 /* Data Terminal Ready [DTR] */ #define RR0_RXAVAIL 0x01 /* Rx Character Available */ #define RR0_INTRPEND 0x02 /* Interrupt Pending (Channel-A Only) */
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 10 16:20:11 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: disklabel.c omron_disklabel.h Log Message: Make "disklabel" command print correct disklabel info. - use exact-width interger types to define on-disk format (daddr_t could be a different size) - use proper LABELOFFSET to locate BSD disklabel (LABELOFFSET for luna68k is 64 as 4.4BSD-Lite2 while other ports that use sun_disklabel use 128) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/disklabel.c \ src/sys/arch/luna68k/stand/boot/omron_disklabel.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/disklabel.c diff -u src/sys/arch/luna68k/stand/boot/disklabel.c:1.1 src/sys/arch/luna68k/stand/boot/disklabel.c:1.2 --- src/sys/arch/luna68k/stand/boot/disklabel.c:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/disklabel.c Thu Jan 10 16:20:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: disklabel.c,v 1.2 2013/01/10 16:20:11 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -112,7 +112,7 @@ int disklabel(int argc, char *argv[]) { struct scd_dk_label *omp = (struct scd_dk_label *) lbl_buff; - struct disklabel*bp = (struct disklabel *)omp->dkl_pad; + struct disklabel*bp = (struct disklabel *)&lbl_buff[LABELOFFSET]; struct fs *fp = (struct fs *) lbl_buff; u_short *p; u_long chksum, count; @@ -147,7 +147,7 @@ disklabel(int argc, char *argv[]) printf("Offset = %d\n", i); printf("\n"); printf("Checksum of Bad Track:\t0x%x\n", omp->dkl_badchk); - printf("Logical Block Total:\t%lu(0x%lx)\n", omp->dkl_maxblk, omp->dkl_maxblk); + printf("Logical Block Total:\t%u(0x%x)\n", omp->dkl_maxblk, omp->dkl_maxblk); printf("Disk Drive Type:\t0x%x\n", omp->dkl_dtype); printf("Number of Disk Drives:\t%d(0x%x)\n", omp->dkl_ndisk, omp->dkl_ndisk); printf("Number of Data Cylinders:\t%d(0x%x)\n", omp->dkl_ncyl, omp->dkl_ncyl); @@ -162,8 +162,8 @@ disklabel(int argc, char *argv[]) printf("Physical Partition Number:\t%d(0x%x)\n", omp->dkl_ppart, omp->dkl_ppart); for (i = 0; i < NLPART; i++) - printf("\t%d:\t%ld\t%ld\n", i, - (long)omp->dkl_map[i].dkl_blkno, (long)omp->dkl_map[i].dkl_nblk); + printf("\t%d:\t%d\t%d\n", i, + omp->dkl_map[i].dkl_blkno, omp->dkl_map[i].dkl_nblk); printf("Identifies This Label Format:\t0x%x\n", omp->dkl_magic); printf("XOR Checksum of Sector:\t0x%x\n", omp->dkl_cksum); } else if (!strcmp(argv[1], "checksum")) { Index: src/sys/arch/luna68k/stand/boot/omron_disklabel.h diff -u src/sys/arch/luna68k/stand/boot/omron_disklabel.h:1.1 src/sys/arch/luna68k/stand/boot/omron_disklabel.h:1.2 --- src/sys/arch/luna68k/stand/boot/omron_disklabel.h:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/omron_disklabel.h Thu Jan 10 16:20:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: omron_disklabel.h,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: omron_disklabel.h,v 1.2 2013/01/10 16:20:11 tsutsui Exp $ */ /* * Copyright (c) 1992 OMRON Corporation. @@ -80,20 +80,20 @@ struct scd_dk_label { char dkl_asciilabel[128]; /* for compatibility */ char dkl_pad[512-(128+8*8+11*2+4)]; - unsigned short dkl_badchk; /* checksum of bad track */ - unsigned long dkl_maxblk; /* # of total logical block */ - unsigned short dkl_dtype; /* disk drive type */ - unsigned short dkl_ndisk; /* # of disk drives */ - unsigned short dkl_ncyl; /* # of data cylinders */ - unsigned short dkl_acyl; /* # of alternate cylinders */ - unsigned short dkl_nhead; /* # of heads in this partition */ - unsigned short dkl_nsect; /* # of 512 byte sectors per track */ - unsigned short dkl_bhead; /* identifies proper label locations */ - unsigned short dkl_ppart; /* physical partition # */ + uint16_t dkl_badchk; /* checksum of bad track */ + uint32_t dkl_maxblk; /* # of total logical block */ + uint16_t dkl_dtype; /* disk drive type */ + uint16_t dkl_ndisk; /* # of disk drives */ + uint16_t dkl_ncyl; /* # of data cylinders */ + uint16_t dkl_acyl; /* # of alternate cylinders */ + uint16_t dkl_nhead; /* # of heads in this partition */ + uint16_t dkl_nsect; /* # of 512 byte sectors per track */ + uint16_t dkl_bhead; /* identifies proper label locations */ + uint16_t dkl_ppart; /* physical partition # */ struct dk_map {/* logical partitions */ - daddr_t dkl_blkno; /* starting block */ - daddr_t dkl_nblk; /* number of blocks */ + int32_t dkl_blkno; /* starting block */ + int32_t dkl_nblk; /* number of blocks */ } dkl_map[NLPART]; - unsigned short dkl_magic; /* identifies this label format */ - unsigned short dkl_cksum; /* xor checksum of sector */ + uint16_t dkl_magic; /* identifies this label format */ + uint16_t dkl_cksum; /* xo
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 10 16:03:49 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: locore.S Log Message: Use proper asm symbol macro. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/locore.S diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.1 src/sys/arch/luna68k/stand/boot/locore.S:1.2 --- src/sys/arch/luna68k/stand/boot/locore.S:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/locore.S Thu Jan 10 16:03:49 2013 @@ -102,82 +102,83 @@ .text - .globl Reset - .globl _buserr,_addrerr - .globl _illinst,_zerodiv,_chkinst,_trapvinst,_privinst - .globl _lev6intr,_lev5intr,_lev3intr,_lev2intr,_badtrap - ASENTRY_NOPROFILE(start) -Reset: +ASGLOBAL(Reset) jmp _C_LABEL(start1) /* 0: NOT USED (reset PC) */ .word 0 /* 1: NOT USED (reset PC) */ - .long _buserr /* 2: bus error */ - .long _addrerr /* 3: address error */ - .long _illinst /* 4: illegal instruction */ - .long _zerodiv /* 5: zero divide */ - .long _chkinst /* 6: CHK instruction */ - .long _trapvinst /* 7: TRAPV instruction */ - .long _privinst /* 8: privilege violation */ - .long _badtrap /* 9: trace */ - .long _illinst /* 10: line 1010 emulator */ - .long _illinst /* 11: line emulator */ - .long _badtrap /* 12: unassigned, reserved */ - .long _coperr /* 13: coprocessor protocol violation */ - .long _fmterr /* 14: format error */ - .long _badtrap /* 15: uninitialized interrupt vector */ - .long _badtrap /* 16: unassigned, reserved */ - .long _badtrap /* 17: unassigned, reserved */ - .long _badtrap /* 18: unassigned, reserved */ - .long _badtrap /* 19: unassigned, reserved */ - .long _badtrap /* 20: unassigned, reserved */ - .long _badtrap /* 21: unassigned, reserved */ - .long _badtrap /* 22: unassigned, reserved */ - .long _badtrap /* 23: unassigned, reserved */ - .long _badtrap /* 24: spurious interrupt */ - .long _badtrap /* 25: level 1 interrupt autovector */ - .long _lev2intr /* 26: level 2 interrupt autovector */ - .long _lev3intr /* 27: level 3 interrupt autovector */ - .long _badtrap /* 28: level 4 interrupt autovector */ - .long _lev5intr /* 29: level 5 interrupt autovector */ - .long _lev6intr /* 30: level 6 interrupt autovector */ - .long _badtrap /* 31: level 7 interrupt autovector */ - .long _illinst /* 32: syscalls */ - .long _illinst /* 33: sigreturn syscall or breakpoint */ - .long _illinst /* 34: breakpoint or sigreturn syscall */ - .long _illinst /* 35: TRAP instruction vector */ - .long _illinst /* 36: TRAP instruction vector */ - .long _illinst /* 37: TRAP instruction vector */ - .long _illinst /* 38: TRAP instruction vector */ - .long _illinst /* 39: TRAP instruction vector */ - .long _illinst /* 40: TRAP instruction vector */ - .long _illinst /* 41: TRAP instruction vector */ - .long _illinst /* 42: TRAP instruction vector */ - .long _illinst /* 43: TRAP instruction vector */ - .long _illinst /* 44: TRAP instruction vector */ - .long _illinst /* 45: TRAP instruction vector */ - .long _illinst /* 46: TRAP instruction vector */ - .long _illinst /* 47: TRAP instruction vector */ - .long _fptrap /* 48: FPCP branch/set on unordered cond */ - .long _fptrap /* 49: FPCP inexact result */ - .long _fptrap /* 50: FPCP divide by zero */ - .long _fptrap /* 51: FPCP underflow */ - .long _fptrap /* 52: FPCP operand error */ - .long _fptrap /* 53: FPCP overflow */ - .long _fptrap /* 54: FPCP signalling NAN */ - - .long _badtrap /* 55: unassigned, reserved */ - .long _badtrap /* 56: unassigned, reserved */ - .long _badtrap /* 57: unassigned, reserved */ - .long _badtrap /* 58: unassigned, reserved */ - .long _badtrap /* 59: unassigned, reserved */ - .long _badtrap /* 60: unassigned, reserved */ - .long _badtrap /* 61: unassigned, reserved */ - .long _badtrap /* 62: unassigned, reserved */ - .long _badtrap /* 63: unassigned, reserved */ -#define BADTRAP16 .long _badtrap,_badtrap,_badtrap,_badtrap,\ -_badtrap,_badtrap,_badtrap,_badtrap,\ -_badtrap,_badtrap,_badtrap,_badtrap,\ -_badtrap,_badtrap,_badtrap,_badtrap + VECTOR(buserr) /* 2: bus error */ + VECTOR(addrerr) /* 3: address error */ + VECTOR(illinst) /* 4: illegal instruction */ + VECTOR(zerodiv) /* 5: zero divide */ + VECTOR(chkinst) /* 6: CHK instruction */ + VECTOR(trapvinst) /* 7: TRAPV instruction */ + VECTOR(privinst) /* 8: privilege violation */ + VECTOR(badtrap) /* 9: trace */ + VECTOR(illinst) /* 10: line 1010 emulator */ + VECTOR(illinst) /* 11: line emulator */ + VECTOR(badtrap) /* 12: unassigned, reserved */ + VECTOR(coperr) /* 13: coprocessor protocol violation */ + VECTOR(fmterr) /* 14: format error */ + VECTOR(badtrap) /* 15: uninitialized interrupt vector */ + VECTOR(badtrap) /* 16: unassigned, reserved */ + VECTOR(badtrap)
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 10 15:51:32 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile boot.ldscript Log Message: Revert to using elf2aout(1) to build a.out binary. a.out binary linked by ldscript doesn't work on some uncertain conditions. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/luna68k/stand/boot/Makefile cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/boot.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.3 src/sys/arch/luna68k/stand/boot/Makefile:1.4 --- src/sys/arch/luna68k/stand/boot/Makefile:1.3 Thu Jan 10 13:10:26 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Thu Jan 10 15:51:32 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2013/01/10 13:10:26 tsutsui Exp $ +# $NetBSD: Makefile,v 1.4 2013/01/10 15:51:32 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -73,10 +73,11 @@ vers.c: ${.CURDIR}/version ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT} ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS} - ${LD} ${LINKFORMAT} -x -o ${PROG}.aout ${OBJS} ${LIBS} + ${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS} + ${ELF2AOUT} ${PROG}.elf ${PROG}.aout mv ${PROG}.aout ${PROG} -CLEANFILES+= ${PROG}.aout +CLEANFILES+= ${PROG}.aout ${PROG}.elf cleandir distclean: .WAIT cleanlibdir Index: src/sys/arch/luna68k/stand/boot/boot.ldscript diff -u src/sys/arch/luna68k/stand/boot/boot.ldscript:1.2 src/sys/arch/luna68k/stand/boot/boot.ldscript:1.3 --- src/sys/arch/luna68k/stand/boot/boot.ldscript:1.2 Thu Jan 10 13:10:26 2013 +++ src/sys/arch/luna68k/stand/boot/boot.ldscript Thu Jan 10 15:51:32 2013 @@ -1,6 +1,6 @@ -/* $NetBSD: boot.ldscript,v 1.2 2013/01/10 13:10:26 tsutsui Exp $ */ +/* $NetBSD: boot.ldscript,v 1.3 2013/01/10 15:51:32 tsutsui Exp $ */ -OUTPUT_FORMAT("a.out-m68k-netbsd") +OUTPUT_FORMAT("elf32-m68k") OUTPUT_ARCH(m68k) ENTRY(start) SECTIONS @@ -45,6 +45,4 @@ SECTIONS _end = .; _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; PROVIDE (end = .); - - /DISCARD/ : { *(.ident) *(.stab) *(.stabstr) *(.comment) } }
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Thu Jan 10 13:10:26 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile boot.ldscript Log Message: Link the target boot binary as a.out directly rather than using elf2aout(1). Confirmed working on LUNA-I. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/Makefile cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/boot.ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.2 src/sys/arch/luna68k/stand/boot/Makefile:1.3 --- src/sys/arch/luna68k/stand/boot/Makefile:1.2 Wed Jan 9 16:28:41 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Thu Jan 10 13:10:26 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2013/01/09 16:28:41 tsutsui Exp $ +# $NetBSD: Makefile,v 1.3 2013/01/10 13:10:26 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -73,11 +73,10 @@ vers.c: ${.CURDIR}/version ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT} ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS} - ${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS} - ${ELF2AOUT} ${PROG}.elf ${PROG}.aout + ${LD} ${LINKFORMAT} -x -o ${PROG}.aout ${OBJS} ${LIBS} mv ${PROG}.aout ${PROG} -CLEANFILES+= ${PROG}.map ${PROG}.elf ${PROG}.gz +CLEANFILES+= ${PROG}.aout cleandir distclean: .WAIT cleanlibdir Index: src/sys/arch/luna68k/stand/boot/boot.ldscript diff -u src/sys/arch/luna68k/stand/boot/boot.ldscript:1.1 src/sys/arch/luna68k/stand/boot/boot.ldscript:1.2 --- src/sys/arch/luna68k/stand/boot/boot.ldscript:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/boot.ldscript Thu Jan 10 13:10:26 2013 @@ -1,6 +1,6 @@ -/* $NetBSD: boot.ldscript,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */ +/* $NetBSD: boot.ldscript,v 1.2 2013/01/10 13:10:26 tsutsui Exp $ */ -OUTPUT_FORMAT("elf32-m68k") +OUTPUT_FORMAT("a.out-m68k-netbsd") OUTPUT_ARCH(m68k) ENTRY(start) SECTIONS @@ -45,4 +45,6 @@ SECTIONS _end = .; _bss_end__ = . ; __bss_end__ = . ; __end__ = . ; PROVIDE (end = .); + + /DISCARD/ : { *(.ident) *(.stab) *(.stabstr) *(.comment) } }
CVS commit: src/sys/arch/luna68k/stand/boot
Module Name:src Committed By: tsutsui Date: Wed Jan 9 16:28:41 UTC 2013 Modified Files: src/sys/arch/luna68k/stand/boot: Makefile Log Message: Make sure to print proper bootprog name in banner. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/luna68k/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/luna68k/stand/boot/Makefile diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.1 src/sys/arch/luna68k/stand/boot/Makefile:1.2 --- src/sys/arch/luna68k/stand/boot/Makefile:1.1 Sat Jan 5 17:44:24 2013 +++ src/sys/arch/luna68k/stand/boot/Makefile Wed Jan 9 16:28:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ +# $NetBSD: Makefile,v 1.2 2013/01/09 16:28:41 tsutsui Exp $ # @(#)Makefile 8.2 (Berkeley) 8/15/93 NOMAN= # defined @@ -47,6 +47,8 @@ SRCS+= ufs_disksubr.c PROG= boot +NEWVERSWHAT= "${PROG}" + SRCS+= vers.c CLEANFILES+=vers.c @@ -68,7 +70,7 @@ LIBS= ${SALIB} ${ZLIB} ${KERNLIB} .PHONY: vers.c vers.c: ${.CURDIR}/version ${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \ - ${.CURDIR}/version "${MACHINE}" + ${.CURDIR}/version ${MACHINE} ${NEWVERSWHAT} ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS} ${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}