Author: akhaldi
Date: Sun Sep 5 16:31:06 2010
New Revision: 48702
URL:
http://svn.reactos.org/svn/reactos?rev=48702&view=rev
Log:
[FREELDR]
- Update fathelp.S to reflect Timo's recent changes in trunk.
Modified:
branches/cmake-bringup/boot/freeldr/freeldr/arch/amd64/fathelp.S
branches/cmake-bringup/boot/freeldr/freeldr/arch/i386/fathelp.S
Modified: branches/cmake-bringup/boot/freeldr/freeldr/arch/amd64/fathelp.S
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/boot/freeldr/free…
==============================================================================
--- branches/cmake-bringup/boot/freeldr/freeldr/arch/amd64/fathelp.S [iso-8859-1]
(original)
+++ branches/cmake-bringup/boot/freeldr/freeldr/arch/amd64/fathelp.S [iso-8859-1] Sun Sep
5 16:31:06 2010
@@ -4,9 +4,12 @@
.intel_syntax noprefix
+//org 8000h
+
.text
.code16
+
#define BootSectorStackTop 0x7bf2
#define DataAreaStartHigh 0x2
@@ -38,6 +41,8 @@
#define VolumeLabel 43
#define FileSystem 54
+#define BootPartition 0x7dfd
+
// This code will be stored in the first 512 bytes
// of freeldr.sys. The first 3 bytes will be a jmp
@@ -46,7 +51,6 @@
//
// This code is loaded at 0000:8000 so we have to
// encode a jmp instruction to jump to 0000:8200
-//.org 0x8000
.global _mainCRTStartup // For Mingw32 builds where the linker looks for this
symbol
_mainCRTStartup:
@@ -119,14 +123,14 @@
jmp LoadFile // Load the next cluster
(if any)
LoadFile_Done:
- mov dl, [bp+BootDrive] // Load the boot drive into DL
- mov dh, BootPartition // Load the boot partition
into DH
- push word ptr 0x0000
- push word ptr 0x8000 // We will do a far return
to 0000:8000h
-
-// retf // Transfer
control to ROSLDR
- .byte 0xcb // == retf
-
+ mov dl,BYTE PTR [bp+BootDrive] // Load the boot drive into DL
+ mov dh,[BootPartition] // Load the boot partition
into DH
+
+ push 0 // push segment (0x0000)
+ mov bx, [0x8000 + 0xA8] // load the RVA of the EntryPoint into eax
+ add bx, 0x8000 // RVA -> VA and skip 3 bytes
(jump to fathelper code)
+ push bx // push offset
+ retf // Transfer control to
FreeLoader
// Reads the entire FAT into memory at 7000:0000
ReadFatIntoMemory:
@@ -225,15 +229,7 @@
-msgLoading:
- .ascii "Loading FreeLoader..."
- .byte 0x0d,0x0a,0
-
-// times 510-($-$$) db 0 // Pad to 510 bytes
-.org 0x1fe
- .word 0x0aa55 // BootSector signature
-
-
-// pseudo adresses
-//.org 0x7dfd
-BootPartition:
+msgLoading: .asciz "Loading FreeLoader...\r\n"
+
+ .org 0x1fe // Pad to 510 bytes
+ .word 0x0aa55 // BootSector signature
Modified: branches/cmake-bringup/boot/freeldr/freeldr/arch/i386/fathelp.S
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/boot/freeldr/free…
==============================================================================
--- branches/cmake-bringup/boot/freeldr/freeldr/arch/i386/fathelp.S [iso-8859-1]
(original)
+++ branches/cmake-bringup/boot/freeldr/freeldr/arch/i386/fathelp.S [iso-8859-1] Sun Sep
5 16:31:06 2010
@@ -4,9 +4,12 @@
.intel_syntax noprefix
+//org 8000h
+
.text
.code16
+
#define BootSectorStackTop 0x7bf2
#define DataAreaStartHigh 0x2
@@ -38,6 +41,8 @@
#define VolumeLabel 43
#define FileSystem 54
+#define BootPartition 0x7dfd
+
// This code will be stored in the first 512 bytes
// of freeldr.sys. The first 3 bytes will be a jmp
@@ -46,7 +51,6 @@
//
// This code is loaded at 0000:8000 so we have to
// encode a jmp instruction to jump to 0000:8200
-//.org 0x8000
.global _mainCRTStartup // For Mingw32 builds where the linker looks for this
symbol
_mainCRTStartup:
@@ -119,14 +123,14 @@
jmp LoadFile // Load the next cluster
(if any)
LoadFile_Done:
- mov dl, [bp+BootDrive] // Load the boot drive into DL
- mov dh, BootPartition // Load the boot partition
into DH
- push word ptr 0x0000
- push word ptr 0x8000 // We will do a far return
to 0000:8000h
-
-// retf // Transfer
control to ROSLDR
- .byte 0xcb // == retf
-
+ mov dl,BYTE PTR [bp+BootDrive] // Load the boot drive into DL
+ mov dh,[BootPartition] // Load the boot partition
into DH
+
+ push 0 // push segment (0x0000)
+ mov bx, [0x8000 + 0xA8] // load the RVA of the EntryPoint into eax
+ add bx, 0x8000 // RVA -> VA and skip 3 bytes
(jump to fathelper code)
+ push bx // push offset
+ retf // Transfer control to
FreeLoader
// Reads the entire FAT into memory at 7000:0000
ReadFatIntoMemory:
@@ -225,15 +229,7 @@
-msgLoading:
- .ascii "Loading FreeLoader..."
- .byte 0x0d,0x0a,0
-
-// times 510-($-$$) db 0 // Pad to 510 bytes
-.org 0x1fe
- .word 0x0aa55 // BootSector signature
-
-
-// pseudo adresses
-//.org 0x7dfd
-BootPartition:
+msgLoading: .asciz "Loading FreeLoader...\r\n"
+
+ .org 0x1fe // Pad to 510 bytes
+ .word 0x0aa55 // BootSector signature