Author: hbelusca
Date: Sat Dec 26 20:43:50 2015
New Revision: 70431
URL:
http://svn.reactos.org/svn/reactos?rev=70431&view=rev
Log:
[BOOTSECTORS]: Sync the .asm files with their .S counterparts (make easier for
diff'ing).
Modified:
trunk/reactos/boot/freeldr/bootsect/fat.S
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/isoboot.asm
trunk/reactos/boot/freeldr/bootsect/isobtrt.asm
Modified: trunk/reactos/boot/freeldr/bootsect/fat.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat.…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat.S [iso-8859-1] Sat Dec 26 20:43:50 2015
@@ -29,7 +29,7 @@
// of the PutChars function in the boot sector.
//
// When it locates freeldr.sys on the disk it will
-// load the first sector of the file to 0000:8000
+// load the first sector of the file to 0000:F800
// With the help of this sector we should be able
// to load the entire file off the disk, no matter
// how fragmented it is.
Modified: trunk/reactos/boot/freeldr/bootsect/fat.asm
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat.…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat.asm [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat.asm [iso-8859-1] Sat Dec 26 20:43:50 2015
@@ -29,7 +29,7 @@
; of the PutChars function in the boot sector.
;
; When it locates freeldr.sys on the disk it will
-; load the first sector of the file to 0000:8000
+; load the first sector of the file to 0000:F800
; With the help of this sector we should be able
; to load the entire file off the disk, no matter
; how fragmented it is.
@@ -187,12 +187,12 @@
FoundFreeLoader:
; We found freeldr.sys on the disk
; so we need to load the first 512
- ; bytes of it to 0000:8000
+ ; bytes of it to 0000:F800
; ES:DI has dir entry (ES:DI == 07E0:XXXX)
mov ax,WORD [es:di+1ah] ; Get start cluster
push ax ; Save start cluster
- push WORD 800h ; Put 800h on the stack and load it
- pop es ; Into ES so that we load the cluster at
0000:8000
+ push WORD 0F80h ; FREELDR_BASE / 16 ; Put load segment on the stack and load
it
+ pop es ; Into ES so that we load the cluster at
0000:F800
call ReadCluster ; Read the cluster
pop ax ; Restore start cluster of FreeLoader
@@ -204,16 +204,14 @@
; Now AX has start cluster of FreeLoader and we
; have loaded the helper code in the first 512 bytes
- ; of FreeLoader to 0000:8000. Now transfer control
+ ; of FreeLoader to 0000:F800. Now transfer control
; to the helper code. Skip the first three bytes
; because they contain a jump instruction to skip
; over the helper code in the FreeLoader image.
- ;jmp 0000:9003h
- push 0 ; push segment (0x0000)
- mov bx, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax
- add bx, 0x8003 ; RVA -> VA and skip 3 bytes (jump to fathelper
code)
- push bx ; push offset
- retf ; Transfer control to FreeLoader
+ ;ljmp16 0, FREELDR_BASE + 3
+ db 0EAh
+ dw 0F803h
+ dw 0
@@ -225,8 +223,8 @@
call PutChars ; Display it
Reboot:
- mov si,msgAnyKey ; Press any key message
- call PutChars ; Display it
+ ; mov si,msgAnyKey ; Press any key message
+ ; call PutChars ; Display it
xor ax,ax
int 16h ; Wait for a keypress
int 19h ; Reboot
Modified: trunk/reactos/boot/freeldr/bootsect/fat32.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat3…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] Sat Dec 26 20:43:50 2015
@@ -400,7 +400,7 @@
cmp eax, HEX(0ffffff8) // Check to see if this is the last cluster in the chain
jae LoadFileDone // If so continue, if not then read the next one
push eax
- xor bx, bx // Load ROSLDR starting at 0000:8000h
+ xor bx, bx // Load ROSLDR starting at 0000:F800h
push es
call ReadCluster
pop es
Modified: trunk/reactos/boot/freeldr/bootsect/fat32.asm
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat3…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/fat32.asm [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/fat32.asm [iso-8859-1] Sat Dec 26 20:43:50 2015
@@ -361,14 +361,14 @@
jmp PrintFileSystemError ; If so exit with error
InitializeLoadSegment:
- mov bx,800h
+ mov bx,0F80h ; FREELDR_BASE / 16
mov es,bx
LoadFile:
cmp eax,0ffffff8h ; Check to see if this is the last cluster in the chain
jae LoadFileDone ; If so continue, if not then read the next one
push eax
- xor bx,bx ; Load ROSLDR starting at 0000:8000h
+ xor bx,bx ; Load ROSLDR starting at 0000:F800h
push es
call ReadCluster
pop es
@@ -391,11 +391,11 @@
mov dl,[BYTE bp+BootDrive] ; Load boot drive into DL
mov dh,[BootPartition] ; Load boot partition into DH
- push 0 ; push segment (0x0000)
- mov eax, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax
- add eax, 0x8000 ; RVA -> VA
- push ax ; push offset
- retf ; Transfer control to FreeLoader
+ ; Transfer execution to the bootloader
+ ;ljmp16 0, FREELDR_BASE
+ db 0EAh
+ dw 0F800h
+ dw 0
; Returns the FAT entry for a given cluster number
; On entry EAX has cluster number
Modified: trunk/reactos/boot/freeldr/bootsect/isoboot.asm
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isob…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/isoboot.asm [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/isoboot.asm [iso-8859-1] Sat Dec 26 20:43:50 2015
@@ -360,7 +360,10 @@
call crlf
%endif
- mov bx, 0x8000 ; bx = load address
+; use high segment, as some bios can fail, when offset is too big
+ mov bx, 0x0F80 ; FREELDR_BASE / 16 ; es = load segment
+ mov es, bx
+ xor ebx, ebx ; bx = load offset
mov si, di ; restore file pointer
mov cx, 0xFFFF ; load the whole file
call getfssec ; get the whole file
@@ -373,13 +376,12 @@
mov dl, [DriveNo] ; dl = boot drive
mov dh, 0 ; dh = boot partition
- push 0 ; push segment (0x0000)
- mov eax, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax
- add eax, 0x8000 ; RVA -> VA
- push ax ; push offset
- retf ; Transfer control to ROSLDR
-
-
+
+ ; Transfer execution to the bootloader
+ ;ljmp16 0, FREELDR_BASE
+ db 0xEA
+ dw 0xF800
+ dw 0
;
; searchdir:
@@ -944,7 +946,7 @@
startldr_msg: db 'Starting SETUPLDR.SYS', 0
%endif
-nosecsize_msg: db 'No sector size, assume 0800', CR, LF, 0
+; nosecsize_msg: db 'No sector size, assume 0800', CR, LF, 0
spec_err_msg: db 'Load spec failed, trying wing ...', CR, LF, 0
maybe_msg: db 'Found smth at drive = ', 0
alright_msg: db 'might be ok, continuing...', CR, LF, 0
Modified: trunk/reactos/boot/freeldr/bootsect/isobtrt.asm
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isob…
==============================================================================
--- trunk/reactos/boot/freeldr/bootsect/isobtrt.asm [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/bootsect/isobtrt.asm [iso-8859-1] Sat Dec 26 20:43:50 2015
@@ -332,7 +332,10 @@
call crlf
%endif
- mov bx, 0x8000 ; bx = load address
+; use high segment, as some bios can fail, when offset is too big
+ mov bx, 0x0F80 ; FREELDR_BASE / 16 ; es = load segment
+ mov es, bx
+ xor ebx, ebx ; bx = load offset
mov si, di ; restore file pointer
mov cx, 0xFFFF ; load the whole file
call getfssec ; get the whole file
@@ -345,13 +348,12 @@
mov dl, [DriveNo] ; dl = boot drive
mov dh, 0 ; dh = boot partition
- push 0 ; push segment (0x0000)
- mov eax, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax
- add eax, 0x8000 ; RVA -> VA
- push ax ; push offset
- retf ; Transfer control to ROSLDR
-
-
+
+ ; Transfer execution to the bootloader
+ ;ljmp16 0, FREELDR_BASE
+ db 0xEA
+ dw 0xF800
+ dw 0
;
; searchdir:
@@ -892,7 +894,7 @@
isolinux_banner db CR, LF, 'Loading IsoBoot...', CR, LF, 0
-copyright_str db ' Copyright (C) 1994-2002 H. Peter Anvin', CR, LF, 0
+copyright_str db ' (C) 1994-2002 H. Peter Anvin', CR, LF, 0
presskey_msg db 'Press any key to boot from CD', 0
dot_msg db '.',0
@@ -910,7 +912,7 @@
startldr_msg: db 'Starting SETUPLDR.SYS', 0
%endif
-nosecsize_msg: db 'Failed to get sector size, assuming 0800', CR, LF, 0
+; nosecsize_msg: db 'Failed to get sector size, assuming 0800', CR, LF, 0
spec_err_msg: db 'Loading spec packet failed, trying to wing it...', CR, LF, 0
maybe_msg: db 'Found something at drive = ', 0
alright_msg: db 'Looks like it might be right, continuing...', CR, LF, 0