mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 16:36:11 +00:00
[FREELDR]
- In the fat bootsector, don't clobber ax, it contains the number of first cluster of freeldr.sys and is used by the fathelper code. - Fix jump code in the fathelper code, like in the other bootsectors. - Now booting from fat partitions (looks like that's what sysreg does) works again. It's safe under the condition that the cluster size is at least 4352 bytes, which is true for harddisks of sizes bigger than 272MB. Booting from smaller fat disks, like floppy breaks when freeldr.sys gets fragmented, which should rarely happen. svn path=/trunk/; revision=48177
This commit is contained in:
parent
c30930d3ec
commit
5dd4d18e01
|
@ -208,11 +208,11 @@ FoundFreeLoader:
|
||||||
; to the helper code. Skip the first three bytes
|
; to the helper code. Skip the first three bytes
|
||||||
; because they contain a jump instruction to skip
|
; because they contain a jump instruction to skip
|
||||||
; over the helper code in the FreeLoader image.
|
; over the helper code in the FreeLoader image.
|
||||||
;jmp 0000:8003h
|
;jmp 0000:9003h
|
||||||
push 0 ; push segment (0x0000)
|
push 0 ; push segment (0x0000)
|
||||||
mov eax, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax
|
mov bx, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax
|
||||||
add eax, 0x8003 ; RVA -> VA and skip 3 bytes (jump to fathelper code)
|
add bx, 0x8003 ; RVA -> VA and skip 3 bytes (jump to fathelper code)
|
||||||
push ax ; push offset
|
push bx ; push offset
|
||||||
retf ; Transfer control to FreeLoader
|
retf ; Transfer control to FreeLoader
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -125,10 +125,12 @@ LoadFile5:
|
||||||
LoadFile_Done:
|
LoadFile_Done:
|
||||||
mov dl,BYTE [BYTE bp+BootDrive] ; Load the boot drive into DL
|
mov dl,BYTE [BYTE bp+BootDrive] ; Load the boot drive into DL
|
||||||
mov dh,[BootPartition] ; Load the boot partition into DH
|
mov dh,[BootPartition] ; Load the boot partition into DH
|
||||||
push WORD 0x0000
|
|
||||||
push WORD 0x8000 ; We will do a far return to 0000:8000h
|
|
||||||
retf ; Transfer control to ROSLDR
|
|
||||||
|
|
||||||
|
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
|
; Reads the entire FAT into memory at 7000:0000
|
||||||
ReadFatIntoMemory:
|
ReadFatIntoMemory:
|
||||||
|
|
Loading…
Reference in a new issue