From a6222fc8f3f19db54cb6e350d9b4eafe2d29b73d Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Wed, 16 Aug 2017 10:44:15 +0000 Subject: [PATCH] [FREELDR] Lower MAX_DISKREADBUFFER_SIZE to let INT 13h, AH=42h only read a maximum of 127 sectors (instead of 128 previously). This fixes USB booting into the kernel on at least Dell Latitude D531 and Lenovo ThinkPad X61. Now CORE-13184 remains (in a VM and on real hardware, probably related to the CDFS driver) svn path=/trunk/; revision=75564 --- reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h b/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h index c747d145cb3..850499cee35 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h +++ b/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h @@ -22,7 +22,12 @@ #define BIOSCALLBUFOFFSET HEX(0000) /* Buffer to store temporary data for any Int386() call */ #define BIOSCALLBUFSIZE PAGE_SIZE /* max is sizeof(VESA_SVGA_INFO) = 512 */ #define MAX_FREELDR_PE_SIZE (MEMORY_MARGIN - FREELDR_PE_BASE - PAGE_SIZE) -#define MAX_DISKREADBUFFER_SIZE HEX(10000) + +/* MAX_DISKREADBUFFER_SIZE is later passed to INT 13h, AH=42h. + According to https://en.wikipedia.org/wiki/INT_13H#INT_13h_AH.3D42h:_Extended_Read_Sectors_From_Drive + some BIOSes can only read a maximum of 127 sectors. (0xFE00 / 512 = 127) + Confirmed when booting from USB on Dell Latitude D531 and Lenovo ThinkPad X61. */ +#define MAX_DISKREADBUFFER_SIZE HEX(FE00) /* These addresses specify the realmode "BSS section" layout */ #define BSS_RealModeEntry (BSS_START + 0)