char *name; /* E.g. /dev/c0d0 */
char *subname; /* E.g. /dev/c0d0:2 */
parttype_t parttype;
+ int biosdrive;
} device_t;
typedef struct region {
static struct {
device_t *dev;
int nr_partitions, free_regions, used_regions, sectors, nr_regions;
+ int biosdrive;
region_t regions[NR_REGIONS];
} devices[MAX_DEVICES];
}
-void m_read(int ev, object_t *op)
+void m_read(int ev, int *biosdrive)
/* Read the partition table from the current device. */
{
int si, i, mode, n, r, v;
v = 2*HZ;
ioctl(device, DIOCTIMEOUT, &v);
- /* Assume up to five lines of kernel messages. */
- statusrow+= 5-1;
- stat_end(5);
-
- if (mode == O_RDONLY) {
- stat_start(1);
- printf("%s: Readonly", curdev->name);
- stat_end(5);
- }
memset(bootblock, 0, sizeof(bootblock));
n= boot_readwrite(0);
if (n < SECTOR_SIZE) n= SECTOR_SIZE;
+ if(biosdrive) (*biosdrive)++;
+
if(!open_ct_ok(device)) {
printf("\n%s: device in use! skipping it.", curdev->subname);
fflush(stdout);
m_magic(ev, op);
m_in(ev, op);
m_out(ev, op);
- m_read(ev, op);
+ m_read(ev, NULL);
m_write(ev, op);
m_shell(ev, op);
m_quit(ev, op);
int done = 0;
int i, choice, drives;
static char line[500];
+ int biosdrive = 0;
printstep(1, "Select a disk to install MINIX 3");
printf("\nProbing for disks. This may take a short while.");
for(; i < MAX_DEVICES;) {
printf(".");
fflush(stdout);
- m_read('r', NULL);
+ m_read('r', &biosdrive);
if(device >= 0) {
devices[i].dev = curdev;
devices[i].free_regions = free_regions;
devices[i].nr_partitions = nr_partitions;
devices[i].used_regions = used_regions;
devices[i].sectors = table[0].size;
+ curdev->biosdrive = biosdrive-1;
memcpy(devices[i].regions, regions, sizeof(regions));
i++;
}
name=strrchr(curdev->name, '/');
if(!name) name = curdev->name;
else name++;
- sprintf(partbuf, "%sp%d\n", name, found-1);
+
+ sprintf(partbuf, "%sp%d d%dp%d\n", name, found-1,
+ curdev->biosdrive, found-1);
sprintf(devname, "/dev/%sp%d", name, found-1);
if(resultfd >= 0 && write(resultfd, partbuf, strlen(partbuf)) < strlen(partbuf)) {
fprintf(stderr, "Autopart internal error (couldn't write result).\n");
read confirmation
if [ "$confirmation" = yes ]; then step2=ok; fi
done
+biosdrivename="Actual BIOS device name unknown, due to expert mode."
else
# Automatic mode
then if [ -s "$PF" ]
then
bd="`cat $PF`"
+ cat "$PF" | read bd bdn
+ biosdrivename="Probably, the right command is \"boot $bdn\"."
if [ -b "/dev/$bd" ]
then primary="$bd"
else echo "Funny device $bd from autopart."
Please type 'shutdown' to exit MINIX 3 and enter the boot monitor. At
the boot monitor prompt, type 'boot $bios', where X is the bios drive
number of the drive you installed on, to try your new MINIX system.
+$biosdrivename
This ends the MINIX setup script. After booting your newly set up system,
you can run the test suites as indicated in the setup manual. You also