summaryrefslogtreecommitdiffstats
path: root/release/sysinstall
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-06-17 19:04:56 +0000
committermarkm <markm@FreeBSD.org>1999-06-17 19:04:56 +0000
commit6491ecd71a0b7e46e7a85894f18dfee835d15e3c (patch)
tree431d5f2b5e03d27ca9b5f7c08d7182d2fa61fc2c /release/sysinstall
parent08db2060ae1d0606b107c8e93c20da3ebc29f30b (diff)
downloadFreeBSD-src-6491ecd71a0b7e46e7a85894f18dfee835d15e3c.zip
FreeBSD-src-6491ecd71a0b7e46e7a85894f18dfee835d15e3c.tar.gz
Add bits of PAO that are non-controversial.
Submitted by: Tatsumi HOSOKAWA
Diffstat (limited to 'release/sysinstall')
-rw-r--r--release/sysinstall/Makefile9
-rw-r--r--release/sysinstall/devices.c15
-rw-r--r--release/sysinstall/install.c7
-rw-r--r--release/sysinstall/main.c7
-rw-r--r--release/sysinstall/pccard.c154
5 files changed, 179 insertions, 13 deletions
diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile
index 439639b..7a5bdf3 100644
--- a/release/sysinstall/Makefile
+++ b/release/sysinstall/Makefile
@@ -13,7 +13,7 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \
disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \
ftp.c globals.c index.c install.c installUpgrade.c keymap.c \
label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \
- msg.c network.c nfs.c options.c package.c system.c \
+ msg.c network.c nfs.c options.c package.c pccard.c system.c \
tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \
keymap.h
@@ -21,6 +21,12 @@ CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
CFLAGS+= -I${.CURDIR}/../../sys
CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS
+PCCARD?= NO
+
+.if ${PCCARD} == "YES"
+CFLAGS+= -DPCCARD
+.endif
+
DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO}
LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk -lftpio
@@ -82,5 +88,4 @@ keymap.h:
( echo " { 0 }"; echo "};" ; echo "" ) >> keymap.tmp
mv keymap.tmp keymap.h
-
.include <bsd.prog.mk>
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c
index c05e38c..c1bff51 100644
--- a/release/sysinstall/devices.c
+++ b/release/sysinstall/devices.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: devices.c,v 1.91 1999/05/21 04:37:48 wpaul Exp $
+ * $Id: devices.c,v 1.92 1999/05/27 10:32:43 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -88,8 +88,8 @@ static struct _devname {
{ DEVICE_TYPE_NETWORK, "en", "Efficient Networks ATM PCI card" },
{ DEVICE_TYPE_NETWORK, "de", "DEC DE435 PCI NIC or other DC21040-AA based card" },
{ DEVICE_TYPE_NETWORK, "fxp", "Intel EtherExpress Pro/100B PCI Fast Ethernet card" },
- { DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 card" },
- { DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 ethernet card" },
+ { DEVICE_TYPE_NETWORK, "ed", "Novell NE1000/2000; 3C503; NE2000-compatible PCMCIA" },
+ { DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 ethernet card/3C589 PCMCIA" },
{ DEVICE_TYPE_NETWORK, "el", "3Com 3C501 ethernet card" },
{ DEVICE_TYPE_NETWORK, "ex", "Intel EtherExpress Pro/10 ethernet card" },
{ DEVICE_TYPE_NETWORK, "fe", "Fujitsu MB86960A/MB86965A ethernet card" },
@@ -253,19 +253,19 @@ deviceGetAll(void)
/* If it's not a link entry, forget it */
if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
- continue;
+ goto loopend;
/* Eliminate network devices that don't make sense */
if (!strncmp(ifptr->ifr_name, "lo", 2))
- continue;
+ goto loopend;
/* If we have a slip device, don't register it */
if (!strncmp(ifptr->ifr_name, "sl", 2)) {
- continue;
+ goto loopend;
}
/* And the same for ppp */
if (!strncmp(ifptr->ifr_name, "tun", 3) || !strncmp(ifptr->ifr_name, "ppp", 3)) {
- continue;
+ goto loopend;
}
/* Try and find its description */
for (i = 0, descr = NULL; device_names[i].name; i++) {
@@ -288,6 +288,7 @@ deviceGetAll(void)
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
continue;
+loopend:
if (ifptr->ifr_addr.sa_len) /* I'm not sure why this is here - it's inherited */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len - sizeof(struct sockaddr));
}
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index c037b50..9e97459 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.236 1999/05/12 09:02:35 jkh Exp $
+ * $Id: install.c,v 1.237 1999/05/27 10:32:47 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -728,8 +728,9 @@ installFixupBin(dialogMenuItem *self)
if (RunningAsInit) {
/* Fix up kernel first */
if (!file_readable("/kernel")) {
- if (file_readable("/kernel.GENERIC")) {
- if (vsystem("cp -p /kernel.GENERIC /kernel")) {
+ char *generic_kernel = "/kernel.GENERIC";
+ if (file_readable(generic_kernel)) {
+ if (vsystem("cp -p %s /kernel", generic_kernel)) {
msgConfirm("Unable to copy /kernel into place!");
return DITEM_FAILURE;
}
diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c
index 9f6c812..37f156c 100644
--- a/release/sysinstall/main.c
+++ b/release/sysinstall/main.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: main.c,v 1.50 1999/01/08 00:14:22 jkh Exp $
+ * $Id: main.c,v 1.51 1999/02/05 22:15:50 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -86,6 +86,11 @@ main(int argc, char **argv)
if (DebugFD)
dup2(DebugFD, 2);
+#ifdef PCCARD
+ /* Initialize PC-card */
+ pccardInitialize();
+#endif
+
/* Probe for all relevant devices on the system */
deviceGetAll();
diff --git a/release/sysinstall/pccard.c b/release/sysinstall/pccard.c
new file mode 100644
index 0000000..7f6f2fb
--- /dev/null
+++ b/release/sysinstall/pccard.c
@@ -0,0 +1,154 @@
+/*
+ * PC-card support for sysinstall
+ *
+ * $Id:$
+ *
+ * Copyright (c) 1997-1999
+ * Tatsumi Hosokawa <hosokawa@jp.FreeBSD.org>. All rights reserved.
+ *
+ * This software may be used, modified, copied, and distributed, in
+ * both source and binary form provided that the above copyright and
+ * these terms are retained. Under no circumstances is the author
+ * responsible for the proper functioning of this software, nor does
+ * the author assume any responsibility for damages incurred with its
+ * use.
+ */
+
+#include "sysinstall.h"
+#include <sys/fcntl.h>
+#include <sys/time.h>
+#include <pccard/cardinfo.h>
+
+#ifdef PCCARD
+
+int pccard_mode = 0;
+
+DMenu MenuPCICMem = {
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ "Please select free address area used by PC-card controller",
+ "PC-card controller uses memory area to get card information.\n"
+ "Please specify an address that is not used by other devices.\n"
+ "If you're uncertain of detailed specification of your hardware,\n"
+ "leave it untouched (default == 0xd0000).",
+ "Press F1 for more HELP",
+ "pccard",
+ { { "Default", "I/O address 0xd0000 - 0xd3fff",
+ NULL, dmenuSetVariable, NULL, "pcicmem=0"},
+ { "D4", "I/O address 0xd4000 - 0xd7fff",
+ NULL, dmenuSetVariable, NULL, "pcicmem=1"},
+ { "D8", "I/O address 0xd8000 - 0xdbfff",
+ NULL, dmenuSetVariable, NULL, "pcicmem=2"},
+ { "DC", "I/O address 0xdc000 - 0xdffff",
+ NULL, dmenuSetVariable, NULL, "pcicmem=3"},
+ { NULL } },
+};
+
+DMenu MenuCardIRQ = {
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ "Please select IRQs that can be used by PC-cards",
+ "Please specify an IRQs that CANNOT be used by PC-card.\n"
+ "For example, if you have a sound card that can't be probed by\n"
+ "this installation floppy and it uses IRQ 10, you have to \n"
+ "choose \"Option 1\" or \"Option 2\" at this menu.\n",
+ "Press F1 for more HELP",
+ "pccard",
+ { { "Default", "IRQ 10, 11",
+ NULL, dmenuSetVariable, NULL, "cardirq=0"},
+ { "Option 1", "IRQ 5, 11 (ex. soundcard on IRQ 10)",
+ NULL, dmenuSetVariable, NULL, "cardirq=1"},
+ { "Option 2", "IRQ 11 (ex. something on IRQ 5 and 10)",
+ NULL, dmenuSetVariable, NULL, "cardirq=2"},
+ { NULL } },
+};
+
+void
+pccardInitialize(void)
+{
+ int fd;
+ int t;
+ int pcic_mem = 0xd0000;
+ char card_device[16];
+ char *card_irq = "";
+ char *spcic_mem;
+ char *scard_irq;
+ char pccardd_cmd[256];
+
+ pccard_mode = 1;
+
+ if (!RunningAsInit && !Fake) {
+ /* It's not my job... */
+ return;
+ }
+
+ dmenuOpenSimple(&MenuPCICMem, FALSE);
+ spcic_mem = variable_get("pcicmem");
+ dmenuOpenSimple(&MenuCardIRQ, FALSE);
+ scard_irq = variable_get("cardirq");
+
+ sscanf(spcic_mem, "%d", &t);
+ switch (t) {
+ case 0:
+ pcic_mem = 0xd0000;
+ break;
+ case 1:
+ pcic_mem = 0xd4000;
+ break;
+ case 2:
+ pcic_mem = 0xd8000;
+ break;
+ case 3:
+ pcic_mem = 0xdc000;
+ break;
+ }
+
+ sscanf(scard_irq, "%d", &t);
+
+ switch (t) {
+ case 0:
+ card_irq = " -i 10 -i 11 ";
+ break;
+ case 1:
+ card_irq = " -i 5 -i 11 ";
+ break;
+ case 2:
+ card_irq = " -i 11 ";
+ break;
+ }
+
+ sprintf(card_device, CARD_DEVICE, 0);
+
+ dialog_clear();
+ msgConfirm("Now starts initializing PC-card controller and cards.\n"
+ "If you've executed this installer from PC-card floppy\n"
+ "drive, this is the last chance to replace it with\n"
+ "installation media (PC-card Ethernet, CDROM, etc.).\n"
+ "Please insert installation media and press [Enter].\n"
+ "If you've not plugged the PC-card installation media\n"
+ "yet, please plug it now and press [Enter].\n"
+ "Otherwise, just press [Enter] to proceed.");
+
+ dialog_clear();
+ msgNotify("Initializing PC-card controller....");
+
+ if (!Fake) {
+ if ((fd = open(card_device, O_RDWR)) < 1) {
+ msgNotify("Can't open PC-card controller %s.\n",
+ card_device);
+ return;
+ }
+
+ if (ioctl(fd, PIOCRWMEM, &pcic_mem) < 0){
+ msgNotify("ioctl %s failed.\n", card_device);
+ return;
+ }
+ }
+
+ strcpy(pccardd_cmd, "/stand/pccardd ");
+ strcat(pccardd_cmd, card_irq);
+ strcat(pccardd_cmd, " -z");
+ vsystem(pccardd_cmd);
+}
+
+#endif /* PCCARD */
+
+
OpenPOWER on IntegriCloud