Author: hbelusca
Date: Sat Dec 26 21:28:01 2015
New Revision: 70432

URL: http://svn.reactos.org/svn/reactos?rev=70432&view=rev
Log:
[BOOTSECTORS]
- fat.asm: remove trailing whitespace.
- fat32.asm: backport the fixes from fat32.S introduced a long time ago.
- fat32.S/faty.S: use .space 12, 0 instead of the long .byte array (generates 
the same code, but is better readable).
- isoboot/btrt: whitespace fix only.

Modified:
    trunk/reactos/boot/freeldr/bootsect/fat.asm
    trunk/reactos/boot/freeldr/bootsect/fat32.S
    trunk/reactos/boot/freeldr/bootsect/fat32.asm
    trunk/reactos/boot/freeldr/bootsect/faty.S
    trunk/reactos/boot/freeldr/bootsect/isoboot.asm
    trunk/reactos/boot/freeldr/bootsect/isobtrt.asm

Modified: trunk/reactos/boot/freeldr/bootsect/fat.asm
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat.asm?rev=70432&r1=70431&r2=70432&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat.asm [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat.asm [iso-8859-1] Sat Dec 26 
21:28:01 2015
@@ -133,8 +133,8 @@
         xor cx,cx
         mov al,[BYTE bp+NumberOfFats]           ; Number of fats
         mul WORD [BYTE bp+SectorsPerFat]        ; Times sectors per fat
-        add ax,WORD [BYTE bp+HiddenSectors] 
-        adc dx,WORD [BYTE bp+HiddenSectors+2]   ; Add the number of hidden 
sectors 
+        add ax,WORD [BYTE bp+HiddenSectors]
+        adc dx,WORD [BYTE bp+HiddenSectors+2]   ; Add the number of hidden 
sectors
         add ax,WORD [BYTE bp+ReservedSectors]   ; Add the number of reserved 
sectors
         adc dx,cx                               ; Add carry bit
         mov WORD [BYTE bp-DataAreaStartLow],ax  ; Save the starting sector of 
the root directory
@@ -225,7 +225,7 @@
 Reboot:
         ; mov  si,msgAnyKey       ; Press any key message
         ; call PutChars           ; Display it
-        xor ax,ax       
+        xor ax,ax
         int 16h                 ; Wait for a keypress
         int 19h                 ; Reboot
 
@@ -270,7 +270,7 @@
 ; DX:AX has logical sector number to read
 ; CX has number of sectors to read
 ReadSectors:
-        
+
         ; We can't just check if the start sector is
         ; in the BIOS CHS range. We have to check if
         ; the start sector + length is in that range.
@@ -314,8 +314,8 @@
 ;       jz   PrintDiskError                     ; Bit 0, extended disk access 
functions (AH=42h-44h,47h,48h) supported
 
 
-                                                ; Good, we're here so the 
computer supports LBA disk access
-                                                ; So finish the extended read
+        ; Good, we're here so the computer supports LBA disk access
+        ; So finish the extended read
         mov  dl,[BYTE bp+BootDrive]             ; Drive number
         mov  ah,42h                             ; Int 13h, AH = 42h - Extended 
Read
         int  13h                                ; Call BIOS
@@ -333,10 +333,10 @@
         add  bx,byte 20h                        ; Increment read buffer for 
next sector
         mov  es,bx
         pop  bx
-                                                
+
         loop ReadSectorsLBALoop                 ; Read next sector
 
-        ret   
+        ret
 
 
 ; Reads logical sectors into [ES:BX]
@@ -351,7 +351,7 @@
         xchg ax,dx
         xor  dx,dx
         div  WORD [BYTE bp+SectorsPerTrack]
-        xchg ax,cx                    
+        xchg ax,cx
         div  WORD [BYTE bp+SectorsPerTrack]    ; Divide logical by 
SectorsPerTrack
         inc  dx                        ; Sectors numbering starts at 1 not 0
         xchg cx,dx
@@ -385,7 +385,7 @@
                                         ; Increment read buffer for next sector
         loop ReadSectorsCHSLoop         ; Read next sector
 
-        ret   
+        ret
 
 
 msgDiskError db 'Disk error',0dh,0ah,0

Modified: trunk/reactos/boot/freeldr/bootsect/fat32.S
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat32.S?rev=70432&r1=70431&r2=70432&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] Sat Dec 26 
21:28:01 2015
@@ -62,9 +62,9 @@
 BackupBootSector:
     .word    6
 Reserved1:
-    .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-
+    .space 12, 0
 // End FAT32 Inserted Info
+
 BootDrive:
     .byte 0
 Reserved:
@@ -355,8 +355,8 @@
     jmp  PrintFileNotFound
 
 FindFile:
-    mov  ax, es              // We didn't find it in the previous dir entry
-    add  ax, 2               // So lets move to the next one
+    mov  ax, es             // We didn't find it in the previous dir entry
+    add  ax, 2              // So lets move to the next one
     mov  es, ax             // And search again
     xor  di, di
     mov  si, offset filename

