Changeset View
Changeset View
Standalone View
Standalone View
stand/i386/zfsboot/zfsboot.c
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | |||||
int main(void); | int main(void); | ||||
int | int | ||||
main(void) | main(void) | ||||
{ | { | ||||
unsigned i; | unsigned i; | ||||
int auto_boot, fd, nextboot = 0; | int auto_boot, fd, nextboot = 0; | ||||
struct disk_devdesc devdesc; | struct disk_devdesc *devdesc; | ||||
bios_getmem(); | bios_getmem(); | ||||
if (high_heap_size > 0) { | if (high_heap_size > 0) { | ||||
heap_top = PTOV(high_heap_base + high_heap_size); | heap_top = PTOV(high_heap_base + high_heap_size); | ||||
heap_bottom = PTOV(high_heap_base); | heap_bottom = PTOV(high_heap_base); | ||||
} else { | } else { | ||||
heap_bottom = (char *) | heap_bottom = (char *) | ||||
Show All 30 Lines | main(void) | ||||
/* Set up currdev variable to have hooks in place. */ | /* Set up currdev variable to have hooks in place. */ | ||||
env_setenv("currdev", EV_VOLATILE, "", i386_setcurrdev, | env_setenv("currdev", EV_VOLATILE, "", i386_setcurrdev, | ||||
env_nounset); | env_nounset); | ||||
for (i = 0; devsw[i] != NULL; i++) | for (i = 0; devsw[i] != NULL; i++) | ||||
if (devsw[i]->dv_init != NULL) | if (devsw[i]->dv_init != NULL) | ||||
(devsw[i]->dv_init)(); | (devsw[i]->dv_init)(); | ||||
disk_parsedev(&devdesc, boot_devname + 4, NULL); | /* XXX assumes this will be a disk, but it looks likely give above */ | ||||
disk_parsedev((struct devdesc **)&devdesc, boot_devname + 4, NULL); | |||||
bootdev = MAKEBOOTDEV(dev_maj[DEVT_DISK], devdesc.d_slice + 1, | bootdev = MAKEBOOTDEV(dev_maj[DEVT_DISK], devdesc->d_slice + 1, | ||||
devdesc.dd.d_unit, | devdesc->dd.d_unit, | ||||
devdesc.d_partition >= 0 ? devdesc.d_partition : 0xff); | devdesc->d_partition >= 0 ? devdesc->d_partition : 0xff); | ||||
free(devdesc); | |||||
/* | /* | ||||
* devformat() can be called only after dv_init | * devformat() can be called only after dv_init | ||||
*/ | */ | ||||
if (bdev != NULL && bdev->dd.d_dev->dv_type == DEVT_ZFS) { | if (bdev != NULL && bdev->dd.d_dev->dv_type == DEVT_ZFS) { | ||||
/* set up proper device name string for ZFS */ | /* set up proper device name string for ZFS */ | ||||
strncpy(boot_devname, devformat(&bdev->dd), sizeof (boot_devname)); | strncpy(boot_devname, devformat(&bdev->dd), sizeof (boot_devname)); | ||||
if (zfs_get_bootonce(bdev, OS_BOOTONCE, cmd, | if (zfs_get_bootonce(bdev, OS_BOOTONCE, cmd, | ||||
▲ Show 20 Lines • Show All 490 Lines • Show Last 20 Lines |