From 69b33539c4420ab485161d9744ad57280e229fa7 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 14 Mar 2011 22:14:41 +0000 Subject: 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) --- sys/arch/amd64/stand/libsa/biosdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/arch/amd64/stand/libsa/biosdev.h') diff --git a/sys/arch/amd64/stand/libsa/biosdev.h b/sys/arch/amd64/stand/libsa/biosdev.h index 765ba0d0e59..fc0a0ce69ea 100644 --- a/sys/arch/amd64/stand/libsa/biosdev.h +++ b/sys/arch/amd64/stand/libsa/biosdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: biosdev.h,v 1.3 2011/03/13 00:13:52 deraadt Exp $ */ +/* $OpenBSD: biosdev.h,v 1.4 2011/03/14 22:14:40 krw Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -49,7 +49,7 @@ int biosopen(struct open_file *, ...); int biosclose(struct open_file *); int biosioctl(struct open_file *, u_long, void *); int bios_getdiskinfo(int, bios_diskinfo_t *); -int biosd_io(int, bios_diskinfo_t *, daddr32_t, int, void *); +int biosd_io(int, bios_diskinfo_t *, u_int, int, void *); const char * bios_getdisklabel(bios_diskinfo_t *, struct disklabel *); /* diskprobe.c */ -- cgit v1.2.3