summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/i386/boot/netboot/Makefile3
-rw-r--r--sys/i386/boot/netboot/bootmenu.c46
-rw-r--r--sys/i386/boot/netboot/main.c16
-rw-r--r--sys/i386/boot/netboot/ns8390.c6
4 files changed, 56 insertions, 15 deletions
diff --git a/sys/i386/boot/netboot/Makefile b/sys/i386/boot/netboot/Makefile
index 8c3f40ab9c73..2352b2cd37e8 100644
--- a/sys/i386/boot/netboot/Makefile
+++ b/sys/i386/boot/netboot/Makefile
@@ -1,8 +1,9 @@
-# $Id: Makefile,v 1.16 1998/03/07 10:48:13 eivind Exp $
+# $Id: Makefile,v 1.17 1998/06/29 18:52:33 bde Exp $
#
# Makefile for NETBOOT
#
# Basic Options:
+# -DSECURE_BOOT - Disable 'boot>' prompt completely
# -DASK_BOOT - Ask "Boot from Network (Y/N) ?" at startup
# -DROMSIZE - Size of EPROM - Must be set (even for .COM files)
# -DRELOC - Relocation address (usually 0x90000)
diff --git a/sys/i386/boot/netboot/bootmenu.c b/sys/i386/boot/netboot/bootmenu.c
index ce1c4164e902..71b350b468a6 100644
--- a/sys/i386/boot/netboot/bootmenu.c
+++ b/sys/i386/boot/netboot/bootmenu.c
@@ -32,8 +32,8 @@ struct bootcmds_t {
{"netmask", cmd_netmask, "<addr> set network mask"},
{"hostname", cmd_hostname, "<name> set hostname"},
{"kernel", cmd_kernel, "<file> set boot filename"},
- {"rootfs", cmd_rootfs, "ip:/fs set root filesystem"},
- {"swapfs", cmd_swapfs, "ip:/fs set swap filesystem"},
+ {"rootfs", cmd_rootfs, "[ip:]/fs set root filesystem"},
+ {"swapfs", cmd_swapfs, "[ip:]/fs set swap filesystem"},
{"swapsize", cmd_swapsize, "<nblks> set swap size"},
{"swapopts", cmd_swapopts, "<options> swap mount options"},
{"rootopts", cmd_rootopts, "<options> root mount options"},
@@ -160,17 +160,22 @@ CMD_ROOTFS - Set root filesystem name
cmd_rootfs(p)
char *p;
{
- if (!setip(p, &arptable[ARP_ROOTSERVER].ipaddr)) {
+ if (*p == '/') {
+ bcopy(&arptable[ARP_SERVER].ipaddr,
+ &arptable[ARP_ROOTSERVER].ipaddr, 4);
+ } else if (!setip(p, &arptable[ARP_ROOTSERVER].ipaddr)) {
printf("Root filesystem is %I:%s\r\n",
nfsdiskless.root_saddr.sin_addr,
nfsdiskless.root_hostnam);
+ return;
} else {
- bcopy(&arptable[ARP_ROOTSERVER].ipaddr,
- &nfsdiskless.root_saddr.sin_addr, 4);
while (*p && (*p != ':')) p++;
if (*p == ':') p++;
- sprintf(&nfsdiskless.root_hostnam, "%s", p);
}
+
+ bcopy(&arptable[ARP_ROOTSERVER].ipaddr,
+ &nfsdiskless.root_saddr.sin_addr, 4);
+ sprintf(&nfsdiskless.root_hostnam, "%s", p);
}
/**************************************************************************
@@ -179,17 +184,22 @@ CMD_SWAPFS - Set swap filesystem name
cmd_swapfs(p)
char *p;
{
- if (!setip(p, &arptable[ARP_SWAPSERVER].ipaddr)) {
+ if (*p == '/') {
+ bcopy(&arptable[ARP_SERVER].ipaddr,
+ &arptable[ARP_SWAPSERVER].ipaddr, 4);
+ } else if (!setip(p, &arptable[ARP_SWAPSERVER].ipaddr)) {
printf("Swap filesystem is %I:%s\r\n",
nfsdiskless.swap_saddr.sin_addr,
nfsdiskless.swap_hostnam);
+ return;
} else {
- bcopy(&arptable[ARP_SWAPSERVER].ipaddr,
- &nfsdiskless.swap_saddr.sin_addr, 4);
while (*p && (*p != ':')) p++;
if (*p == ':') p++;
- sprintf(&nfsdiskless.swap_hostnam, "%s", p);
}
+
+ bcopy(&arptable[ARP_SWAPSERVER].ipaddr,
+ &nfsdiskless.swap_saddr.sin_addr, 4);
+ sprintf(&nfsdiskless.swap_hostnam, "%s", p);
}
/**************************************************************************
@@ -305,7 +315,8 @@ execute(buf)
while(cmd->name) {
p = buf;
q = cmd->name;
- while (*q && (*(q++) == *(p++))) ;
+ while (*q && *q == *p++)
+ q++;
if ((!(*q)) && ((*p == ' ') || (*p == '\t') || (!(*p)))) {
if (!cmd->func)
return(1);
@@ -327,6 +338,18 @@ bootmenu()
{
char cmd[80];
int ptr, c;
+#ifdef SECURE_BOOT
+ char *p;
+
+ printf("\r\n");
+
+ printf("Press any key to retry:");
+ while (iskey())
+ getchar();
+ getchar();
+ printf("\r\n");
+ eth_probe();
+#else
printf("\r\n");
while (1) {
ptr = 0;
@@ -349,5 +372,6 @@ bootmenu()
printf("\r\n");
if (execute(cmd)) break;
}
+#endif
eth_reset();
}
diff --git a/sys/i386/boot/netboot/main.c b/sys/i386/boot/netboot/main.c
index 7ffb5d05aebe..086d71c7a5b2 100644
--- a/sys/i386/boot/netboot/main.c
+++ b/sys/i386/boot/netboot/main.c
@@ -292,7 +292,7 @@ cfg_done:
printf("Bad executable format!\r\n");
longjmp(jmp_bootmenu, 1);
}
- loadpoint = (char *)0x100000;
+ loadpoint = (char *)(head.a_entry & 0x00FFFFFF);
offset = N_TXTOFF(head);
printf("text=0x%X, ",head.a_text);
nfsload(head.a_text);
@@ -343,7 +343,9 @@ POLLKBD - Check for Interrupt from keyboard
**************************************************************************/
pollkbd()
{
+#ifndef SECURE_BOOT
if (iskey() && (getchar() == ESC)) longjmp(jmp_bootmenu,1);
+#endif
}
/**************************************************************************
@@ -658,6 +660,18 @@ decode_rfc1048(p)
case 131: /* swap mount options */
bootp_string("swapopts", p);
break;
+ case 132: /* any other options */
+ case 133:
+ case 134:
+ case 135:
+ case 136:
+ case 137:
+ case 138:
+ case 139:
+ case 140:
+ case 141:
+ bootp_string("", p);
+ break;
default:
printf("Unknown RFC1048-tag ");
for(q=p;q<p+2+TAG_LEN(p);q++)
diff --git a/sys/i386/boot/netboot/ns8390.c b/sys/i386/boot/netboot/ns8390.c
index 3071a8aa6508..c495d5a3cdbb 100644
--- a/sys/i386/boot/netboot/ns8390.c
+++ b/sys/i386/boot/netboot/ns8390.c
@@ -82,8 +82,10 @@ eth_probe()
chksum = 0;
/* Check for WD/SMC card by checking ethernet address */
if (inb(eth_asic_base+8) != 0) continue;
- if (inb(eth_asic_base+9) != 0) continue;
- if (inb(eth_asic_base+10) != 0xC0) continue;
+ if (inb(eth_asic_base+9) != 0xE0) {
+ if (inb(eth_asic_base+9) != 0) continue;
+ if (inb(eth_asic_base+10) != 0xC0) continue;
+ }
for (i=8; i<16; i++)
chksum += inb(i+eth_asic_base);
if ((chksum & 0x00FF) == 0x00FF)