mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix for not valid PE module bug
svn path=/trunk/; revision=1752
This commit is contained in:
parent
4e81d099cf
commit
a934fd1c24
4 changed files with 63 additions and 61 deletions
|
@ -1,6 +1,6 @@
|
||||||
file ntoskrnl/ntoskrnl.nostrip.exe
|
file ntoskrnl/ntoskrnl.nostrip.exe
|
||||||
#add-symbol-file lib/ntdll/ntdll.dll 0x77f61000
|
#add-symbol-file lib/ntdll/ntdll.dll 0x77f61000
|
||||||
add-symbol-file lib/kernel32/kernel32.dll 0x77f01000
|
#add-symbol-file lib/kernel32/kernel32.dll 0x77f01000
|
||||||
#add-symbol-file apps/exp/exp.exe 0x401000
|
#add-symbol-file apps/exp/exp.exe 0x401000
|
||||||
#add-symbol-file subsys/csrss/csrss.exe 0x401000
|
#add-symbol-file subsys/csrss/csrss.exe 0x401000
|
||||||
#add-symbol-file subsys/smss/smss.exe 0x401000
|
#add-symbol-file subsys/smss/smss.exe 0x401000
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
/sbin/modprobe loop
|
/sbin/modprobe loop
|
||||||
#echo "Installing to floppy."
|
echo "Installing to floppy."
|
||||||
#mount -t vfat /bochs/1.44a /mnt/floppy -o loop,rw
|
mount -t vfat /bochs/1.44a.dos /mnt/floppy -o loop,rw
|
||||||
#./install-system.sh /mnt/floppy
|
./install-system.sh /mnt/floppy
|
||||||
#umount /mnt/floppy
|
umount /mnt/floppy
|
||||||
echo "Installing to disk."
|
echo "Installing to disk."
|
||||||
mount -t vfat /bochs/10M.vga.dos /mnt/floppy -o loop,offset=8704,rw
|
mount -t vfat /bochs/10M.vga.dos /mnt/floppy -o loop,offset=8704,rw
|
||||||
./install.sh /mnt/floppy
|
./install.sh /mnt/floppy
|
||||||
|
|
|
@ -49,6 +49,7 @@ BuildCommDCBAndTimeoutsW@12
|
||||||
BuildCommDCBW@8
|
BuildCommDCBW@8
|
||||||
CallNamedPipeA@28
|
CallNamedPipeA@28
|
||||||
CallNamedPipeW@28
|
CallNamedPipeW@28
|
||||||
|
CancelIo
|
||||||
CancelWaitableTimer@4
|
CancelWaitableTimer@4
|
||||||
ClearCommBreak@4
|
ClearCommBreak@4
|
||||||
ClearCommError@12
|
ClearCommError@12
|
||||||
|
|
|
@ -599,7 +599,24 @@ e_res2: resw 10
|
||||||
e_lfanew: resd 1
|
e_lfanew: resd 1
|
||||||
ENDSTRUC
|
ENDSTRUC
|
||||||
|
|
||||||
|
|
||||||
|
_mb_magic:
|
||||||
|
dd 0
|
||||||
|
_mb_flags:
|
||||||
|
dd 0
|
||||||
|
_mb_checksum:
|
||||||
|
dd 0
|
||||||
|
_mb_header_addr:
|
||||||
|
dd 0
|
||||||
|
_mb_load_addr:
|
||||||
|
dd 0
|
||||||
|
_mb_load_end_addr:
|
||||||
|
dd 0
|
||||||
|
_mb_bss_end_addr:
|
||||||
|
dd 0
|
||||||
|
_mb_entry_addr:
|
||||||
|
dd 0
|
||||||
|
|
||||||
_cpe_doshdr:
|
_cpe_doshdr:
|
||||||
times pe_doshdr_size db 0
|
times pe_doshdr_size db 0
|
||||||
_current_filehandle:
|
_current_filehandle:
|
||||||
|
@ -670,6 +687,38 @@ pe_load_module:
|
||||||
jmp .error
|
jmp .error
|
||||||
.mz_hdr_good
|
.mz_hdr_good
|
||||||
|
|
||||||
|
;;
|
||||||
|
;; Find the BSS size
|
||||||
|
;;
|
||||||
|
mov ebx, dword [_multiboot_mods_count]
|
||||||
|
cmp ebx, 0
|
||||||
|
jne .not_first
|
||||||
|
|
||||||
|
mov edx, 0
|
||||||
|
mov ax, 0x4200
|
||||||
|
mov cx, 0
|
||||||
|
mov dx, 0x1004
|
||||||
|
mov bx, [_current_filehandle]
|
||||||
|
int 0x21
|
||||||
|
jnc .start_seek1
|
||||||
|
mov dx, error_file_seek_failed
|
||||||
|
jmp .error
|
||||||
|
.start_seek1:
|
||||||
|
mov ah, 0x3F
|
||||||
|
mov bx, [_current_filehandle]
|
||||||
|
mov cx, 32
|
||||||
|
mov dx, _mb_magic
|
||||||
|
int 0x21
|
||||||
|
jnc .mb_header_read
|
||||||
|
mov dx, error_file_read_failed
|
||||||
|
jmp .error
|
||||||
|
.mb_header_read:
|
||||||
|
jmp .first
|
||||||
|
|
||||||
|
.not_first:
|
||||||
|
mov dword [_mb_bss_end_addr], 0
|
||||||
|
.first:
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Seek to the end of the file to get the file size
|
;; Seek to the end of the file to get the file size
|
||||||
;;
|
;;
|
||||||
|
@ -787,12 +836,17 @@ pe_load_module:
|
||||||
int 021h
|
int 021h
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
.do_round:
|
mov edx, [_mb_bss_end_addr]
|
||||||
|
cmp edx, 0
|
||||||
|
je .no_bss
|
||||||
|
mov edi, edx
|
||||||
|
.no_bss:
|
||||||
test di, 0xfff
|
test di, 0xfff
|
||||||
jz .no_round
|
jz .no_round
|
||||||
and di, 0xf000
|
and di, 0xf000
|
||||||
add edi, 0x1000
|
add edi, 0x1000
|
||||||
.no_round
|
.no_round:
|
||||||
|
|
||||||
mov bx, [_multiboot_mods_count]
|
mov bx, [_multiboot_mods_count]
|
||||||
imul bx, bx, multiboot_module_size
|
imul bx, bx, multiboot_module_size
|
||||||
add bx, _multiboot_modules
|
add bx, _multiboot_modules
|
||||||
|
@ -875,59 +929,6 @@ _himem_copy:
|
||||||
pop ds
|
pop ds
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;;
|
|
||||||
;; Zero high memory
|
|
||||||
;; ARGUMENTS
|
|
||||||
;; EDI = Destination address
|
|
||||||
;; ECX = Byte count
|
|
||||||
;; RETURNS
|
|
||||||
;; EDI = End of the destination region
|
|
||||||
;; ECX = 0
|
|
||||||
;;
|
|
||||||
_himem_zero:
|
|
||||||
push ds ; Save DS
|
|
||||||
push es
|
|
||||||
push eax
|
|
||||||
|
|
||||||
mov [.old_cs], cs
|
|
||||||
|
|
||||||
cli ; No interrupts during pmode
|
|
||||||
|
|
||||||
mov eax, cr0 ; Entered protected mode
|
|
||||||
or eax, 0x1
|
|
||||||
mov cr0, eax
|
|
||||||
|
|
||||||
jmp LOADER_CS:.l1 ; Flush prefetch queue
|
|
||||||
.l1:
|
|
||||||
|
|
||||||
mov eax, KERNEL_DS ; Load DS with a suitable selector
|
|
||||||
mov ds, ax
|
|
||||||
mov eax, LOADER_DS
|
|
||||||
mov es, ax
|
|
||||||
|
|
||||||
.l2:
|
|
||||||
mov byte [ds:edi], 0
|
|
||||||
dec ecx
|
|
||||||
inc si
|
|
||||||
inc edi
|
|
||||||
cmp ecx, 0
|
|
||||||
jne .l2
|
|
||||||
|
|
||||||
mov eax, cr0 ; Leave protected mode
|
|
||||||
and eax, 0xfffffffe
|
|
||||||
mov cr0, eax
|
|
||||||
|
|
||||||
db 0xea
|
|
||||||
dw .l3
|
|
||||||
.old_cs:
|
|
||||||
dw 0x0
|
|
||||||
.l3:
|
|
||||||
sti
|
|
||||||
pop eax
|
|
||||||
pop es
|
|
||||||
pop ds
|
|
||||||
ret
|
|
||||||
|
|
||||||
;
|
;
|
||||||
; Loading message
|
; Loading message
|
||||||
;
|
;
|
||||||
|
|
Loading…
Reference in a new issue