Merge contents of filesystem.c into conf.c, and remove declaration of

errno from conf.c and put it in boot.c.
This commit is contained in:
simonb 1999-03-14 00:57:06 +00:00
parent 35d517b9f1
commit e4dd1abb05
6 changed files with 36 additions and 118 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.10 1999/02/22 07:17:44 simonb Exp $ */
/* $NetBSD: conf.c,v 1.11 1999/03/14 00:57:07 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -45,10 +45,13 @@
#include <rz.h>
const struct callback *callv = &callvec;
int errno;
extern void nullsys();
extern int nodev(), noioctl();
#ifdef UFS_NOCLOSE
#define ufs_close 0
#endif
#ifdef UFS_NOWRITE
#define ufs_write 0
#endif
#ifdef SMALL
#define rzclose /*(()(struct open_file*))*/0
@ -62,3 +65,9 @@ struct devsw devsw[] = {
};
int ndevs = (sizeof(devsw)/sizeof(devsw[0]));
struct fs_ops file_system[] = {
{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat }
};
int nfsys = sizeof(file_system)/sizeof(struct fs_ops);

View File

@ -1,10 +1,10 @@
# $NetBSD: Makefile,v 1.6 1999/02/24 13:54:54 simonb Exp $
# $NetBSD: Makefile,v 1.7 1999/03/14 00:57:06 simonb Exp $
# @(#)Makefile 8.3 (Berkeley) 2/16/94
S= ${.CURDIR}/../../../..
PROG= boot
SRCS= start.S boot.c conf.c filesystem.c
SRCS= start.S boot.c conf.c
CLEANFILES+=${PROG}.elf ${PROG}.map ${ALL}
DPADD+= ${LIBS}

View File

@ -1,4 +1,4 @@
/* $NetBSD: boot.c,v 1.11 1999/02/22 10:23:53 simonb Exp $ */
/* $NetBSD: boot.c,v 1.12 1999/03/14 00:57:07 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -43,10 +43,9 @@
#include <stand.h>
#include <machine/dec_prom.h>
#include "byteswap.h"
char line[512];
int errno;
/*
* This gets arguments from the PROM, calls other routines to open
@ -62,39 +61,15 @@ _main(argc, argv)
char **argv;
{
register char *cp;
int ask, entry;
int entry;
#ifdef DIAGNOSTIC
extern int prom_id; /* hack, saved by standalone startup */
(*(callvec._printf))("hello, world\n");
printf ((callv == &callvec)? "No REX %x\n" : "have REX %x\n",
prom_id);
#endif
#ifdef JUSTASK
ask = 1;
#else
/* check for DS5000 boot */
if (strcmp(argv[0], "boot") == 0) {
argc--;
argv++;
}
cp = *argv;
ask = 0;
#endif /* JUSTASK */
printf("Boot: ");
if (ask) {
gets(line);
if (line[0] == '\0')
return 0;
cp = line;
argv[0] = cp;
argc = 1;
} else
printf("%s\n", cp);
printf("Boot: %s\n", cp);
entry = loadfile(cp);
if (entry == -1)
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: bootxx.c,v 1.11 1999/02/22 10:23:53 simonb Exp $ */
/* $NetBSD: bootxx.c,v 1.12 1999/03/14 00:57:07 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -43,10 +43,9 @@
#include <stand.h>
#include <machine/dec_prom.h>
#include "byteswap.h"
char line[512];
int errno;
/*
* This gets arguments from the PROM, calls other routines to open
@ -62,39 +61,15 @@ _main(argc, argv)
char **argv;
{
register char *cp;
int ask, entry;
int entry;
#ifdef DIAGNOSTIC
extern int prom_id; /* hack, saved by standalone startup */
(*(callvec._printf))("hello, world\n");
printf ((callv == &callvec)? "No REX %x\n" : "have REX %x\n",
prom_id);
#endif
#ifdef JUSTASK
ask = 1;
#else
/* check for DS5000 boot */
if (strcmp(argv[0], "boot") == 0) {
argc--;
argv++;
}
cp = *argv;
ask = 0;
#endif /* JUSTASK */
printf("Boot: ");
if (ask) {
gets(line);
if (line[0] == '\0')
return 0;
cp = line;
argv[0] = cp;
argc = 1;
} else
printf("%s\n", cp);
printf("Boot: %s\n", cp);
entry = loadfile(cp);
if (entry == -1)
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.10 1999/02/22 07:17:44 simonb Exp $ */
/* $NetBSD: conf.c,v 1.11 1999/03/14 00:57:07 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -45,10 +45,13 @@
#include <rz.h>
const struct callback *callv = &callvec;
int errno;
extern void nullsys();
extern int nodev(), noioctl();
#ifdef UFS_NOCLOSE
#define ufs_close 0
#endif
#ifdef UFS_NOWRITE
#define ufs_write 0
#endif
#ifdef SMALL
#define rzclose /*(()(struct open_file*))*/0
@ -62,3 +65,9 @@ struct devsw devsw[] = {
};
int ndevs = (sizeof(devsw)/sizeof(devsw[0]));
struct fs_ops file_system[] = {
{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat }
};
int nfsys = sizeof(file_system)/sizeof(struct fs_ops);

View File

@ -1,50 +0,0 @@
/*
* Copyright (c) 1993 Philip A. Nelson.
* 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.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Philip A. Nelson.
* 4. The name of Philip A. Nelson may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY PHILIP NELSON ``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 PHILIP NELSON 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, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* filesystem.c
*
* $NetBSD: filesystem.c,v 1.3 1999/02/22 10:18:40 simonb Exp $
*/
#include <stand.h>
#include <ufs.h>
#ifdef UFS_NOCLOSE
#define ufs_close 0
#endif
#ifdef UFS_NOWRITE
#define ufs_write 0
#endif
struct fs_ops file_system[] = {
{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek, ufs_stat }
};
int nfsys = sizeof(file_system)/sizeof(struct fs_ops);