Author: tkreuzer
Date: Sat Jul  2 15:08:54 2011
New Revision: 52500

URL: http://svn.reactos.org/svn/reactos?rev=52500&view=rev
Log:
[FAT32]
- Really fix loading the MSVC built kernel, by moving the FAT sector buffer 
beyond the area for freeldr.sys
- Load segment only in one place

Modified:
    trunk/reactos/boot/freeldr/bootsect/fat32.S

Modified: trunk/reactos/boot/freeldr/bootsect/fat32.S
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat32.S?rev=52500&r1=52499&r2=52500&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] Sat Jul  2 
15:08:54 2011
@@ -153,6 +153,7 @@
 // EAX has logical sector number to read
 // CX has number of sectors to read
 ReadSectors:
+    push es
     cmp  eax, dword ptr ds:[BiosCHSDriveSize]        // Check if they are 
reading a sector outside CHS range
     jae  ReadSectorsLBA                        // Yes - go to the LBA routine
                                                 // If at all possible we want 
to use LBA routines because
@@ -194,13 +195,6 @@
     mov  dl, byte ptr BP_REL(BootDrive)                // Drive number
     mov  ah, HEX(42)                                // Int 13h, AH = 42h - 
Extended Read
     int  HEX(13)                                // Call BIOS
-
-    /* This code "fixes" loading the MSVC built kernel */
-    pushad
-    mov  si, offset msgNull
-    call PutChars
-    popad
-
     jc   PrintDiskError                        // If the read failed then abort
 
     add  sp, 16                            // Remove disk address packet from 
stack
@@ -219,6 +213,7 @@
     sub  cx, word ptr ds:[LBASectorsRead]
     jnz  ReadSectorsLBA                        // Read next sector
 
+    pop es
     ret
 
 LBASectorsRead:
@@ -309,8 +304,6 @@
     .ascii "File system error", CR, LF, NUL
 msgAnyKey:
     .ascii "Press any key to restart", CR, LF, NUL
-msgNull:
-    .ascii NUL
 
 .org 509 // Pad to 509 bytes
 
@@ -473,21 +466,21 @@
 
 LoadFatSector:
     push  ecx
+
+    mov   bx, HEX(9000)                            // We will load it to 
[9000:0000h]
+    mov   es, bx
+
     // EAX holds logical FAT sector number
     // Check if we have already loaded it
     cmp   eax, dword ptr ds:[FatSectorInCache]
     je    LoadFatSectorAlreadyLoaded
 
     mov   dword ptr ds:[FatSectorInCache], eax
-    mov   bx, HEX(7000)
-    mov   es, bx
-    xor   bx, bx                                // We will load it to 
[7000:0000h]
+    xor   bx, bx
     mov   cx, 1
     call  ReadSectors
 
 LoadFatSectorAlreadyLoaded:
-    mov   bx, HEX(7000)
-    mov   es, bx
     pop   ecx
     mov   eax, dword ptr es:[ecx]                    // Get FAT entry
     and   eax, HEX(0fffffff)                        // Mask off reserved bits


Reply via email to