1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-04 17:15:50 +00:00

Changes to support diskless booting on the alpha:

* Make the network code in the bootstrap more chatty (helps debugging)
* Add nfs root stuff to cpu_rootconf(). I also added a check to make sure
  it really was netbooting which allows the use of the same kernel for local
  and network boots.
* Tweak the de driver so that it takes the speed setting from the console
  for the alpha (some PWSs have broken de chipsets). This is the same
  behaviour as NetBSD/alpha.

Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
This commit is contained in:
Doug Rabson 1999-05-03 09:36:29 +00:00
parent 67fb73e4b4
commit 84b399de51
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46356
4 changed files with 51 additions and 15 deletions

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: autoconf.c,v 1.15 1999/03/28 17:33:38 dfr Exp $
* $Id: autoconf.c,v 1.16 1999/04/16 21:21:25 peter Exp $
*/
#include "opt_bootp.h"
@ -67,6 +67,8 @@ static int setdumpdev __P((dev_t dev));
device_t isa_bus_device = 0;
struct cam_sim *boot_sim = 0;
extern int nfs_diskless_valid;
static void
configure_start()
@ -227,6 +229,23 @@ cpu_rootconf()
}
#endif
#ifdef BOOTP_NFSROOT
if (!strcmp(bootdev_protocol(), "BOOTP")
&& !mountrootfsname && !nfs_diskless_valid) {
if (bootverbose)
printf("Considering BOOTP NFS root f/s.\n");
mountrootfsname = "nfs";
}
#endif /* BOOTP_NFSROOT */
#if defined(NFS) || defined(NFS_ROOT)
if (!mountrootfsname && nfs_diskless_valid) {
if (bootverbose)
printf("Considering NFS root f/s.\n");
mountrootfsname = "nfs";
}
#endif /* NFS */
#if defined(FFS) || defined(FFS_ROOT)
if (!mountrootfsname) {
static char rootname[] = "da0a";

View File

@ -1,5 +1,5 @@
/*
* $Id: dev_net.c,v 1.2 1998/08/22 10:31:01 dfr Exp $
* $Id: dev_net.c,v 1.3 1998/09/20 21:46:19 dfr Exp $
* From: $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $
*/
@ -65,6 +65,7 @@
#include <netinet/in_systm.h>
#include <stand.h>
#include <string.h>
#include <net.h>
#include <netif.h>
#include <bootparam.h>
@ -206,6 +207,8 @@ net_getparams(sock)
int sock;
{
char buf[MAXHOSTNAMELEN];
char temp[FNAME_SIZE];
int i;
n_long smask;
#ifdef SUPPORT_BOOTP
@ -218,7 +221,7 @@ net_getparams(sock)
if (try_bootp)
bootp(sock);
if (myip.s_addr != 0)
return (0);
goto exit;
if (debug)
printf("net_open: BOOTP failed, trying RARP/RPC...\n");
#endif
@ -262,9 +265,23 @@ net_getparams(sock)
printf("net_open: bootparam/getfile RPC failed\n");
return (EIO);
}
exit:
printf("net_open: server addr: %s\n", inet_ntoa(rootip));
printf("net_open: server path: %s\n", rootpath);
/*
* If present, strip the server's address off of the rootpath
* before passing it along. This allows us to be compatible with
* the kernel's diskless (BOOTP_NFSROOT) booting conventions
*/
for(i=0; i<FNAME_SIZE; i++)
if(rootpath[i] == ':')
break;
if(i && i != FNAME_SIZE) {
i++;
bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1);
bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1);
}
printf("net_open: server path: %s\n", rootpath);
return (0);
}

View File

@ -1,5 +1,5 @@
/* $NetBSD: if_de.c,v 1.82 1999/02/28 17:08:51 explorer Exp $ */
/* $Id: if_de.c,v 1.102 1999/03/17 16:44:52 luigi Exp $ */
/* $Id: if_de.c,v 1.103 1999/04/24 20:13:59 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@ -5607,10 +5607,10 @@ tulip_pci_attach(
(sc)->tulip_pci_busno = parent; \
(sc)->tulip_pci_devno = pa->pa_device; \
} while (0)
#endif /* __NetBSD__ */
#if defined(__alpha__)
tulip_media_t media = TULIP_MEDIA_UNKNOWN;
#endif
#endif /* __NetBSD__ */
int retval, idx;
u_int32_t revinfo, cfdainfo, id;
#if !defined(TULIP_IOMAPPED) && defined(__FreeBSD__)
@ -5713,7 +5713,7 @@ tulip_pci_attach(
PCI_CONF_WRITE(PCI_CFDA, cfdainfo);
DELAY(11*1000);
}
#if defined(__alpha__) && defined(__NetBSD__)
#if defined(__alpha__)
/*
* The Alpha SRM console encodes a console set media in the driver
* part of the CFDA register. Note that the Multia presents a
@ -5915,11 +5915,11 @@ tulip_pci_attach(
#endif
s = TULIP_RAISESPL();
#if defined(__alpha__) && defined(__NetBSD__)
#if defined(__alpha__)
sc->tulip_media = media;
#endif
tulip_attach(sc);
#if defined(__alpha__) && defined(__NetBSD__)
#if defined(__alpha__)
if (sc->tulip_media != TULIP_MEDIA_UNKNOWN)
tulip_linkup(sc, media);
#endif

View File

@ -1,5 +1,5 @@
/* $NetBSD: if_de.c,v 1.82 1999/02/28 17:08:51 explorer Exp $ */
/* $Id: if_de.c,v 1.102 1999/03/17 16:44:52 luigi Exp $ */
/* $Id: if_de.c,v 1.103 1999/04/24 20:13:59 peter Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@ -5607,10 +5607,10 @@ tulip_pci_attach(
(sc)->tulip_pci_busno = parent; \
(sc)->tulip_pci_devno = pa->pa_device; \
} while (0)
#endif /* __NetBSD__ */
#if defined(__alpha__)
tulip_media_t media = TULIP_MEDIA_UNKNOWN;
#endif
#endif /* __NetBSD__ */
int retval, idx;
u_int32_t revinfo, cfdainfo, id;
#if !defined(TULIP_IOMAPPED) && defined(__FreeBSD__)
@ -5713,7 +5713,7 @@ tulip_pci_attach(
PCI_CONF_WRITE(PCI_CFDA, cfdainfo);
DELAY(11*1000);
}
#if defined(__alpha__) && defined(__NetBSD__)
#if defined(__alpha__)
/*
* The Alpha SRM console encodes a console set media in the driver
* part of the CFDA register. Note that the Multia presents a
@ -5915,11 +5915,11 @@ tulip_pci_attach(
#endif
s = TULIP_RAISESPL();
#if defined(__alpha__) && defined(__NetBSD__)
#if defined(__alpha__)
sc->tulip_media = media;
#endif
tulip_attach(sc);
#if defined(__alpha__) && defined(__NetBSD__)
#if defined(__alpha__)
if (sc->tulip_media != TULIP_MEDIA_UNKNOWN)
tulip_linkup(sc, media);
#endif