Adapt to libsa changes & some other minor nits.
This commit is contained in:
parent
5520ccdbf9
commit
974115eb54
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bootxx.c,v 1.5 1995/09/18 20:24:53 chuck Exp $ */
|
||||
/* $NetBSD: bootxx.c,v 1.6 1995/09/18 21:31:44 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Paul Kranenburg
|
||||
|
@ -60,10 +60,11 @@ const char progname[] = "bootxx";
|
|||
|
||||
void loadboot __P((struct open_file *, caddr_t));
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
char *dummy;
|
||||
int n;
|
||||
size_t n;
|
||||
register void (*entry)__P((caddr_t)) = (void (*)__P((caddr_t)))LOADADDR;
|
||||
|
||||
prom_init();
|
||||
|
@ -94,7 +95,7 @@ loadboot(f, addr)
|
|||
{
|
||||
register int i;
|
||||
register char *buf;
|
||||
int n;
|
||||
size_t n;
|
||||
daddr_t blk;
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: conf.c,v 1.1 1995/09/16 23:20:28 pk Exp $ */
|
||||
/* $NetBSD: conf.c,v 1.2 1995/09/18 21:31:45 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Philip A. Nelson.
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <stand.h>
|
||||
#include <ufs.h>
|
||||
#include <netinet/in.h>
|
||||
#include <nfs.h>
|
||||
|
||||
struct fs_ops file_system_ufs[] = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: net.c,v 1.1 1995/09/16 23:20:33 pk Exp $ */
|
||||
/* $NetBSD: net.c,v 1.2 1995/09/18 21:31:46 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Gordon W. Ross
|
||||
|
@ -60,8 +60,6 @@
|
|||
#include "netif.h"
|
||||
#include "bootparam.h"
|
||||
|
||||
u_int32_t myip, rootip, gateip, mask;
|
||||
u_char bcea[6] = BA; /* for arp.c, rarp.c */
|
||||
char rootpath[FNAME_SIZE];
|
||||
|
||||
int netdev_sock = -1;
|
||||
|
@ -80,12 +78,15 @@ net_open(pd)
|
|||
/* On first open, do netif open, mount, etc. */
|
||||
if (open_count == 0) {
|
||||
/* Find network interface. */
|
||||
if ((netdev_sock = netif_open(pd)) < 0)
|
||||
return (ENXIO);
|
||||
if ((netdev_sock = netif_open(pd)) < 0) {
|
||||
error = errno;
|
||||
goto bad;
|
||||
}
|
||||
if ((error = net_mountroot()) != 0)
|
||||
return (error);
|
||||
goto bad;
|
||||
}
|
||||
open_count++;
|
||||
bad:
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
@ -118,36 +119,38 @@ net_mountroot()
|
|||
/* Get boot info using RARP and Sun bootparams. */
|
||||
|
||||
/* Get our IP address. (rarp.c) */
|
||||
if ((myip = rarp_getipaddress(netdev_sock)) == 0)
|
||||
return (EIO);
|
||||
printf("boot: client IP address: %s\n", intoa(myip));
|
||||
if (rarp_getipaddress(netdev_sock) == -1)
|
||||
return errno;
|
||||
|
||||
printf("boot: client IP address: %s\n", inet_ntoa(myip));
|
||||
|
||||
/* Get our hostname, server IP address. */
|
||||
if (bp_whoami(netdev_sock))
|
||||
return (EIO);
|
||||
return (errno);
|
||||
|
||||
printf("boot: client name: %s\n", hostname);
|
||||
|
||||
/* Get the root pathname. */
|
||||
if (bp_getfile(netdev_sock, "root", &rootip, rootpath))
|
||||
return (EIO);
|
||||
return (errno);
|
||||
|
||||
#else
|
||||
|
||||
/* Get boot info using BOOTP way. (RFC951, RFC1048) */
|
||||
bootp(netdev_sock);
|
||||
|
||||
printf("Using IP address: %s\n", intoa(myip));
|
||||
printf("Using IP address: %s\n", inet_ntoa(myip));
|
||||
|
||||
printf("myip: %s (%s)", hostname, intoa(myip));
|
||||
printf("myip: %s (%s)", hostname, inet_ntoa(myip));
|
||||
if (gateip)
|
||||
printf(", gateip: %s", intoa(gateip));
|
||||
if (mask)
|
||||
printf(", mask: %s", intoa(mask));
|
||||
printf(", gateip: %s", inet_ntoa(gateip));
|
||||
if (netmask)
|
||||
printf(", netmask: %s", intoa(netmask));
|
||||
printf("\n");
|
||||
|
||||
#endif
|
||||
|
||||
printf("root addr=%s path=%s\n", intoa(rootip), rootpath);
|
||||
printf("root addr=%s path=%s\n", inet_ntoa(rootip), rootpath);
|
||||
|
||||
/* Get the NFS file handle (mount). */
|
||||
return nfs_mount(netdev_sock, rootip, rootpath);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: netif_sun.c,v 1.1 1995/09/16 23:20:34 pk Exp $ */
|
||||
/* $NetBSD: netif_sun.c,v 1.2 1995/09/18 21:31:48 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 Gordon W. Ross
|
||||
|
@ -85,6 +85,7 @@ netif_open(machdep_hint)
|
|||
#ifdef DEBUG
|
||||
printf("netif_open: device busy\n");
|
||||
#endif
|
||||
errno = ENFILE;
|
||||
return (-1);
|
||||
}
|
||||
bzero(io, sizeof(*io));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: promdev.c,v 1.12 1995/09/17 00:50:58 pk Exp $ */
|
||||
/* $NetBSD: promdev.c,v 1.13 1995/09/18 21:31:49 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Paul Kranenburg
|
||||
|
@ -150,7 +150,6 @@ devopen(f, fname, file)
|
|||
const char *fname;
|
||||
char **file;
|
||||
{
|
||||
char *cp;
|
||||
int error = 0, fd;
|
||||
struct promdata *pd;
|
||||
|
||||
|
@ -496,7 +495,7 @@ prom_getether(fd, ea)
|
|||
}
|
||||
bcopy(sun4_idprom.id_ether, ea, 6);
|
||||
} else if (promvec->pv_romvec_vers < 2) {
|
||||
(void)(*promvec->pv_enaddr)(fd, ea);
|
||||
(void)(*promvec->pv_enaddr)(fd, (char *)ea);
|
||||
} else {
|
||||
char buf[64];
|
||||
sprintf(buf, "%x mac-address drop swap 6 cmove", ea);
|
||||
|
@ -597,7 +596,6 @@ getpropstring(node, name)
|
|||
*/
|
||||
|
||||
#include <machine/pte.h>
|
||||
#include <machine/ctlreg.h>
|
||||
|
||||
struct saioreq prom_si;
|
||||
static int promdev_inuse;
|
||||
|
@ -610,7 +608,6 @@ prom0_iopen(pd)
|
|||
struct om_boottable *ops;
|
||||
struct devinfo *dip;
|
||||
struct saioreq *si;
|
||||
char *p;
|
||||
int error;
|
||||
|
||||
if (promdev_inuse)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: promdev.h,v 1.2 1995/09/17 00:51:00 pk Exp $ */
|
||||
/* $NetBSD: promdev.h,v 1.3 1995/09/18 21:31:50 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Paul Kranenburg
|
||||
|
@ -55,6 +55,8 @@ extern int hz;
|
|||
extern int cputyp, nbpg, pgofset, pgshift;
|
||||
extern int debug;
|
||||
|
||||
extern void prom_init __P((void));
|
||||
|
||||
/* Note: dvma_*() routines are for "oldmon" machines only */
|
||||
extern char *dvma_mapin __P((char *, size_t));
|
||||
extern char *dvma_mapout __P((char *, size_t));
|
||||
|
|
Loading…
Reference in New Issue