summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/stand/efiboot
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2017-11-06 08:57:35 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2017-11-06 08:57:35 +0000
commit242695fb28602cb3a7d2de306a7d7b6ed4c448b9 (patch)
treec1ce39f824bb3c3d49d605d5a18ef123e781308a /sys/arch/amd64/stand/efiboot
parent66d2e9bb89a132f9e0937b71462b64bf700ece7b (diff)
Call CD-ROM devices cdN instead of hdN. Also select the booted device
properly when the system is booted from CD-ROM. Initial diff from FUKAUMI Naoki.
Diffstat (limited to 'sys/arch/amd64/stand/efiboot')
-rw-r--r--sys/arch/amd64/stand/efiboot/efiboot.c9
-rw-r--r--sys/arch/amd64/stand/efiboot/efidev.c9
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/arch/amd64/stand/efiboot/efiboot.c b/sys/arch/amd64/stand/efiboot/efiboot.c
index d6fe512c2a6..52c16a648a8 100644
--- a/sys/arch/amd64/stand/efiboot/efiboot.c
+++ b/sys/arch/amd64/stand/efiboot/efiboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efiboot.c,v 1.25 2017/10/11 04:07:50 yasuoka Exp $ */
+/* $OpenBSD: efiboot.c,v 1.26 2017/11/06 08:57:34 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -94,8 +94,11 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
for (dp = dp0; !IsDevicePathEnd(dp);
dp = NextDevicePathNode(dp)) {
if (DevicePathType(dp) == MEDIA_DEVICE_PATH &&
- DevicePathSubType(dp) == MEDIA_HARDDRIVE_DP) {
- bios_bootdev = 0x80;
+ (DevicePathSubType(dp) == MEDIA_HARDDRIVE_DP ||
+ DevicePathSubType(dp) == MEDIA_CDROM_DP)) {
+ bios_bootdev =
+ (DevicePathSubType(dp) == MEDIA_CDROM_DP)
+ ? 0x1e0 : 0x80;
efi_bootdp = dp0;
break;
}
diff --git a/sys/arch/amd64/stand/efiboot/efidev.c b/sys/arch/amd64/stand/efiboot/efidev.c
index d3e69088446..8f85835cf45 100644
--- a/sys/arch/amd64/stand/efiboot/efidev.c
+++ b/sys/arch/amd64/stand/efiboot/efidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efidev.c,v 1.27 2017/07/21 01:21:42 yasuoka Exp $ */
+/* $OpenBSD: efidev.c,v 1.28 2017/11/06 08:57:34 yasuoka Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -656,7 +656,7 @@ efiopen(struct open_file *f, ...)
case 2: /* fd */
break;
case 6: /* cd */
- biosdev = bios_bootdev & 0xff;
+ biosdev |= 0xe0;
break;
default:
return ENXIO;
@@ -787,8 +787,9 @@ efi_dump_diskinfo(void)
sizu = "GB";
}
- printf("hd%d\t%u\t%u\t%u%s\t0x%x\t0x%x\t%s\n",
- (bdi->bios_number & 0x7f),
+ printf("%cd%d\t%u\t%u\t%u%s\t0x%x\t0x%x\t%s\n",
+ (B_TYPE(bdi->bsd_dev) == 6)? 'c' : 'h',
+ (bdi->bios_number & 0x1f),
ed->blkio->Media->BlockSize,
ed->blkio->Media->IoAlign, (unsigned)siz, sizu,
bdi->flags, bdi->checksum,