Author: tkreuzer
Date: Thu Oct 23 21:52:39 2014
New Revision: 64945

URL: http://svn.reactos.org/svn/reactos?rev=64945&view=rev
Log:
[FREELDR]
Move the BIOS call buffer to physical address 0x4000, making another page 
available at the top, moving the margin down to 0x9E000. Should fix boot with 
machines that have a large EBDA.
CORE-8692 #comment please retest.

Modified:
    trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c
    trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c
    trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h

Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c?rev=64945&r1=64944&r2=64945&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c      [iso-8859-1] 
(original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c      [iso-8859-1] 
Thu Oct 23 21:52:39 2014
@@ -108,8 +108,7 @@
     i386_ScreenPosX = 0;
     i386_ScreenPosY = 0;
 
-    PrintText("An error occured in FreeLoader\n"
-              VERSION"\n"
+    PrintText("An error occured in " VERSION "\n"
               "Report this error to the ReactOS Development mailing list 
<[email protected]>\n\n"
               "0x%02lx: %s\n", TrapIndex, 
i386ExceptionDescriptionText[TrapIndex]);
 #ifdef _M_IX86

Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c?rev=64945&r1=64944&r2=64945&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c        [iso-8859-1] 
(original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcmem.c        [iso-8859-1] 
Thu Oct 23 21:52:39 2014
@@ -32,7 +32,6 @@
 #define STACK_BASE_PAGE    (STACKLOW / PAGE_SIZE)
 #define FREELDR_BASE_PAGE  (FREELDR_BASE / PAGE_SIZE)
 #define DISKBUF_BASE_PAGE  (DISKREADBUFFER / PAGE_SIZE)
-#define BIOSBUF_BASE_PAGE  (BIOSCALLBUFFER / PAGE_SIZE)
 
 #define STACK_PAGE_COUNT   (FREELDR_BASE_PAGE - STACK_BASE_PAGE)
 #define FREELDR_PAGE_COUNT (DISKBUF_BASE_PAGE - FREELDR_BASE_PAGE)
@@ -45,11 +44,10 @@
 FREELDR_MEMORY_DESCRIPTOR PcMemoryMap[MAX_BIOS_DESCRIPTORS + 1] =
 {
     { LoaderFirmwarePermanent, 0x00,               1 }, // realmode int vectors
-    { LoaderFirmwareTemporary, 0x01,               STACK_BASE_PAGE - 1 }, // 
freeldr stack + cmdline
+    { LoaderFirmwareTemporary, 0x01,               STACK_BASE_PAGE - 1 }, // 
freeldr stack, cmdline, BIOS call buffer
     { LoaderOsloaderStack,     STACK_BASE_PAGE,    FREELDR_BASE_PAGE - 
STACK_BASE_PAGE }, // prot mode stack.
     { LoaderLoadedProgram,     FREELDR_BASE_PAGE,  FREELDR_PAGE_COUNT }, // 
freeldr image
     { LoaderFirmwareTemporary, DISKBUF_BASE_PAGE,  DISKBUF_PAGE_COUNT }, // 
Disk read buffer for int 13h. DISKREADBUFFER
-    { LoaderFirmwareTemporary, BIOSBUF_BASE_PAGE,  BIOSBUF_PAGE_COUNT }, // 
BIOSCALLBUFFER
     { LoaderFirmwarePermanent, 0x9F,               0x1 },  // EBDA
     { LoaderFirmwarePermanent, 0xA0,               0x50 }, // ROM / Video
     { LoaderSpecialMemory,     0xF0,               0x10 }, // ROM / Video
@@ -203,13 +201,14 @@
        bit value at address 0x413 inside the BDA, which gives us the usable 
size
        in KB */
     Size = (*(PUSHORT)(ULONG_PTR)0x413) * 1024;
-    if (Size < 0x9F000)
+    if (Size < MEMORY_MARGIN)
     {
         FrLdrBugCheckWithMessage(
             MEMORY_INIT_FAILURE,
             __FILE__,
             __LINE__,
-            "The BIOS reported a usable memory range up to 0x%x, which is too 
small!\n",
+            "The BIOS reported a usable memory range up to 0x%x, which is too 
small!\n\n"
+            "If you see this, please report to the ReactOS team!",
             Size);
     }
 
@@ -230,13 +229,13 @@
     {
         /* Check if this is high enough */
         ULONG EbdaBase = (ULONG)Regs.w.es << 4;
-        if (EbdaBase < 0x9F000)
+        if (EbdaBase < MEMORY_MARGIN)
         {
             FrLdrBugCheckWithMessage(
                 MEMORY_INIT_FAILURE,
                 __FILE__,
                 __LINE__,
-                "The location of your EBDA is 0x%lx, which is too low!\n"
+                "The location of your EBDA is 0x%lx, which is too low!\n\n"
                 "If you see this, please report to the ReactOS team!",
                 EbdaBase);
         }

Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h?rev=64945&r1=64944&r2=64945&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h      
[iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h      
[iso-8859-1] Thu Oct 23 21:52:39 2014
@@ -9,6 +9,7 @@
 #define PDP_ADDRESS         HEX(2000) /* One page PDP page table */
 #define PD_ADDRESS          HEX(3000) /* One page PD page table */
 //#endif
+#define BIOSCALLBUFFER      HEX(4000) /* Buffer to store temporary data for 
any Int386() call */
 #define STACK16ADDR         HEX(6F00) /* The 16-bit stack top will be at 
0000:6F00 */
 #define BSS_START           HEX(6F00)
 #define STACKLOW            HEX(7000)
@@ -16,7 +17,7 @@
 #define FREELDR_BASE        HEX(F800)
 #define FREELDR_PE_BASE    HEX(10000)
 #define DISKREADBUFFER     HEX(8E000) /* Buffer to store data read in from the 
disk via the BIOS */
-#define BIOSCALLBUFFER     HEX(9E000) /* Buffer to store temporary data for 
any Int386() call */
+#define MEMORY_MARGIN      HEX(9E000) /* Highest usable address */
 /* 9F000- 9FFFF is reserved for the EBDA */
 #define DISKREADBUFFER_SIZE HEX(10000)
 


Reply via email to