MAKE = exec make -$(MAKEFLAGS)
ALL = \
+ atnormalize \
dosread \
fdisk \
format \
$(CCLD) -o $@ $?
install -S 16kw $@
+atnormalize: atnormalize.c
+ $(CCLD) -o $@ $?
+ install -S 16kw $@
+
fdisk: fdisk.c
$(CCLD) -o $@ $?
install -S 4kw $@
install -S 4kw $@
install: \
+ /usr/bin/atnormalize \
/usr/bin/dosread \
/usr/bin/dosdir \
/usr/bin/doswrite \
/bin/loadkeys \
/bin/readclock \
+/usr/bin/atnormalize: atnormalize
+ install -cs -o bin $? $@
+
/usr/bin/dosread: dosread
install -cs -o bin $? $@
--- /dev/null
+#include <sys/types.h>
+#include <stdio.h>
+#include <termcap.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stddef.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <time.h>
+#include <dirent.h>
+#include <limits.h>
+#include <a.out.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/ioctl.h>
+#include <minix/config.h>
+#include <minix/const.h>
+#include <minix/partition.h>
+#include <minix/u64.h>
+#include <ibm/partition.h>
+#include <termios.h>
+#include <stdarg.h>
+
+int main(void)
+{
+ int v, d;
+ char name[20];
+
+ for(d = 0; d < 4; d++) {
+ int device;
+ sprintf(name, "/dev/c0d%d", d);
+ if((device=open(name, O_RDONLY)) >= 0) {
+ v = 0;
+ ioctl(device, DIOCTIMEOUT, &v);
+ close(device);
+ }
+ }
+
+ return 0;
+}
}
do {
+ printstep(5, "Select a region");
+
printf("\nI've found the following region%s on this disk (%s).\n\n",
SORNOT(nr_regions), prettysizeprint(table[0].size/2));
printregions(regions, 0, nr_partitions, free_regions, nr_regions, 1);
printf("That region number isn't available.\n");
continue;
}
+ printstep(6, "Confirm your partition choice");
sure = is_sure(0, "\nPlease confirm you want to use disk region number %d?", rn);
} else {
+ printstep(6, "Confirm your partition choice");
rn = 0;
sure = is_sure(0, "\nUse this region?");
}
return(®ions[rn]);
}
+void printstep(int step, char *str)
+{
+ int n;
+ n = printf("\n --- Step %d: %s ", step, str);
+ while(n++ < 70) printf("-");
+ printf("\n\n");
+}
+
device_t *
select_disk(void)
{
int i, choice, drives;
static char line[500];
- printf("\nProbing for disks. This may take a short while. ");
+ printf("\nProbing for disks. This may take a short while.");
do {
i = 0;
printf("\nProbing done; %d drive%s found.\n", drives, SORNOT(drives));
- printf("\nI've found the following drive%s on your system.\n", SORNOT(drives));
-
- for(i = 0; i < drives; i++) {
- if(drives > 1)
- printf("\n %2d. ", i);
- else printf(" ");
- printf(" (%s, ", devices[i].dev->name);
- printf("%s)\n", prettysizeprint(devices[i].sectors/2));
- printregions(devices[i].regions, 8,
- devices[i].nr_partitions,
- devices[i].free_regions,
- devices[i].nr_regions, 0);
- }
+ if(drives == 1) {
+ sure = 1;
+ choice = 0;
+ } else {
+
+ printstep(3, "Choose a disk to install MINIX 3 on");
+
+ printf("\nI've found the following drive%s on your system.\n", SORNOT(drives));
- if(drives > 1) {
+ for(i = 0; i < drives; i++) {
+ if(drives > 1)
+ printf("\n %2d. ", i);
+ else printf(" ");
+ printf(" (%s, ", devices[i].dev->name);
+ printf("%s)\n", prettysizeprint(devices[i].sectors/2));
+ printregions(devices[i].regions, 8,
+ devices[i].nr_partitions,
+ devices[i].free_regions,
+ devices[i].nr_regions, 0);
+ }
+
printf("\nPlease enter disk number you want to use: ");
fflush(NULL);
if(!fgets(line, sizeof(line)-2, stdin))
printf("Number out of range.\n");
continue;
}
- if(!(sure = is_sure(0, "\nPlease confirm you want to use disk %d (%s)?",
- choice, devices[choice].dev->name)))
- exit(1);
- } else {
- if(!(sure = is_sure(0, "\nUse this disk?")))
- exit(1);
- choice = 0;
+ printstep(4, "Confirm your choice");
+ sure = is_sure(0, "\nPlease confirm you want to use disk %d (%s)?",
+ choice, devices[choice].dev->name);
}
} while(!sure);
return devices[choice].dev;
probing = 1;
autopartmode = 1;
- printf("\n\n --- Step 2.1 --- Select drive and region -----------------------------\n\n");
-
do {
curdev = select_disk();
} while(!curdev);
memcpy(orig_table, table, sizeof(table));
do {
- printf("\n\n --- Step 2.1 --- Select drive and region -----------------------------\n\n");
-
/* Show regions. */
r = select_region();
} while(!r); /* Back to step 2. */
- printf("\n\n --- Step 2.2 --- Confirm your choice ---------------------------------\n\n");
-
/* Write things. */
if(scribble_region(r, &pe)) {
char *name;
m_dump(table);
#endif
+ printstep(7, "Point of no return");
+
printf("\nThis is the point of no return. You have selected to install MINIX\n");
printf("into region %d of disk %d. If you agree with this selection, your\n", (int)(r-regions), (int) (curdev-firstdev));
printf("disk will be written to prepare for the rest of the installation.\n\n");
# Expert mode
echo -n "
MINIX needs one primary partition of about 250 MB for a full install.
-The maxium fill system currently supported is 4 GB.
+The maximum fill system currently supported is 4 GB.
If there is no free space on your disk then you have to choose an option:
(1) Delete one or more partitions
fi
else echo "Autopart tool failed. Trying again."
fi
+
+ # reset at retries and timeouts in case autopart left
+ # them messy
+ atnormalize
done
fi
echo "2. Realtek 8139 based card"
echo "3. Realtek 8029 based card (emulated by Qemu)"
echo "4. NE2000, 3com 503 or WD based card (NE2000 is emulated by Bochs)"
-echo "5. A 3com 501 or 509"
-echo "6. A different Ethernet card (no networking)"
+echo "5. NE2000, with default settings for Bochs emulation in $LOCALRC"
+echo "6. A 3com 501 or 509"
+echo "7. A different Ethernet card (no networking)"
echo ""
echo "With some cards, you'll have to edit $LOCALRC "
echo "after installing to the proper parameters."
read eth
driver=""
driverargs=""
+config_warn="Note: After installing, please edit $LOCALRC to the right configuration."
case "$eth" in
1) driver=fxp; ;;
2) driver=rtl8139; ;;
- 3) driver=dp8390; driverargs="dp8390_args='DPETH0=pci'"; ;;
- 4) driver=dp8390; driverargs="#dp8390_args='DPETH0=port:irq:memory'"; echo "Note: After installing, please edit $LOCALRC to the right configuration."; ;;
- 5) driver=dpeth; ;;
+ 3) driver=dp8390; driverargs="dp8390_arg='DPETH0=pci'"; ;;
+ 4) driver=dp8390; driverargs="#dp8390_arg='DPETH0=port:irq:memory'";
+ echo $config_warn;
+ ;;
+ 5) driver=dp8390; driverargs="dp8390_arg='DPETH0=240:9'"; ;;
+ 6) driver=dpeth; driverargs="#dpeth_arg='DPETH0=port:irq:memory'";
+ echo $config_warn;
+ ;;
esac
# Compute the amount of memory available to MINIX.
*) test $memsize -lt 6144 && swapadv=$(expr 6144 - $memsize)
esac
-blockdefault=8
+blockdefault=2
echo " --- Step 9: Select a disk block size -----------------------------"
echo "The default block size on the disk is $blockdefault KB.
-If you have a small disk or small RAM you may want less
-than $blockdefault KB. Please type 1, 2, or 4 for a smaller
-block size (in KB), or hit ENTER for the default of
-$blockdefault KB blocks, which should be fine in most cases."
+If you have a small disk or small RAM you may want 1 KB blocks.
+Please type 1 then, or leave it at the default.
while [ -z "$blocksize" ]
-do echo -n "Block size [$blockdefault KB]? "
+do echo -n "Block size in KB [$blockdefault]? "
read blocksize
if [ -z "$blocksize" ]
then blocksize=$blockdefault
fi
- if [ "$blocksize" -ne 1 -a "$blocksize" -ne 2 -a "$blocksize" -ne 4 -a "$blocksize" -ne $blockdefault ]
- then echo "$blocksize bogus block size. 1, 2, 4 or $blockdefault please."
+ if [ "$blocksize" -ne 1 -a "$blocksize" -ne $blockdefault ]
+ then echo "$blocksize bogus block size. 1 or $blockdefault please."
blocksize=""
fi
done
# Partition the primary.
p3=0:0
test "$swapsize" -gt 0 && p3=81:`expr $swapsize \* 2`
-partition /dev/$primary 1 81:32768* $p3 81:0+ || exit
+partition /dev/$primary 1 81:4352* $p3 81:0+ || exit
if [ "$swapsize" -gt 0 ]
then
absolutely sure that there can not be any bad blocks. Otherwise just wait.)"
trap ': nothing' 2
readall -b /dev/$usr | sh
-sleep 2
trap 2
echo " --- Step 13: Wait for files to be copied ------------------------------"
"
mkfs -B $blocksizebytes /dev/$root || exit
+readall -b /dev/$root | sh
mount /dev/$root /mnt || exit
# Running from the installation CD.
cpdir -vx / /mnt || exit
return 1;
}
- if(!(logfp = fopen("/var/log/messages", "a"))) {
- perror("/var/log/messages");
+ if(!(logfp = fopen("/usr/log/messages", "a"))) {
+ perror("/usr/log/messages");
return 1;
}