Modified: trunk/reactos/boot/freeldr/bootsect/fat32.asm
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat32.asm?rev=70432&r1=70431&r2=70432&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat32.asm       [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat32.asm       [iso-8859-1] Sat Dec 26 
21:28:01 2015
@@ -108,7 +108,7 @@
         ; First we have to load our extra boot code at
         ; sector 14 into memory at [0000:7e00h]
         mov  eax,0eh
-        add  eax,DWORD [BYTE bp+HiddenSectors]  ; Add the number of hidden 
sectors 
+        add  eax,DWORD [BYTE bp+HiddenSectors]  ; Add the number of hidden 
sectors
         mov  cx,1
         xor  bx,bx
         mov  es,bx                              ; Read sector to [0000:7e00h]
@@ -122,6 +122,7 @@
 ; EAX has logical sector number to read
 ; CX has number of sectors to read
 ReadSectors:
+        push es
         cmp  eax,DWORD [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
@@ -181,6 +182,7 @@
         sub  cx,[LBASectorsRead]
         jnz  ReadSectorsLBA                     ; Read next sector
 
+        pop es
         ret
 
 LBASectorsRead:
@@ -227,7 +229,7 @@
 
         loop  ReadSectorsCHSLoop                    ; Read next sector
 
-        ret   
+        ret
 
 
 
@@ -249,7 +251,7 @@
 Reboot:
         mov  si,msgAnyKey               ; Press any key message
         call PutChars                   ; Display it
-        xor ax,ax       
+        xor ax,ax
         int 16h                         ; Wait for a keypress
         int 19h                         ; Reboot
 
@@ -279,7 +281,7 @@
 
 BootSignature:
         dw 0aa55h       ; BootSector signature
-        
+
 
 ; End of bootsector
 ;
@@ -326,7 +328,7 @@
         add  ax,2               ; So lets move to the next one
         mov  es,ax              ; And search again
         xor  di,di
-        mov  si,filename        
+        mov  si,filename
         mov  cx,11
         rep  cmpsb              ; Compare filenames
         jz   FoundFile          ; If same we found it
@@ -340,7 +342,6 @@
         jmp  StartSearch
 
 FoundFile:
-
                                         ; Display "Loading FreeLoader..." 
message
         mov  si,msgLoading              ; Loading message
         call PutChars                   ; Display it
@@ -437,21 +438,21 @@
 
 LoadFatSector:
         push  ecx
+
+        mov   bx, 9000h                         ; 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 [FatSectorInCache]
         je   LoadFatSectorAlreadyLoaded
 
         mov  DWORD [FatSectorInCache],eax
-        mov  bx,9000h
-        mov  es,bx
-        xor  bx,bx                              ; We will load it to 
[9000:0000h]
+        xor  bx,bx
         mov  cx,1
         call ReadSectors
 
 LoadFatSectorAlreadyLoaded:
-        mov  bx,9000h
-        mov  es,bx
         pop  ecx
         mov  eax,DWORD [es:ecx]                 ; Get FAT entry
         and  eax,0fffffffh                      ; Mask off reserved bits

Modified: trunk/reactos/boot/freeldr/bootsect/faty.S
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/faty.S?rev=70432&r1=70431&r2=70432&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/faty.S  [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/faty.S  [iso-8859-1] Sat Dec 26 
21:28:01 2015
@@ -112,7 +112,7 @@
 BackupBootSector:
     .word    6
 Reserved1:
-    .byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    .space 12, 0
 #endif // FAT32
 
 BootDrive:

Modified: trunk/reactos/boot/freeldr/bootsect/isoboot.asm
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isoboot.asm?rev=70432&r1=70431&r2=70432&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/isoboot.asm     [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/isoboot.asm     [iso-8859-1] Sat Dec 26 
21:28:01 2015
@@ -14,7 +14,7 @@
 ;  the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
 ;  USA; either version 2 of the License, or (at your option) any later
 ;  version; incorporated herein by reference.
-; 
+;
 ; ****************************************************************************
 ;
 ; THIS FILE IS A MODIFIED VERSION OF ISOLINUX.ASM
@@ -158,7 +158,7 @@
        mov     byte [TimeoutCount], 5
 .next_second:
        mov     eax, [BIOS_timer]               ; load current tick counter
-       add     eax, 19                         ; 
+       add     eax, 19                         ;
 
 .poll_again:
        call    pollchar_and_empty

Modified: trunk/reactos/boot/freeldr/bootsect/isobtrt.asm
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isobtrt.asm?rev=70432&r1=70431&r2=70432&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/isobtrt.asm     [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/isobtrt.asm     [iso-8859-1] Sat Dec 26 
21:28:01 2015
@@ -14,7 +14,7 @@
 ;  the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
 ;  USA; either version 2 of the License, or (at your option) any later
 ;  version; incorporated herein by reference.
-; 
+;
 ; ****************************************************************************
 ;
 ; THIS FILE IS A MODIFIED VERSION OF ISOLINUX.ASM


Reply via email to