ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2008
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
761 discussions
Start a n
N
ew thread
[tkreuzer] 34728: forgot this one: a stubbed out loader.c copied from i386
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 21:30:36 2008 New Revision: 34728 URL:
http://svn.reactos.org/svn/reactos?rev=34728&view=rev
Log: forgot this one: a stubbed out loader.c copied from i386 Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c (with props) Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c [iso-8859-1] Wed Jul 23 21:30:36 2008 @@ -1,0 +1,216 @@ +/* + * FreeLoader + * Copyright (C) 1998-2003 Brian Palmer <brianp(a)sginet.com> + * Copyright (C) 2005 Alex Ionescu <alex(a)relsoft.net> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#define _NTSYSTEM_ +#include <freeldr.h> + +#define NDEBUG +#include <debug.h> +#undef DbgPrint + +/* Page Directory and Tables for non-PAE Systems */ +extern PAGE_DIRECTORY_X86 startup_pagedirectory; +extern PAGE_DIRECTORY_X86 lowmem_pagetable; +extern PAGE_DIRECTORY_X86 kernel_pagetable; +extern PAGE_DIRECTORY_X86 hyperspace_pagetable; +extern PAGE_DIRECTORY_X86 apic_pagetable; +extern PAGE_DIRECTORY_X86 kpcr_pagetable; +extern PAGE_DIRECTORY_X86 kuser_pagetable; +extern ULONG_PTR KernelBase; +extern ROS_KERNEL_ENTRY_POINT KernelEntryPoint; +/* FUNCTIONS *****************************************************************/ + +/*++ + * FrLdrStartup + * INTERNAL + * + * Prepares the system for loading the Kernel. + * + * Params: + * Magic - Multiboot Magic + * + * Returns: + * None. + * + * Remarks: + * None. + * + *--*/ +VOID +NTAPI +FrLdrStartup(ULONG Magic) +{ + ASSERT(FALSE); +#if 0 + /* Disable Interrupts */ + _disable(); + + /* Re-initalize EFLAGS */ + Ke386EraseFlags(); + + /* Initialize the page directory */ + FrLdrSetupPageDirectory(); + + /* Initialize Paging, Write-Protection and Load NTOSKRNL */ + FrLdrSetupPae(Magic); +#endif +} + +/*++ + * FrLdrSetupPae + * INTERNAL + * + * Configures PAE on a MP System, and sets the PDBR if it's supported, or if + * the system is UP. + * + * Params: + * Magic - Multiboot Magic + * + * Returns: + * None. + * + * Remarks: + * None. + * + *--*/ +VOID +FASTCALL +FrLdrSetupPae(ULONG Magic) +{ +#if 0 + ULONG_PTR PageDirectoryBaseAddress = (ULONG_PTR)&startup_pagedirectory; + + /* Set the PDBR */ + __writecr3(PageDirectoryBaseAddress); + + /* Enable Paging and Write Protect*/ + __writecr0(__readcr0() | X86_CR0_PG | X86_CR0_WP); + + /* Jump to Kernel */ + (*KernelEntryPoint)(Magic, &LoaderBlock); +#endif +} + +/*++ + * FrLdrSetupPageDirectory + * INTERNAL + * + * Sets up the ReactOS Startup Page Directory. + * + * Params: + * None. + * + * Returns: + * None. + * + * Remarks: + * We are setting PDEs, but using the equvivalent (for our purpose) PTE structure. + * As such, please note that PageFrameNumber == PageEntryNumber. + * + *--*/ +VOID +FASTCALL +FrLdrSetupPageDirectory(VOID) +{ +#if 0 + PPAGE_DIRECTORY_X86 PageDir; + ULONG KernelPageTableIndex; + ULONG i; + + /* Get the Kernel Table Index */ + KernelPageTableIndex = KernelBase >> PDE_SHIFT; + + /* Get the Startup Page Directory */ + PageDir = (PPAGE_DIRECTORY_X86)&startup_pagedirectory; + + /* Set up the Low Memory PDE */ + PageDir->Pde[LowMemPageTableIndex].Valid = 1; + PageDir->Pde[LowMemPageTableIndex].Write = 1; + PageDir->Pde[LowMemPageTableIndex].PageFrameNumber = PaPtrToPfn(lowmem_pagetable); + + /* Set up the Kernel PDEs */ + PageDir->Pde[KernelPageTableIndex].Valid = 1; + PageDir->Pde[KernelPageTableIndex].Write = 1; + PageDir->Pde[KernelPageTableIndex].PageFrameNumber = PaPtrToPfn(kernel_pagetable); + PageDir->Pde[KernelPageTableIndex + 1].Valid = 1; + PageDir->Pde[KernelPageTableIndex + 1].Write = 1; + PageDir->Pde[KernelPageTableIndex + 1].PageFrameNumber = PaPtrToPfn(kernel_pagetable + 4096); + + /* Set up the Startup PDE */ + PageDir->Pde[StartupPageTableIndex].Valid = 1; + PageDir->Pde[StartupPageTableIndex].Write = 1; + PageDir->Pde[StartupPageTableIndex].PageFrameNumber = PaPtrToPfn(startup_pagedirectory); + + /* Set up the Hyperspace PDE */ + PageDir->Pde[HyperspacePageTableIndex].Valid = 1; + PageDir->Pde[HyperspacePageTableIndex].Write = 1; + PageDir->Pde[HyperspacePageTableIndex].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable); + + /* Set up the HAL PDE */ + PageDir->Pde[HalPageTableIndex].Valid = 1; + PageDir->Pde[HalPageTableIndex].Write = 1; + PageDir->Pde[HalPageTableIndex].PageFrameNumber = PaPtrToPfn(apic_pagetable); + + /* Set up Low Memory PTEs */ + PageDir = (PPAGE_DIRECTORY_X86)&lowmem_pagetable; + for (i=0; i<1024; i++) + { + PageDir->Pde[i].Valid = 1; + PageDir->Pde[i].Write = 1; + PageDir->Pde[i].Owner = 1; + PageDir->Pde[i].PageFrameNumber = PaToPfn(i * PAGE_SIZE); + } + + /* Set up Kernel PTEs */ + PageDir = (PPAGE_DIRECTORY_X86)&kernel_pagetable; + for (i=0; i<1536; i++) + { + PageDir->Pde[i].Valid = 1; + PageDir->Pde[i].Write = 1; + PageDir->Pde[i].PageFrameNumber = PaToPfn(KERNEL_BASE_PHYS + i * PAGE_SIZE); + } + + /* Setup APIC Base */ + PageDir = (PPAGE_DIRECTORY_X86)&apic_pagetable; + PageDir->Pde[0].Valid = 1; + PageDir->Pde[0].Write = 1; + PageDir->Pde[0].CacheDisable = 1; + PageDir->Pde[0].WriteThrough = 1; + PageDir->Pde[0].PageFrameNumber = PaToPfn(HAL_BASE); + PageDir->Pde[0x200].Valid = 1; + PageDir->Pde[0x200].Write = 1; + PageDir->Pde[0x200].CacheDisable = 1; + PageDir->Pde[0x200].WriteThrough = 1; + PageDir->Pde[0x200].PageFrameNumber = PaToPfn(HAL_BASE + KERNEL_BASE_PHYS); + + /* Setup KUSER_SHARED_DATA Base */ + PageDir->Pde[0x1F0].Valid = 1; + PageDir->Pde[0x1F0].Write = 1; + PageDir->Pde[0x1F0].PageFrameNumber = 2; + + /* Setup KPCR Base*/ + PageDir->Pde[0x1FF].Valid = 1; + PageDir->Pde[0x1FF].Write = 1; + PageDir->Pde[0x1FF].PageFrameNumber = 1; + + /* Zero shared data */ + RtlZeroMemory((PVOID)(2 << MM_PAGE_SHIFT), PAGE_SIZE); +#endif +} + Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 5 months
1
0
0
0
[tkreuzer] 34727: Implement a LoaderEntry, a function to setup a pagetable, a function to switch to long mode, a function to switch to real mode, Int386 to call interrupts, add some defines for amd64, enable full debug output. now setupldr should compile, and start it's work. It boots into long mode, reads the memory layout from bios and finally crashes, because the page table is limited to a single page of 2MB atm
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 21:27:00 2008 New Revision: 34727 URL:
http://svn.reactos.org/svn/reactos?rev=34727&view=rev
Log: Implement a LoaderEntry, a function to setup a pagetable, a function to switch to long mode, a function to switch to real mode, Int386 to call interrupts, add some defines for amd64, enable full debug output. now setupldr should compile, and start it's work. It boots into long mode, reads the memory layout from bios and finally crashes, because the page table is limited to a single page of 2MB atm Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/int386.S (with props) Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_base64k.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/disk.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/mm.h Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -1,0 +1,303 @@ +.intel_syntax noprefix +.text +.code16 + +//.org 0x8000 + +#define STACK16ADDR 0x7000 /* The 16-bit stack top will be at 0000:7000 */ +#define STACK64ADDR 0x74000 /* The 64-bit stack top will be at 0x74000 */ + +.global RealEntryPoint +RealEntryPoint: + + cli + + /* Setup real mode segment registers */ + xor ax, ax + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + /* Setup a real mode stack */ + mov sp, stack16 + + /* Zero BootDrive and BootPartition */ + xor eax, eax + mov _BootDrive, eax + mov _BootPartition, eax + + /* Store the boot drive */ + mov _BootDrive, dl + + /* Store the boot partition */ + mov _BootPartition, dh + + /* Load the GDT */ + lgdt gdtptr + /* Load the IDT */ +// lidt idtptr + + call x86_16_EnableA20 + + call x86_16_BuildPageTables + + /* Switch to long mode */ + call x86_16_SwitchToLong + + .code64 + + /* GO! */ + xor rcx, rcx + call _BootMain + + /* Return into real mode */ + call x86_64_SwitchToReal + .code16 + +// int 0x19 + + /* We should never get here */ +stop: + jmp stop + nop + nop + + +/** 16 Bit helper functions ***************************************************/ +.code16 + +x86_16_Empty8042: + .word 0x00eb,0x00eb // jmp $+2, jmp $+2 + in al, 0x64 + cmp al, 0xff // legacy-free machine without keyboard + jz empty_8042_ret // controllers on Intel Macs read back 0xFF + test al, 0x02 + jnz x86_16_Empty8042 +empty_8042_ret: + ret + +x86_16_EnableA20: + pusha + call x86_16_Empty8042 + mov al, 0xD1 // command write + out 0x64, al + call x86_16_Empty8042 + mov al, 0xDF // A20 on + out 0x60, al + call x86_16_Empty8042 + popa + ret + + +/* + * We defines one 2MB page at the start of memory, so we can access the first + * 2MBs as if paging was disabled + */ + +#define PML4_PAGENUM 60 // Put it high enough so it doesn't interfere with freeldr + +#define PAGESIZE 4096 +#define PDP_PAGENUM (PML4_PAGENUM + 1) +#define PD_PAGENUM (PDP_PAGENUM + 1) +#define PML4_ADDRESS (PML4_PAGENUM * PAGESIZE) +#define PDP_ADDRESS (PDP_PAGENUM * PAGESIZE) +#define PML4_SEG (PML4_ADDRESS / 16) + +x86_16_BuildPageTables: + pusha + push es + + mov ax, PML4_SEG + mov es, ax + cld + xor di, di + + /* One entry in the PML4 pointing to PDP */ + mov ax, ((PDP_PAGENUM << 12) & 0xffff) | 0x00f + stosw + mov ax, (PDP_PAGENUM >> 4) + stosw + xor ax,ax + mov cx, 0x07fe + rep stosw + + /* One entry in the PDP pointing to PD */ + mov ax, ((PD_PAGENUM << 12) & 0xffff) | 0x00f + stosw + mov ax, (PD_PAGENUM >> 4) + stosw + xor ax,ax + mov cx, 0x07fe + rep stosw + + /* One entry in the PD defining a 2MB page */ + mov ax, 0x018f + stosw + xor ax,ax + mov cx,0x07ff + rep stosw + + /* Return */ + pop es + popa + ret + + +#define LMODE_CS 0x08 +#define LMODE_DS 0x10 +#define RMODE_CS 0x18 /* RMode code selector, base 0 limit 64k */ +#define RMODE_DS 0x20 /* RMode data selector, base 0 limit 64k */ + +//.global x86_16_SwitchToLong +x86_16_SwitchToLong: + cli + + xor ax,ax + mov ds,ax + mov es,ax + mov fs,ax + mov gs,ax + mov ss,ax + + /* Get the return address off the stack */ + pop word ptr code64ret + + /* Save 16-bit stack pointer */ + mov stack16, sp + + mov eax, 0x00a0 // Set PAE and PGE: 10100000b + mov cr4, eax + + mov edx, PML4_ADDRESS // Point cr3 at PML4 + mov cr3, edx + + mov ecx, 0xC0000080 // Specify EFER MSR + + rdmsr // Enable long mode + or eax, 0x00000100 + wrmsr + + mov ebx, cr0 // Activate long mode + or ebx, 0x80000001 // by enabling paging and protection simultaneously + mov cr0, ebx // skipping protected mode entirely + + jmp LMODE_CS:offset LongCat //Load CS with 64 bit segment and flush the instruction cache + +.code64 +LongCat: + /* Set up 64 bit stack */ + mov rsp, stack64 + + /* Put the return address back onto the stack */ + push qword ptr code64ret + + /* Now return in long mode! */ + ret + + +/** 64 But functions **********************************************************/ +.code64 + +.global x86_64_SwitchToReal +x86_64_SwitchToReal: + + /* Get the return address off the stack */ + pop qword ptr code64ret + + /* Save 64-bit stack pointer */ + mov stack64, rsp + + /* Step 1 - deactivate long mode, by disabling paging */ + mov rax, cr0 + and rax, 0x000000007fffffff //~0x80000000 + mov cr0, rax + + /* Step 2 - disable long mode in EFER MSR */ + mov rcx, 0xC0000080 // Specify EFER MSR + rdmsr + and eax, ~0x00000100 // Disable EFER.LME + wrmsr + + .code32 + /* jmp to 16-bit segment to set the limit correctly */ + jmp RMODE_CS: offset SwitchToReal2 + +SwitchToReal2: + .code16 + + /* Step 3 - Disable Protected Mode */ + mov eax, cr0 + and eax, ~0x00000001 + mov cr0, eax + + /* Clear prefetch queue & correct CS */ + jmp 0:offset BeReal + +BeReal: + /* Restore segment registers */ + mov ax, 0 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + /* Rstore 16 bit stack */ + mov sp, stack16 + +// lidt rmode_idtptr /* Load IDTR with real mode value */ + +// sti /* These are ok now */ + + /* Put the return address back onto the stack */ + push word ptr code64ret + + /* Now return in real mode! */ + ret + + +/** Some data *****************************************************************/ + +.code64 + +stack16: + .quad STACK16ADDR + +stack64: + .quad STACK64ADDR + +code64ret: + .quad 0 + +gdt: + .quad 0x0000000000000000 + .quad 0x0020980000000000 + .quad 0x0000900000000000 + .word 0xFFFF, 0x0000, 0x9E00, 0x0000 /* 16-bit real mode CS */ + .word 0xFFFF, 0x0000, 0x9200, 0x0000 /* 16-bit real mode DS */ + +/* GDT table pointer */ +gdtptr: + .word 0x27 /* Limit */ + .long gdt /* Base Address */ + + +.global _BootDrive +_BootDrive: + .long 0 + +.global _BootPartition +_BootPartition: + .long 0 + + +/////////////////////////////////////////////////////////////////////////////// + +/* Need to include them here, because of linking issues between 64 / 16 bit */ +//#include "debug16.S" +#include "int386.S" +#include "boot.S" +#include "i386pnp.S" + Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/arch.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/int386.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/int386.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/int386.S [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -1,0 +1,170 @@ +/* + * FreeLoader + * Copyright (C) 1998-2002 Brian Palmer <brianp(a)sginet.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .intel_syntax noprefix + .text + .code16 + +#define ASM +#include <arch.h> + + +Int386_REGS: + +Int386_eax: + .long 0 +Int386_ebx: + .long 0 +Int386_ecx: + .long 0 +Int386_edx: + .long 0 + +Int386_esi: + .long 0 +Int386_edi: + .long 0 + +Int386_ds: + .word 0 +Int386_es: + .word 0 +Int386_fs: + .word 0 +Int386_gs: + .word 0 + +Int386_eflags: + .long 0 + +Int386_vector: + .quad 0 +Int386_regsin: + .quad 0 +Int386_regsout: + .quad 0 + +/* + * int Int386(int ivec, REGS* in, REGS* out); + */ +EXTERN(_Int386) + .code64 + + /* Get the function parameters */ + mov Int386_vector, rcx + mov Int386_vector_opcode, cl + mov Int386_regsin, rdx + mov Int386_regsout, r8 + + /* Save all registers + segment registers */ +// push ds +// push es + push fs + push gs + push rbx + push rcx + push rdx + push rsi + push rdi + + /* Copy the input regs to our variables */ + lea rdi, Int386_REGS + mov esi, Int386_regsin + mov ecx, 0x24 + rep movsb + + call x86_64_SwitchToReal + .code16 + + /* Setup the registers */ + mov ax, cs:Int386_ds + mov ds, ax /* DS register */ + mov ax, cs:Int386_es + mov es, ax /* ES register */ + mov ax, cs:Int386_fs + mov fs, ax /* FS register */ + mov ax, cs:Int386_gs + mov gs, ax /* GS register */ + + mov eax, cs:Int386_eax /* EAX register */ + mov ebx, cs:Int386_ebx /* EBX register */ + mov ecx, cs:Int386_ecx /* ECX register */ + mov edx, cs:Int386_edx /* EDX register */ + + mov esi, cs:Int386_esi /* ESI register */ + mov edi, cs:Int386_edi /* EDI register */ + + /* Do not set the flags register */ + /* only return its value in regsout */ + //pushl Int386_eflags + //popfl /* EFLAGS register */ + + /* Call the interrupt vector */ + /*int Int386_vector*/ +Int386_int_opcode: + .byte 0xcd +Int386_vector_opcode: + .byte 0x00 + + /* Save the registers */ + mov cs:Int386_eax, eax /* EAX register */ + mov cs:Int386_ebx, ebx /* EBX register */ + mov cs:Int386_ecx, ecx /* ECX register */ + mov cs:Int386_edx, edx /* EDX register */ + + mov cs:Int386_esi, esi /* ESI register */ + mov cs:Int386_edi, edi /* EDI register */ + + mov ax, ds /* DS register */ + mov cs:Int386_ds, ax + mov ax, es /* ES register */ + mov cs:Int386_es, ax + mov ax, fs /* FS register */ + mov cs:Int386_fs, ax + mov ax, gs /* GS register */ + mov cs:Int386_gs, ax + + pushf + pop cs:Int386_eflags /* EFLAGS register */ + + call x86_16_SwitchToLong + .code64 + + /* Copy the variables to the output regs */ + lea rsi, Int386_REGS + mov rdi, Int386_regsout + mov rcx, 0x24 + rep movsb + + /* Restore segment and all other registers */ + pop rdi + pop rsi + pop rdx + pop rcx + pop rbx + pop gs + pop fs +// pop es +// pop ds + + /* Get return value */ + xor rax, rax + mov eax, Int386_eax + + ret Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/int386.S ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -23,11 +23,11 @@ #ifdef DBG -//#define DEBUG_ALL +#define DEBUG_ALL //#define DEBUG_INIFILE //#define DEBUG_REACTOS //#define DEBUG_CUSTOM -#define DEBUG_NONE +//#define DEBUG_NONE #if defined (DEBUG_ALL) ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM | @@ -243,7 +243,7 @@ VOID DebugPrint(ULONG Mask, char *format, ...) { va_list ap; - char Buffer[4096]; + char Buffer[2096]; char *ptr = Buffer; // Mask out unwanted debug messages @@ -271,7 +271,7 @@ VOID DebugPrint1(char *format, ...) { va_list ap; - char Buffer[4096]; + char Buffer[2096]; char *ptr = Buffer; va_start(ap, format); Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -84,6 +84,7 @@ <file>i386disk.c</file> <file>i386rtl.c</file> <file>i386vid.c</file> + <file>loader.c</file> <file>pccons.c</file> <file>pcdisk.c</file> <file>pcmem.c</file> Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_base64k.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_base64k.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_base64k.rbuild [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -26,7 +26,6 @@ <file>i386cpu.S</file> <file>i386idt.S</file> <file>i386trap.S</file> - <!-- file>linux.S</file --> <file>mb.S</file> </directory> </if> Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/disk.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/disk.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/disk.h [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -106,14 +106,14 @@ // i386 BIOS Disk Functions (i386disk.c) // /////////////////////////////////////////////////////////////////////////////////////// -#ifdef __i386__ +#if defined(__i386__) || defined(_M_AMD64) BOOLEAN DiskResetController(ULONG DriveNumber); BOOLEAN DiskInt13ExtensionsSupported(ULONG DriveNumber); //VOID DiskStopFloppyMotor(VOID); BOOLEAN DiskGetExtendedDriveParameters(ULONG DriveNumber, PVOID Buffer, USHORT BufferSize); -#endif // defined __i386__ +#endif // defined __i386__ || defined(_M_AMD64) /////////////////////////////////////////////////////////////////////////////////////// // Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/mm.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Wed Jul 23 21:27:00 2008 @@ -49,6 +49,17 @@ ( ((a) >> MM_PAGE_SHIFT) + ((a) & MM_PAGE_MASK ? 1 : 0) ) #endif // defined __i386__ or _PPC_ or _MIPS_ + +#if defined (_AMD64_) + +#define MM_PAGE_SIZE 4096 +#define MM_PAGE_MASK 0xFFF +#define MM_PAGE_SHIFT 12 + +#define MM_SIZE_TO_PAGES(a) \ + ( ((a) >> MM_PAGE_SHIFT) + ((a) & MM_PAGE_MASK ? 1 : 0) ) + +#endif // HEAP and STACK size #define HEAP_PAGES 0x400
16 years, 5 months
1
0
0
0
[tkreuzer] 34726: - implement _alloca (untested), ChainLoadBiosBootSectorCode, SoftReboot - copy drvmap.S, i386cpu.S, i386idt.S, i386pnp.S, i386trap.S, mb.S
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 21:18:44 2008 New Revision: 34726 URL:
http://svn.reactos.org/svn/reactos?rev=34726&view=rev
Log: - implement _alloca (untested), ChainLoadBiosBootSectorCode, SoftReboot - copy drvmap.S, i386cpu.S, i386idt.S, i386pnp.S, i386trap.S, mb.S Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/_alloca.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/boot.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386idt.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mb.S (with props) Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/_alloca.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/_alloca.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/_alloca.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,36 @@ +/* stuff needed for libgcc on win32. */ +.intel_syntax noprefix + +/*#ifdef L_chkstk*/ +#ifdef WIN32 + + .global ___chkstk + .global __alloca +___chkstk: +__alloca: + push rcx /* save temp */ + mov rcx, rsp /* get sp */ + add rcx, 8 /* and point to return addr */ + +probe: + cmp rax, 0x1000 /* > 4k ?*/ + jb done + + sub rcx, 0x1000 /* yes, move pointer down 4k*/ + or qword ptr [rcx], 0x0 /* probe there */ + sub rax, 0x1000 /* decrement count */ + jmp probe /* and do it again */ + +done: + sub rcx, rax + or qword ptr [rcx], 0x0 /* less that 4k, just peek here */ + + mov rax, rsp + mov rsp, rcx /* decrement stack */ + + mov rcx, [rax] /* recover saved temp */ + mov rax, [rax + 8]/* get return address */ + jmp [rax] + + +#endif Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/_alloca.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/boot.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/boot.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/boot.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,64 @@ +/* + * FreeLoader + * Copyright (C) 1998-2002 Brian Palmer <brianp(a)sginet.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM +#include <arch.h> + + +EXTERN(_ChainLoadBiosBootSectorCode) + .code64 + + call x86_64_SwitchToReal + .code16 + + /* Set the boot drive */ + mov dl, _BootDrive + + /* Load segment registers */ + cli + mov bx, 0x0000 + mov ds, bx + mov es, bx + mov fs, bx + mov gs, bx + mov ss, bx + mov sp, 0x7C00 + +// ljmpl $0x0000,$0x7C00 + jmp 0x7c00:0x0000 + +EXTERN(_SoftReboot) + .code64 + + call x86_64_SwitchToReal + .code16 + + mov ax, 0x40 + mov ds, ax + mov si, 0x72 + + // Set the word at location 40:72 to 1234h + mov word ptr [si], 0x1234 + + // and jump to location FFFF:0 in ROM +// ljmpl $0xFFFF,$0x0000 + jmp 0xffff: 0x0000 Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/boot.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,132 @@ +/* + * FreeLoader + * Copyright (C) 1998-2002 Brian Palmer <brianp(a)sginet.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM +#include <arch.h> + + +EXTERN(_DriveMapInt13HandlerStart) +Int13Handler: + + pushw %bp + movw %sp,%bp + pushw %ax + pushw %cx + pushw %si + + cld + + /* Get callers flags from stack */ + movw 0x06(%bp),%ax + movw %ax,%cs:(CallersFlags - Int13Handler) + + /* Save the drive number they passed in */ + movb %dl,%cs:(PassedInDriveNumber - Int13Handler) + + /* Now we need to perform the mapping */ + xorw %cx,%cx + movw $(Int13HandlerMapCount - Int13Handler),%si + /* Get the count of drives in the map list */ + movb %cs:(%si),%cl + incw %si + + /* If the map list is empty then just call the old int 13h handler */ + cmpb $0,%cl + jz CallOldInt13Handler + +GetMappedDriveNumberLoop: + + /* Get the next drive number in the list */ + lodsw %cs:(%si),%ax + /* Check to see if it's the one they are calling int 13h for */ + cmpb %al,%dl + /* 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 */ + movb %ah,%dl + /* Call BIOS Int 13 Handler */ + jmp CallOldInt13Handler + +GetMappedDriveNumberLoopNext: + loop GetMappedDriveNumberLoop + +CallOldInt13Handler: + /* Restore the registers we changed off the stack */ + popw %si + popw %cx + popw %ax + + /* Put flags onto stack */ + pushw %cs:(CallersFlags - Int13Handler) + + /* Call old int 13h handler with new drive number */ + .byte 0x9a /* lcall */ +EXTERN(_DriveMapOldInt13HandlerAddress) + .word 0 + .word 0 + + /* Update the callers flags with the values the BIOS returned */ + pushw %ax + pushf + popw %ax + movw %ax,0x06(%bp) + popw %ax + /* Restore the callers drive number */ + movb %cs:(PassedInDriveNumber - Int13Handler),%dl + + popw %bp + + iret + +CallersFlags: + .word 0 + +PassedInDriveNumber: + .byte 0 + +EXTERN(_DriveMapInt13HandlerMapList) +Int13HandlerMapCount: + .byte 0 + +Int13HandlerDrive1: + .byte 0 +Int13HandlerDriveNew1: + .byte 0 + +Int13HandlerDrive2: + .byte 0 +Int13HandlerDriveNew2: + .byte 0 + +Int13HandlerDrive3: + .byte 0 +Int13HandlerDriveNew3: + .byte 0 + +Int13HandlerDrive4: + .byte 0 +Int13HandlerDriveNew4: + .byte 0 + +EXTERN(_DriveMapInt13HandlerEnd) Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/drvmap.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,131 @@ +/* + * FreeLoader + * Copyright (C) 2003 Eric Kohl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM + +#include <arch.h> + +/* + * U32 CpuidSupported(VOID); + * + * RETURNS: + * 0x00000001: CPU supports the CPUID instruction + * 0x00000300: Found 80386 CPU + * 0x00000400: Found 80486 CPU without CPUID support + */ + +EXTERN(_CpuidSupported) + .code32 + + pushl %ecx /* save ECX */ + + pushfl /* push original EFLAGS */ + popl %eax /* get original EFLAGS */ + movl %eax,%ecx /* save original EFLAGS */ + xorl $0x40000,%eax /* flip AC bit in EFLAGS */ + pushl %eax /* save new EFLAGS value on stack */ + popfl /* replace current EFLAGS value */ + + pushfl /* get new EFLAGS */ + popl %eax /* store new EFLAGS in EAX */ + xorl %ecx, %eax /* can't toggle AC bit, processor=80386 */ + + movl $0x300,%eax /* return processor id */ + jz NoCpuid /* jump if 80386 processor */ + + pushl %ecx + popfl /* restore AC bit in EFLAGS first */ + + movl %ecx,%eax /* get original EFLAGS */ + xorl $0x200000,%eax /* flip ID bit in EFLAGS */ + pushl %eax /* save new EFLAGS value on stack */ + popfl /* replace current EFLAGS value */ + pushfl /* get new EFLAGS */ + popl %eax /* store new EFLAGS in EAX */ + xorl %ecx,%eax /* can't toggle ID bit, */ + + movl $0x400,%eax /* return processor id */ + je NoCpuid /* processor=80486 */ + + movl $1,%eax /* CPUID supported */ + +NoCpuid: + pushl %ecx + popfl /* restore EFLAGS */ + popl %ecx /* retore ECX */ + + ret + + +/* + * VOID GetCpuid(U32 Level, U32 *eax, U32 *ebx, U32 *ecx, U32 *edx); + */ + +EXTERN(_GetCpuid) + .code32 + + pushl %ebp + movl %esp,%ebp + + pushl %eax + pushl %ebx + pushl %ecx + pushl %edx + pushl %esi + + movl 0x08(%ebp),%eax + + cpuid + + movl 0x0C(%ebp),%esi + movl %eax,(%esi) + + movl 0x10(%ebp),%esi + movl %ebx,(%esi) + + movl 0x14(%ebp),%esi + movl %ecx,(%esi) + + movl 0x18(%ebp),%esi + movl %edx,(%esi) + + popl %esi + popl %edx + popl %ecx + popl %ebx + popl %eax + + movl %ebp,%esp + popl %ebp + ret + + +/* + * U64 RDTSC(VOID); + */ + +EXTERN(_RDTSC) + .code32 + rdtsc + ret + +/* EOF */ Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386cpu.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386idt.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386idt.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386idt.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,224 @@ +/* + * FreeLoader + * Copyright (C) 1998-2002 Brian Palmer <brianp(a)sginet.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM +#include <arch.h> + + + .p2align 2 /* force 4-byte alignment */ +EXTERN(i386idt) + /* Exception 0 - Divide By Zero */ + .word i386DivideByZero /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Flags, Zero Byte */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 1 - Debug Exception */ + .word i386DebugException /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 2 - NMI */ + .word i386NMIException /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 3 - Breakpoint (INT 3) */ + .word i386Breakpoint /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 4 - Overflow (INTO with EFLAGS[OF] set) */ + .word i386Overflow /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 5 - Bound Exception */ + .word i386BoundException /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 6 - Invalid Opcode */ + .word i386InvalidOpcode /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 7 - FPU Not Available */ + .word i386FPUNotAvailable /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 8 - Double Fault */ + .word i386DoubleFault /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 9 - Coprocessor Segment Overrun */ + .word i386CoprocessorSegment /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 10 (0x0A) - Invalid TSS */ + .word i386InvalidTSS /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 11 (0x0B) - Segment Not Present */ + .word i386SegmentNotPresent /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 12 (0x0C) - Stack Exception */ + .word i386StackException /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 13 (0x0D) - General Protection Fault */ + .word i386GeneralProtectionFault /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 14 (0x0E) - Page Fault */ + .word i386PageFault /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 15 (0x0F) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 16 (0x10) - Coprocessor Error */ + .word i386CoprocessorError /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 17 (0x11) - Alignment Check */ + .word i386AlignmentCheck /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 18 (0x12) - Machine Check */ + .word i386MachineCheck /* Offset 0 - 15 */ + .word 0x0008 /* Selector */ + .word 0x8e00 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 19 (0x13) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 20 (0x14) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 21 (0x15) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 22 (0x16) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 23 (0x17) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 24 (0x18) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 25 (0x19) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 26 (0x1A) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 27 (0x1B) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 28 (0x1C) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 29 (0x1D) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 30 (0x1E) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + + /* Exception 31 (0x1F) - Reserved */ + .word 0x0000 /* Offset 0 - 15 */ + .word 0x0000 /* Selector */ + .word 0x0000 /* Zero byte, flags */ + .word 0x0000 /* Offset 16 - 31 */ + +/* IDT table pointer */ +EXTERN(i386idtptr) + .word (i386idtptr-i386idt) /* Limit */ + .long i386idt /* Base Address */ Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386idt.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,258 @@ +/* + * FreeLoader + * Copyright (C) 2003 Eric Kohl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM + +#include <arch.h> + + +/* + * U32 PnpBiosSupported(VOID); + * + * RETURNS: + */ +_pnp_bios_entry_point: + .long 0 +_pnp_bios_data_segment: + .word 0 + +EXTERN(_PnpBiosSupported) + .code64 + + push rdi + push rsi + push rcx + push rdx + + xor edi, edi + + /* init esi */ + mov esi, 0xF0000 + +pnp_again: + mov eax, [%esi] + cmp eax, 0x506E5024 /* "$PnP" */ + je pnp_found + + cmp esi, 0xFFFF0 + je pnp_not_found + +pnp_add: + add esi, 0x10 + jmp pnp_again + +pnp_found: + /* first calculate the checksum */ + push rsi + + push 0x21 + pop rcx + xor edx, edx + +pnp_loop: + lodsb + add dl, al + loop pnp_loop + + test dl, dl + pop rsi + jnz pnp_add + + mov edi, esi + + /* Calculate the bios entry point (far pointer) */ + xor eax, eax + mov ax, [esi + 0x0F] + shl eax, 16 + mov ax, [esi + 0x0D] + mov _pnp_bios_entry_point, eax + + /* Store bios data segment */ + mov ax, [esi + 0x1B] + mov _pnp_bios_data_segment, ax + +pnp_not_found: + mov eax, edi + + pop rdx + pop rcx + pop rsi + pop rdi + + ret + + +/* + * U32 PnpBiosGetDeviceNodeCount(U32 *NodeSize, U32 *NodeCount); + * + * RETURNS: + */ +_pnp_result: + .long 0 +_pnp_node_size: + .word 0 +_pnp_node_count: + .word 0 + +EXTERN(_PnpBiosGetDeviceNodeCount) + .code64 + + push rbp + mov rbp, rsp + +// pushal FIXME +// push es + + call x86_64_SwitchToReal + .code16 + + mov ax, _pnp_bios_data_segment + push ax + + push cs + mov ax, _pnp_node_size + push ax + + push cs + mov ax, _pnp_node_count + push ax + + push 0 + + call [_pnp_bios_entry_point] + add sp, 12 + + movzx ecx, ax + mov _pnp_result, ecx + + call x86_16_SwitchToLong + .code64 + + mov esi, [rbp + 0x08] + mov ax, _pnp_node_size + movzx ecx, ax + mov [rsi], ecx + + mov rsi, [ebp + 0x0C] + mov ax, _pnp_node_count + movzx ecx, ax + mov [rsi], eax + +// pop es +// popal + + mov rsp, rbp + pop rbp + + xor rax, rax + mov eax, _pnp_result + + ret + + +/* + * U32 PnpBiosGetDeviceNode(U8 *NodeId, U8 *NodeBuffer); + * + * RETURNS: + */ +_pnp_buffer_segment: + .word 0 +_pnp_buffer_offset: + .word 0 + +_pnp_node_number: + .byte 0 + +EXTERN(_PnpBiosGetDeviceNode) + .code64 + + push rbp + mov rbp, rsp + +// pushal +// push es + + /* get current node number */ + mov rsi, [rbp + 0x08] + mov al, [rsi] + mov _pnp_node_number, al + + /* convert pointer to node buffer to segment/offset */ + mov eax, [rbp + 0x0C] + shr eax, 4 + and eax, 0xf000 + mov _pnp_buffer_segment , ax + mov eax, [rbp + 0x0C] + and eax, 0xffff + mov _pnp_buffer_offset, ax + + call x86_64_SwitchToReal + .code16 + + /* push bios segment */ + mov ax, _pnp_bios_data_segment + push ax + + /* push control flag */ + push 0x0001 + + /* push pointer to node buffer (segment/offset) */ + mov ax, _pnp_buffer_segment + push ax + mov ax, _pnp_buffer_offset + push ax + + /* push pointer to node number (segment/offset) */ + push cs + mov ax, _pnp_node_number + push ax + + /* push function number */ + push 1 + + /* call entry point */ + call [_pnp_bios_entry_point] + add sp, 14 + + movzx ecx, ax + mov _pnp_result, ecx + + call x86_16_SwitchToLong + .code64 + + /* update node number */ + mov rsi, [rbp + 0x08] + mov al, _pnp_node_number + mov [rsi], al + +// pop es +// popal + + mov rsp, rbp + pop rbp + + xor rax, rax + mov eax, _pnp_result + + ret + +/* EOF */ Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386pnp.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,942 @@ +/* + * FreeLoader + * Copyright (C) 1998-2002 Brian Palmer <brianp(a)sginet.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM +#include <arch.h> +#include <ver.h> + +#define SCREEN_ATTR 0x1f /* Bright white on blue background */ + +.macro SAVE_CPU_REGS + movl %eax,i386_EAX + movl %ebx,i386_EBX + movl %ecx,i386_ECX + movl %edx,i386_EDX + movl %esp,i386_ESP + movl %ebp,i386_EBP + movl %esi,i386_ESI + movl %edi,i386_EDI + movw %ds,%ax + movw %ax,i386_DS + movw %es,%ax + movw %ax,i386_ES + movw %fs,%ax + movw %ax,i386_FS + movw %gs,%ax + movw %ax,i386_GS + movw %ss,%ax + movw %ax,i386_SS + popl %eax + movl %eax,i386_EIP + popl %eax + movw %ax,i386_CS + popl %eax + movl %eax,i386_EFLAGS + movl %cr0,%eax + movl %eax,i386_CR0 + //movl %cr1,%eax + //movl %eax,i386_CR1 + movl %cr2,%eax + movl %eax,i386_CR2 + movl %cr3,%eax + movl %eax,i386_CR3 + movl %dr0,%eax + movl %eax,i386_DR0 + movl %dr1,%eax + movl %eax,i386_DR1 + movl %dr2,%eax + movl %eax,i386_DR2 + movl %dr3,%eax + movl %eax,i386_DR3 + movl %dr6,%eax + movl %eax,i386_DR6 + movl %dr7,%eax + movl %eax,i386_DR7 + sgdt i386_GDTR + sidt i386_IDTR + sldt i386_LDTR + str i386_TR +.endm + + + +i386ExceptionHandlerText: + .ascii "An error occured in FreeLoader\n" + .ascii VERSION + .ascii "\n" + .asciz "Report this error to the ReactOS Development mailing list <ros-dev(a)reactos.org>\n\n" + +i386DivideByZeroText: + .asciz "Exception 00: DIVIDE BY ZERO\n\n" +i386DebugExceptionText: + .asciz "Exception 01: DEBUG EXCEPTION\n\n" +i386NMIExceptionText: + .asciz "Exception 02: NON-MASKABLE INTERRUPT EXCEPTION\n\n" +i386BreakpointText: + .asciz "Exception 03: BREAKPOINT (INT 3)\n\n" +i386OverflowText: + .asciz "Exception 04: OVERFLOW\n\n" +i386BoundExceptionText: + .asciz "Exception 05: BOUND EXCEPTION\n\n" +i386InvalidOpcodeText: + .asciz "Exception 06: INVALID OPCODE\n\n" +i386FPUNotAvailableText: + .asciz "Exception 07: FPU NOT AVAILABLE\n\n" +i386DoubleFaultText: + .asciz "Exception 08: DOUBLE FAULT\n\n" +i386CoprocessorSegmentText: + .asciz "Exception 09: COPROCESSOR SEGMENT OVERRUN\n\n" +i386InvalidTSSText: + .asciz "Exception 0A: INVALID TSS\n\n" +i386SegmentNotPresentText: + .asciz "Exception 0B: SEGMENT NOT PRESENT\n\n" +i386StackExceptionText: + .asciz "Exception 0C: STACK EXCEPTION\n\n" +i386GeneralProtectionFaultText: + .asciz "Exception 0D: GENERAL PROTECTION FAULT\n\n" +i386PageFaultText: + .asciz "Exception 0E: PAGE FAULT\n\n" +i386CoprocessorErrorText: + .asciz "Exception 10: COPROCESSOR ERROR\n\n" +i386AlignmentCheckText: + .asciz "Exception 11: ALIGNMENT CHECK\n\n" +i386MachineCheckText: + .asciz "Exception 12: MACHINE CHECK\n\n" + +i386_EAX_Text: + .asciz "EAX: " +i386_EBX_Text: + .asciz "EBX: " +i386_ECX_Text: + .asciz "ECX: " +i386_EDX_Text: + .asciz "EDX: " +i386_ESP_Text: + .asciz " ESP: " +i386_EBP_Text: + .asciz " EBP: " +i386_ESI_Text: + .asciz " ESI: " +i386_EDI_Text: + .asciz " EDI: " +i386_CS_Text: + .asciz "CS: " +i386_DS_Text: + .asciz "DS: " +i386_ES_Text: + .asciz "ES: " +i386_FS_Text: + .asciz "FS: " +i386_GS_Text: + .asciz "GS: " +i386_SS_Text: + .asciz "SS: " +i386_EFLAGS_Text: + .asciz " EFLAGS: " +i386_EIP_Text: + .asciz " EIP: " +i386_ERROR_CODE_Text: + .asciz " ERROR CODE: " +i386_CR0_Text: + .asciz " CR0: " +i386_CR1_Text: + .asciz " CR1: " +i386_CR2_Text: + .asciz " CR2: " +i386_CR3_Text: + .asciz " CR3: " +i386_DR0_Text: + .asciz " DR0: " +i386_DR1_Text: + .asciz " DR1: " +i386_DR2_Text: + .asciz " DR2: " +i386_DR3_Text: + .asciz " DR3: " +i386_DR6_Text: + .asciz " DR6: " +i386_DR7_Text: + .asciz " DR7: " +i386_GDTR_Text: + .asciz " GDTR Base: " +i386_IDTR_Text: + .asciz " IDTR Base: " +i386_Limit_Text: + .asciz " Limit: " +i386_LDTR_Text: + .asciz " LDTR: " +i386_TR_Text: + .asciz " TR: " + +i386FramesText: + .asciz "Frames:\n" + +/* Set by each exception handler to the address of the description text */ +i386ExceptionDescriptionText: + .long 0 + +/* Used to store the contents of all the registers when an exception occurs */ +i386_EAX: + .long 0 +i386_EBX: + .long 0 +i386_ECX: + .long 0 +i386_EDX: + .long 0 +i386_ESP: + .long 0 +i386_EBP: + .long 0 +i386_ESI: + .long 0 +i386_EDI: + .long 0 +i386_CS: + .word 0 +i386_DS: + .word 0 +i386_ES: + .word 0 +i386_FS: + .word 0 +i386_GS: + .word 0 +i386_SS: + .word 0 +i386_EFLAGS: + .long 0 +i386_EIP: + .long 0 +i386_ERROR_CODE: + .long 0 +i386_CR0: + .long 0 +i386_CR1: + .long 0 +i386_CR2: + .long 0 +i386_CR3: + .long 0 +i386_DR0: + .long 0 +i386_DR1: + .long 0 +i386_DR2: + .long 0 +i386_DR3: + .long 0 +i386_DR6: + .long 0 +i386_DR7: + .long 0 +i386_GDTR: + .word 0 + .long 0 +i386_IDTR: + .word 0 + .long 0 +i386_LDTR: + .word 0 +i386_TR: + .word 0 + +/* Used to store the current X and Y position on the screen */ +i386_ScreenPosX: + .long 0 +i386_ScreenPosY: + .long 0 + +/************************************************************************/ +i386CommonExceptionHandler: + .code32 + + SAVE_CPU_REGS + + pushl $SCREEN_ATTR + call _MachVideoClearScreen + add $4,%esp + + movl $i386ExceptionHandlerText,%esi + call i386PrintText + + movl i386ExceptionDescriptionText,%esi + call i386PrintText + + movl $i386_EAX_Text,%esi + call i386PrintText + movl i386_EAX,%eax + call i386PrintHexDword // Display EAX + movl $i386_ESP_Text,%esi + call i386PrintText + movl i386_ESP,%eax + call i386PrintHexDword // Display ESP + movl $i386_CR0_Text,%esi + call i386PrintText + movl i386_CR0,%eax + call i386PrintHexDword // Display CR0 + movl $i386_DR0_Text,%esi + call i386PrintText + movl i386_DR0,%eax + call i386PrintHexDword // Display DR0 + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_EBX_Text,%esi + call i386PrintText + movl i386_EBX,%eax + call i386PrintHexDword // Display EBX + movl $i386_EBP_Text,%esi + call i386PrintText + movl i386_EBP,%eax + call i386PrintHexDword // Display EBP + movl $i386_CR1_Text,%esi + call i386PrintText + movl i386_CR1,%eax + call i386PrintHexDword // Display CR1 + movl $i386_DR1_Text,%esi + call i386PrintText + movl i386_DR1,%eax + call i386PrintHexDword // Display DR1 + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_ECX_Text,%esi + call i386PrintText + movl i386_ECX,%eax + call i386PrintHexDword // Display ECX + movl $i386_ESI_Text,%esi + call i386PrintText + movl i386_ESI,%eax + call i386PrintHexDword // Display ESI + movl $i386_CR2_Text,%esi + call i386PrintText + movl i386_CR2,%eax + call i386PrintHexDword // Display CR2 + movl $i386_DR2_Text,%esi + call i386PrintText + movl i386_DR2,%eax + call i386PrintHexDword // Display DR2 + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_EDX_Text,%esi + call i386PrintText + movl i386_EDX,%eax + call i386PrintHexDword // Display EDX + movl $i386_EDI_Text,%esi + call i386PrintText + movl i386_EDI,%eax + call i386PrintHexDword // Display EDI + movl $i386_CR3_Text,%esi + call i386PrintText + movl i386_CR3,%eax + call i386PrintHexDword // Display CR3 + movl $i386_DR3_Text,%esi + call i386PrintText + movl i386_DR3,%eax + call i386PrintHexDword // Display DR3 + incl i386_ScreenPosY + movl $55,i386_ScreenPosX + movl $i386_DR6_Text,%esi + call i386PrintText + movl i386_DR6,%eax + call i386PrintHexDword // Display DR6 + incl i386_ScreenPosY + movl $55,i386_ScreenPosX + movl $i386_DR7_Text,%esi + call i386PrintText + movl i386_DR7,%eax + call i386PrintHexDword // Display DR7 + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + incl i386_ScreenPosY + movl $i386_CS_Text,%esi + call i386PrintText + movw i386_CS,%ax + call i386PrintHexWord // Display CS + movl $i386_EIP_Text,%esi + call i386PrintText + movl i386_EIP,%eax + call i386PrintHexDword // Display EIP + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_DS_Text,%esi + call i386PrintText + movw i386_DS,%ax + call i386PrintHexWord // Display DS + movl $i386_ERROR_CODE_Text,%esi + call i386PrintText + movl i386_ERROR_CODE,%eax + call i386PrintHexDword // Display ERROR CODE + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_ES_Text,%esi + call i386PrintText + movw i386_ES,%ax + call i386PrintHexWord // Display ES + movl $i386_EFLAGS_Text,%esi + call i386PrintText + movl i386_EFLAGS,%eax + call i386PrintHexDword // Display EFLAGS + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_FS_Text,%esi + call i386PrintText + movw i386_FS,%ax + call i386PrintHexWord // Display FS + movl $i386_GDTR_Text,%esi + call i386PrintText + movl i386_GDTR+2,%eax + call i386PrintHexDword // Display GDTR Base + movl $i386_Limit_Text,%esi + call i386PrintText + movw i386_GDTR,%ax + call i386PrintHexWord // Display GDTR Limit + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_GS_Text,%esi + call i386PrintText + movw i386_GS,%ax + call i386PrintHexWord // Display GS + movl $i386_IDTR_Text,%esi + call i386PrintText + movl i386_IDTR+2,%eax + call i386PrintHexDword // Display IDTR Base + movl $i386_Limit_Text,%esi + call i386PrintText + movw i386_IDTR,%ax + call i386PrintHexWord // Display IDTR Limit + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + movl $i386_SS_Text,%esi + call i386PrintText + movw i386_SS,%ax + call i386PrintHexWord // Display SS + movl $i386_LDTR_Text,%esi + call i386PrintText + movw i386_LDTR,%ax + call i386PrintHexWord // Display LDTR + movl $i386_TR_Text,%esi + call i386PrintText + movw i386_TR,%ax + call i386PrintHexWord // Display TR + movl $0,i386_ScreenPosX + incl i386_ScreenPosY + incl i386_ScreenPosY + call i386PrintFrames // Display frames + incl i386_ScreenPosY + incl i386_ScreenPosY + + cli +i386ExceptionHandlerHang: + hlt + jmp i386ExceptionHandlerHang + + iret + +i386PrintFrames: + movl $0,i386_ScreenPosX + movl $i386FramesText,%esi + call i386PrintText + + movl i386_EBP,%edi +printnextframe: + test %edi,%edi + je nomoreframes + movl $STACK32ADDR,%eax + cmpl %edi,%eax + jbe nomoreframes + movl 4(%edi),%eax + pushl %edi + call i386PrintHexDword // Display frame + popl %edi + incl i386_ScreenPosX + incl i386_ScreenPosX + movl 0(%edi),%edi + jmp printnextframe +nomoreframes: + ret + +/************************************************************************/ +/* AL = Char to display */ +/************************************************************************/ +i386PrintChar: + .code32 + + pushl i386_ScreenPosY + pushl i386_ScreenPosX + pushl $SCREEN_ATTR + andl $0xff,%eax + pushl %eax + call _MachVideoPutChar + addl $16,%esp + + ret + +/************************************************************************/ +/* ESI = Address of text to display */ +/************************************************************************/ +i386PrintText: + .code32 + +i386PrintTextLoop: + lodsb + + // Check for end of string char + cmp $0,%al + je i386PrintTextDone + + // Check for newline char + cmp $0x0a,%al + jne i386PrintTextLoop2 + incl i386_ScreenPosY + movl $0,i386_ScreenPosX + jmp i386PrintTextLoop + +i386PrintTextLoop2: + call i386PrintChar + incl i386_ScreenPosX + + jmp i386PrintTextLoop + +i386PrintTextDone: + + ret + +/************************************************************************/ +/* Prints the value in EAX on the screen in hex */ +/************************************************************************/ +i386PrintHexDword: + .code32 + + call i386PrintHex1 + +i386PrintHex1: + call i386PrintHex2 +i386PrintHex2: + call i386PrintHex3 +i386PrintHex3: + movb $4,%cl + rol %cl,%eax + push %eax + andb $0x0f,%al + movl $i386PrintHexTable,%ebx + xlat /*$i386PrintHexTable*/ + call i386PrintChar + incl i386_ScreenPosX + pop %eax + + ret + +i386PrintHexTable: + .ascii "0123456789ABCDEF" + +/************************************************************************/ +/* Prints the value in AX on the screen in hex */ +/************************************************************************/ +i386PrintHexWord: + .code32 + + call i386PrintHexWord1 +i386PrintHexWord1: + call i386PrintHexWord2 +i386PrintHexWord2: + movb $4,%cl + rol %cl,%ax + push %eax + andb $0x0f,%al + movl $i386PrintHexTable,%ebx + xlat /*$i386PrintHexTable*/ + call i386PrintChar + incl i386_ScreenPosX + pop %eax + + ret + +/************************************************************************/ +/* Prints the value in AL on the screen in hex */ +/************************************************************************/ +i386PrintHexByte: + .code32 + + call i386PrintHexByte1 +i386PrintHexByte1: + movb $4,%cl + rol %cl,%al + push %eax + andb $0x0f,%al + movl $i386PrintHexTable,%ebx + xlat /*$i386PrintHexTable*/ + call i386PrintChar + incl i386_ScreenPosX + pop %eax + + ret + +/************************************************************************/ +EXTERN(i386DivideByZero) + .code32 + + movl $i386DivideByZeroText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386DebugException) + .code32 + + movl $i386DebugExceptionText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386NMIException) + .code32 + + movl $i386NMIExceptionText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386Breakpoint) + .code32 + + movl $i386BreakpointText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386Overflow) + .code32 + + movl $i386OverflowText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386BoundException) + .code32 + + movl $i386BoundExceptionText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386InvalidOpcode) + .code32 + + movl $i386InvalidOpcodeText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386FPUNotAvailable) + .code32 + + movl $i386FPUNotAvailableText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386DoubleFault) + .code32 + + popl %eax + movl %eax,i386_ERROR_CODE + + movl $i386DoubleFaultText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386CoprocessorSegment) + .code32 + + movl $i386CoprocessorSegmentText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386InvalidTSS) + .code32 + + popl %eax + movl %eax,i386_ERROR_CODE + + movl $i386InvalidTSSText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386SegmentNotPresent) + .code32 + + popl %eax + movl %eax,i386_ERROR_CODE + + movl $i386SegmentNotPresentText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386StackException) + .code32 + + popl %eax + movl %eax,i386_ERROR_CODE + + movl $i386StackExceptionText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386GeneralProtectionFault) + .code32 + + popl %eax + movl %eax,i386_ERROR_CODE + + movl $i386GeneralProtectionFaultText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386PageFault) + .code32 + + popl %eax + movl %eax,i386_ERROR_CODE + + movl $i386PageFaultText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386CoprocessorError) + .code32 + + movl $i386CoprocessorErrorText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386AlignmentCheck) + .code32 + + movl $i386AlignmentCheckText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************/ +EXTERN(i386MachineCheck) + .code32 + + movl $i386MachineCheckText,i386ExceptionDescriptionText + jmp i386CommonExceptionHandler + +/************************************************************************ + * DEBUGGING SUPPORT FUNCTIONS + ************************************************************************/ +EXTERN(_INSTRUCTION_BREAKPOINT1) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr0 + movl %dr7,%eax + andl $0xfff0ffff,%eax + orl $0x00000303,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_READWRITE_BREAKPOINT1) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr0 + movl %dr7,%eax + andl $0xfff0ffff,%eax + orl $0x00030303,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_WRITE_BREAKPOINT1) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr0 + movl %dr7,%eax + andl $0xfff0ffff,%eax + orl $0x00010303,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_INSTRUCTION_BREAKPOINT2) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr1 + movl %dr7,%eax + andl $0xff0fffff,%eax + orl $0x0000030c,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_READWRITE_BREAKPOINT2) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr1 + movl %dr7,%eax + andl $0xff0fffff,%eax + orl $0x0030030c,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_WRITE_BREAKPOINT2) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr1 + movl %dr7,%eax + andl $0xff0fffff,%eax + orl $0x0010030c,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_INSTRUCTION_BREAKPOINT3) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr2 + movl %dr7,%eax + andl $0xf0ffffff,%eax + orl $0x00000330,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_READWRITE_BREAKPOINT3) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr2 + movl %dr7,%eax + andl $0xf0ffffff,%eax + orl $0x03000330,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_WRITE_BREAKPOINT3) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr2 + movl %dr7,%eax + andl $0xf0ffffff,%eax + orl $0x01000330,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_INSTRUCTION_BREAKPOINT4) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr3 + movl %dr7,%eax + andl $0x0fffffff,%eax + orl $0x000003c0,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_READWRITE_BREAKPOINT4) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr3 + movl %dr7,%eax + andl $0x0fffffff,%eax + orl $0x300003c0,%eax + movl %eax,%dr7 + + popl %eax + + ret + +EXTERN(_MEMORY_WRITE_BREAKPOINT4) + .code32 + + pushl %eax + + movl 8(%esp),%eax + + movl %eax,%dr3 + movl %dr7,%eax + andl $0x0fffffff,%eax + orl $0x100003c0,%eax + movl %eax,%dr7 + + popl %eax + + ret Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386trap.S ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mb.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mb.S (added) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mb.S [iso-8859-1] Wed Jul 23 21:18:44 2008 @@ -1,0 +1,79 @@ +/* + * FreeLoader + * Copyright (C) 1998-2002 Brian Palmer <brianp(a)sginet.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + .text + .code16 + +#define ASM +#include <arch.h> +#include <multiboot.h> + + /* + * Here we assume the kernel is loaded at 1mb + * This boots the kernel + */ + .code32 + .globl _PageDirectoryStart + + .globl _startup_pagedirectory + .globl _lowmem_pagetable + .globl _kernel_pagetable + .globl _hyperspace_pagetable + .globl _apic_pagetable + .globl _kpcr_pagetable + .globl _kuser_pagetable + + .globl _PageDirectoryEnd + + // + // Boot information structure + // + +EXTERN(_reactos_memory_map_descriptor_size) + .long 0 + +EXTERN(_reactos_memory_map) + .rept (32 * /*sizeof(memory_map_t)*/24) + .byte 0 + .endr + +.bss +_PageDirectoryStart: +_startup_pagedirectory: + .fill 4096, 1, 0 + +_lowmem_pagetable: + .fill 4096, 1, 0 + +_kernel_pagetable: + .fill 2*4096, 1, 0 + +_hyperspace_pagetable: + .fill 4096, 1, 0 + +_apic_pagetable: + .fill 4096, 1, 0 + +_kpcr_pagetable: + .fill 4096, 1, 0 + +_kuser_pagetable: + .fill 4096, 1, 0 + +_PageDirectoryEnd: Propchange: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mb.S ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 5 months
1
0
0
0
[tkreuzer] 34725: freeldr: - add amd64 to rbuild files - add include/amd64 and arch/amd64 and copy some files from i386, maybe we can later share some of them between those architectures - convert fathelp.asm to fathelp.S so we can link it. Content stays the same as for i386
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 20:48:44 2008 New Revision: 34725 URL:
http://svn.reactos.org/svn/reactos?rev=34725&view=rev
Log: freeldr: - add amd64 to rbuild files - add include/amd64 and arch/amd64 and copy some files from i386, maybe we can later share some of them between those architectures - convert fathelp.asm to fathelp.S so we can link it. Content stays the same as for i386 Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/fathelp.S (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hardware.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hwacpi.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hwapm.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hwpci.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386disk.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386rtl.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386vid.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mach.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pccons.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcdisk.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcmem.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcrtc.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcvideo.c (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h (with props) branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h (with props) Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_base64k.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_startup.rbuild branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h [This mail would be too long, it was shortened to contain the URLs only.] Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/fathelp.S URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hardware.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hwacpi.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hwapm.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/hwpci.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386disk.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386rtl.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/i386vid.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/mach.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pccons.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcdisk.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcmem.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcrtc.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/pcvideo.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_base64k.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/freeldr_startup.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Added: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/machpc.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
16 years, 5 months
1
0
0
0
[tkreuzer] 34724: freeldr: - use strtoull for reading a pointer - use %p in a debugprint instead of cast to int
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 20:34:28 2008 New Revision: 34724 URL:
http://svn.reactos.org/svn/reactos?rev=34724&view=rev
Log: freeldr: - use strtoull for reading a pointer - use %p in a debugprint instead of cast to int Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/cmdline.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/registry.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/cmdline.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/cmdline.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/cmdline.c [iso-8859-1] Wed Jul 23 20:34:28 2008 @@ -61,7 +61,7 @@ // Get ramdisk base address // Setting = strstr(CmdLine, "rdbase="); - if (Setting) gRamDiskBase = (PVOID)strtoul(Setting + + if (Setting) gRamDiskBase = (PVOID)(ULONG_PTR)strtoull(Setting + sizeof("rdbase=") - sizeof(ANSI_NULL), NULL, Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/registry.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] Wed Jul 23 20:34:28 2008 @@ -460,8 +460,8 @@ PLIST_ENTRY Ptr; PVALUE Value = NULL; - DbgPrint((DPRINT_REGISTRY, "Key 0x%x, ValueName '%S', Type %d, Data 0x%x, DataSize %d\n", - (int)Key, ValueName, (int)Type, (int)Data, (int)DataSize)); + DbgPrint((DPRINT_REGISTRY, "Key 0x%p, ValueName '%S', Type %ld, Data 0x%p, DataSize %ld\n", + Key, ValueName, Type, Data, DataSize)); if ((ValueName == NULL) || (*ValueName == 0)) {
16 years, 5 months
1
0
0
0
[tkreuzer] 34723: freeldr: - fix several ULONG to pointer casts
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 20:25:43 2008 New Revision: 34723 URL:
http://svn.reactos.org/svn/reactos?rev=34723&view=rev
Log: freeldr: - fix several ULONG to pointer casts Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/comm/rs232.c [iso-8859-1] Wed Jul 23 20:25:43 2008 @@ -137,9 +137,9 @@ if (ComPort == 0) { - if (Rs232DoesComPortExist ((PUCHAR)BaseArray[2])) - { - Rs232PortBase = (PUCHAR)BaseArray[2]; + if (Rs232DoesComPortExist ((PUCHAR)(ULONG_PTR)BaseArray[2])) + { + Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[2]; Rs232ComPort = 2; /*#ifndef NDEBUG sprintf (buffer, @@ -149,9 +149,9 @@ HalDisplayString (buffer); #endif*/ /* NDEBUG */ } - else if (Rs232DoesComPortExist ((PUCHAR)BaseArray[1])) - { - Rs232PortBase = (PUCHAR)BaseArray[1]; + else if (Rs232DoesComPortExist ((PUCHAR)(ULONG_PTR)BaseArray[1])) + { + Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[1]; Rs232ComPort = 1; /*#ifndef NDEBUG sprintf (buffer, @@ -171,9 +171,9 @@ } else { - if (Rs232DoesComPortExist ((PUCHAR)BaseArray[ComPort])) - { - Rs232PortBase = (PUCHAR)BaseArray[ComPort]; + if (Rs232DoesComPortExist ((PUCHAR)(ULONG_PTR)BaseArray[ComPort])) + { + Rs232PortBase = (PUCHAR)(ULONG_PTR)BaseArray[ComPort]; Rs232ComPort = ComPort; /*#ifndef NDEBUG sprintf (buffer, @@ -280,7 +280,7 @@ BOOLEAN Rs232PortInUse(ULONG Base) { #ifdef DBG - return PortInitialized && Rs232PortBase == (PUCHAR)Base ? TRUE : FALSE; + return PortInitialized && Rs232PortBase == (PUCHAR)(ULONG_PTR)Base ? TRUE : FALSE; #else return FALSE; #endif Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/disk/ramdisk.c [iso-8859-1] Wed Jul 23 20:25:43 2008 @@ -66,7 +66,7 @@ // // Get actual pointers and lengths // - StartAddress = (PVOID)((ULONG)SectorNumber * 512); + StartAddress = (PVOID)((ULONG_PTR)SectorNumber * 512); Length = SectorCount * 512; // Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] Wed Jul 23 20:25:43 2008 @@ -951,7 +951,7 @@ } // Copy the data to their buffer - RtlCopyMemory(InodeBuffer, (PVOID)(FILESYSBUFFER + (InodeOffsetInBlock * EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE)); + RtlCopyMemory(InodeBuffer, (PVOID)(ULONG_PTR)(FILESYSBUFFER + (InodeOffsetInBlock * EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE)); DbgPrint((DPRINT_FILESYSTEM, "Dumping inode information:\n")); DbgPrint((DPRINT_FILESYSTEM, "i_mode = 0x%x\n", InodeBuffer->i_mode)); Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/meminit.c [iso-8859-1] Wed Jul 23 20:25:43 2008 @@ -169,7 +169,7 @@ ULONG MmGetPageNumberFromAddress(PVOID Address) { - return ((ULONG)Address) / MM_PAGE_SIZE; + return ((ULONG_PTR)Address) / MM_PAGE_SIZE; } PVOID MmGetEndAddressOfAnyMemory(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount) @@ -195,7 +195,7 @@ DbgPrint((DPRINT_MEMORY, "MmGetEndAddressOfAnyMemory() returning 0x%x\n", (ULONG)EndAddressOfMemory)); - return (PVOID)(ULONG)EndAddressOfMemory; + return (PVOID)(ULONG_PTR)EndAddressOfMemory; } ULONG MmGetAddressablePageCountIncludingHoles(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MapCount) @@ -203,7 +203,7 @@ ULONG PageCount; ULONGLONG EndAddress; - EndAddress = (ULONGLONG)(ULONG)MmGetEndAddressOfAnyMemory(BiosMemoryMap, MapCount); + EndAddress = (ULONGLONG)(ULONG_PTR)MmGetEndAddressOfAnyMemory(BiosMemoryMap, MapCount); // Since MmGetEndAddressOfAnyMemory() won't // return addresses higher than 0xFFFFFFFF @@ -252,7 +252,7 @@ if (TempBiosMemoryMap[Index].Length >= PageLookupTableSize) { - PageLookupTableMemAddress = (PVOID)(ULONG) + PageLookupTableMemAddress = (PVOID)(ULONG_PTR) (TempBiosMemoryMap[Index].BaseAddress + (TempBiosMemoryMap[Index].Length - PageLookupTableSize)); break; } @@ -304,8 +304,8 @@ for (Index=0; Index<MapCount; Index++) { - MemoryMapStartPage = MmGetPageNumberFromAddress((PVOID)(ULONG)BiosMemoryMap[Index].BaseAddress); - MemoryMapEndPage = MmGetPageNumberFromAddress((PVOID)(ULONG)(BiosMemoryMap[Index].BaseAddress + BiosMemoryMap[Index].Length - 1)); + MemoryMapStartPage = MmGetPageNumberFromAddress((PVOID)(ULONG_PTR)BiosMemoryMap[Index].BaseAddress); + MemoryMapEndPage = MmGetPageNumberFromAddress((PVOID)(ULONG_PTR)(BiosMemoryMap[Index].BaseAddress + BiosMemoryMap[Index].Length - 1)); MemoryMapPageCount = (MemoryMapEndPage - MemoryMapStartPage) + 1; switch (BiosMemoryMap[Index].Type) Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Wed Jul 23 20:25:43 2008 @@ -67,7 +67,7 @@ MmAllocatePagesInLookupTable(PageLookupTableAddress, FirstFreePageFromEnd, PagesNeeded, MemoryType); FreePagesInLookupTable -= PagesNeeded; - MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE); + MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE); #ifdef DBG DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd)); @@ -167,7 +167,7 @@ MmAllocatePagesInLookupTable(PageLookupTableAddress, StartPageNumber, PagesNeeded, MemoryType); FreePagesInLookupTable -= PagesNeeded; - MemPointer = (PVOID)(StartPageNumber * MM_PAGE_SIZE); + MemPointer = (PVOID)((ULONG_PTR)StartPageNumber * MM_PAGE_SIZE); #ifdef DBG DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, StartPageNumber)); @@ -201,7 +201,7 @@ PagesNeeded = ROUND_UP(MemorySize, MM_PAGE_SIZE) / MM_PAGE_SIZE; // Get the page number for their desired address - DesiredAddressPageNumber = (ULONG)DesiredAddress / MM_PAGE_SIZE; + DesiredAddressPageNumber = (ULONG_PTR)DesiredAddress / MM_PAGE_SIZE; // If we don't have enough available mem // then return NULL @@ -224,7 +224,7 @@ MmAllocatePagesInLookupTable(PageLookupTableAddress, FirstFreePageFromEnd, PagesNeeded, MemoryType); FreePagesInLookupTable -= PagesNeeded; - MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE); + MemPointer = (PVOID)((ULONG_PTR)FirstFreePageFromEnd * MM_PAGE_SIZE); #ifdef DBG DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d.\n", MemorySize, PagesNeeded, FirstFreePageFromEnd));
16 years, 5 months
1
0
0
0
[tkreuzer] 34722: freeldr: - make SectionId a ULONG_PTR - same for some Loaderblock members
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 20:22:30 2008 New Revision: 34722 URL:
http://svn.reactos.org/svn/reactos?rev=34722&view=rev
Log: freeldr: - make SectionId a ULONG_PTR - same for some Loaderblock members Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/inifile.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/inifile/inifile.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/oslist.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/setupldr.c branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/ui/ui.c Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -23,7 +23,7 @@ { CHAR SettingName[80]; CHAR SettingValue[80]; - ULONG SectionId; + ULONG_PTR SectionId; ULONG OperatingSystemCount; PCSTR *OperatingSystemSectionNames; PCSTR *OperatingSystemDisplayNames; @@ -169,7 +169,7 @@ { CHAR DefaultOSText[80]; PCSTR DefaultOSName; - ULONG SectionId; + ULONG_PTR SectionId; ULONG DefaultOS = 0; ULONG Idx; @@ -206,7 +206,7 @@ { CHAR TimeOutText[20]; LONG TimeOut; - ULONG SectionId; + ULONG_PTR SectionId; TimeOut = CmdLineGetTimeOut(); if (0 <= TimeOut) Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/inifile.h URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/inifile.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/inifile.h [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -72,14 +72,14 @@ BOOLEAN IniFileInitialize(VOID); -BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId); -ULONG IniGetNumSectionItems(ULONG SectionId); -ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex); -ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex); -BOOLEAN IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize); -BOOLEAN IniReadSettingByName(ULONG SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize); -BOOLEAN IniAddSection(PCSTR SectionName, ULONG* SectionId); -BOOLEAN IniAddSettingValueToSection(ULONG SectionId, PCSTR SettingName, PCSTR SettingValue); +BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR* SectionId); +ULONG IniGetNumSectionItems(ULONG_PTR SectionId); +ULONG IniGetSectionSettingNameSize(ULONG_PTR SectionId, ULONG SettingIndex); +ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex); +BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize); +BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize); +BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR* SectionId); +BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue); #endif // defined __PARSEINI_H Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/inifile/inifile.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/inifile/inifile.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/inifile/inifile.c [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -20,7 +20,7 @@ #include <freeldr.h> #include <debug.h> -BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId) +BOOLEAN IniOpenSection(PCSTR SectionName, ULONG_PTR* SectionId) { PINI_SECTION Section; @@ -35,7 +35,7 @@ { // We found it if (SectionId) - *SectionId = (ULONG)Section; + *SectionId = (ULONG_PTR)Section; DbgPrint((DPRINT_INIFILE, "IniOpenSection() Found it! SectionId = 0x%x\n", SectionId)); return TRUE; } @@ -49,7 +49,7 @@ return FALSE; } -ULONG IniGetNumSectionItems(ULONG SectionId) +ULONG IniGetNumSectionItems(ULONG_PTR SectionId) { PINI_SECTION Section = (PINI_SECTION)SectionId; @@ -59,7 +59,7 @@ return Section->SectionItemCount; } -PINI_SECTION_ITEM IniGetSettingByNumber(ULONG SectionId, ULONG SettingNumber) +PINI_SECTION_ITEM IniGetSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber) { PINI_SECTION Section = (PINI_SECTION)SectionId; PINI_SECTION_ITEM SectionItem; @@ -83,7 +83,7 @@ return NULL; } -ULONG IniGetSectionSettingNameSize(ULONG SectionId, ULONG SettingIndex) +ULONG IniGetSectionSettingNameSize(ULONG_PTR SectionId, ULONG SettingIndex) { PINI_SECTION_ITEM SectionItem; @@ -96,7 +96,7 @@ return (strlen(SectionItem->ItemName) + 1); } -ULONG IniGetSectionSettingValueSize(ULONG SectionId, ULONG SettingIndex) +ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex) { PINI_SECTION_ITEM SectionItem; @@ -109,7 +109,7 @@ return (strlen(SectionItem->ItemValue) + 1); } -BOOLEAN IniReadSettingByNumber(ULONG SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize) +BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize) { PINI_SECTION_ITEM SectionItem; DbgPrint((DPRINT_INIFILE, ".001 NameSize = %d ValueSize = %d\n", NameSize, ValueSize)); @@ -142,7 +142,7 @@ return TRUE; } -BOOLEAN IniReadSettingByName(ULONG SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize) +BOOLEAN IniReadSettingByName(ULONG_PTR SectionId, PCSTR SettingName, PCHAR Buffer, ULONG BufferSize) { PINI_SECTION Section = (PINI_SECTION)SectionId; PINI_SECTION_ITEM SectionItem; @@ -174,7 +174,7 @@ return FALSE; } -BOOLEAN IniAddSection(PCSTR SectionName, ULONG* SectionId) +BOOLEAN IniAddSection(PCSTR SectionName, ULONG_PTR* SectionId) { PINI_SECTION Section; @@ -202,12 +202,12 @@ IniFileSectionCount++; InsertHeadList(&IniFileSectionListHead, &Section->ListEntry); - *SectionId = (ULONG)Section; + *SectionId = (ULONG_PTR)Section; return TRUE; } -BOOLEAN IniAddSettingValueToSection(ULONG SectionId, PCSTR SettingName, PCSTR SettingValue) +BOOLEAN IniAddSettingValueToSection(ULONG_PTR SectionId, PCSTR SettingName, PCSTR SettingValue) { PINI_SECTION Section = (PINI_SECTION)SectionId; PINI_SECTION_ITEM SectionItem; Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/oslist.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/oslist.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/oslist.c [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -26,8 +26,8 @@ CHAR SettingName[260]; CHAR SettingValue[260]; ULONG OperatingSystemCount; - ULONG SectionId; - ULONG OperatingSystemSectionId; + ULONG_PTR SectionId; + ULONG_PTR OperatingSystemSectionId; ULONG SectionSettingCount; PCHAR *OperatingSystemSectionNames; PCHAR *OperatingSystemDisplayNames; Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/reactos.c [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -571,7 +571,7 @@ CHAR szKernelName[255]; CHAR szFileName[255]; CHAR MsgBuffer[256]; - ULONG SectionId; + ULONG_PTR SectionId; PIMAGE_NT_HEADERS NtHeader; PVOID LoadBase; ULONG_PTR Base; @@ -596,19 +596,19 @@ * Setup multiboot information structure */ LoaderBlock.CommandLine = reactos_kernel_cmdline; - LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart; - LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd; + LoaderBlock.PageDirectoryStart = (ULONG_PTR)&PageDirectoryStart; + LoaderBlock.PageDirectoryEnd = (ULONG_PTR)&PageDirectoryEnd; LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; LoaderBlock.DrivesAddr = reactos_arc_disk_info; - LoaderBlock.RdAddr = (ULONG)gRamDiskBase; + LoaderBlock.RdAddr = (ULONG_PTR)gRamDiskBase; LoaderBlock.RdLength = gRamDiskSize; - LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); + LoaderBlock.MmapLength = (SIZE_T)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { ULONG i; LoaderBlock.Flags |= MB_FLAGS_MEM_INFO | MB_FLAGS_MMAP_INFO; - LoaderBlock.MmapAddr = (unsigned long)&reactos_memory_map; + LoaderBlock.MmapAddr = (ULONG_PTR)&reactos_memory_map; reactos_memory_map_descriptor_size = sizeof(memory_map_t); // GetBiosMemoryMap uses a fixed value of 24 for (i=0; i<(LoaderBlock.MmapLength/sizeof(memory_map_t)); i++) { @@ -698,7 +698,7 @@ /* * Detect hardware */ - LoaderBlock.ArchExtra = (ULONG)MachHwDetect(); + LoaderBlock.ArchExtra = (ULONG_PTR)MachHwDetect(); UiDrawProgressBarCenter(5, 100, szLoadingMsg); LoaderBlock.DrivesCount = reactos_disk_count; Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/setupldr.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -183,20 +183,20 @@ /* Setup multiboot information structure */ LoaderBlock.CommandLine = reactos_kernel_cmdline; - LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart; - LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd; + LoaderBlock.PageDirectoryStart = (ULONG_PTR)&PageDirectoryStart; + LoaderBlock.PageDirectoryEnd = (ULONG_PTR)&PageDirectoryEnd; LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { -#ifdef _M_IX86 +#if defined (_M_IX86) || defined (_M_AMD64) ULONG i; #endif LoaderBlock.Flags |= MB_FLAGS_MEM_INFO | MB_FLAGS_MMAP_INFO; - LoaderBlock.MmapAddr = (unsigned long)&reactos_memory_map; + LoaderBlock.MmapAddr = (ULONG_PTR)&reactos_memory_map; reactos_memory_map_descriptor_size = sizeof(memory_map_t); // GetBiosMemoryMap uses a fixed value of 24 -#ifdef _M_IX86 +#if defined (_M_IX86) || defined (_M_AMD64) for (i=0; i<(LoaderBlock.MmapLength/sizeof(memory_map_t)); i++) { if (BiosMemoryUsable == reactos_memory_map[i].type && @@ -231,7 +231,7 @@ /* Detect hardware */ UiDrawStatusText("Detecting hardware..."); - LoaderBlock.ArchExtra = (ULONG)MachHwDetect(); + LoaderBlock.ArchExtra = (ULONG_PTR)MachHwDetect(); UiDrawStatusText(""); /* set boot device */ Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/ui/ui.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/ui/ui.c [iso-8859-1] Wed Jul 23 20:22:30 2008 @@ -80,7 +80,7 @@ { VIDEODISPLAYMODE UiDisplayMode; // Tells us if we are in text or graphics mode BOOLEAN UiMinimal = FALSE; // Tells us if we should use a minimal console-like UI - ULONG SectionId; + ULONG_PTR SectionId; CHAR DisplayModeText[260]; CHAR SettingText[260]; ULONG Depth; @@ -408,7 +408,7 @@ CHAR SettingValue[80]; PCHAR MessageBoxText; ULONG MessageBoxTextSize; - ULONG SectionId; + ULONG_PTR SectionId; if (!IniOpenSection(SectionName, &SectionId)) {
16 years, 5 months
1
0
0
0
[tkreuzer] 34721: comment out 2 unneeded libs, that don't compile
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 20:07:48 2008 New Revision: 34721 URL:
http://svn.reactos.org/svn/reactos?rev=34721&view=rev
Log: comment out 2 unneeded libs, that don't compile Modified: branches/ros-amd64-bringup/reactos/lib/drivers/directory.rbuild Modified: branches/ros-amd64-bringup/reactos/lib/drivers/directory.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/d…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/drivers/directory.rbuild [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/drivers/directory.rbuild [iso-8859-1] Wed Jul 23 20:07:48 2008 @@ -4,12 +4,14 @@ <directory name="csq"> <xi:include href="csq/csq.rbuild" /> </directory> +<!-- <directory name="ip"> <xi:include href="ip/ip.rbuild" /> </directory> <directory name="oskittcp"> <xi:include href="oskittcp/oskittcp.rbuild" /> </directory> +--> <directory name="chew"> <xi:include href="chew/chew.rbuild" /> </directory>
16 years, 5 months
1
0
0
0
[tkreuzer] 34720: - rename _toul to _toulptr and make it return an ULONG_PTR
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 20:06:22 2008 New Revision: 34720 URL:
http://svn.reactos.org/svn/reactos?rev=34720&view=rev
Log: - rename _toul to _toulptr and make it return an ULONG_PTR Modified: branches/ros-amd64-bringup/reactos/lib/sdk/scrnsave/scrnsave.c Modified: branches/ros-amd64-bringup/reactos/lib/sdk/scrnsave/scrnsave.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/s…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/sdk/scrnsave/scrnsave.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/sdk/scrnsave/scrnsave.c [iso-8859-1] Wed Jul 23 20:06:22 2008 @@ -36,10 +36,10 @@ #define ISNUM(c) ((c) >= '0' && c <= '9') -static unsigned long _toul(const TCHAR *s) -{ - unsigned long res; - unsigned long n; +static ULONG_PTR _toulptr(const TCHAR *s) +{ + ULONG_PTR res; + ULONG_PTR n; const TCHAR *p; for (p = s; *p; p++) @@ -223,7 +223,7 @@ fChildPreview = TRUE; while (ISSPACE(*++p)); - hParent = (HWND) _toul(p); + hParent = (HWND) _toulptr(p); if (hParent && IsWindow(hParent)) return LaunchScreenSaver(hParent);
16 years, 5 months
1
0
0
0
[tkreuzer] 34719: last fixes for crt. Those are messing with handles and casting between 32 and 64 bit. I'm not sure if it's correct, probably not... crt and libcntpr now compile warning free on amd64
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Jul 23 19:58:16 2008 New Revision: 34719 URL:
http://svn.reactos.org/svn/reactos?rev=34719&view=rev
Log: last fixes for crt. Those are messing with handles and casting between 32 and 64 bit. I'm not sure if it's correct, probably not... crt and libcntpr now compile warning free on amd64 Modified: branches/ros-amd64-bringup/reactos/lib/sdk/crt/conio/getch.c branches/ros-amd64-bringup/reactos/lib/sdk/crt/stdio/file.c Modified: branches/ros-amd64-bringup/reactos/lib/sdk/crt/conio/getch.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/s…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/sdk/crt/conio/getch.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/sdk/crt/conio/getch.c [iso-8859-1] Wed Jul 23 19:58:16 2008 @@ -31,7 +31,7 @@ * ENABLE_ECHO_INPUT and ENABLE_LINE_INPUT if they're currently * switched on. */ - ConsoleHandle = (HANDLE) _get_osfhandle(stdin->_file); + ConsoleHandle = (HANDLE)(ULONG_PTR) _get_osfhandle(stdin->_file); RestoreMode = GetConsoleMode(ConsoleHandle, &ConsoleMode) && (0 != (ConsoleMode & (ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT))); @@ -39,7 +39,7 @@ SetConsoleMode(ConsoleHandle, ConsoleMode & (~ (ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT))); } - ReadConsoleA((HANDLE)_get_osfhandle(stdin->_file), + ReadConsoleA((HANDLE)(ULONG_PTR)_get_osfhandle(stdin->_file), &c, 1, &NumberOfCharsRead, Modified: branches/ros-amd64-bringup/reactos/lib/sdk/crt/stdio/file.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/s…
============================================================================== --- branches/ros-amd64-bringup/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] Wed Jul 23 19:58:16 2008 @@ -1291,7 +1291,7 @@ HANDLE hand = fdtoh(fd); TRACE(":fd (%d) handle (%p)\n",fd,hand); - return (long)hand; + return (long)(LONG_PTR)hand; } /********************************************************************* @@ -1654,7 +1654,7 @@ if (!(oflags & (_O_BINARY | _O_TEXT))) oflags |= _O_BINARY; - fd = alloc_fd((HANDLE)handle, split_oflags(oflags)); + fd = alloc_fd((HANDLE)(LONG_PTR)handle, split_oflags(oflags)); TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags); return fd; }
16 years, 5 months
1
0
0
0
← Newer
1
...
24
25
26
27
28
29
30
...
77
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Results per page:
10
25
50
100
200