diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-03-14 22:14:41 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2011-03-14 22:14:41 +0000 |
commit | 69b33539c4420ab485161d9744ad57280e229fa7 (patch) | |
tree | b5502d3403d4ba32abc4a364e1499192a6ec4d5b /sys/arch/amd64/include | |
parent | 26cdeae19d2eaec023adb36e2b08a132e413779b (diff) |
Clamp BIOS io attempts to < 2 ^28 - 1 sectors (a.k.a. 128GB for
512-byte sectors) as some BIOSen get confused when we ask for sectors
higher up.
Uss u_int throughout the boot code to calculate sector addresses,
since 32 bits is enough to do 28 ^ 1 - 1 arithmetic. Add checks
for wraparound.
I can now install and boot from the 7th extended partition below
128GB.
Much feedback & guidance from deraadt@. Also from weingart@ on
BIOS io.
ok deraadt@ (less a couple of minor tweaks found in testing)
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r-- | sys/arch/amd64/include/biosvar.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h index ba13e9fafa5..0abc8c2b4f8 100644 --- a/sys/arch/amd64/include/biosvar.h +++ b/sys/arch/amd64/include/biosvar.h @@ -1,5 +1,5 @@ /* XXX - DSR */ -/* $OpenBSD: biosvar.h,v 1.11 2010/11/22 21:07:18 miod Exp $ */ +/* $OpenBSD: biosvar.h,v 1.12 2011/03/14 22:14:40 krw Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -36,6 +36,7 @@ #define BOOTARG_OFF (NBPG*2) #define BOOTARG_LEN (NBPG*1) #define BOOTBIOS_ADDR (0x7c00) +#define BOOTBIOS_MAXSEC ((1 << 28) - 1) /* BIOS configure flags */ #define BIOSF_BIOS32 0x0001 |