summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/bios.c1
-rw-r--r--sys/i386/i386/bios.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c
index ad7d247667cc..0f22bb31c3f7 100644
--- a/sys/amd64/amd64/bios.c
+++ b/sys/amd64/amd64/bios.c
@@ -514,6 +514,7 @@ pnpbios_scan(void)
if ((error = bios16(&args, PNP_COUNT_DEVNODES, &ndevs, &bigdev)) || (args.r.eax & 0xff))
printf("pnpbios: error %d/%x getting device count/size limit\n", error, args.r.eax);
+ ndevs &= 0xff; /* clear high byte garbage */
if (bootverbose)
printf("pnpbios: %d devices, largest %d bytes\n", ndevs, bigdev);
diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c
index ad7d247667cc..0f22bb31c3f7 100644
--- a/sys/i386/i386/bios.c
+++ b/sys/i386/i386/bios.c
@@ -514,6 +514,7 @@ pnpbios_scan(void)
if ((error = bios16(&args, PNP_COUNT_DEVNODES, &ndevs, &bigdev)) || (args.r.eax & 0xff))
printf("pnpbios: error %d/%x getting device count/size limit\n", error, args.r.eax);
+ ndevs &= 0xff; /* clear high byte garbage */
if (bootverbose)
printf("pnpbios: %d devices, largest %d bytes\n", ndevs, bigdev);