Author: hbelusca Date: Sun Feb 1 22:15:32 2015 New Revision: 66146
URL: http://svn.reactos.org/svn/reactos?rev=66146&view=rev Log: [FREELDR]: All tabs to 4 spaces and remove trailing whitespace.
Modified: trunk/reactos/boot/freeldr/freeldr/CHANGELOG trunk/reactos/boot/freeldr/freeldr/arch/amd64/entry.S trunk/reactos/boot/freeldr/freeldr/arch/amd64/int386.S trunk/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c trunk/reactos/boot/freeldr/freeldr/arch/i386/drvmap.S trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S trunk/reactos/boot/freeldr/freeldr/arch/i386/mb.S trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c trunk/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_util.s trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c trunk/reactos/boot/freeldr/freeldr/arch/realmode/amd64.S trunk/reactos/boot/freeldr/freeldr/arch/realmode/fathelp.inc trunk/reactos/boot/freeldr/freeldr/arch/realmode/helpers.inc trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S trunk/reactos/boot/freeldr/freeldr/arch/realmode/int386.inc trunk/reactos/boot/freeldr/freeldr/arch/realmode/linux.inc trunk/reactos/boot/freeldr/freeldr/arch/realmode/pnp.inc trunk/reactos/boot/freeldr/freeldr/arch/realmode/pxe.inc trunk/reactos/boot/freeldr/freeldr/comm/rs232.c trunk/reactos/boot/freeldr/freeldr/include/ver.h trunk/reactos/boot/freeldr/freeldr/ui/directui.c trunk/reactos/boot/freeldr/freeldr/ui/minitui.c trunk/reactos/boot/freeldr/freeldr/windows/headless.c
Modified: trunk/reactos/boot/freeldr/freeldr/CHANGELOG URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CHANGE... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/CHANGELOG [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/CHANGELOG [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -38,7 +38,7 @@
Changes in v1.8.24 (09/20/2004) (hbirr)
-- Implemented the driver loading by the sequence of tag entries +- Implemented the driver loading by the sequence of tag entries in the GroupOrderList key.
Changes in v1.8.23 (30/08/2004) (ekohl) @@ -56,7 +56,7 @@ - Experimental NTFS reading support with no boot code yet. - Adjusted detection timeouts for PS/2 and RS232 to the minimum allowed by the specifications. -- Enabled the 'Press any key to boot from CD' message in the ISO +- Enabled the 'Press any key to boot from CD' message in the ISO boot code and show it only when some hard disk is present.
Changes in v1.8.20 (21/05/2004) (navaraf) @@ -228,7 +228,7 @@ - freeldr.c, bootmgr.c, setupldr.c, makefile: Renamed LoadBootManager() and ReactOSRunSetupLoader() to RunLoader(). Either bootmgr.o or setupldr.o is used to build freeldr.sys or - setupldr.sys + setupldr.sys
Changes in v1.7.5 (8/21/2002) (brianp)
Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/entry.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/a... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/entry.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/entry.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -1,4 +1,3 @@ -
#include <asm.inc> #include <arch/pc/x86common.h> @@ -45,11 +44,11 @@ xor rcx, rcx call BootMain
- /* We should never get here */ + /* We should never get here */ stop: - jmp stop - nop - nop + jmp stop + nop + nop
PUBLIC Reboot @@ -74,17 +73,17 @@
SwitchToReal: /* Set sane segments */ - mov ax, LMODE_DS - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - //mov ss, ax + mov ax, LMODE_DS + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + //mov ss, ax
//mov word ptr [HEX(0b8008)], HEX(0e00) + '4'
- /* Save 64-bit stack pointer */ - mov qword ptr [stack64], rsp + /* Save 64-bit stack pointer */ + mov qword ptr [stack64], rsp
/* Step 1 - jump to compatibility segment */ jmp fword ptr [jumpvector] @@ -97,15 +96,15 @@ /* Note: In fact the CPU is in 32 bit mode here. But it will interprete the generated instructions accordingly. rax will become eax */
- /* Step 2 - deactivate long mode, by disabling paging */ - mov rax, cr0 - and eax, HEX(7fffffff) //~0x80000000, upper bits cleared - mov cr0, rax + /* Step 2 - deactivate long mode, by disabling paging */ + mov rax, cr0 + and eax, HEX(7fffffff) //~0x80000000, upper bits cleared + mov cr0, rax
// mov word ptr [HEX(0b800a)], HEX(0e00) + '5'
- /* Step 3 - jump to 16-bit segment to set the limit correctly */ - .byte HEX(0EA) // 32bit long jmp + /* Step 3 - jump to 16-bit segment to set the limit correctly */ + .byte HEX(0EA) // 32bit long jmp AddressOfRealModeEntryPoint: .long 0 // receives address of RealModeEntryPoint .word HEX(20)//RMODE_CS @@ -119,7 +118,7 @@ /////////////////////////////////////////
- /* 64-bit stack pointer */ + /* 64-bit stack pointer */ stack64: .double STACKADDR
Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/int386.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/a... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/int386.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/int386.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -34,18 +34,18 @@ mov qword ptr [r11 + 16], rdx mov qword ptr [r11 + 24], r8
- /* Save non-volatile registers */ - push rbx - push rbp - push rsi - push rdi + /* Save non-volatile registers */ + push rbx + push rbp + push rsi + push rdi
/* Alloc stack space for home registers */ - sub rsp, 40 + sub rsp, 40 //.ENDPROLOG
int386_2: - /* Copy the int vector to shared memory */ + /* Copy the int vector to shared memory */ mov dword ptr [BSS_IntVector], ecx
/* Copy input registers */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/a... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/pnpbios.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -41,25 +41,25 @@ xor rdi, rdi
/* init rsi */ - mov rsi, HEX(0F0000) + mov rsi, HEX(0F0000)
pnp_again: mov eax, [rsi] - cmp eax, HEX(506E5024) /* "$PnP" */ + cmp eax, HEX(506E5024) /* "$PnP" */ je pnp_found
- cmp rsi, HEX(0FFFF0) + cmp rsi, HEX(0FFFF0) je pnp_not_found
pnp_add: - add rsi, 16 + add rsi, 16 jmp pnp_again
pnp_found: /* first calculate the checksum */ push rsi
- push HEX(21) + push HEX(21) pop rcx xor edx, edx
@@ -76,14 +76,14 @@
/* Calculate the bios entry point (far pointer) */ xor eax, eax - mov ax, [rsi + HEX(0F)] - shl eax, 16 - mov ax, [rsi + HEX(0D)] - mov dword ptr [BSS_PnpBiosEntryPoint], eax + mov ax, [rsi + HEX(0F)] + shl eax, 16 + mov ax, [rsi + HEX(0D)] + mov dword ptr [BSS_PnpBiosEntryPoint], eax
/* Store bios data segment */ mov ax, [rsi + HEX(1B)] - mov word ptr [BSS_PnpBiosDataSegment], ax + mov word ptr [BSS_PnpBiosDataSegment], ax
pnp_not_found: mov rax, rdi @@ -109,14 +109,14 @@ call CallRealMode
xor eax, eax - mov ax, [BSS_PnpNodeSize] - mov [rcx], eax - mov ax, [BSS_PnpNodeCount] - mov [rdx], eax + mov ax, [BSS_PnpNodeSize] + mov [rcx], eax + mov ax, [BSS_PnpNodeCount] + mov [rdx], eax
- mov eax, dword ptr [BSS_PnpResult] + mov eax, dword ptr [BSS_PnpResult]
- ret + ret
@@ -128,29 +128,29 @@ PUBLIC PnpBiosGetDeviceNode PnpBiosGetDeviceNode:
- /* get current node number */ - mov al, [rcx] - mov byte ptr [BSS_PnpNodeNumber], al + /* get current node number */ + mov al, [rcx] + mov byte ptr [BSS_PnpNodeNumber], al
- /* convert pointer to node buffer to segment/offset */ - mov rax, rdx - shr eax, 4 - mov word ptr [BSS_PnpBiosBufferSegment], ax - mov rax, rdx - and eax, HEX(0f) - mov word ptr [BSS_PnpBiosBufferOffset], ax + /* convert pointer to node buffer to segment/offset */ + mov rax, rdx + shr eax, 4 + mov word ptr [BSS_PnpBiosBufferSegment], ax + mov rax, rdx + and eax, HEX(0f) + mov word ptr [BSS_PnpBiosBufferOffset], ax
/* Call the real mode function */ mov bx, FNID_PnpBiosGetDeviceNode call CallRealMode
- /* update node number */ - mov al, byte ptr [BSS_PnpNodeNumber] - mov [rcx], al + /* update node number */ + mov al, byte ptr [BSS_PnpNodeNumber] + mov [rcx], al
- mov eax, [BSS_PnpResult] + mov eax, [BSS_PnpResult]
- ret + ret
END /* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/a... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -106,12 +106,12 @@ PHARDWARE_PDE_ARMV6 PointerPde; PHARDWARE_LARGE_PTE_ARMV6 LargePte; PFN_NUMBER Pfn; - + /* Setup the Startup PDE */ LargePte = &PdrPage->PageDir.Pte[StartupPdePageTableIndex]; TempLargePte.PageFrameNumber = PaToLargePfn((ULONG_PTR)&PdrPage->PageDir); *LargePte = TempLargePte; - + /* Map-in the PDR */ LargePte = &PdrPage->PageDir.Pte[PdrPageTableIndex]; *LargePte = TempLargePte; @@ -130,7 +130,7 @@ *PointerPde++ = TempPde; }
- /* + /* * Now map these page tables in PTE space (MiAddressToPte(PTE_BASE)). * Note that they all live on a single page, since each is 1KB. */ @@ -156,7 +156,7 @@ TempPte.PageFrameNumber = 0; *PointerPte = TempPte;
- /* TODO: Map in the kernel CPTs */ + /* TODO: Map in the kernel CPTs */ return TRUE; }
@@ -177,7 +177,7 @@ LoaderBlock->u.Arm.SecondLevelDcacheFillSize = SecondLevelDcacheFillSize; LoaderBlock->u.Arm.SecondLevelIcacheSize = SecondLevelIcacheSize; LoaderBlock->u.Arm.SecondLevelIcacheFillSize = SecondLevelIcacheSize; - + /* Write initial context information */ LoaderBlock->KernelStack = (ULONG_PTR)PdrPage->KernelStack; LoaderBlock->KernelStack += KERNEL_STACK_SIZE; @@ -248,11 +248,11 @@ WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG Pcr, IN ULONG Tss) -{ +{ ARM_CONTROL_REGISTER ControlRegister; ARM_TTB_REGISTER TtbRegister; ARM_DOMAIN_REGISTER DomainRegister; - + /* Set the TTBR */ TtbRegister.AsUlong = (ULONG_PTR)&PdrPage->PageDir; ASSERT(TtbRegister.Reserved == 0); @@ -270,5 +270,5 @@ ControlRegister.DCacheEnabled = TRUE; ControlRegister.ForceAp = TRUE; ControlRegister.ExtendedPageTables = TRUE; - KeArmControlRegisterSet(ControlRegister); -} + KeArmControlRegisterSet(ControlRegister); +}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/drvmap.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/drvmap.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/drvmap.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -27,115 +27,115 @@ _DriveMapInt13HandlerStart: Int13Handler:
- push bp - mov bp, sp - push ax - push cx - push si + push bp + mov bp, sp + push ax + push cx + push si
- cld + cld
- /* Get callers flags from stack */ - mov ax, [bp + 6] - mov word ptr cs:[CallersFlags - Int13Handler], ax + /* Get callers flags from stack */ + mov ax, [bp + 6] + mov word ptr cs:[CallersFlags - Int13Handler], ax
- /* Save the drive number they passed in */ - mov cs:[PassedInDriveNumber - Int13Handler], dl + /* Save the drive number they passed in */ + mov cs:[PassedInDriveNumber - Int13Handler], dl
- /* Now we need to perform the mapping */ - xor cx, cx - mov si, offset Int13HandlerMapCount - Int13Handler + /* Now we need to perform the mapping */ + xor cx, cx + mov si, offset Int13HandlerMapCount - Int13Handler
- /* Get the count of drives in the map list */ - mov cl, cs:[si] - inc si + /* Get the count of drives in the map list */ + mov cl, cs:[si] + inc si
- /* If the map list is empty then just call the old int 13h handler */ - cmp cl, 0 - jz CallOldInt13Handler + /* If the map list is empty then just call the old int 13h handler */ + cmp cl, 0 + jz CallOldInt13Handler
GetMappedDriveNumberLoop:
- /* Get the next drive number in the list */ - lods ax, cs:[si] + /* Get the next drive number in the list */ + lods ax, cs:[si]
- /* Check to see if it's the one they are calling int 13h for */ - cmp dl, al + /* Check to see if it's the one they are calling int 13h for */ + cmp dl, al
- /* If not get the next one */ - jne GetMappedDriveNumberLoopNext + /* If not get the next one */ + jne GetMappedDriveNumberLoopNext
- /* If we get here then we have found a mapped drive */ - /* Send new drive number on to the old int 13h handler */ - mov dl, ah + /* If we get here then we have found a mapped drive */ + /* Send new drive number on to the old int 13h handler */ + mov dl, ah
- /* Call BIOS Int 13 Handler */ - jmp CallOldInt13Handler + /* Call BIOS Int 13 Handler */ + jmp CallOldInt13Handler
GetMappedDriveNumberLoopNext: - loop GetMappedDriveNumberLoop + loop GetMappedDriveNumberLoop
CallOldInt13Handler: - /* Restore the registers we changed off the stack */ - pop si - pop cx - pop ax + /* Restore the registers we changed off the stack */ + pop si + pop cx + pop ax
- /* Put flags onto stack */ - push word ptr cs:[CallersFlags - Int13Handler] + /* Put flags onto stack */ + push word ptr cs:[CallersFlags - Int13Handler]
- /* Call old int 13h handler with new drive number */ - .byte HEX(9a) /* lcall */ + /* Call old int 13h handler with new drive number */ + .byte HEX(9a) /* lcall */ PUBLIC _DriveMapOldInt13HandlerAddress _DriveMapOldInt13HandlerAddress: - .word 0 - .word 0 + .word 0 + .word 0
- /* Update the callers flags with the values the BIOS returned */ - push ax - pushf - pop ax - mov [bp + 6], ax - pop ax + /* Update the callers flags with the values the BIOS returned */ + push ax + pushf + pop ax + mov [bp + 6], ax + pop ax
- /* Restore the callers drive number */ - mov dl, cs:[PassedInDriveNumber - Int13Handler] + /* Restore the callers drive number */ + mov dl, cs:[PassedInDriveNumber - Int13Handler]
- pop bp + pop bp
- iret + iret
CallersFlags: - .word 0 + .word 0
PassedInDriveNumber: - .byte 0 + .byte 0
PUBLIC _DriveMapInt13HandlerMapList _DriveMapInt13HandlerMapList: Int13HandlerMapCount: - .byte 0 + .byte 0
Int13HandlerDrive1: - .byte 0 + .byte 0 Int13HandlerDriveNew1: - .byte 0 + .byte 0
Int13HandlerDrive2: - .byte 0 + .byte 0 Int13HandlerDriveNew2: - .byte 0 + .byte 0
Int13HandlerDrive3: - .byte 0 + .byte 0 Int13HandlerDriveNew3: - .byte 0 + .byte 0
Int13HandlerDrive4: - .byte 0 + .byte 0 Int13HandlerDriveNew4: - .byte 0 + .byte 0
PUBLIC _DriveMapInt13HandlerEnd _DriveMapInt13HandlerEnd:
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -245,13 +245,13 @@
/* 16-bit stack pointer */ stack16: - .word STACK16ADDR + .word STACK16ADDR
/* 32-bit stack pointer */ stack32: .long STACKADDR
- .align 4 /* force 4-byte alignment */ + .align 4 /* force 4-byte alignment */ gdt: /* NULL Descriptor */ .word HEX(0000) @@ -285,18 +285,18 @@
/* GDT table pointer */ gdtptr: - .word HEX(27) /* Limit */ - .long gdt /* Base Address */ + .word HEX(27) /* Limit */ + .long gdt /* Base Address */
/* Real-mode IDT pointer */ rmode_idtptr: - .word HEX(3ff) /* Limit */ - .long 0 /* Base Address */ + .word HEX(3ff) /* Limit */ + .long 0 /* Base Address */
PUBLIC i386idtptr i386idtptr: - .word 255 /* Limit */ - .long _i386Idt /* Base Address */ + .word 255 /* Limit */ + .long _i386Idt /* Base Address */
PUBLIC _FrldrBootDrive _FrldrBootDrive:
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386bug.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -33,7 +33,8 @@ "Exception 12: MACHINE CHECK\n\n" };
-#define SCREEN_ATTR 0x1f +#define SCREEN_ATTR 0x1F // Bright white on blue background + void i386PrintChar(char chr, ULONG x, ULONG y) {
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386pnp.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -32,67 +32,67 @@ PUBLIC _PnpBiosSupported _PnpBiosSupported:
- push edi - push esi - push ecx - push edx + push edi + push esi + push ecx + push edx
- xor edi, edi + xor edi, edi
- /* init esi */ - mov esi, HEX(0F0000) + /* init esi */ + mov esi, HEX(0F0000)
pnp_again: - mov eax, [esi] - cmp eax, HEX(506E5024) /* "$PnP" */ - je pnp_found + mov eax, [esi] + cmp eax, HEX(506E5024) /* "$PnP" */ + je pnp_found
- cmp esi, HEX(0FFFF0) - je pnp_not_found + cmp esi, HEX(0FFFF0) + je pnp_not_found
pnp_add: - add esi, 16 - jmp pnp_again + add esi, 16 + jmp pnp_again
pnp_found: - /* first calculate the checksum */ - push esi + /* first calculate the checksum */ + push esi
- push HEX(21) - pop ecx - xor edx, edx + push HEX(21) + pop ecx + xor edx, edx
pnp_loop: - lodsb - add dl, al - loop pnp_loop + lodsb + add dl, al + loop pnp_loop
- test dl, dl - pop esi - jnz pnp_add + test dl, dl + pop esi + jnz pnp_add
- mov edi, esi + mov edi, esi
- /* Calculate the bios entry point (far pointer) */ - xor eax, eax - mov ax, [esi + HEX(0F)] - shl eax, 16 - mov ax, [esi + HEX(0D)] - mov dword ptr ds:[BSS_PnpBiosEntryPoint], eax + /* Calculate the bios entry point (far pointer) */ + xor eax, eax + mov ax, [esi + HEX(0F)] + shl eax, 16 + mov ax, [esi + HEX(0D)] + mov dword ptr ds:[BSS_PnpBiosEntryPoint], eax
- /* Store bios data segment */ - mov ax, [esi + HEX(1B)] - mov word ptr ds:[BSS_PnpBiosDataSegment], ax + /* Store bios data segment */ + mov ax, [esi + HEX(1B)] + mov word ptr ds:[BSS_PnpBiosDataSegment], ax
pnp_not_found: - mov eax, edi + mov eax, edi
- pop edx - pop ecx - pop esi - pop edi + pop edx + pop ecx + pop esi + pop edi
- ret + ret
/* @@ -103,34 +103,34 @@ PUBLIC _PnpBiosGetDeviceNodeCount _PnpBiosGetDeviceNodeCount:
- push ebp - mov ebp, esp + push ebp + mov ebp, esp
- pusha - push es + pusha + push es
mov bx, FNID_PnpBiosGetDeviceNodeCount call i386CallRealMode
- mov esi, [ebp + 8] - mov ax, [BSS_PnpNodeSize] - movzx ecx, ax - mov [esi], ecx + mov esi, [ebp + 8] + mov ax, [BSS_PnpNodeSize] + movzx ecx, ax + mov [esi], ecx
- mov esi, [ebp + 12] - mov ax, [BSS_PnpNodeCount] - movzx ecx, ax - mov [esi], ecx + mov esi, [ebp + 12] + mov ax, [BSS_PnpNodeCount] + movzx ecx, ax + mov [esi], ecx
- pop es - popa + pop es + popa
- mov esp, ebp - pop ebp + mov esp, ebp + pop ebp
- mov eax, dword ptr [BSS_PnpResult] + mov eax, dword ptr [BSS_PnpResult]
- ret + ret
/* @@ -141,43 +141,44 @@ PUBLIC _PnpBiosGetDeviceNode _PnpBiosGetDeviceNode:
- push ebp - mov ebp, esp + push ebp + mov ebp, esp
- pusha - push es + pusha + push es
- /* get current node number */ - mov esi, [ebp + 8] - mov al, [esi] - mov byte ptr ds:[BSS_PnpNodeNumber], al + /* get current node number */ + mov esi, [ebp + 8] + mov al, [esi] + mov byte ptr ds:[BSS_PnpNodeNumber], al
- /* convert pointer to node buffer to segment/offset */ - mov eax, [ebp + 12] - shr eax, 4 - and eax, HEX(0f000) - mov word ptr ds:[BSS_PnpBiosBufferSegment], ax - mov eax, [ebp + 12] - and eax, HEX(0ffff) - mov word ptr ds:[BSS_PnpBiosBufferOffset], ax + /* convert pointer to node buffer to segment/offset */ + mov eax, [ebp + 12] + shr eax, 4 + and eax, HEX(0f000) + mov word ptr ds:[BSS_PnpBiosBufferSegment], ax + mov eax, [ebp + 12] + and eax, HEX(0ffff) + mov word ptr ds:[BSS_PnpBiosBufferOffset], ax
mov bx, FNID_PnpBiosGetDeviceNode call i386CallRealMode
- /* update node number */ - mov esi, [ebp + 8] - mov al, byte ptr ds:[BSS_PnpNodeNumber] - mov [esi], al + /* update node number */ + mov esi, [ebp + 8] + mov al, byte ptr ds:[BSS_PnpNodeNumber] + mov [esi], al
- pop es - popa + pop es + popa
- mov esp, ebp - pop ebp + mov esp, ebp + pop ebp
- mov eax, [BSS_PnpResult] + mov eax, [BSS_PnpResult]
- ret + ret
END + /* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386trap.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -19,9 +19,6 @@
#include <asm.inc> #include <arch/pc/x86common.h> -#include <ver.h> - -#define SCREEN_ATTR 0x1f /* Bright white on blue background */
EXTERN _i386PrintExceptionText@12:PROC
@@ -59,10 +56,10 @@ /* push KSPECIAL_REGISTERS */ /* Gdtr, Idtr, Tr, Ldtr, Reserved */ sub esp, 44 - sgdt [esp] - sidt [esp + 8] - str word ptr [esp + 16] - sldt word ptr [esp + 18] + sgdt [esp] + sidt [esp + 8] + str word ptr [esp + 16] + sldt word ptr [esp + 18] mov eax, dr7; push eax mov eax, dr6; @@ -87,12 +84,12 @@
/* Set by each exception handler to the address of the description text */ i386ExceptionIndex: - .long 0 + .long 0
/************************************************************************/ i386CommonExceptionHandler:
- SAVE_CPU_REGS + SAVE_CPU_REGS
lea eax, [esp + (21 * 4)] // KTRAP_FRAME push esp // KSPECIAL_REGISTERS @@ -100,26 +97,26 @@ push dword ptr ds:[i386ExceptionIndex] call _i386PrintExceptionText@12
- cli + cli i386ExceptionHandlerHang: - hlt - jmp i386ExceptionHandlerHang + hlt + jmp i386ExceptionHandlerHang
- iret + iret
MACRO(TRAP_STUB, function, index) PUBLIC VAL(function) &function: push 0 // Fake error code - mov dword ptr ds:[i386ExceptionIndex], VAL(index) - jmp i386CommonExceptionHandler + mov dword ptr ds:[i386ExceptionIndex], VAL(index) + jmp i386CommonExceptionHandler ENDM
MACRO(TRAP_STUB2, function, index) PUBLIC VAL(function) &function: - mov dword ptr ds:[i386ExceptionIndex], VAL(index) - jmp i386CommonExceptionHandler + mov dword ptr ds:[i386ExceptionIndex], VAL(index) + jmp i386CommonExceptionHandler ENDM
/************************************************************************/ @@ -156,15 +153,15 @@ #else \functionname: #endif - push eax - mov eax, [esp + 8] - mov dr3, eax - mov eax, dr7 - and eax, VAL(mask1) - or eax, VAL(mask2) - mov dr7, eax - pop eax - ret + push eax + mov eax, [esp + 8] + mov dr3, eax + mov eax, dr7 + and eax, VAL(mask1) + or eax, VAL(mask2) + mov dr7, eax + pop eax + ret ENDM
BREAKPOINT_TEPLATE _INSTRUCTION_BREAKPOINT1, HEX(0fff0ffff), HEX(000000303) @@ -180,5 +177,4 @@ BREAKPOINT_TEPLATE _MEMORY_READWRITE_BREAKPOINT4, HEX(00fffffff), HEX(0300003c0) BREAKPOINT_TEPLATE _MEMORY_WRITE_BREAKPOINT4, HEX(00fffffff), HEX(0100003c0)
- END
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/linux.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -30,16 +30,16 @@ PUBLIC _BootOldLinuxKernel _BootOldLinuxKernel:
- /* First we have to copy the kernel down from 0x100000 to 0x10000 */ - /* The reason we can overwrite low memory is because this code */ - /* executes between 0000:8000 and 0000:FFFF. That leaves space for */ - /* 32k of code before we start interfering with Linux kernel address space. */ + /* First we have to copy the kernel down from 0x100000 to 0x10000 */ + /* The reason we can overwrite low memory is because this code */ + /* executes between 0000:8000 and 0000:FFFF. That leaves space for */ + /* 32k of code before we start interfering with Linux kernel address space. */
- /* Get KernelSize in ECX and move the kernel down */ - mov ecx, [esp + 4] - mov esi, HEX(100000) - mov edi, HEX(10000) - rep movsb + /* Get KernelSize in ECX and move the kernel down */ + mov ecx, [esp + 4] + mov esi, HEX(100000) + mov edi, HEX(10000) + rep movsb
/* Fall through */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/mb.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/mb.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/mb.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -35,16 +35,16 @@ #endif _PageDirectoryStart: _startup_pagedirectory: - .fill 4096, 1, 0 + .fill 4096, 1, 0
_lowmem_pagetable: - .fill 4096, 1, 0 + .fill 4096, 1, 0
_kernel_pagetable: - .fill 2*4096, 1, 0 + .fill 2*4096, 1, 0
_apic_pagetable: - .fill 4096, 1, 0 + .fill 4096, 1, 0
_PageDirectoryEnd:
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/p... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/boot.s [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -1,38 +1,38 @@ - .section ".text" - .extern PpcInit - .globl _start - .globl call_ofw + .section ".text" + .extern PpcInit + .globl _start + .globl call_ofw _start: - sync - isync + sync + isync
- lis %r1,stackend@ha - addi %r1,%r1,stackend@l + lis %r1,stackend@ha + addi %r1,%r1,stackend@l
- /* Store ofw call addr */ - mr %r21,%r5 - lis %r10,ofw_call_addr@ha - stw %r5,ofw_call_addr@l(%r10) + /* Store ofw call addr */ + mr %r21,%r5 + lis %r10,ofw_call_addr@ha + stw %r5,ofw_call_addr@l(%r10)
- bl zero_registers - - /* Zero CTR */ - mtcr %r31 + bl zero_registers
- lis %r3,PpcInit@ha - addi %r3,%r3,PpcInit@l - mtlr %r3 + /* Zero CTR */ + mtcr %r31
- /* Check for ofw */ - lis %r3,ofw_call_addr@ha - lwz %r3,ofw_call_addr@l(%r3) - cmpw %r3,%r31 /* Zero? */ - mr %r3,%r31 - beq initfp - - lis %r3,call_ofw@ha - addi %r3,%r3,call_ofw@l - b bootme + lis %r3,PpcInit@ha + addi %r3,%r3,PpcInit@l + mtlr %r3 + + /* Check for ofw */ + lis %r3,ofw_call_addr@ha + lwz %r3,ofw_call_addr@l(%r3) + cmpw %r3,%r31 /* Zero? */ + mr %r3,%r31 + beq initfp + + lis %r3,call_ofw@ha + addi %r3,%r3,call_ofw@l + b bootme
initfp: /* Enabling FP at this point won't hurt, and the varargs scheme we're @@ -41,71 +41,71 @@ ori %r0,%r0,8192 mtmsr %r0
-bootme: - blr +bootme: + blr
zero_registers: - xor %r2,%r2,%r2 - mr %r0,%r2 - mr %r3,%r2 - - mr %r4,%r2 - mr %r5,%r2 - mr %r6,%r2 - mr %r7,%r2 + xor %r2,%r2,%r2 + mr %r0,%r2 + mr %r3,%r2
- mr %r8,%r2 - mr %r9,%r2 - mr %r10,%r2 - mr %r11,%r2 + mr %r4,%r2 + mr %r5,%r2 + mr %r6,%r2 + mr %r7,%r2
- mr %r12,%r2 - mr %r13,%r2 - mr %r14,%r2 - mr %r15,%r2 - - mr %r12,%r2 - mr %r13,%r2 - mr %r14,%r2 - mr %r15,%r2 - - mr %r16,%r2 - mr %r17,%r2 - mr %r18,%r2 - mr %r19,%r2 - - mr %r20,%r2 - mr %r21,%r2 - mr %r22,%r2 - mr %r23,%r2 - - mr %r24,%r2 - mr %r25,%r2 - mr %r26,%r2 - mr %r27,%r2 - - mr %r28,%r2 - mr %r29,%r2 - mr %r30,%r2 - mr %r31,%r2 + mr %r8,%r2 + mr %r9,%r2 + mr %r10,%r2 + mr %r11,%r2
- blr - + mr %r12,%r2 + mr %r13,%r2 + mr %r14,%r2 + mr %r15,%r2 + + mr %r12,%r2 + mr %r13,%r2 + mr %r14,%r2 + mr %r15,%r2 + + mr %r16,%r2 + mr %r17,%r2 + mr %r18,%r2 + mr %r19,%r2 + + mr %r20,%r2 + mr %r21,%r2 + mr %r22,%r2 + mr %r23,%r2 + + mr %r24,%r2 + mr %r25,%r2 + mr %r26,%r2 + mr %r27,%r2 + + mr %r28,%r2 + mr %r29,%r2 + mr %r30,%r2 + mr %r31,%r2 + + blr + ofw_memory_size: - .long 0 - .long 0 - .long 0 - .long 0 + .long 0 + .long 0 + .long 0 + .long 0
- .align 4 + .align 4 stack: - .space 0x4000 + .space 0x4000 stackend: - .long 0,0,0,0 - - .globl _bss - .section ".bss2" + .long 0,0,0,0 + + .globl _bss + .section ".bss2" _bss: - .long 0 + .long 0
- .align 4 + .align 4
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/p... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -209,14 +209,14 @@ BiosMemoryMap[slots].Length = claimed[i] - last; slots++; } - + BiosMemoryMap[slots].Type = BiosMemoryUsable; BiosMemoryMap[slots].BaseAddress = claimed[i]; BiosMemoryMap[slots].Length = 8 * 1024 * 1024; - + total += BiosMemoryMap[slots].Length; - last = - BiosMemoryMap[slots].BaseAddress + + last = + BiosMemoryMap[slots].BaseAddress + BiosMemoryMap[slots].Length; slots++; i++; @@ -236,12 +236,12 @@ i, (int)BiosMemoryMap[i].BaseAddress, (int)BiosMemoryMap[i].Length); - + }
mem_range_end = regdata[1];
- printf( "Returning memory map (%d entries, %dk free, %dk total ram)\n", + printf( "Returning memory map (%d entries, %dk free, %dk total ram)\n", slots, total / 1024, regdata[1] / 1024 );
return slots; @@ -313,10 +313,10 @@
/* Recursively copy the device tree into our representation * It'll be passed to HAL. - * - * When NT was first done on PPC, it was on PReP hardware, which is very + * + * When NT was first done on PPC, it was on PReP hardware, which is very * like PC hardware (really, just a PPC on a PC motherboard). HAL can guess - * the addresses of needed resources in this scheme as it can on x86. + * the addresses of needed resources in this scheme as it can on x86. * * Most PPC hardware doesn't assign fixed addresses to hardware, which is * the problem that open firmware partially solves. It allows hardware makers @@ -327,8 +327,8 @@ * recording information from openfirmware to be treated as hints. */ VOID OfwCopyDeviceTree -(PCONFIGURATION_COMPONENT_DATA ParentKey, - char *name, +(PCONFIGURATION_COMPONENT_DATA ParentKey, + char *name, int innode, ULONG *BusNumber, ULONG *DiskController, @@ -360,7 +360,7 @@ proplen = ofw_getproplen(node, cur_name); if (proplen > 256 || proplen < 0) { - printf("Warning: not getting prop %s (too long: %d)\n", + printf("Warning: not getting prop %s (too long: %d)\n", cur_name, proplen); continue; } @@ -369,7 +369,7 @@ /* Get device type so we can examine it */ if (!strcmp(cur_name, "device_type")) strcpy(devtype, (char *)data); - + NarrowToWide(wide_name, cur_name); //RegSetValue(NewKey, wide_name, REG_BINARY, data, proplen);
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_util.s URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/p... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_util.s [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/ofw_util.s [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -1,8 +1,8 @@ - .section .text - .globl ofw_functions - .globl ofw_call_addr - .globl call_ofw -call_ofw: + .section .text + .globl ofw_functions + .globl ofw_call_addr + .globl call_ofw +call_ofw: /* R3 has the function offset to call (n * 4) * Other arg registers are unchanged. */ subi %r1,%r1,0x100 @@ -46,4 +46,3 @@ lwz %r20,36(%r1) addi %r1,%r1,0x100 blr -
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/p... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -82,8 +82,8 @@ // Find the last ram address in physical space ... this bypasses mapping // but could run into non-ram objects right above ram. Usually systems // aren't designed like that though. - for (physAddr = 0x40000, change = newStore; - (physAddr < 0x80000000) && (change == newStore); + for (physAddr = 0x40000, change = newStore; + (physAddr < 0x80000000) && (change == newStore); physAddr += 1 << 12) { oldStore = GetPhys(physAddr); @@ -106,7 +106,7 @@ return 1; }
-/* Most PReP hardware is in standard locations, based on the corresponding +/* Most PReP hardware is in standard locations, based on the corresponding * hardware on PCs. */ PCONFIGURATION_COMPONENT_DATA PpcPrepHwDetect() { PCONFIGURATION_COMPONENT_DATA SystemKey;
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/p... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep.h [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -15,11 +15,11 @@
void print_bar( struct _pci_bar *bar ); void pci_setup -( PCONFIGURATION_COMPONENT_DATA pci_bus, +( PCONFIGURATION_COMPONENT_DATA pci_bus, struct _pci_desc *pci_desc ); void pci_read_bar -( struct _pci_desc *pci_desc, - int bus, int dev, int fn, int bar, +( struct _pci_desc *pci_desc, + int bus, int dev, int fn, int bar, struct _pci_bar *bar_data );
void vga_setup
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/p... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/prep_vga.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -10,7 +10,7 @@ #define VGA_HEIGHT 768 struct _vga_desc vga1_desc = { (char *)0x800003c0 };
-void vga_setup( PCONFIGURATION_COMPONENT_DATA pcibus, +void vga_setup( PCONFIGURATION_COMPONENT_DATA pcibus, struct _pci_desc *desc, struct _vga_desc *vga_desc, int bus, int dev, int fn ) { struct _pci_bar bar_data;
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/amd64.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/amd64.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/amd64.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -15,26 +15,26 @@ .org 512 Startup:
- cli - - /* Setup real mode segment registers */ - xor ax, ax - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax + cli + + /* Setup real mode segment registers */ + xor ax, ax + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax
/* Save the boot drive and partition */ mov byte ptr ds:[BSS_BootDrive], dl mov byte ptr ds:[BSS_BootPartition], dh
- /* Setup a real mode stack */ + /* Setup a real mode stack */ mov sp, word ptr ds:[stack16]
- /* Output first status */ - mov si, offset Msg_Starting - call writestr + /* Output first status */ + mov si, offset Msg_Starting + call writestr
/* Enable A20 address line */ call EnableA20 @@ -44,9 +44,9 @@ test al, al jnz .LongModeSupported
- /* Output failure message */ - mov si, offset Msg_Unsupported - call writestr + /* Output failure message */ + mov si, offset Msg_Unsupported + call writestr
/* Wait for a keypress */ int HEX(16) @@ -57,21 +57,21 @@ .ascii "Press any key to reboot...", NUL
Msg_Starting: - .ascii "Starting FreeLoader...", CR, LF, NUL + .ascii "Starting FreeLoader...", CR, LF, NUL
Msg_LongModeSupported: .ascii "Long mode support detected.", CR, LF, NUL
.LongModeSupported: - /* Output status */ - mov si, offset Msg_LongModeSupported - call writestr - - /* Load the GDT */ - lgdt fword ptr [gdtptr] + /* Output status */ + mov si, offset Msg_LongModeSupported + call writestr + + /* Load the GDT */ + lgdt fword ptr [gdtptr]
/* Build the startup page tables */ - call BuildPageTables + call BuildPageTables
/* Store real mode entry point in shared memory */ mov dword ptr ds:[BSS_RealModeEntry], offset RealModeEntryPoint @@ -95,9 +95,9 @@ xor ax, ax mov es, ax
- /* Output status */ - mov si, offset Msg_SwitchToLongMode - call writestr + /* Output status */ + mov si, offset Msg_SwitchToLongMode + call writestr
jmp ExitToLongMode
@@ -106,36 +106,36 @@
.align 8 gdt: - .word HEX(0000), HEX(0000), HEX(0000), HEX(0000) /* 00: NULL descriptor */ - .word HEX(0000), HEX(0000), HEX(0000), HEX(0000) /* 08: */ - .word HEX(0000), HEX(0000), HEX(9800), HEX(0020) /* 10: long mode cs */ - .word HEX(ffff), HEX(0000), HEX(f300), HEX(00cf) /* 18: long mode ds */ - .word HEX(FFFF), HEX(0000), HEX(9E00), HEX(0000) /* 20: 16-bit real mode CS */ - .word HEX(FFFF), HEX(0000), HEX(9200), HEX(0000) /* 28: 16-bit real mode DS */ - .word HEX(FFFF), HEX(0000), HEX(9B00), HEX(00CF) /* 30: compat mode cs */ + .word HEX(0000), HEX(0000), HEX(0000), HEX(0000) /* 00: NULL descriptor */ + .word HEX(0000), HEX(0000), HEX(0000), HEX(0000) /* 08: */ + .word HEX(0000), HEX(0000), HEX(9800), HEX(0020) /* 10: long mode cs */ + .word HEX(ffff), HEX(0000), HEX(f300), HEX(00cf) /* 18: long mode ds */ + .word HEX(FFFF), HEX(0000), HEX(9E00), HEX(0000) /* 20: 16-bit real mode CS */ + .word HEX(FFFF), HEX(0000), HEX(9200), HEX(0000) /* 28: 16-bit real mode DS */ + .word HEX(FFFF), HEX(0000), HEX(9B00), HEX(00CF) /* 30: compat mode cs */
/* GDT table pointer */ gdtptr: - .word HEX(37) /* Limit */ - .long offset gdt /* Base Address */ + .word HEX(37) /* Limit */ + .long offset gdt /* Base Address */
CheckFor64BitSupport: - /* Check if CPU supports CPUID */ - pushad - pushfd - pop eax - mov ebx, eax - xor eax, HEX(00200000) - push eax - popfd - pushfd - pop eax - cmp eax,ebx - jnz .CheckForPAE + /* Check if CPU supports CPUID */ + pushad + pushfd + pop eax + mov ebx, eax + xor eax, HEX(00200000) + push eax + popfd + pushfd + pop eax + cmp eax,ebx + jnz .CheckForPAE
mov si, offset .Msg_NoCpuidSupport - call writestr + call writestr popad xor al, al ret @@ -144,15 +144,15 @@ .ascii "The system doesn't support CPUID.", CR, LF, NUL
.CheckForPAE: - /* CPUID support detected - getting the PAE/PGE */ - mov eax,1 // Fn0000_0001 - PAE in EDX[6] - cpuid - and edx, HEX(00a0) - cmp edx, HEX(00a0) - je .CheckForLongMode + /* CPUID support detected - getting the PAE/PGE */ + mov eax,1 // Fn0000_0001 - PAE in EDX[6] + cpuid + and edx, HEX(00a0) + cmp edx, HEX(00a0) + je .CheckForLongMode
mov si, offset .Msg_NoPAE - call writestr + call writestr popad xor al, al ret @@ -161,15 +161,15 @@ .ascii "PAE or PGE not set.", CR, LF, NUL
.CheckForLongMode: - xor edx, edx - mov eax, HEX(80000001) - cpuid - and edx, HEX(20000000) - test edx,edx - jnz .Success + xor edx, edx + mov eax, HEX(80000001) + cpuid + and edx, HEX(20000000) + test edx,edx + jnz .Success
mov si, offset .Msg_NoLongMode - call writestr + call writestr popad xor al, al ret @@ -185,53 +185,53 @@
BuildPageTables: - pusha - push es - - /* Get segment of the PML4 */ - mov eax, PML4_ADDRESS / 16 - mov es, ax - cld - xor di, di - - /* One entry in the PML4 pointing to PDP */ - mov eax, PDP_ADDRESS - or eax, HEX(0f) - stosd - - /* clear rest */ - xor eax, eax - mov cx, 1023 - rep stosd - - /* One entry in the PDP pointing to PD */ - mov eax, PD_ADDRESS - or eax, HEX(0f) - stosd - - /* clear rest */ - xor eax, eax - mov ecx, 1023 - rep stosd - - /* 512 entries in the PD, each defining a 2MB page each */ - mov ecx, 512 - mov eax, HEX(008f) + pusha + push es + + /* Get segment of the PML4 */ + mov eax, PML4_ADDRESS / 16 + mov es, ax + cld + xor di, di + + /* One entry in the PML4 pointing to PDP */ + mov eax, PDP_ADDRESS + or eax, HEX(0f) + stosd + + /* clear rest */ + xor eax, eax + mov cx, 1023 + rep stosd + + /* One entry in the PDP pointing to PD */ + mov eax, PD_ADDRESS + or eax, HEX(0f) + stosd + + /* clear rest */ + xor eax, eax + mov ecx, 1023 + rep stosd + + /* 512 entries in the PD, each defining a 2MB page each */ + mov ecx, 512 + mov eax, HEX(008f)
.Bpt2: - mov es: [di], eax - mov dword ptr es: [di + 4], 0 - add eax, 512 * 4096 // add 512 4k pages - add di, 8 - - /* Loop all PDEs */ - dec cx - jnz .Bpt2 - - /* Return */ - pop es - popa - ret + mov es: [di], eax + mov dword ptr es: [di + 4], 0 + add eax, 512 * 4096 // add 512 4k pages + add di, 8 + + /* Loop all PDEs */ + dec cx + jnz .Bpt2 + + /* Return */ + pop es + popa + ret
/******************************************************************************/ @@ -241,13 +241,13 @@
/* This is the entry point from long mode */ RealModeEntryPoint: - /* Disable Protected Mode */ - mov eax, cr0 - and eax, HEX(0fffffffe) // ~0x00000001 - mov cr0, eax - - /* Clear prefetch queue & correct CS */ - ljmp16 0, offset InRealMode + /* Disable Protected Mode */ + mov eax, cr0 + and eax, HEX(0fffffffe) // ~0x00000001 + mov cr0, eax + + /* Clear prefetch queue & correct CS */ + ljmp16 0, offset InRealMode
InRealMode:
@@ -285,43 +285,43 @@ cli
/* Set correct segment registers */ - xor ax,ax - mov ds,ax - mov es,ax - mov fs,ax - mov gs,ax - mov ss,ax + xor ax,ax + mov ds,ax + mov es,ax + mov fs,ax + mov gs,ax + mov ss,ax
/* Safe current stack pointer */ mov word ptr ds:[stack16], sp
/* Set PAE and PGE: 10100000b */ - mov eax, HEX(00a0) - mov cr4, eax + mov eax, HEX(00a0) + mov cr4, eax
/* Point cr3 at the PML4 */ - mov eax, PML4_ADDRESS - mov cr3, eax + mov eax, PML4_ADDRESS + mov cr3, eax
/* Enable long mode */ - mov ecx, MSR_EFER - rdmsr - or eax, HEX(00000100) - wrmsr + mov ecx, MSR_EFER + rdmsr + or eax, HEX(00000100) + wrmsr
/* Activate long mode by enabling paging and protection simultaneously, skipping protected mode entirely */ - mov eax, cr0 - or eax, HEX(80000001) - mov cr0, eax + mov eax, cr0 + or eax, HEX(80000001) + mov cr0, eax
/* Clear prefetch queue & correct CS */ ljmp16 LMODE_CS, InLongMode InLongMode: - //DB 66h, 0B8h, 18h, 00h // mov ax, LMODE_DS - //DB 66h, 8Eh, 0D8h // mov ds, ax - //DB 66h, 66h, 0C7h, 04h, 25h, 00h, 80h, 0Bh, 00h, 31h, 0Eh - //mov word ptr [HEX(b8000)], HEX(0e00) + '1' + //DB 66h, 0B8h, 18h, 00h // mov ax, LMODE_DS + //DB 66h, 8Eh, 0D8h // mov ds, ax + //DB 66h, 66h, 0C7h, 04h, 25h, 00h, 80h, 0Bh, 00h, 31h, 0Eh + //mov word ptr [HEX(b8000)], HEX(0e00) + '1'
.byte HEX(0ff), HEX(25) // opcode of 64bit indirect jump .long 1 // relative address of LongModeEntryPoint
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/fathelp.inc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/fathelp.inc [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/fathelp.inc [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -8,37 +8,37 @@
//.text
-#define BootSectorStackTop HEX(7bf2) -#define DataAreaStartHigh 2 -#define DataAreaStartLow 4 -#define BiosCHSDriveSizeHigh 6 -#define BiosCHSDriveSizeLow 8 -#define BiosCHSDriveSize 8 -#define ReadSectorsOffset 10 -#define ReadClusterOffset 12 -#define PutCharsOffset 14 - -#define OEMName 3 -#define BytesPerSector 11 -#define SectsPerCluster 13 -#define ReservedSectors 14 -#define NumberOfFats 16 -#define MaxRootEntries 17 -#define TotalSectors 19 -#define MediaDescriptor 21 -#define SectorsPerFat 22 -#define SectorsPerTrack 24 -#define NumberOfHeads 26 -#define HiddenSectors 28 -#define TotalSectorsBig 32 -#define BootDrive 36 -#define Reserved 37 -#define ExtendSig 38 -#define SerialNumber 39 -#define VolumeLabel 43 -#define FileSystem 54 - -#define BootPartition HEX(7dfd) +#define BootSectorStackTop HEX(7bf2) +#define DataAreaStartHigh 2 +#define DataAreaStartLow 4 +#define BiosCHSDriveSizeHigh 6 +#define BiosCHSDriveSizeLow 8 +#define BiosCHSDriveSize 8 +#define ReadSectorsOffset 10 +#define ReadClusterOffset 12 +#define PutCharsOffset 14 + +#define OEMName 3 +#define BytesPerSector 11 +#define SectsPerCluster 13 +#define ReservedSectors 14 +#define NumberOfFats 16 +#define MaxRootEntries 17 +#define TotalSectors 19 +#define MediaDescriptor 21 +#define SectorsPerFat 22 +#define SectorsPerTrack 24 +#define NumberOfHeads 26 +#define HiddenSectors 28 +#define TotalSectorsBig 32 +#define BootDrive 36 +#define Reserved 37 +#define ExtendSig 38 +#define SerialNumber 39 +#define VolumeLabel 43 +#define FileSystem 54 + +#define BootPartition HEX(7dfd)
// This code will be stored in the first 512 bytes @@ -82,13 +82,13 @@ call IsFat12 pop ax jnc LoadFile2 - cmp ax, HEX(0ff8) // Check to see if this is the last cluster in the chain + cmp ax, HEX(0ff8) // Check to see if this is the last cluster in the chain jmp LoadFile3
LoadFile2: cmp ax, HEX(0fff8) LoadFile3: - jae LoadFile_Done // If so continue, if not then read then next one + jae LoadFile_Done // If so continue, if not then read then next one push ax xor bx,bx // Load ROSLDR starting at 0000:8000h push es @@ -97,27 +97,27 @@
xor bx,bx mov bl, [bp+SectsPerCluster] - shl bx,5 // BX = BX * 512 / 16 - mov ax,es // Increment the load address by - add ax,bx // The size of a cluster + shl bx,5 // BX = BX * 512 / 16 + mov ax,es // Increment the load address by + add ax,bx // The size of a cluster mov es,ax
call IsFat12 pop ax push es jnc LoadFile4 - call GetFatEntry12 // Get the next entry + call GetFatEntry12 // Get the next entry jmp LoadFile5 LoadFile4: call GetFatEntry16 LoadFile5: pop es
- jmp LoadFile // Load the next cluster (if any) + jmp LoadFile // Load the next cluster (if any)
LoadFile_Done: - mov dl, byte ptr [bp+BootDrive] // Load the boot drive into DL - mov dh, byte ptr ds:[BootPartition] // Load the boot partition into DH + mov dl, byte ptr [bp+BootDrive] // Load the boot drive into DL + mov dh, byte ptr ds:[BootPartition] // Load the boot partition into DH
/* continue where other bootsectors start */ jmp start @@ -141,15 +141,15 @@ // On entry AX has cluster number // On return AX has FAT entry for that cluster GetFatEntry16: - mov cx,2 // AX = AX * 2 (since FAT16 entries are 2 bytes) + mov cx,2 // AX = AX * 2 (since FAT16 entries are 2 bytes) mul cx shl dx,12
mov bx, HEX(7000) add bx,dx mov es,bx - mov bx,ax // Restore FAT entry offset - mov ax, es:[bx] // Get FAT entry + mov bx,ax // Restore FAT entry offset + mov ax, es:[bx] // Get FAT entry
ret
@@ -161,13 +161,13 @@ push ax mov cx,ax shr ax,1 - add ax,cx // AX = AX * 1.5 (AX = AX + (AX / 2)) (since FAT12 entries are 12 bits) + add ax,cx // AX = AX * 1.5 (AX = AX + (AX / 2)) (since FAT12 entries are 12 bits)
mov bx, HEX(7000) mov es,bx - mov bx,ax // Put FAT entry offset into BX - mov ax, es:[bx] // Get FAT entry - pop cx // Get cluster number from stack + mov bx,ax // Put FAT entry offset into BX + mov ax, es:[bx] // Get FAT entry + pop cx // Get cluster number from stack and cx,1 jz UseLow12Bits and ax, HEX(0fff0) @@ -201,8 +201,8 @@ // EAX now contains the number of sectors on the volume
IsFat12_2: - sub eax,ebx // Subtract data area start sector - xor edx,edx // from total sectors of volume + sub eax,ebx // Subtract data area start sector + xor edx,edx // from total sectors of volume
// EDX:EAX now contains the number of data sectors on the volume movzx ebx, byte ptr [bp+SectsPerCluster] @@ -220,6 +220,6 @@ msgLoading: .ascii "Loading FreeLoader...", CR, LF, NUL
- .org 510 // Pad to 510 bytes - .word HEX(0aa55) // BootSector signature - + .org 510 // Pad to 510 bytes + .word HEX(0aa55) // BootSector signature +
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/helpers.inc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/helpers.inc [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/helpers.inc [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -1,21 +1,21 @@
Empty8042: - .word HEX(00eb), HEX(00eb) // jmp $+2, jmp $+2 + .word HEX(00eb), HEX(00eb) // jmp $+2, jmp $+2 in al, HEX(64) - cmp al, HEX(0ff) // legacy-free machine without keyboard - jz Empty8042_ret // controllers on Intel Macs read back 0xFF + cmp al, HEX(0ff) // legacy-free machine without keyboard + jz Empty8042_ret // controllers on Intel Macs read back 0xFF test al, 2 jnz Empty8042 Empty8042_ret: - ret + ret
EnableA20: pusha call Empty8042 - mov al, HEX(0D1) // command write + mov al, HEX(0D1) // command write out HEX(064), al call Empty8042 - mov al, HEX(0DF) // A20 on + mov al, HEX(0DF) // A20 on out HEX(060), al call Empty8042 popa @@ -26,32 +26,32 @@ * si = pointer to zero terminated string */ writestr: - pushfd - pushad + pushfd + pushad writestr_top: - lodsb - and al, al - jz writestr_end - call writechr - jmp short writestr_top + lodsb + and al, al + jz writestr_end + call writechr + jmp short writestr_top writestr_end: - popad - popfd - ret + popad + popfd + ret
/* * writechr * al = character to output */ writechr: - pushf - pusha - mov ah, HEX(0E) - xor bx, bx - int HEX(10) - popa - popf - ret + pushf + pusha + mov ah, HEX(0E) + xor bx, bx + int HEX(10) + popa + popf + ret
// // writehex[248]: Write a hex number in (AL, AX, EAX) to the console @@ -93,13 +93,13 @@ ret
Reboot: - cli + cli
- /* Set the word at location 40h:72h to 0 (cold reboot) */ - mov word ptr ds:[HEX(0472)], HEX(0) + /* Set the word at location 40h:72h to 0 (cold reboot) */ + mov word ptr ds:[HEX(0472)], HEX(0)
- /* and jump to location F000h:FFF0h in ROM */ - ljmp16 HEX(0F000), HEX(0FFF0) + /* and jump to location F000h:FFF0h in ROM */ + ljmp16 HEX(0F000), HEX(0FFF0)
ChainLoadBiosBootSectorCode:
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -58,50 +58,50 @@ /* This is the entry point from protected mode */ switch_to_real16:
- /* Restore segment registers to correct limit */ - mov ax, RMODE_DS - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - - /* Disable Protected Mode */ - mov eax, cr0 - and eax, CR0_PE_CLR - mov cr0, eax - - /* Clear prefetch queue & correct CS */ - ljmp16 0, inrmode + /* Restore segment registers to correct limit */ + mov ax, RMODE_DS + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + /* Disable Protected Mode */ + mov eax, cr0 + and eax, CR0_PE_CLR + mov cr0, eax + + /* Clear prefetch queue & correct CS */ + ljmp16 0, inrmode
inrmode: /* Set real mode segments */ - xor ax, ax - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - - /* Clear out the high 16-bits of ESP */ - /* This is needed because I have one */ - /* machine that hangs when booted to dos if */ - /* anything other than 0x0000 is in the high */ - /* 16-bits of ESP. Even though real-mode */ - /* code should only use SP and not ESP. */ - xor esp, esp + xor ax, ax + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + /* Clear out the high 16-bits of ESP */ + /* This is needed because I have one */ + /* machine that hangs when booted to dos if */ + /* anything other than 0x0000 is in the high */ + /* 16-bits of ESP. Even though real-mode */ + /* code should only use SP and not ESP. */ + xor esp, esp
/* Restore real mode stack */ - mov sp, word ptr ds:[stack16] - - /* Load IDTR with real mode value */ + mov sp, word ptr ds:[stack16] + + /* Load IDTR with real mode value */ #ifdef _USE_ML lidt fword ptr rmode_idtptr #else - lidt rmode_idtptr + lidt rmode_idtptr #endif
- sti /* These are ok now */ + sti /* These are ok now */
/* Do the callback, specified by bx */ shl bx, 1 @@ -155,47 +155,47 @@ .word STACK16ADDR
-.align 4 /* force 4-byte alignment */ +.align 4 /* force 4-byte alignment */ gdt: - /* NULL Descriptor */ - .word HEX(0000) - .word HEX(0000) - .word HEX(0000) - .word HEX(0000) - - /* 32-bit flat CS */ - .word HEX(FFFF) - .word HEX(0000) - .word HEX(9A00) - .word HEX(00CF) - - /* 32-bit flat DS */ - .word HEX(FFFF) - .word HEX(0000) - .word HEX(9200) - .word HEX(00CF) - - /* 16-bit real mode CS */ - .word HEX(FFFF) - .word HEX(0000) - .word HEX(9E00) - .word HEX(0000) - - /* 16-bit real mode DS */ - .word HEX(FFFF) - .word HEX(0000) - .word HEX(9200) - .word HEX(0000) + /* NULL Descriptor */ + .word HEX(0000) + .word HEX(0000) + .word HEX(0000) + .word HEX(0000) + + /* 32-bit flat CS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9A00) + .word HEX(00CF) + + /* 32-bit flat DS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9200) + .word HEX(00CF) + + /* 16-bit real mode CS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9E00) + .word HEX(0000) + + /* 16-bit real mode DS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9200) + .word HEX(0000)
/* GDT table pointer */ gdtptr: - .word HEX(27) /* Limit */ + .word HEX(27) /* Limit */ .word gdt, 0 /* Base Address */
/* Real-mode IDT pointer */ rmode_idtptr: - .word HEX(3ff) /* Limit */ - .long 0 /* Base Address */ + .word HEX(3ff) /* Limit */ + .long 0 /* Base Address */
#include "int386.inc" #include "pxe.inc"
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/int386.inc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/int386.inc [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/int386.inc [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -6,75 +6,75 @@ #define EFLAGS_SF HEX(80)
Int386: - /* Save all registers + segment registers */ - push ds - push es - push fs - push gs - pushad + /* Save all registers + segment registers */ + push ds + push es + push fs + push gs + pushad
/* Get the interupt vector and patch the opcode */ mov al, byte ptr ds:[BSS_IntVector] mov byte ptr ds:[Int386_vector_opcode], al
- /* Get current EFLAGS and mask CF, ZF and SF */ - pushf - pop cx - and cx, not (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF) + /* Get current EFLAGS and mask CF, ZF and SF */ + pushf + pop cx + and cx, not (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF)
- /* Get flags CF, ZF and SF from the REGS structure */ - mov ax, word ptr cs:[BSS_RegisterSet + REGS_EFLAGS] - and ax, (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF) + /* Get flags CF, ZF and SF from the REGS structure */ + mov ax, word ptr cs:[BSS_RegisterSet + REGS_EFLAGS] + and ax, (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF)
- /* Combine flags and set them */ - or ax, cx - push ax - popf + /* Combine flags and set them */ + or ax, cx + push ax + popf
- /* Setup the registers */ - mov ax, word ptr cs:[BSS_RegisterSet + REGS_DS] - mov ds, ax - mov ax, word ptr cs:[BSS_RegisterSet + REGS_ES] - mov es, ax - mov ax, word ptr cs:[BSS_RegisterSet + REGS_FS] - mov fs, ax - mov ax, word ptr cs:[BSS_RegisterSet + REGS_GS] - mov gs, ax + /* Setup the registers */ + mov ax, word ptr cs:[BSS_RegisterSet + REGS_DS] + mov ds, ax + mov ax, word ptr cs:[BSS_RegisterSet + REGS_ES] + mov es, ax + mov ax, word ptr cs:[BSS_RegisterSet + REGS_FS] + mov fs, ax + mov ax, word ptr cs:[BSS_RegisterSet + REGS_GS] + mov gs, ax
- mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EAX] - mov ebx, dword ptr cs:[BSS_RegisterSet + REGS_EBX] - mov ecx, dword ptr cs:[BSS_RegisterSet + REGS_ECX] - mov edx, dword ptr cs:[BSS_RegisterSet + REGS_EDX] - mov esi, dword ptr cs:[BSS_RegisterSet + REGS_ESI] - mov edi, dword ptr cs:[BSS_RegisterSet + REGS_EDI] - // Don't setup ebp, we only use it as output! + mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EAX] + mov ebx, dword ptr cs:[BSS_RegisterSet + REGS_EBX] + mov ecx, dword ptr cs:[BSS_RegisterSet + REGS_ECX] + mov edx, dword ptr cs:[BSS_RegisterSet + REGS_EDX] + mov esi, dword ptr cs:[BSS_RegisterSet + REGS_ESI] + mov edi, dword ptr cs:[BSS_RegisterSet + REGS_EDI] + // Don't setup ebp, we only use it as output!
- /* Call the interrupt vector */ - /*int Int386_vector*/ - .byte HEX(0cd) + /* Call the interrupt vector */ + /*int Int386_vector*/ + .byte HEX(0cd) Int386_vector_opcode: - .byte 00 + .byte 00
- /* Save the registers */ - mov dword ptr cs:[BSS_RegisterSet + REGS_EAX], eax - mov dword ptr cs:[BSS_RegisterSet + REGS_EBX], ebx - mov dword ptr cs:[BSS_RegisterSet + REGS_ECX], ecx - mov dword ptr cs:[BSS_RegisterSet + REGS_EDX], edx - mov dword ptr cs:[BSS_RegisterSet + REGS_ESI], esi - mov dword ptr cs:[BSS_RegisterSet + REGS_EDI], edi - mov dword ptr cs:[BSS_RegisterSet + REGS_EBP], ebp + /* Save the registers */ + mov dword ptr cs:[BSS_RegisterSet + REGS_EAX], eax + mov dword ptr cs:[BSS_RegisterSet + REGS_EBX], ebx + mov dword ptr cs:[BSS_RegisterSet + REGS_ECX], ecx + mov dword ptr cs:[BSS_RegisterSet + REGS_EDX], edx + mov dword ptr cs:[BSS_RegisterSet + REGS_ESI], esi + mov dword ptr cs:[BSS_RegisterSet + REGS_EDI], edi + mov dword ptr cs:[BSS_RegisterSet + REGS_EBP], ebp
- mov ax, ds - mov word ptr cs:[BSS_RegisterSet + REGS_DS], ax - mov ax, es - mov word ptr cs:[BSS_RegisterSet + REGS_ES], ax - mov ax, fs - mov word ptr cs:[BSS_RegisterSet + REGS_FS], ax - mov ax, gs - mov word ptr cs:[BSS_RegisterSet + REGS_GS], ax + mov ax, ds + mov word ptr cs:[BSS_RegisterSet + REGS_DS], ax + mov ax, es + mov word ptr cs:[BSS_RegisterSet + REGS_ES], ax + mov ax, fs + mov word ptr cs:[BSS_RegisterSet + REGS_FS], ax + mov ax, gs + mov word ptr cs:[BSS_RegisterSet + REGS_GS], ax
- pushfd - pop dword ptr cs:[BSS_RegisterSet + REGS_EFLAGS] + pushfd + pop dword ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
popad pop gs
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/linux.inc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/linux.inc [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/linux.inc [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -1,16 +1,15 @@ -
BootLinuxKernel: // dl must be set to the boot drive
- /* Load segment registers */ - cli - mov bx, HEX(9000) - mov ds, bx - mov es, bx - mov fs, bx - mov gs, bx - mov ss, bx - mov sp, HEX(9000) + /* Load segment registers */ + cli + mov bx, HEX(9000) + mov ds, bx + mov es, bx + mov fs, bx + mov gs, bx + mov ss, bx + mov sp, HEX(9000)
- ljmp16 HEX(9020), HEX(0000) + ljmp16 HEX(9020), HEX(0000)
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/pnp.inc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/pnp.inc [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/pnp.inc [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -1,58 +1,56 @@ -
PnpBiosGetDeviceNodeCount:
- mov ax, word ptr ds:[BSS_PnpBiosDataSegment] - push ax + mov ax, word ptr ds:[BSS_PnpBiosDataSegment] + push ax
- push cs - mov ax, BSS_PnpNodeSize - push ax + push cs + mov ax, BSS_PnpNodeSize + push ax
- push cs - mov ax, BSS_PnpNodeCount - push ax + push cs + mov ax, BSS_PnpNodeCount + push ax
- push 0 + push 0
- call dword ptr ds:[BSS_PnpBiosEntryPoint] - add sp, 12 + call dword ptr ds:[BSS_PnpBiosEntryPoint] + add sp, 12
- movzx ecx, ax - mov dword ptr ds:[BSS_PnpResult], ecx + movzx ecx, ax + mov dword ptr ds:[BSS_PnpResult], ecx
ret
PnpBiosGetDeviceNode:
- /* push bios segment */ - mov ax, word ptr ds:[BSS_PnpBiosDataSegment] - push ax + /* push bios segment */ + mov ax, word ptr ds:[BSS_PnpBiosDataSegment] + push ax
- /* push control flag */ - push 1 + /* push control flag */ + push 1
- /* push pointer to node buffer (segment/offset) */ - mov ax, word ptr ds:[BSS_PnpBiosBufferSegment] - push ax - mov ax, word ptr ds:[BSS_PnpBiosBufferOffset] - push ax + /* push pointer to node buffer (segment/offset) */ + mov ax, word ptr ds:[BSS_PnpBiosBufferSegment] + push ax + mov ax, word ptr ds:[BSS_PnpBiosBufferOffset] + push ax
- /* push pointer to node number (segment/offset) */ - push cs - mov ax, BSS_PnpNodeNumber - push ax + /* push pointer to node number (segment/offset) */ + push cs + mov ax, BSS_PnpNodeNumber + push ax
- /* push function number */ - push 1 + /* push function number */ + push 1
- /* call entry point */ - call dword ptr ds:[BSS_PnpBiosEntryPoint] - add sp, 14 + /* call entry point */ + call dword ptr ds:[BSS_PnpBiosEntryPoint] + add sp, 14
- movzx ecx, ax - mov dword ptr ds:[BSS_PnpResult], ecx + movzx ecx, ax + mov dword ptr ds:[BSS_PnpResult], ecx
ret -
Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/pxe.inc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/pxe.inc [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/pxe.inc [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -17,17 +17,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
- PxeCallApi:
- mov ax, word ptr ds:[BSS_PxeBufferSegment] - push ax - mov ax, word ptr ds:[BSS_PxeBufferOffset] - push ax - mov ax, word ptr ds:[BSS_PxeFunction] - push ax - call dword ptr ds:[BSS_PxeEntryPoint] - add esp, 6 - mov word ptr ds:[BSS_PxeResult], ax + mov ax, word ptr ds:[BSS_PxeBufferSegment] + push ax + mov ax, word ptr ds:[BSS_PxeBufferOffset] + push ax + mov ax, word ptr ds:[BSS_PxeFunction] + push ax + call dword ptr ds:[BSS_PxeEntryPoint] + add esp, 6 + mov word ptr ds:[BSS_PxeResult], ax
ret
Modified: trunk/reactos/boot/freeldr/freeldr/comm/rs232.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/comm/r... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -18,7 +18,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + #ifndef _M_ARM
#include <freeldr.h>
Modified: trunk/reactos/boot/freeldr/freeldr/include/ver.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/ver.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/ver.h [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -17,15 +17,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
-#ifndef __ASM__ #pragma once -#endif
-/* just some stuff */ -#define VERSION "FreeLoader v3.0" -#define COPYRIGHT "Copyright (C) 1998-2007 ReactOS Team" +/* Just some stuff */ +#define VERSION "FreeLoader v3.0" +#define COPYRIGHT "Copyright (C) 1998-2007 ReactOS Team" #define AUTHOR_EMAIL "<www.reactos.org>" -#define BY_AUTHOR "by ReactOS Team" +#define BY_AUTHOR "by ReactOS Team"
// FreeLoader version defines // @@ -38,9 +36,4 @@ #define FREELOADER_MINOR_VERSION 0 #define FREELOADER_PATCH_VERSION 0
- -#ifndef __ASM__ - -PCHAR GetFreeLoaderVersionString(VOID); - -#endif // __ASM__ +PCHAR GetFreeLoaderVersionString(VOID);
Modified: trunk/reactos/boot/freeldr/freeldr/ui/directui.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/dir... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/directui.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -226,13 +226,13 @@ UiDrawProgressBar(IN ULONG Left, IN ULONG Top, IN ULONG Right, - IN ULONG Bottom, + IN ULONG Bottom, IN ULONG Position, IN ULONG Range, IN PCHAR ProgressText) { ULONG i, ProgressBarWidth; - + /* Calculate the width of the bar proper */ ProgressBarWidth = (Right - Left) - 3;
Modified: trunk/reactos/boot/freeldr/freeldr/ui/minitui.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/ui/min... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/ui/minitui.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/ui/minitui.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -154,7 +154,7 @@ TuiEditBox, TuiTextToColor, TuiTextToFillStyle, - MiniTuiDrawBackdrop, /* no FadeIn */ + MiniTuiDrawBackdrop, /* no FadeIn */ TuiFadeOut, TuiDisplayMenu, MiniTuiDrawMenu,
Modified: trunk/reactos/boot/freeldr/freeldr/windows/headless.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/window... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/headless.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/headless.c [iso-8859-1] Sun Feb 1 22:15:32 2015 @@ -97,7 +97,7 @@ } } else - { + { /* Pick correct port for address */ PortAddress = (PUCHAR)0x2F8; if (CpDoesPortExist(PortAddress)) @@ -182,17 +182,17 @@ { case 2: LoaderRedirectionInformation.PortAddress = (PUCHAR)0x2F8; - break; - + break; + case 3: LoaderRedirectionInformation.PortAddress = (PUCHAR)0x3E8; - break; - + break; + case 4: LoaderRedirectionInformation.PortAddress = (PUCHAR)0x2E8; - break; - - default: + break; + + default: LoaderRedirectionInformation.PortAddress = (PUCHAR)0x3F8; break; } @@ -218,7 +218,7 @@ { /* Port seems usable, set it up and get the BIOS GUID */ WinLdrEnableFifo(WinLdrTerminalDeviceId, TRUE); - + WinLdrLoadGUID(&LoaderRedirectionInformation.SystemGUID);
/* Calculate delay in us based on the baud, assume 9600 if none given */ @@ -297,7 +297,7 @@ else { LoaderRedirectionInformation.BaudRate = 9600; - } + } }
/* Enable headless support if parameters were found */