Sync with sys/i386/boot/netboot/Makefile, bootmenu.c, main.c and

ns8390.c revisions 1.18, 1.15, 1.22 and 1.13, respectiely.
This commit is contained in:
KATO Takenori 1998-07-02 12:37:36 +00:00
parent dfcb23c332
commit 3744016942
4 changed files with 52 additions and 12 deletions

View File

@ -3,6 +3,7 @@
# 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)
@ -95,6 +96,6 @@ nb3c509.com: start2.o ${SRCS:N*.h:R:S/$/.o/g} 3c509.o
# This force the creation of the "machine" symlink. These objects are
# specially handled in this file, and thus can't be taken care of in
# ../Makefile.inc
3c509.o makerom ns8390.o start2.ro: beforedepend
3c509.o makerom ns8390.o start2.ro: machine
.include <bsd.prog.mk>

View File

@ -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)) {
printf("Root filesystem is %I:%s\n",
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);
}
/**************************************************************************
@ -305,7 +310,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);
@ -349,5 +355,6 @@ bootmenu()
printf("\n");
if (execute(cmd)) break;
}
#endif
eth_reset();
}

View File

@ -304,7 +304,7 @@ cfg_done:
printf("Bad executable format!\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);
#ifdef PC98
@ -358,7 +358,9 @@ POLLKBD - Check for Interrupt from keyboard
**************************************************************************/
pollkbd()
{
#ifndef SECURE_BOOT
if (iskey() && (getchar() == ESC)) longjmp(jmp_bootmenu,1);
#endif
}
/**************************************************************************
@ -671,6 +673,34 @@ 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;
case RFC1048_ROOT_PATH: /* XXX check len */
bootp_string("rootfs", p);
break;
case RFC1048_SWAP_PATH:
bootp_string("swapfs", p);
break;
case RFC1048_SWAP_LEN: /* T129 */
sprintf(config_buffer+strlen(config_buffer),
"swapsize %d\n", ntohl(*(long *)(p+2)) );
break;
case 130: /* root mount options */
bootp_string("rootopts", p);
break;
case 131: /* swap mount options */
bootp_string("swapopts", p);
break;
default:
printf("Unknown RFC1048-tag ");
for(q=p;q<p+2+TAG_LEN(p);q++)

View File

@ -95,8 +95,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)