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
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
September 2011
----- 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
20 participants
399 discussions
Start a n
N
ew thread
[akhaldi] 53530: * Fix rbuild build.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 2 15:13:29 2011 New Revision: 53530 URL:
http://svn.reactos.org/svn/reactos?rev=53530&view=rev
Log: * Fix rbuild build. Modified: trunk/reactos/hal/halx86/halmps.rbuild Modified: trunk/reactos/hal/halx86/halmps.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/halmps.rbuild?r…
============================================================================== --- trunk/reactos/hal/halx86/halmps.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/halmps.rbuild [iso-8859-1] Fri Sep 2 15:13:29 2011 @@ -16,11 +16,9 @@ <library>libcntpr</library> <directory name="mp"> <if property="ARCH" value="i386"> - <directory name="i386"> - <file>mps.S</file> - <file>mpsboot.asm</file> - <file>mpsirql.c</file> - </directory> + <file>mps.S</file> + <file>mpsboot.asm</file> + <file>mpsirql.c</file> </if> </directory> </module>
13 years, 3 months
1
0
0
0
[tkreuzer] 53529: [HAL] - Flatten the directory structure - use static libraries in cmake builds as well to save build time
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Sep 2 14:45:19 2011 New Revision: 53529 URL:
http://svn.reactos.org/svn/reactos?rev=53529&view=rev
Log: [HAL] - Flatten the directory structure - use static libraries in cmake builds as well to save build time Added: trunk/reactos/hal/halx86/acpi/ - copied from r53510, trunk/reactos/hal/halx86/generic/acpi/ trunk/reactos/hal/halx86/generic/portio.c - copied unchanged from r53510, trunk/reactos/hal/halx86/generic/i386/portio.c trunk/reactos/hal/halx86/generic/systimer.S - copied unchanged from r53510, trunk/reactos/hal/halx86/generic/i386/systimer.S trunk/reactos/hal/halx86/generic/trap.S - copied unchanged from r53510, trunk/reactos/hal/halx86/generic/i386/trap.S trunk/reactos/hal/halx86/legacy/ - copied from r53510, trunk/reactos/hal/halx86/generic/legacy/ trunk/reactos/hal/halx86/mp/mps.S - copied unchanged from r53510, trunk/reactos/hal/halx86/mp/i386/mps.S trunk/reactos/hal/halx86/mp/mpsboot.asm - copied unchanged from r53510, trunk/reactos/hal/halx86/mp/i386/mpsboot.asm trunk/reactos/hal/halx86/mp/mpsirql.c - copied unchanged from r53510, trunk/reactos/hal/halx86/mp/i386/mpsirql.c Removed: trunk/reactos/hal/halx86/generic/acpi/ trunk/reactos/hal/halx86/generic/i386/ trunk/reactos/hal/halx86/generic/legacy/ trunk/reactos/hal/halx86/mp/i386/ Modified: trunk/reactos/hal/halx86/CMakeLists.txt trunk/reactos/hal/halx86/amd64/halinit.c trunk/reactos/hal/halx86/generic/halinit.c trunk/reactos/hal/halx86/hal_generic.rbuild trunk/reactos/hal/halx86/hal_generic_acpi.rbuild trunk/reactos/hal/halx86/hal_generic_pcat.rbuild trunk/reactos/hal/halx86/hal_mini.rbuild trunk/reactos/hal/halx86/legacy/halpnpdd.c trunk/reactos/hal/halx86/up/halinit_up.c Modified: trunk/reactos/hal/halx86/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/CMakeLists.txt?…
============================================================================== --- trunk/reactos/hal/halx86/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/CMakeLists.txt [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -23,48 +23,54 @@ if(ARCH MATCHES i386) list(APPEND HAL_GENERIC_SOURCE generic/bios.c - generic/halinit.c generic/timer.c - generic/i386/portio.c - generic/i386/systimer.S - generic/i386/trap.S) + generic/portio.c + generic/systimer.S + generic/trap.S) endif() -list(APPEND HAL_GENERIC_PCAT_SOURCE - generic/legacy/bus/bushndlr.c - generic/legacy/bus/cmosbus.c - generic/legacy/bus/isabus.c - generic/legacy/bus/pcibus.c - generic/legacy/bus/pcidata.c - generic/legacy/bus/sysbus.c - generic/legacy/bussupp.c - generic/legacy/halpnpdd.c - generic/legacy/halpcat.c) +add_library(lib_hal_generic ${HAL_GENERIC_SOURCE}) +add_pch(lib_hal_generic include/hal.h) -list(APPEND HAL_GENERIC_ACPI_SOURCE - generic/acpi/halacpi.c - generic/acpi/halpnpdd.c - generic/acpi/busemul.c - generic/legacy/bus/pcibus.c) +list(APPEND HAL_LEGACY_SOURCE + legacy/bus/bushndlr.c + legacy/bus/cmosbus.c + legacy/bus/isabus.c + legacy/bus/pcibus.c + legacy/bus/pcidata.c + legacy/bus/sysbus.c + legacy/bussupp.c + legacy/halpnpdd.c + legacy/halpcat.c) + +add_library(lib_hal_legacy ${HAL_LEGACY_SOURCE}) +add_pch(lib_hal_legacy include/hal.h) +target_link_libraries(lib_hal_legacy lib_hal_generic) + +list(APPEND HAL_ACPI_SOURCE + acpi/halacpi.c + acpi/halpnpdd.c + acpi/busemul.c + legacy/bus/pcibus.c) + +add_library(lib_hal_acpi ${HAL_ACPI_SOURCE}) +add_pch(lib_hal_acpi include/hal.h) +target_link_libraries(lib_hal_acpi lib_hal_generic) if(ARCH MATCHES i386) - list(APPEND HAL_GENERIC_ACPI_SOURCE - generic/halinit.c) - - list(APPEND HAL_GENERIC_UP_SOURCE - generic/spinlock.c + list(APPEND HAL_UP_SOURCE up/pic.c up/processor.c) list(APPEND MINI_HAL_SOURCE - generic/i386/portio.c - generic/i386/systimer.S - generic/legacy/bus/bushndlr.c - generic/legacy/bus/cmosbus.c - generic/legacy/bus/isabus.c - generic/legacy/bus/pcibus.c - generic/legacy/bus/sysbus.c - generic/legacy/bussupp.c + generic/portio.c + generic/systimer.S + legacy/bus/bushndlr.c + legacy/bus/cmosbus.c + legacy/bus/isabus.c + legacy/bus/pcibus.c + legacy/bus/sysbus.c + legacy/bussupp.c generic/beep.c generic/bios.c generic/cmos.c @@ -84,42 +90,38 @@ spec2def(hal.dll ../hal.spec) - list(APPEND HAL_SOURCE - ${HAL_GENERIC_SOURCE} - ${HAL_GENERIC_PCAT_SOURCE} - ${HAL_GENERIC_UP_SOURCE} + # hal + add_library(hal SHARED + ${HAL_UP_SOURCE} up/halinit_up.c up/halup.rc + generic/spinlock.c + generic/halinit.c ${CMAKE_CURRENT_BINARY_DIR}/hal.def) - - # hal - add_library(hal SHARED ${HAL_SOURCE}) + target_link_libraries(hal lib_hal_generic lib_hal_legacy libcntpr) + add_importlibs(hal ntoskrnl) add_pch(hal include/hal.h) add_dependencies(hal psdk bugcodes) - set_entrypoint(hal HalInitSystem 8) set_subsystem(hal native) set_image_base(hal 0x00010000) - add_importlibs(hal ntoskrnl) - target_link_libraries(hal libcntpr) - add_cd_file(TARGET hal DESTINATION reactos/system32 NO_CAB FOR all) # hal acpi spec2def(halacpi.dll ../hal.spec halacpi) add_library(halacpi SHARED - ${HAL_GENERIC_SOURCE} - ${HAL_GENERIC_ACPI_SOURCE} - ${HAL_GENERIC_UP_SOURCE} + ${HAL_UP_SOURCE} up/halinit_up.c up/halup.rc + generic/spinlock.c + generic/halinit.c ${CMAKE_CURRENT_BINARY_DIR}/halacpi.def) + target_link_libraries(halacpi lib_hal_generic lib_hal_acpi libcntpr) + add_importlibs(halacpi ntoskrnl) add_dependencies(halacpi psdk bugcodes) set_entrypoint(halacpi HalInitSystem@8) set_subsystem(halacpi native) set_image_base(halacpi 0x00010000) - add_importlibs(halacpi ntoskrnl) - target_link_libraries(halacpi libcntpr) set_property(TARGET halacpi PROPERTY COMPILE_DEFINITIONS CONFIG_ACPI) add_cd_file(TARGET halacpi DESTINATION reactos/system32 NO_CAB FOR all) @@ -134,11 +136,10 @@ list(APPEND HAL_SOURCE ${HAL_GENERIC_SOURCE} - ${HAL_GENERIC_PCAT_SOURCE} - ${HAL_GENERIC_UP_SOURCE} - up/halinit_up.c - up/halup.rc + ${HAL_ACPI_SOURCE} + ${HAL_UP_SOURCE} generic/spinlock.c + generic/halinit.c amd64/x86bios.c amd64/halinit.c amd64/stubs.c Modified: trunk/reactos/hal/halx86/amd64/halinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/amd64/halinit.c…
============================================================================== --- trunk/reactos/hal/halx86/amd64/halinit.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/amd64/halinit.c [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: hal/halx86/amd64/halinit.c * PURPOSE: HAL Entrypoint and Initialization - * PROGRAMMERS: + * PROGRAMMERS: */ /* INCLUDES ******************************************************************/ @@ -20,14 +20,30 @@ /* FUNCTIONS *****************************************************************/ -/* - * @implemented - */ -BOOLEAN -NTAPI -HalInitSystem(IN ULONG BootPhase, - IN PLOADER_PARAMETER_BLOCK LoaderBlock) +VOID +HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - UNIMPLEMENTED; - return FALSE; + } + +VOID +HalpInitPhase1(VOID) +{ + +} + +VOID +INIT_FUNCTION +HalpInitializeClock(VOID) +{ +} + +VOID +HalpCalibrateStallExecution() +{ +} + +VOID +HalpInitializePICs(IN BOOLEAN EnableInterrupts) +{ +} Modified: trunk/reactos/hal/halx86/generic/halinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit…
============================================================================== --- trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -53,7 +53,7 @@ PKPRCB Prcb = KeGetCurrentPrcb(); /* Check the boot phase */ - if (!BootPhase) + if (BootPhase == 0) { /* Phase 0... save bus type */ HalpBusType = LoaderBlock->u.I386.MachineType & 0xFF; @@ -159,27 +159,6 @@ /* Initialize bus handlers */ HalpInitBusHandlers(); -#ifndef _MINIHAL_ - /* Enable IRQ 0 */ - HalpEnableInterruptHandler(IDT_DEVICE, - 0, - PRIMARY_VECTOR_BASE, - CLOCK2_LEVEL, - HalpClockInterrupt, - Latched); - - /* Enable IRQ 8 */ - HalpEnableInterruptHandler(IDT_DEVICE, - 0, - PRIMARY_VECTOR_BASE + 8, - PROFILE_LEVEL, - HalpProfileInterrupt, - Latched); - - /* Initialize DMA. NT does this in Phase 0 */ - HalpInitDma(); -#endif - /* Do some HAL-specific initialization */ HalpInitPhase1(); } Modified: trunk/reactos/hal/halx86/hal_generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic.rbu…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal_generic.rbuild [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -21,11 +21,9 @@ <file>usage.c</file> <if property="ARCH" value="i386"> <file>bios.c</file> - <directory name="i386"> - <file>portio.c</file> - <file>systimer.S</file> - <file>trap.S</file> - </directory> + <file>portio.c</file> + <file>systimer.S</file> + <file>trap.S</file> </if> </directory> <directory name="include"> Modified: trunk/reactos/hal/halx86/hal_generic_acpi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic_acp…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic_acpi.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal_generic_acpi.rbuild [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -7,17 +7,17 @@ <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> <define name="CONFIG_ACPI" /> + <directory name="acpi"> + <file>halacpi.c</file> + <file>halpnpdd.c</file> + <file>busemul.c</file> + </directory> + <directory name="legacy"> + <directory name="bus"> + <file>pcibus.c</file> + </directory> + </directory> <directory name="generic"> - <directory name="acpi"> - <file>halacpi.c</file> - <file>halpnpdd.c</file> - <file>busemul.c</file> - </directory> - <directory name="legacy"> - <directory name="bus"> - <file>pcibus.c</file> - </directory> - </directory> <if property="ARCH" value="i386"> <file>halinit.c</file> </if> Modified: trunk/reactos/hal/halx86/hal_generic_pcat.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_generic_pca…
============================================================================== --- trunk/reactos/hal/halx86/hal_generic_pcat.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal_generic_pcat.rbuild [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -6,20 +6,20 @@ <include base="ntoskrnl">include</include> <define name="_NTHALDLL_" /> <define name="_NTHAL_" /> + <directory name="legacy"> + <directory name="bus"> + <file>bushndlr.c</file> + <file>cmosbus.c</file> + <file>isabus.c</file> + <file>pcibus.c</file> + <file>pcidata.c</file> + <file>sysbus.c</file> + </directory> + <file>bussupp.c</file> + <file>halpcat.c</file> + <file>halpnpdd.c</file> + </directory> <directory name="generic"> - <directory name="legacy"> - <directory name="bus"> - <file>bushndlr.c</file> - <file>cmosbus.c</file> - <file>isabus.c</file> - <file>pcibus.c</file> - <file>pcidata.c</file> - <file>sysbus.c</file> - </directory> - <file>bussupp.c</file> - <file>halpcat.c</file> - <file>halpnpdd.c</file> - </directory> <if property="ARCH" value="i386"> <file>halinit.c</file> </if> Modified: trunk/reactos/hal/halx86/hal_mini.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/hal_mini.rbuild…
============================================================================== --- trunk/reactos/hal/halx86/hal_mini.rbuild [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/hal_mini.rbuild [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -9,16 +9,6 @@ <define name="_BLDR_" /> <define name="_MINIHAL_" /> <directory name="generic"> - <directory name="legacy"> - <directory name="bus"> - <file>bushndlr.c</file> - <file>cmosbus.c</file> - <file>isabus.c</file> - <file>pcibus.c</file> - <file>sysbus.c</file> - </directory> - <file>bussupp.c</file> - </directory> <file>beep.c</file> <file>bios.c</file> <file>cmos.c</file> @@ -32,10 +22,18 @@ <file>sysinfo.c</file> <file>timer.c</file> <file>usage.c</file> - <directory name="i386"> - <file>portio.c</file> - <file>systimer.S</file> + <file>portio.c</file> + <file>systimer.S</file> + </directory> + <directory name="legacy"> + <directory name="bus"> + <file>bushndlr.c</file> + <file>cmosbus.c</file> + <file>isabus.c</file> + <file>pcibus.c</file> + <file>sysbus.c</file> </directory> + <file>bussupp.c</file> </directory> <directory name="up"> <file>halinit_up.c</file> Modified: trunk/reactos/hal/halx86/legacy/halpnpdd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/legacy/halpnpdd…
============================================================================== --- trunk/reactos/hal/halx86/legacy/halpnpdd.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/legacy/halpnpdd.c [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -750,7 +750,7 @@ break; case IRP_MN_QUERY_CAPABILITIES: - + /* Call the worker */ DPRINT("Querying the capabilities for the PDO\n"); Status = HalpQueryCapabilities(DeviceObject, @@ -773,7 +773,7 @@ break; case IRP_MN_QUERY_ID: - + /* Call the worker */ DPRINT("Query the ID for the PDO\n"); Status = HalpQueryIdPdo(DeviceObject, @@ -782,7 +782,7 @@ break; default: - + /* We don't handle anything else, so inherit the old state */ DPRINT("Illegal IRP: %lx\n", Minor); Status = Irp->IoStatus.Status; @@ -807,7 +807,7 @@ { DPRINT1("HAL: PnP Driver WMI!\n"); while (TRUE); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } NTSTATUS @@ -816,7 +816,7 @@ IN PIRP Irp) { DPRINT1("HAL: PnP Driver Power!\n"); - return STATUS_SUCCESS; + return STATUS_SUCCESS; } NTSTATUS Modified: trunk/reactos/hal/halx86/up/halinit_up.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/halinit_up.c…
============================================================================== --- trunk/reactos/hal/halx86/up/halinit_up.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/up/halinit_up.c [iso-8859-1] Fri Sep 2 14:45:19 2011 @@ -26,7 +26,26 @@ VOID HalpInitPhase1(VOID) { +#ifndef _MINIHAL_ + /* Enable IRQ 0 */ + HalpEnableInterruptHandler(IDT_DEVICE, + 0, + PRIMARY_VECTOR_BASE, + CLOCK2_LEVEL, + HalpClockInterrupt, + Latched); + /* Enable IRQ 8 */ + HalpEnableInterruptHandler(IDT_DEVICE, + 0, + PRIMARY_VECTOR_BASE + 8, + PROFILE_LEVEL, + HalpProfileInterrupt, + Latched); + + /* Initialize DMA. NT does this in Phase 0 */ + HalpInitDma(); +#endif } /* EOF */
13 years, 3 months
1
0
0
0
[akhaldi] 53528: [WIN32K] * Missed this one.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 2 10:17:30 2011 New Revision: 53528 URL:
http://svn.reactos.org/svn/reactos?rev=53528&view=rev
Log: [WIN32K] * Missed this one. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/accelerator.c [iso-8859-1] Fri Sep 2 10:17:30 2011 @@ -56,8 +56,6 @@ EngSetLastError(ERROR_INVALID_ACCEL_HANDLE); return NULL; } - - ASSERT(Accel->head.cLockObj >= 0); return Accel; }
13 years, 3 months
1
0
0
0
[akhaldi] 53527: [WIN32K] * Remove some useless asserts considering cLockObj is DWORD.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Sep 2 09:23:20 2011 New Revision: 53527 URL:
http://svn.reactos.org/svn/reactos?rev=53527&view=rev
Log: [WIN32K] * Remove some useless asserts considering cLockObj is DWORD. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/menu.c [iso-8859-1] Fri Sep 2 09:23:20 2011 @@ -74,7 +74,6 @@ return NULL; } - ASSERT(Menu->head.cLockObj >= 0); return Menu; } @@ -137,11 +136,8 @@ { PMENU_OBJECT Menu = UserGetMenuObject(hMenu); if (Menu) - { - ASSERT(Menu->head.cLockObj >= 0); - Menu->head.cLockObj++; - } + return Menu; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Fri Sep 2 09:23:20 2011 @@ -93,8 +93,6 @@ return NULL; } - ASSERT(Monitor->head.cLockObj >= 0); - return Monitor; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Fri Sep 2 09:23:20 2011 @@ -61,11 +61,8 @@ Window = UserGetWindowObject(hWnd); if (Window) - { - ASSERT(Window->head.cLockObj >= 0); - Window->head.cLockObj++; - } + return Window; } @@ -86,8 +83,6 @@ EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); return NULL; } - - ASSERT(Window->head.cLockObj >= 0); return Window; }
13 years, 3 months
1
0
0
0
[tkreuzer] 53526: [FREELDR] - Move cleaning the shared user data to after WinLdrSetProcessorContext, as we need the new page tables to be active - Fix indentation/coding style in registry.c - Fix a...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Sep 1 19:01:19 2011 New Revision: 53526 URL:
http://svn.reactos.org/svn/reactos?rev=53526&view=rev
Log: [FREELDR] - Move cleaning the shared user data to after WinLdrSetProcessorContext, as we need the new page tables to be active - Fix indentation/coding style in registry.c - Fix a few 64 bit warnings - delete <arch>/ntsetup.c and rename <arch>/wlmemory.c to <arch>/winldr.c Added: trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c - copied, changed from r53510, trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c trunk/reactos/boot/freeldr/freeldr/arch/arm/winldr.c - copied unchanged from r53454, trunk/reactos/boot/freeldr/freeldr/arch/arm/wlmemory.c trunk/reactos/boot/freeldr/freeldr/arch/i386/winldr.c - copied unchanged from r53510, trunk/reactos/boot/freeldr/freeldr/arch/i386/wlmemory.c Removed: trunk/reactos/boot/freeldr/freeldr/arch/amd64/ntsetup.c trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c trunk/reactos/boot/freeldr/freeldr/arch/arm/wlmemory.c trunk/reactos/boot/freeldr/freeldr/arch/i386/ntsetup.c trunk/reactos/boot/freeldr/freeldr/arch/i386/wlmemory.c Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt trunk/reactos/boot/freeldr/freeldr/cmdline.c trunk/reactos/boot/freeldr/freeldr/debug.c trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild trunk/reactos/boot/freeldr/freeldr/fs/ext2.c trunk/reactos/boot/freeldr/freeldr/fs/fat.c trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h trunk/reactos/boot/freeldr/freeldr/include/mm.h trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c trunk/reactos/boot/freeldr/freeldr/reactos/registry.c trunk/reactos/boot/freeldr/freeldr/windows/winldr.c trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -112,8 +112,7 @@ arch/i386/xboxmem.c arch/i386/xboxrtc.c arch/i386/xboxvideo.c - arch/i386/ntsetup.c - arch/i386/wlmemory.c + arch/i386/winldr.c windows/headless.c disk/scsiport.c) if(NOT MSVC) @@ -141,8 +140,7 @@ arch/i386/pcmem.c arch/i386/pcrtc.c arch/i386/pcvideo.c - arch/amd64/ntsetup.c - arch/amd64/wlmemory.c) + arch/amd64/winldr.c) else() #TBD endif() Removed: trunk/reactos/boot/freeldr/freeldr/arch/amd64/ntsetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/ntsetup.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/ntsetup.c (removed) @@ -1,84 +1,0 @@ -/* - * PROJECT: EFI Windows Loader - * LICENSE: GPL - See COPYING in the top level directory - * FILE: freeldr/windows/i386/ntsetup.c - * PURPOSE: i386-specific setup for Windows boot - * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) - */ - -/* INCLUDES ***************************************************************/ - -#include <freeldr.h> -#include <debug.h> - -// this is needed for new IDT filling -#if 0 -extern ULONG_PTR i386DivideByZero; -extern ULONG_PTR i386DebugException; -extern ULONG_PTR i386NMIException; -extern ULONG_PTR i386Breakpoint; -extern ULONG_PTR i386Overflow; -extern ULONG_PTR i386BoundException; -extern ULONG_PTR i386InvalidOpcode; -extern ULONG_PTR i386FPUNotAvailable; -extern ULONG_PTR i386DoubleFault; -extern ULONG_PTR i386CoprocessorSegment; -extern ULONG_PTR i386InvalidTSS; -extern ULONG_PTR i386SegmentNotPresent; -extern ULONG_PTR i386StackException; -extern ULONG_PTR i386GeneralProtectionFault; -extern ULONG_PTR i386PageFault; // exc 14 -extern ULONG_PTR i386CoprocessorError; // exc 16 -extern ULONG_PTR i386AlignmentCheck; // exc 17 -#endif - -/* FUNCTIONS **************************************************************/ - -// Last step before going virtual -void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock, - PVOID *GdtIdt, - ULONG *PcrBasePage, - ULONG *TssBasePage) -{ - ULONG TssSize; - ULONG TssPages; - ULONG_PTR Pcr = 0; - ULONG_PTR Tss = 0; - ULONG BlockSize, NumPages; - - LoaderBlock->u.I386.CommonDataArea = (PVOID)DbgPrint; // HACK - LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA; - - /* Allocate 2 pages for PCR */ - Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage); - *PcrBasePage = Pcr >> MM_PAGE_SHIFT; - RtlZeroMemory((PVOID)Pcr, 2 * MM_PAGE_SIZE); - - if (Pcr == 0) - { - UiMessageBox("Can't allocate PCR\n"); - return; - } - - /* Allocate TSS */ - TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1); - TssPages = TssSize / MM_PAGE_SIZE; - - Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData); - - *TssBasePage = Tss >> MM_PAGE_SHIFT; - - /* Allocate space for new GDT + IDT */ - BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT limits here? - NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT; - *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); - - if (*GdtIdt == NULL) - { - UiMessageBox("Can't allocate pages for GDT+IDT!\n"); - return; - } - - /* Zero newly prepared GDT+IDT */ - RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT); -} Copied: trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c (from r53510, trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/winldr.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -23,8 +23,8 @@ //PHARDWARE_PTE HalPageTable; PVOID GdtIdt; -ULONG PcrBasePage; -ULONG TssBasePage; +ULONG_PTR PcrBasePage; +ULONG_PTR TssBasePage; /* FUNCTIONS **************************************************************/ @@ -152,6 +152,8 @@ { if (!MempMapSinglePage(VirtualAddress, PhysicalAddress)) { + DPRINTM(DPRINT_WINDOWS, "Failed to map page %ld from %p to %p\n", + i, (PVOID)VirtualAddress, (PVOID)PhysicalAddress); return i; } VirtualAddress += PAGE_SIZE; @@ -172,7 +174,8 @@ StartPage * PAGE_SIZE, NumberOfPages) != NumberOfPages) { - DPRINTM(DPRINT_WINDOWS,"Failed to map pages 1\n"); + DPRINTM(DPRINT_WINDOWS,"Failed to map pages %ld, %ld\n", + StartPage, NumberOfPages); return FALSE; } @@ -181,7 +184,8 @@ StartPage * PAGE_SIZE, NumberOfPages) != NumberOfPages) { - DPRINTM(DPRINT_WINDOWS,"Failed to map pages 2\n"); + DPRINTM(DPRINT_WINDOWS,"Failed to map pages %ld, %ld\n", + StartPage, NumberOfPages); return FALSE; } @@ -227,7 +231,7 @@ } BOOLEAN -WinLdrMapSpecialPages(ULONG PcrBasePage) +WinLdrMapSpecialPages() { /* Map the PCR page */ if (!MempMapSinglePage(KIP0PCRADDRESS, PcrBasePage * PAGE_SIZE)) @@ -350,10 +354,8 @@ DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n"); } -WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - ULONG TssSize; - ULONG_PTR KernelStack; +void WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock) +{ ULONG_PTR Pcr = 0; ULONG_PTR Tss = 0; ULONG BlockSize, NumPages; @@ -382,24 +384,25 @@ /* Allocate space for new GDT + IDT */ BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT limits here? NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT; - *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); - - if (*GdtIdt == NULL) + GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); + if (GdtIdt == NULL) { UiMessageBox("Can't allocate pages for GDT+IDT!\n"); return; } /* Zero newly prepared GDT+IDT */ - RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT); - - /* Write initial context information */ - LoaderBlock->KernelStack = (ULONG_PTR)KernelStack; - LoaderBlock->KernelStack += KERNEL_STACK_SIZE; - LoaderBlock->Prcb = (ULONG_PTR)&Pcr->Prcb; - LoaderBlock->Process = (ULONG_PTR)PdrPage->InitialProcess; - LoaderBlock->Thread = (ULONG_PTR)PdrPage->InitialThread; - + RtlZeroMemory(GdtIdt, NumPages << MM_PAGE_SHIFT); + + // Before we start mapping pages, create a block of memory, which will contain + // PDE and PTEs + if (MempAllocatePageTables() == FALSE) + { + // FIXME: bugcheck + } + + /* Map stuff like PCR, KI_USER_SHARED_DATA and Apic */ + WinLdrMapSpecialPages(); } Removed: trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/amd64/wlmemory.c (removed) @@ -1,410 +1,0 @@ -/* - * PROJECT: EFI Windows Loader - * LICENSE: GPL - See COPYING in the top level directory - * FILE: freeldr/amd64/wlmemory.c - * PURPOSE: Memory related routines - * PROGRAMMERS: Timo Kreuzer (timo.kreuzer(a)reactos.org) - */ - -/* INCLUDES ***************************************************************/ - -#include <freeldr.h> - -#include <ndk/asm.h> -#include <debug.h> - -//extern ULONG LoaderPagesSpanned; - -#define HYPER_SPACE_ENTRY 0x1EE - -/* GLOBALS ***************************************************************/ - -PHARDWARE_PTE PxeBase; -//PHARDWARE_PTE HalPageTable; - -PVOID GdtIdt; -ULONG PcrBasePage; -ULONG TssBasePage; - -/* FUNCTIONS **************************************************************/ - -BOOLEAN -MempAllocatePageTables() -{ - DPRINTM(DPRINT_WINDOWS,">>> MempAllocatePageTables\n"); - - /* Allocate a page for the PML4 */ - PxeBase = MmAllocateMemoryWithType(PAGE_SIZE, LoaderMemoryData); - if (!PxeBase) - { - DPRINTM(DPRINT_WINDOWS,"failed to allocate PML4\n"); - return FALSE; - } - - // FIXME: Physical PTEs = FirmwareTemporary ? - - /* Zero the PML4 */ - RtlZeroMemory(PxeBase, PAGE_SIZE); - - /* The page tables are located at 0xfffff68000000000 - * We create a recursive self mapping through all 4 levels at - * virtual address 0xfffff6fb7dbedf68 */ - PxeBase[VAtoPXI(PXE_BASE)].Valid = 1; - PxeBase[VAtoPXI(PXE_BASE)].Write = 1; - PxeBase[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(PxeBase); - - // FIXME: map PDE's for hals memory mapping - - DPRINTM(DPRINT_WINDOWS,">>> leave MempAllocatePageTables\n"); - - return TRUE; -} - -PHARDWARE_PTE -MempGetOrCreatePageDir(PHARDWARE_PTE PdeBase, ULONG Index) -{ - PHARDWARE_PTE SubDir; - - if (!PdeBase) - return NULL; - - if (!PdeBase[Index].Valid) - { - SubDir = MmAllocateMemoryWithType(PAGE_SIZE, LoaderMemoryData); - if (!SubDir) - return NULL; - RtlZeroMemory(SubDir, PAGE_SIZE); - PdeBase[Index].PageFrameNumber = PtrToPfn(SubDir); - PdeBase[Index].Valid = 1; - PdeBase[Index].Write = 1; - } - else - { - SubDir = (PVOID)((ULONG64)(PdeBase[Index].PageFrameNumber) * PAGE_SIZE); - } - return SubDir; -} - -BOOLEAN -MempMapSinglePage(ULONG64 VirtualAddress, ULONG64 PhysicalAddress) -{ - PHARDWARE_PTE PpeBase, PdeBase, PteBase; - ULONG Index; - - PpeBase = MempGetOrCreatePageDir(PxeBase, VAtoPXI(VirtualAddress)); - PdeBase = MempGetOrCreatePageDir(PpeBase, VAtoPPI(VirtualAddress)); - PteBase = MempGetOrCreatePageDir(PdeBase, VAtoPDI(VirtualAddress)); - - if (!PteBase) - { - DPRINTM(DPRINT_WINDOWS,"!!!No Dir %p, %p, %p, %p\n", PxeBase, PpeBase, PdeBase, PteBase); - return FALSE; - } - - Index = VAtoPTI(VirtualAddress); - if (PteBase[Index].Valid) - { - DPRINTM(DPRINT_WINDOWS,"!!!Already mapped %ld\n", Index); - return FALSE; - } - - PteBase[Index].Valid = 1; - PteBase[Index].Write = 1; - PteBase[Index].PageFrameNumber = PhysicalAddress / PAGE_SIZE; - - return TRUE; -} - -BOOLEAN -MempIsPageMapped(PVOID VirtualAddress) -{ - PHARDWARE_PTE PpeBase, PdeBase, PteBase; - ULONG Index; - - Index = VAtoPXI(VirtualAddress); - if (!PxeBase[Index].Valid) - return FALSE; - - PpeBase = (PVOID)((ULONG64)(PxeBase[Index].PageFrameNumber) * PAGE_SIZE); - Index = VAtoPPI(VirtualAddress); - if (!PpeBase[Index].Valid) - return FALSE; - - PdeBase = (PVOID)((ULONG64)(PpeBase[Index].PageFrameNumber) * PAGE_SIZE); - Index = VAtoPDI(VirtualAddress); - if (!PdeBase[Index].Valid) - return FALSE; - - PteBase = (PVOID)((ULONG64)(PdeBase[Index].PageFrameNumber) * PAGE_SIZE); - Index = VAtoPTI(VirtualAddress); - if (!PteBase[Index].Valid) - return FALSE; - - return TRUE; -} - -ULONG -MempMapRangeOfPages(ULONG64 VirtualAddress, ULONG64 PhysicalAddress, ULONG cPages) -{ - ULONG i; - - for (i = 0; i < cPages; i++) - { - if (!MempMapSinglePage(VirtualAddress, PhysicalAddress)) - { - return i; - } - VirtualAddress += PAGE_SIZE; - PhysicalAddress += PAGE_SIZE; - } - return i; -} - -BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages) -{ - DPRINTM(DPRINT_WINDOWS,">>> MempSetupPaging(0x%lx, %ld, %p)\n", - StartPage, NumberOfPages, StartPage * PAGE_SIZE + KSEG0_BASE); - - /* Identity mapping */ - if (MempMapRangeOfPages(StartPage * PAGE_SIZE, - StartPage * PAGE_SIZE, - NumberOfPages) != NumberOfPages) - { - DPRINTM(DPRINT_WINDOWS,"Failed to map pages 1\n"); - return FALSE; - } - - /* Kernel mapping */ - if (MempMapRangeOfPages(StartPage * PAGE_SIZE + KSEG0_BASE, - StartPage * PAGE_SIZE, - NumberOfPages) != NumberOfPages) - { - DPRINTM(DPRINT_WINDOWS,"Failed to map pages 2\n"); - return FALSE; - } - - return TRUE; -} - -VOID -MempUnmapPage(ULONG Page) -{ - // DPRINTM(DPRINT_WINDOWS,">>> MempUnmapPage\n"); -} - -VOID -WinLdrpMapApic() -{ - BOOLEAN LocalAPIC; - LARGE_INTEGER MsrValue; - ULONG CpuInfo[4]; - ULONG64 APICAddress; - - DPRINTM(DPRINT_WINDOWS,">>> WinLdrpMapApic\n"); - - /* Check if we have a local APIC */ - __cpuid((int*)CpuInfo, 1); - LocalAPIC = (((CpuInfo[3] >> 9) & 1) != 0); - - /* If there is no APIC, just return */ - if (!LocalAPIC) - { - DPRINTM(DPRINT_WINDOWS,"No APIC found.\n"); - return; - } - - /* Read the APIC Address */ - MsrValue.QuadPart = __readmsr(0x1B); - APICAddress = (MsrValue.LowPart & 0xFFFFF000); - - DPRINTM(DPRINT_WINDOWS, "Local APIC detected at address 0x%x\n", - APICAddress); - - /* Map it */ - MempMapSinglePage(APIC_BASE, APICAddress); -} - -BOOLEAN -WinLdrMapSpecialPages(ULONG PcrBasePage) -{ - /* Map the PCR page */ - if (!MempMapSinglePage(KIP0PCRADDRESS, PcrBasePage * PAGE_SIZE)) - { - DPRINTM(DPRINT_WINDOWS, "Could not map PCR @ %lx\n", PcrBasePage); - return FALSE; - } - - /* Map KI_USER_SHARED_DATA */ - if (!MempMapSinglePage(KI_USER_SHARED_DATA, (PcrBasePage+1) * PAGE_SIZE)) - { - DPRINTM(DPRINT_WINDOWS, "Could not map KI_USER_SHARED_DATA\n"); - return FALSE; - } - - /* Map the APIC page */ - WinLdrpMapApic(); - - return TRUE; -} - -VOID -Amd64SetupGdt(PVOID GdtBase, ULONG64 TssBase) -{ - PKGDTENTRY64 Entry; - KDESCRIPTOR GdtDesc; - - /* Setup KGDT64_NULL */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_NULL); - *(PULONG64)Entry = 0x0000000000000000ULL; - - /* Setup KGDT64_R0_CODE */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_R0_CODE); - *(PULONG64)Entry = 0x00209b0000000000ULL; - - /* Setup KGDT64_R0_DATA */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_R0_DATA); - *(PULONG64)Entry = 0x00cf93000000ffffULL; - - /* Setup KGDT64_R3_CMCODE */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CMCODE); - *(PULONG64)Entry = 0x00cffb000000ffffULL; - - /* Setup KGDT64_R3_DATA */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_DATA); - *(PULONG64)Entry = 0x00cff3000000ffffULL; - - /* Setup KGDT64_R3_CODE */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CODE); - *(PULONG64)Entry = 0x0020fb0000000000ULL; - - /* Setup KGDT64_R3_CMTEB */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_R3_CMTEB); - *(PULONG64)Entry = 0xff40f3fd50003c00ULL; - - /* Setup TSS entry */ - Entry = KiGetGdtEntry(GdtBase, KGDT64_SYS_TSS); - KiInitGdtEntry(Entry, TssBase, sizeof(KTSS), I386_TSS, 0); - - /* Setup GDT descriptor */ - GdtDesc.Base = GdtBase; - GdtDesc.Limit = NUM_GDT * sizeof(KGDTENTRY) - 1; - - /* Set the new Gdt */ - __lgdt(&GdtDesc.Limit); - DbgPrint("Gdtr.Base = %p, num = %ld\n", GdtDesc.Base, NUM_GDT); - -} - -VOID -Amd64SetupIdt(PVOID IdtBase) -{ - KDESCRIPTOR IdtDesc, OldIdt; - - /* Get old IDT */ - __sidt(&OldIdt); - - /* Copy the old IDT */ - RtlCopyMemory(IdtBase, (PVOID)OldIdt.Base, OldIdt.Limit + 1); - - /* Setup the new IDT descriptor */ - IdtDesc.Base = IdtBase; - IdtDesc.Limit = NUM_IDT * sizeof(KIDTENTRY) - 1; - - /* Set the new IDT */ - __lidt(&IdtDesc.Limit); - DbgPrint("Idtr.Base = %p\n", IdtDesc.Base); - -} - -VOID -WinLdrSetProcessorContext(void) -{ - DPRINTM(DPRINT_WINDOWS, "WinLdrSetProcessorContext\n"); - - /* Disable Interrupts */ - _disable(); - - /* Re-initalize EFLAGS */ - __writeeflags(0); - - /* Set the new PML4 */ - __writecr3((ULONG64)PxeBase); - - /* Get kernel mode address of gdt / idt */ - GdtIdt = (PVOID)((ULONG64)GdtIdt + KSEG0_BASE); - - /* Create gdt entries and load gdtr */ - Amd64SetupGdt(GdtIdt, KSEG0_BASE | (TssBasePage << MM_PAGE_SHIFT)); - - /* Copy old Idt and set idtr */ - Amd64SetupIdt((PVOID)((ULONG64)GdtIdt + 2048)); // HACK! - - /* LDT is unused */ -// __lldt(0); - - /* Load TSR */ - __ltr(KGDT64_SYS_TSS); - - DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n"); -} - -WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - ULONG TssSize; - ULONG_PTR KernelStack; - ULONG_PTR Pcr = 0; - ULONG_PTR Tss = 0; - ULONG BlockSize, NumPages; - - LoaderBlock->u.I386.CommonDataArea = (PVOID)DbgPrint; // HACK - LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA; - - /* Allocate 2 pages for PCR */ - Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage); - PcrBasePage = Pcr >> MM_PAGE_SHIFT; - if (Pcr == 0) - { - UiMessageBox("Can't allocate PCR\n"); - return; - } - RtlZeroMemory((PVOID)Pcr, 2 * MM_PAGE_SIZE); - - /* Allocate a kernel stack */ - Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage); - - /* Allocate TSS */ - BlockSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1); - Tss = (ULONG_PTR)MmAllocateMemoryWithType(BlockSize, LoaderMemoryData); - TssBasePage = Tss >> MM_PAGE_SHIFT; - - /* Allocate space for new GDT + IDT */ - BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT limits here? - NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT; - *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); - - if (*GdtIdt == NULL) - { - UiMessageBox("Can't allocate pages for GDT+IDT!\n"); - return; - } - - /* Zero newly prepared GDT+IDT */ - RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT); - - /* Write initial context information */ - LoaderBlock->KernelStack = (ULONG_PTR)KernelStack; - LoaderBlock->KernelStack += KERNEL_STACK_SIZE; - LoaderBlock->Prcb = (ULONG_PTR)&Pcr->Prcb; - LoaderBlock->Process = (ULONG_PTR)PdrPage->InitialProcess; - LoaderBlock->Thread = (ULONG_PTR)PdrPage->InitialThread; - -} - - -VOID -MempDump() -{ -} - Removed: trunk/reactos/boot/freeldr/freeldr/arch/arm/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/arm/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/arm/wlmemory.c (removed) @@ -1,274 +1,0 @@ -/* - * PROJECT: ReactOS Boot Loader - * LICENSE: BSD - See COPYING.ARM in the top level directory - * FILE: boot/freeldr/arch/arm/loader.c - * PURPOSE: ARM Kernel Loader - * PROGRAMMERS: ReactOS Portable Systems Group - */ - -/* INCLUDES ***************************************************************/ - -#include <freeldr.h> -#include <debug.h> -#include <internal/arm/mm.h> -#include <internal/arm/intrin_i.h> - -#define PFN_SHIFT 12 -#define LARGE_PFN_SHIFT 20 - -#define PTE_BASE 0xC0000000 -#define PDE_BASE 0xC0400000 -#define PDR_BASE 0xFFD00000 -#define VECTOR_BASE 0xFFFF0000 - -#ifdef _ZOOM2_ -#define IDMAP_BASE 0x81000000 -#define MMIO_BASE 0x10000000 -#else -#define IDMAP_BASE 0x00000000 -#define MMIO_BASE 0x10000000 -#endif - -#define LowMemPageTableIndex (IDMAP_BASE >> PDE_SHIFT) -#define MmioPageTableIndex (MMIO_BASE >> PDE_SHIFT) -#define KernelPageTableIndex (KSEG0_BASE >> PDE_SHIFT) -#define StartupPtePageTableIndex (PTE_BASE >> PDE_SHIFT) -#define StartupPdePageTableIndex (PDE_BASE >> PDE_SHIFT) -#define PdrPageTableIndex (PDR_BASE >> PDE_SHIFT) -#define VectorPageTableIndex (VECTOR_BASE >> PDE_SHIFT) - -#ifndef _ZOOM2_ -PVOID MempPdrBaseAddress = (PVOID)0x70000; -PVOID MempKernelBaseAddress = (PVOID)0; -#else -PVOID MempPdrBaseAddress = (PVOID)0x81100000; -PVOID MempKernelBaseAddress = (PVOID)0x80000000; -#endif - -/* Converts a Physical Address into a Page Frame Number */ -#define PaToPfn(p) ((p) >> PFN_SHIFT) -#define PaToLargePfn(p) ((p) >> LARGE_PFN_SHIFT) -#define PaPtrToPfn(p) (((ULONG_PTR)(p)) >> PFN_SHIFT) - -/* Converts a Physical Address into a Coarse Page Table PFN */ -#define PaPtrToPdePfn(p) (((ULONG_PTR)(p)) >> CPT_SHIFT) - -typedef struct _KPDR_PAGE -{ - PAGE_DIRECTORY_ARM PageDir; // 0xC0400000 [0xFFD00000] - CHAR HyperSpace[233 * PAGE_SIZE]; // 0xC0404000 [0xFFD04000] - PAGE_TABLE_ARM KernelPageTable[3]; // 0xC04ED000 [0xFFDED000] - CHAR SharedData[PAGE_SIZE]; // 0xC04F0000 [0xFFDF0000] - CHAR KernelStack[KERNEL_STACK_SIZE]; // 0xC04F1000 [0xFFDF1000] - CHAR PanicStack[KERNEL_STACK_SIZE]; // 0xC04F4000 [0xFFDF4000] - CHAR InterruptStack[KERNEL_STACK_SIZE]; // 0xC04F7000 [0xFFDF7000] - CHAR InitialProcess[PAGE_SIZE]; // 0xC04FA000 [0xFFDFA000] - CHAR InitialThread[PAGE_SIZE]; // 0xC04FB000 [0xFFDFB000] - CHAR Prcb[PAGE_SIZE]; // 0xC04FC000 [0xFFDFC000] - PAGE_TABLE_ARM PageDirPageTable; // 0xC04FD000 [0xFFDFD000] - PAGE_TABLE_ARM VectorPageTable; // 0xC04FE000 [0xFFDFE000] - CHAR Pcr[PAGE_SIZE]; // 0xC04FF000 [0xFFDFF000] -} KPDR_PAGE, *PKPDR_PAGE; - -C_ASSERT(sizeof(KPDR_PAGE) == (1 * 1024 * 1024)); - -HARDWARE_PTE_ARMV6 TempPte; -HARDWARE_LARGE_PTE_ARMV6 TempLargePte; -HARDWARE_PDE_ARMV6 TempPde; -PKPDR_PAGE PdrPage; - -/* FUNCTIONS **************************************************************/ - -BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages) -{ - return TRUE; -} - -VOID -MempUnmapPage(IN ULONG Page) -{ - return; -} - -VOID -MempDump(VOID) -{ - return; -} - -BOOLEAN -WinLdrMapSpecialPages(ULONG PcrBasePage) -{ - ULONG i; - PHARDWARE_PTE_ARMV6 PointerPte; - PHARDWARE_PDE_ARMV6 PointerPde; - PHARDWARE_LARGE_PTE_ARMV6 LargePte; - PFN_NUMBER Pfn; - - /* Setup the Startup PDE */ - LargePte = &PdrPage->PageDir.Pte[StartupPdePageTableIndex]; - TempLargePte.PageFrameNumber = PaToLargePfn((ULONG_PTR)&PdrPage->PageDir); - *LargePte = TempLargePte; - - /* Map-in the PDR */ - LargePte = &PdrPage->PageDir.Pte[PdrPageTableIndex]; - *LargePte = TempLargePte; - - /* After this point, any MiAddressToPde is guaranteed not to fault */ - - /* - * Link them in the Startup PDE. - * Note these are the entries in the PD at (MiAddressToPde(PTE_BASE)). - */ - PointerPde = &PdrPage->PageDir.Pde[StartupPtePageTableIndex]; - Pfn = PaPtrToPdePfn(&PdrPage->PageDirPageTable); - for (i = 0; i < 4; i++) - { - TempPde.PageFrameNumber = Pfn++; - *PointerPde++ = TempPde; - } - - /* - * Now map these page tables in PTE space (MiAddressToPte(PTE_BASE)). - * Note that they all live on a single page, since each is 1KB. - */ - PointerPte = &PdrPage->PageDirPageTable.Pte[0x300]; - TempPte.PageFrameNumber = PaPtrToPfn(&PdrPage->PageDirPageTable); - *PointerPte = TempPte; - - /* - * After this point, MiAddressToPte((PDE_BASE) to MiAddressToPte(PDE_TOP)) - * is guaranteed not to fault. - * Any subsequent page allocation will first need its page table created - * and mapped in the PTE_BASE first, then the page table itself will be - * editable through its flat PTE address. - */ - - /* Setup the Vector PDE */ - PointerPde = &PdrPage->PageDir.Pde[VectorPageTableIndex]; - TempPde.PageFrameNumber = PaPtrToPdePfn(&PdrPage->VectorPageTable); - *PointerPde = TempPde; - - /* Setup the Vector PTEs */ - PointerPte = &PdrPage->VectorPageTable.Pte[0xF0]; - TempPte.PageFrameNumber = 0; - *PointerPte = TempPte; - - /* TODO: Map in the kernel CPTs */ - return TRUE; -} - -VOID -WinLdrSetupForNt(IN PLOADER_PARAMETER_BLOCK LoaderBlock, - IN PVOID *GdtIdt, - IN ULONG *PcrBasePage, - IN ULONG *TssBasePage) -{ - PKPDR_PAGE PdrPage = (PVOID)0xFFD00000; - - /* Load cache information */ - LoaderBlock->u.Arm.FirstLevelDcacheSize = FirstLevelDcacheSize; - LoaderBlock->u.Arm.FirstLevelDcacheFillSize = FirstLevelDcacheFillSize; - LoaderBlock->u.Arm.FirstLevelIcacheSize = FirstLevelIcacheSize; - LoaderBlock->u.Arm.FirstLevelIcacheFillSize = FirstLevelIcacheFillSize; - LoaderBlock->u.Arm.SecondLevelDcacheSize = SecondLevelDcacheSize; - LoaderBlock->u.Arm.SecondLevelDcacheFillSize = SecondLevelDcacheFillSize; - LoaderBlock->u.Arm.SecondLevelIcacheSize = SecondLevelIcacheSize; - LoaderBlock->u.Arm.SecondLevelIcacheFillSize = SecondLevelIcacheSize; - - /* Write initial context information */ - LoaderBlock->KernelStack = (ULONG_PTR)PdrPage->KernelStack; - LoaderBlock->KernelStack += KERNEL_STACK_SIZE; - LoaderBlock->u.Arm.PanicStack = (ULONG_PTR)PdrPage->PanicStack; - LoaderBlock->u.Arm.PanicStack += KERNEL_STACK_SIZE; - LoaderBlock->u.Arm.InterruptStack = (ULONG_PTR)PdrPage->InterruptStack; - LoaderBlock->u.Arm.InterruptStack += KERNEL_STACK_SIZE; - LoaderBlock->Prcb = (ULONG_PTR)PdrPage->Prcb; - LoaderBlock->Process = (ULONG_PTR)PdrPage->InitialProcess; - LoaderBlock->Thread = (ULONG_PTR)PdrPage->InitialThread; -} - -BOOLEAN -MempAllocatePageTables(VOID) -{ - ULONG i; - PHARDWARE_PTE_ARMV6 PointerPte; - PHARDWARE_PDE_ARMV6 PointerPde; - PHARDWARE_LARGE_PTE_ARMV6 LargePte; - PFN_NUMBER Pfn; - - /* Setup templates */ - TempPte.Sbo = TempPte.Valid = TempLargePte.LargePage = TempLargePte.Sbo = TempPde.Valid = 1; - - /* Allocate the 1MB "PDR" (Processor Data Region). Must be 1MB aligned */ - PdrPage = MmAllocateMemoryAtAddress(sizeof(KPDR_PAGE), - MempPdrBaseAddress, - LoaderMemoryData); - - /* Setup the Low Memory PDE as an identity-mapped Large Page (1MB) */ - LargePte = &PdrPage->PageDir.Pte[LowMemPageTableIndex]; - TempLargePte.PageFrameNumber = PaToLargePfn(IDMAP_BASE); - *LargePte = TempLargePte; - - /* Setup the MMIO PDE as two identity mapped large pages -- the kernel will blow these away later */ - LargePte = &PdrPage->PageDir.Pte[MmioPageTableIndex]; - Pfn = PaToLargePfn(MMIO_BASE); - for (i = 0; i < 2; i++) - { - TempLargePte.PageFrameNumber = Pfn++; - *LargePte++ = TempLargePte; - } - - /* Setup the Kernel PDEs */ - PointerPde = &PdrPage->PageDir.Pde[KernelPageTableIndex]; - Pfn = PaPtrToPdePfn(PdrPage->KernelPageTable); - for (i = 0; i < 12; i++) - { - TempPde.PageFrameNumber = Pfn; - *PointerPde++ = TempPde; - Pfn++; - } - - /* Setup the Kernel PTEs */ - PointerPte = PdrPage->KernelPageTable[0].Pte; - Pfn = PaPtrToPfn(MempKernelBaseAddress); - for (i = 0; i < 3072; i++) - { - TempPte.PageFrameNumber = Pfn++; - *PointerPte++ = TempPte; - } - - /* Done */ - return TRUE; -} - -VOID -WinLdrSetProcessorContext(PVOID GdtIdt, - IN ULONG Pcr, - IN ULONG Tss) -{ - ARM_CONTROL_REGISTER ControlRegister; - ARM_TTB_REGISTER TtbRegister; - ARM_DOMAIN_REGISTER DomainRegister; - - /* Set the TTBR */ - TtbRegister.AsUlong = (ULONG_PTR)&PdrPage->PageDir; - ASSERT(TtbRegister.Reserved == 0); - KeArmTranslationTableRegisterSet(TtbRegister); - - /* Disable domains and simply use access bits on PTEs */ - DomainRegister.AsUlong = 0; - DomainRegister.Domain0 = ClientDomain; - KeArmDomainRegisterSet(DomainRegister); - - /* Enable ARMv6+ paging (MMU), caches and the access bit */ - ControlRegister = KeArmControlRegisterGet(); - ControlRegister.MmuEnabled = TRUE; - ControlRegister.ICacheEnabled = TRUE; - ControlRegister.DCacheEnabled = TRUE; - ControlRegister.ForceAp = TRUE; - ControlRegister.ExtendedPageTables = TRUE; - KeArmControlRegisterSet(ControlRegister); -} Removed: trunk/reactos/boot/freeldr/freeldr/arch/i386/ntsetup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/ntsetup.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/ntsetup.c (removed) @@ -1,84 +1,0 @@ -/* - * PROJECT: EFI Windows Loader - * LICENSE: GPL - See COPYING in the top level directory - * FILE: freeldr/windows/i386/ntsetup.c - * PURPOSE: i386-specific setup for Windows boot - * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) - */ - -/* INCLUDES ***************************************************************/ - -#include <freeldr.h> -#include <debug.h> - -// this is needed for new IDT filling -#if 0 -extern ULONG_PTR i386DivideByZero; -extern ULONG_PTR i386DebugException; -extern ULONG_PTR i386NMIException; -extern ULONG_PTR i386Breakpoint; -extern ULONG_PTR i386Overflow; -extern ULONG_PTR i386BoundException; -extern ULONG_PTR i386InvalidOpcode; -extern ULONG_PTR i386FPUNotAvailable; -extern ULONG_PTR i386DoubleFault; -extern ULONG_PTR i386CoprocessorSegment; -extern ULONG_PTR i386InvalidTSS; -extern ULONG_PTR i386SegmentNotPresent; -extern ULONG_PTR i386StackException; -extern ULONG_PTR i386GeneralProtectionFault; -extern ULONG_PTR i386PageFault; // exc 14 -extern ULONG_PTR i386CoprocessorError; // exc 16 -extern ULONG_PTR i386AlignmentCheck; // exc 17 -#endif - -/* FUNCTIONS **************************************************************/ -#if 0 -// Last step before going virtual -void WinLdrSetupForNt(PLOADER_PARAMETER_BLOCK LoaderBlock, - PVOID *GdtIdt, - ULONG *PcrBasePage, - ULONG *TssBasePage) -{ - ULONG TssSize; - //ULONG TssPages; - ULONG_PTR Pcr = 0; - ULONG_PTR Tss = 0; - ULONG BlockSize, NumPages; - - LoaderBlock->u.I386.CommonDataArea = NULL; // Force No ABIOS support - LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA; - - /* Allocate 2 pages for PCR */ - Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage); - *PcrBasePage = Pcr >> MM_PAGE_SHIFT; - - if (Pcr == 0) - { - UiMessageBox("Can't allocate PCR\n"); - return; - } - - /* Allocate TSS */ - TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1); - //TssPages = TssSize / MM_PAGE_SIZE; - - Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData); - - *TssBasePage = Tss >> MM_PAGE_SHIFT; - - /* Allocate space for new GDT + IDT */ - BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT limits here? - NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT; - *GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); - - if (*GdtIdt == NULL) - { - UiMessageBox("Can't allocate pages for GDT+IDT!\n"); - return; - } - - /* Zero newly prepared GDT+IDT */ - RtlZeroMemory(*GdtIdt, NumPages << MM_PAGE_SHIFT); -} -#endif Removed: trunk/reactos/boot/freeldr/freeldr/arch/i386/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/wlmemory.c (removed) @@ -1,613 +1,0 @@ -/* - * PROJECT: EFI Windows Loader - * LICENSE: GPL - See COPYING in the top level directory - * FILE: freeldr/winldr/i386/wlmemory.c - * PURPOSE: Memory related routines - * PROGRAMMERS: Aleksey Bragin (aleksey(a)reactos.org) - */ - -/* INCLUDES ***************************************************************/ - -#include <freeldr.h> - -#include <ndk/asm.h> -#include <debug.h> - -// This is needed because headers define wrong one for ReactOS -#undef KIP0PCRADDRESS -#define KIP0PCRADDRESS 0xffdff000 - -#define HYPER_SPACE_ENTRY 0x300 - -// This is needed only for SetProcessorContext routine -#pragma pack(2) - typedef struct - { - USHORT Limit; - ULONG Base; - } GDTIDT; -#pragma pack(4) - -/* GLOBALS ***************************************************************/ - -PHARDWARE_PTE PDE; -PHARDWARE_PTE HalPageTable; - -PUCHAR PhysicalPageTablesBuffer; -PUCHAR KernelPageTablesBuffer; -ULONG PhysicalPageTables; -ULONG KernelPageTables; - -ULONG PcrBasePage; -ULONG TssBasePage; -PVOID GdtIdt; - -/* FUNCTIONS **************************************************************/ - -BOOLEAN -MempAllocatePageTables() -{ - ULONG NumPageTables, TotalSize; - PUCHAR Buffer; - // It's better to allocate PDE + PTEs contigiuos - - // Max number of entries = MaxPageNum >> 10 - // FIXME: This is a number to describe ALL physical memory - // and windows doesn't expect ALL memory mapped... - NumPageTables = TotalPagesInLookupTable >> 10; - - DPRINTM(DPRINT_WINDOWS, "NumPageTables = %d\n", NumPageTables); - - // Allocate memory block for all these things: - // PDE, HAL mapping page table, physical mapping, kernel mapping - TotalSize = (1 + 1 + NumPageTables * 2) * MM_PAGE_SIZE; - - // PDE+HAL+KernelPTEs == MemoryData - Buffer = MmAllocateMemoryWithType(TotalSize, LoaderMemoryData); - - // Physical PTEs = FirmwareTemporary - PhysicalPageTablesBuffer = (PUCHAR)Buffer + TotalSize - NumPageTables*MM_PAGE_SIZE; - MmSetMemoryType(PhysicalPageTablesBuffer, - NumPageTables*MM_PAGE_SIZE, - LoaderFirmwareTemporary); - - // This check is now redundant - if (Buffer + (TotalSize - NumPageTables*MM_PAGE_SIZE) != - PhysicalPageTablesBuffer) - { - DPRINTM(DPRINT_WINDOWS, "There was a problem allocating two adjacent blocks of memory!"); - } - - if (Buffer == NULL || PhysicalPageTablesBuffer == NULL) - { - UiMessageBox("Impossible to allocate memory block for page tables!"); - return FALSE; - } - - // Zero all this memory block - RtlZeroMemory(Buffer, TotalSize); - - // Set up pointers correctly now - PDE = (PHARDWARE_PTE)Buffer; - - // Map the page directory at 0xC0000000 (maps itself) - PDE[HYPER_SPACE_ENTRY].PageFrameNumber = (ULONG)PDE >> MM_PAGE_SHIFT; - PDE[HYPER_SPACE_ENTRY].Valid = 1; - PDE[HYPER_SPACE_ENTRY].Write = 1; - - // The last PDE slot is allocated for HAL's memory mapping (Virtual Addresses 0xFFC00000 - 0xFFFFFFFF) - HalPageTable = (PHARDWARE_PTE)&Buffer[MM_PAGE_SIZE*1]; - - // Map it - PDE[1023].PageFrameNumber = (ULONG)HalPageTable >> MM_PAGE_SHIFT; - PDE[1023].Valid = 1; - PDE[1023].Write = 1; - - // Store pointer to the table for easier access - KernelPageTablesBuffer = &Buffer[MM_PAGE_SIZE*2]; - - // Zero counters of page tables used - PhysicalPageTables = 0; - KernelPageTables = 0; - - return TRUE; -} - -VOID -MempAllocatePTE(ULONG Entry, PHARDWARE_PTE *PhysicalPT, PHARDWARE_PTE *KernelPT) -{ - //Print(L"Creating PDE Entry %X\n", Entry); - - // Identity mapping - *PhysicalPT = (PHARDWARE_PTE)&PhysicalPageTablesBuffer[PhysicalPageTables*MM_PAGE_SIZE]; - PhysicalPageTables++; - - PDE[Entry].PageFrameNumber = (ULONG)*PhysicalPT >> MM_PAGE_SHIFT; - PDE[Entry].Valid = 1; - PDE[Entry].Write = 1; - - if (Entry+(KSEG0_BASE >> 22) > 1023) - { - DPRINTM(DPRINT_WINDOWS, "WARNING! Entry: %X > 1023\n", Entry+(KSEG0_BASE >> 22)); - } - - // Kernel-mode mapping - *KernelPT = (PHARDWARE_PTE)&KernelPageTablesBuffer[KernelPageTables*MM_PAGE_SIZE]; - KernelPageTables++; - - PDE[Entry+(KSEG0_BASE >> 22)].PageFrameNumber = ((ULONG)*KernelPT >> MM_PAGE_SHIFT); - PDE[Entry+(KSEG0_BASE >> 22)].Valid = 1; - PDE[Entry+(KSEG0_BASE >> 22)].Write = 1; -} - -BOOLEAN -MempSetupPaging(IN ULONG StartPage, - IN ULONG NumberOfPages) -{ - PHARDWARE_PTE PhysicalPT; - PHARDWARE_PTE KernelPT; - ULONG Entry, Page; - - //Print(L"MempSetupPaging: SP 0x%X, Number: 0x%X\n", StartPage, NumberOfPages); - - // HACK - if (StartPage+NumberOfPages >= 0x80000) - { - // - // We can't map this as it requires more than 1 PDE - // and in fact it's not possible at all ;) - // - //Print(L"skipping...\n"); - return TRUE; - } - - // - // Now actually set up the page tables for identity mapping - // - for (Page = StartPage; Page < StartPage + NumberOfPages; Page++) - { - Entry = Page >> 10; - - if (((PULONG)PDE)[Entry] == 0) - { - MempAllocatePTE(Entry, &PhysicalPT, &KernelPT); - } - else - { - PhysicalPT = (PHARDWARE_PTE)(PDE[Entry].PageFrameNumber << MM_PAGE_SHIFT); - KernelPT = (PHARDWARE_PTE)(PDE[Entry+(KSEG0_BASE >> 22)].PageFrameNumber << MM_PAGE_SHIFT); - } - - PhysicalPT[Page & 0x3ff].PageFrameNumber = Page; - PhysicalPT[Page & 0x3ff].Valid = (Page != 0); - PhysicalPT[Page & 0x3ff].Write = (Page != 0); - - KernelPT[Page & 0x3ff].PageFrameNumber = Page; - KernelPT[Page & 0x3ff].Valid = (Page != 0); - KernelPT[Page & 0x3ff].Write = (Page != 0); - } - - return TRUE; -} - -VOID -MempUnmapPage(ULONG Page) -{ - PHARDWARE_PTE KernelPT; - ULONG Entry = (Page >> 10) + (KSEG0_BASE >> 22); - - /* Don't unmap hyperspace or HAL entries */ - if (Entry == HYPER_SPACE_ENTRY || Entry == 1023) - return; - - if (PDE[Entry].Valid) - { - KernelPT = (PHARDWARE_PTE)(PDE[Entry].PageFrameNumber << MM_PAGE_SHIFT); - - if (KernelPT) - { - KernelPT[Page & 0x3ff].PageFrameNumber = 0; - KernelPT[Page & 0x3ff].Valid = 0; - KernelPT[Page & 0x3ff].Write = 0; - } - } -} - -VOID -WinLdrpMapApic() -{ - BOOLEAN LocalAPIC; - LARGE_INTEGER MsrValue; - ULONG APICAddress, CpuInfo[4]; - - /* Check if we have a local APIC */ - __cpuid((int*)CpuInfo, 1); - LocalAPIC = (((CpuInfo[3] >> 9) & 1) != 0); - - /* If there is no APIC, just return */ - if (!LocalAPIC) - return; - - /* Read the APIC Address */ - MsrValue.QuadPart = __readmsr(0x1B); - APICAddress = (MsrValue.LowPart & 0xFFFFF000); - - DPRINTM(DPRINT_WINDOWS, "Local APIC detected at address 0x%x\n", - APICAddress); - - /* Map it */ - HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].PageFrameNumber - = APICAddress >> MM_PAGE_SHIFT; - HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].Valid = 1; - HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].Write = 1; - HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].WriteThrough = 1; - HalPageTable[(APIC_BASE - 0xFFC00000) >> MM_PAGE_SHIFT].CacheDisable = 1; -} - -BOOLEAN -WinLdrMapSpecialPages(void) -{ - - //VideoDisplayString(L"Hello from VGA, going into the kernel\n"); - DPRINTM(DPRINT_WINDOWS, "HalPageTable: 0x%X\n", HalPageTable); - - // Page Tables have been setup, make special handling for PCR and TSS - // (which is done in BlSetupFotNt in usual ntldr) - HalPageTable[(KI_USER_SHARED_DATA - 0xFFC00000) >> MM_PAGE_SHIFT].PageFrameNumber = PcrBasePage+1; - HalPageTable[(KI_USER_SHARED_DATA - 0xFFC00000) >> MM_PAGE_SHIFT].Valid = 1; - HalPageTable[(KI_USER_SHARED_DATA - 0xFFC00000) >> MM_PAGE_SHIFT].Write = 1; - - HalPageTable[(KIP0PCRADDRESS - 0xFFC00000) >> MM_PAGE_SHIFT].PageFrameNumber = PcrBasePage; - HalPageTable[(KIP0PCRADDRESS - 0xFFC00000) >> MM_PAGE_SHIFT].Valid = 1; - HalPageTable[(KIP0PCRADDRESS - 0xFFC00000) >> MM_PAGE_SHIFT].Write = 1; - - // Map APIC - WinLdrpMapApic(); - - // Map VGA memory - //VideoMemoryBase = MmMapIoSpace(0xb8000, 4000, MmNonCached); - //DPRINTM(DPRINT_WINDOWS, "VideoMemoryBase: 0x%X\n", VideoMemoryBase); - - return TRUE; -} - -void WinLdrSetupMachineDependent(PLOADER_PARAMETER_BLOCK LoaderBlock) -{ - ULONG TssSize; - //ULONG TssPages; - ULONG_PTR Pcr = 0; - ULONG_PTR Tss = 0; - ULONG BlockSize, NumPages; - - LoaderBlock->u.I386.CommonDataArea = NULL; // Force No ABIOS support - LoaderBlock->u.I386.MachineType = MACHINE_TYPE_ISA; - - /* Allocate 2 pages for PCR */ - Pcr = (ULONG_PTR)MmAllocateMemoryWithType(2 * MM_PAGE_SIZE, LoaderStartupPcrPage); - PcrBasePage = Pcr >> MM_PAGE_SHIFT; - - if (Pcr == 0) - { - UiMessageBox("Can't allocate PCR\n"); - return; - } - - /* Allocate TSS */ - TssSize = (sizeof(KTSS) + MM_PAGE_SIZE) & ~(MM_PAGE_SIZE - 1); - //TssPages = TssSize / MM_PAGE_SIZE; - - Tss = (ULONG_PTR)MmAllocateMemoryWithType(TssSize, LoaderMemoryData); - - TssBasePage = Tss >> MM_PAGE_SHIFT; - - /* Allocate space for new GDT + IDT */ - BlockSize = NUM_GDT*sizeof(KGDTENTRY) + NUM_IDT*sizeof(KIDTENTRY);//FIXME: Use GDT/IDT limits here? - NumPages = (BlockSize + MM_PAGE_SIZE - 1) >> MM_PAGE_SHIFT; - GdtIdt = (PKGDTENTRY)MmAllocateMemoryWithType(NumPages * MM_PAGE_SIZE, LoaderMemoryData); - - if (GdtIdt == NULL) - { - UiMessageBox("Can't allocate pages for GDT+IDT!\n"); - return; - } - - /* Zero newly prepared GDT+IDT */ - RtlZeroMemory(GdtIdt, NumPages << MM_PAGE_SHIFT); - - // Before we start mapping pages, create a block of memory, which will contain - // PDE and PTEs - if (MempAllocatePageTables() == FALSE) - { - // FIXME: bugcheck - } - - /* Map stuff like PCR, KI_USER_SHARED_DATA and Apic */ - WinLdrMapSpecialPages(); -} - - -VOID -WinLdrSetProcessorContext(void) -{ - GDTIDT GdtDesc, IdtDesc, OldIdt; - PKGDTENTRY pGdt; - PKIDTENTRY pIdt; - USHORT Ldt = 0; - ULONG Pcr; - ULONG Tss; - //ULONG i; - - Pcr = KIP0PCRADDRESS; - Tss = KSEG0_BASE | (TssBasePage << MM_PAGE_SHIFT); - - DPRINTM(DPRINT_WINDOWS, "GDtIdt %p, Pcr %p, Tss 0x%08X\n", - GdtIdt, Pcr, Tss); - - // Enable paging - //BS->ExitBootServices(ImageHandle,MapKey); - - // Disable Interrupts - _disable(); - - // Re-initalize EFLAGS - __writeeflags(0); - - // Set the PDBR - __writecr3((ULONG_PTR)PDE); - - // Enable paging by modifying CR0 - __writecr0(__readcr0() | CR0_PG); - - // Kernel expects the PCR to be zero-filled on startup - // FIXME: Why zero it here when we can zero it right after allocation? - RtlZeroMemory((PVOID)Pcr, MM_PAGE_SIZE); //FIXME: Why zero only 1 page when we allocate 2? - - // Get old values of GDT and IDT - Ke386GetGlobalDescriptorTable(&GdtDesc); - __sidt(&IdtDesc); - - // Save old IDT - OldIdt.Base = IdtDesc.Base; - OldIdt.Limit = IdtDesc.Limit; - - // Prepare new IDT+GDT - GdtDesc.Base = KSEG0_BASE | (ULONG_PTR)GdtIdt; - GdtDesc.Limit = NUM_GDT * sizeof(KGDTENTRY) - 1; - IdtDesc.Base = (ULONG)((PUCHAR)GdtDesc.Base + GdtDesc.Limit + 1); - IdtDesc.Limit = NUM_IDT * sizeof(KIDTENTRY) - 1; - - // ======================== - // Fill all descriptors now - // ======================== - - pGdt = (PKGDTENTRY)GdtDesc.Base; - pIdt = (PKIDTENTRY)IdtDesc.Base; - - // - // Code selector (0x8) - // Flat 4Gb - // - pGdt[1].LimitLow = 0xFFFF; - pGdt[1].BaseLow = 0; - pGdt[1].HighWord.Bytes.BaseMid = 0; - pGdt[1].HighWord.Bytes.Flags1 = 0x9A; - pGdt[1].HighWord.Bytes.Flags2 = 0xCF; - pGdt[1].HighWord.Bytes.BaseHi = 0; - - // - // Data selector (0x10) - // Flat 4Gb - // - pGdt[2].LimitLow = 0xFFFF; - pGdt[2].BaseLow = 0; - pGdt[2].HighWord.Bytes.BaseMid = 0; - pGdt[2].HighWord.Bytes.Flags1 = 0x92; - pGdt[2].HighWord.Bytes.Flags2 = 0xCF; - pGdt[2].HighWord.Bytes.BaseHi = 0; - - // - // Selector (0x18) - // Flat 2Gb - // - pGdt[3].LimitLow = 0xFFFF; - pGdt[3].BaseLow = 0; - pGdt[3].HighWord.Bytes.BaseMid = 0; - pGdt[3].HighWord.Bytes.Flags1 = 0xFA; - pGdt[3].HighWord.Bytes.Flags2 = 0xCF; - pGdt[3].HighWord.Bytes.BaseHi = 0; - - // - // Selector (0x20) - // Flat 2Gb - // - pGdt[4].LimitLow = 0xFFFF; - pGdt[4].BaseLow = 0; - pGdt[4].HighWord.Bytes.BaseMid = 0; - pGdt[4].HighWord.Bytes.Flags1 = 0xF2; - pGdt[4].HighWord.Bytes.Flags2 = 0xCF; - pGdt[4].HighWord.Bytes.BaseHi = 0; - - // - // TSS Selector (0x28) - // - pGdt[5].LimitLow = 0x78-1; //FIXME: Check this - pGdt[5].BaseLow = (USHORT)(Tss & 0xffff); - pGdt[5].HighWord.Bytes.BaseMid = (UCHAR)((Tss >> 16) & 0xff); - pGdt[5].HighWord.Bytes.Flags1 = 0x89; - pGdt[5].HighWord.Bytes.Flags2 = 0x00; - pGdt[5].HighWord.Bytes.BaseHi = (UCHAR)((Tss >> 24) & 0xff); - - // - // PCR Selector (0x30) - // - pGdt[6].LimitLow = 0x01; - pGdt[6].BaseLow = (USHORT)(Pcr & 0xffff); - pGdt[6].HighWord.Bytes.BaseMid = (UCHAR)((Pcr >> 16) & 0xff); - pGdt[6].HighWord.Bytes.Flags1 = 0x92; - pGdt[6].HighWord.Bytes.Flags2 = 0xC0; - pGdt[6].HighWord.Bytes.BaseHi = (UCHAR)((Pcr >> 24) & 0xff); - - // - // Selector (0x38) - // - pGdt[7].LimitLow = 0xFFFF; - pGdt[7].BaseLow = 0; - pGdt[7].HighWord.Bytes.BaseMid = 0; - pGdt[7].HighWord.Bytes.Flags1 = 0xF3; - pGdt[7].HighWord.Bytes.Flags2 = 0x40; - pGdt[7].HighWord.Bytes.BaseHi = 0; - - // - // Some BIOS stuff (0x40) - // - pGdt[8].LimitLow = 0xFFFF; - pGdt[8].BaseLow = 0x400; - pGdt[8].HighWord.Bytes.BaseMid = 0; - pGdt[8].HighWord.Bytes.Flags1 = 0xF2; - pGdt[8].HighWord.Bytes.Flags2 = 0x0; - pGdt[8].HighWord.Bytes.BaseHi = 0; - - // - // Selector (0x48) - // - pGdt[9].LimitLow = 0; - pGdt[9].BaseLow = 0; - pGdt[9].HighWord.Bytes.BaseMid = 0; - pGdt[9].HighWord.Bytes.Flags1 = 0; - pGdt[9].HighWord.Bytes.Flags2 = 0; - pGdt[9].HighWord.Bytes.BaseHi = 0; - - // - // Selector (0x50) - // - pGdt[10].LimitLow = 0xFFFF; //FIXME: Not correct! - pGdt[10].BaseLow = 0; - pGdt[10].HighWord.Bytes.BaseMid = 0x2; - pGdt[10].HighWord.Bytes.Flags1 = 0x89; - pGdt[10].HighWord.Bytes.Flags2 = 0; - pGdt[10].HighWord.Bytes.BaseHi = 0; - - // - // Selector (0x58) - // - pGdt[11].LimitLow = 0xFFFF; - pGdt[11].BaseLow = 0; - pGdt[11].HighWord.Bytes.BaseMid = 0x2; - pGdt[11].HighWord.Bytes.Flags1 = 0x9A; - pGdt[11].HighWord.Bytes.Flags2 = 0; - pGdt[11].HighWord.Bytes.BaseHi = 0; - - // - // Selector (0x60) - // - pGdt[12].LimitLow = 0xFFFF; - pGdt[12].BaseLow = 0; //FIXME: Maybe not correct, but noone cares - pGdt[12].HighWord.Bytes.BaseMid = 0x2; - pGdt[12].HighWord.Bytes.Flags1 = 0x92; - pGdt[12].HighWord.Bytes.Flags2 = 0; - pGdt[12].HighWord.Bytes.BaseHi = 0; - - // - // Video buffer Selector (0x68) - // - pGdt[13].LimitLow = 0x3FFF; - pGdt[13].BaseLow = 0x8000; - pGdt[13].HighWord.Bytes.BaseMid = 0x0B; - pGdt[13].HighWord.Bytes.Flags1 = 0x92; - pGdt[13].HighWord.Bytes.Flags2 = 0; - pGdt[13].HighWord.Bytes.BaseHi = 0; - - // - // Points to GDT (0x70) - // - pGdt[14].LimitLow = NUM_GDT*sizeof(KGDTENTRY) - 1; - pGdt[14].BaseLow = 0x7000; - pGdt[14].HighWord.Bytes.BaseMid = 0xFF; - pGdt[14].HighWord.Bytes.Flags1 = 0x92; - pGdt[14].HighWord.Bytes.Flags2 = 0; - pGdt[14].HighWord.Bytes.BaseHi = 0xFF; - - // - // Some unused descriptors should go here - // - - // Copy the old IDT - RtlCopyMemory(pIdt, (PVOID)OldIdt.Base, OldIdt.Limit + 1); - - // Mask interrupts - //asm("cli\n"); // they are already masked before enabling paged mode - - // Load GDT+IDT - Ke386SetGlobalDescriptorTable(&GdtDesc); - __lidt(&IdtDesc); - - // Jump to proper CS and clear prefetch queue -#if defined(__GNUC__) - asm("ljmp $0x08, $1f\n" - "1:\n"); -#elif defined(_MSC_VER) - /* We can't express the above in MASM so we use this far return instead */ - __asm - { - push 8 - push offset resume - retf - resume: - }; -#else -#error -#endif - - // Set SS selector - Ke386SetSs(0x10); // DataSelector=0x10 - - // Set DS and ES selectors - Ke386SetDs(0x10); - Ke386SetEs(0x10); // this is vital for rep stosd - - // LDT = not used ever, thus set to 0 - Ke386SetLocalDescriptorTable(Ldt); - - // Load TSR - Ke386SetTr(KGDT_TSS); - - // Clear GS - Ke386SetGs(0); - - // Set FS to PCR - Ke386SetFs(0x30); - - // Real end of the function, just for information - /* do not uncomment! - pop edi; - pop esi; - pop ebx; - mov esp, ebp; - pop ebp; - ret - */ -} - -#if DBG -VOID -MempDump() -{ - ULONG *PDE_Addr=(ULONG *)PDE;//0xC0300000; - int i, j; - - DPRINTM(DPRINT_WINDOWS, "\nPDE\n"); - - for (i=0; i<128; i++) - { - DPRINTM(DPRINT_WINDOWS, "0x%04X | ", i*8); - - for (j=0; j<8; j++) - { - DPRINTM(DPRINT_WINDOWS, "0x%08X ", PDE_Addr[i*8+j]); - } - - DPRINTM(DPRINT_WINDOWS, "\n"); - } -} -#endif - Modified: trunk/reactos/boot/freeldr/freeldr/cmdline.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/cmdli…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/cmdline.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/cmdline.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -21,14 +21,14 @@ CmdLineParse(IN PCHAR CmdLine) { PCHAR End, Setting; - ULONG Length, Offset = 0; + ULONG_PTR Length, Offset = 0; // // Set defaults // CmdLineInfo.DefaultOperatingSystem = NULL; CmdLineInfo.TimeOut = -1; - + // // Get timeout // @@ -49,14 +49,14 @@ Setting += sizeof("defaultos=") + sizeof(ANSI_NULL); End = strstr(Setting, " "); if (End) Length = End - Setting; else Length = sizeof(DefaultOs); - + // // Copy the default OS // strncpy(DefaultOs, Setting, Length); CmdLineInfo.DefaultOperatingSystem = DefaultOs; } - + // // Get ramdisk base address // @@ -66,7 +66,7 @@ sizeof(ANSI_NULL), NULL, 0); - + // // Get ramdisk size // Modified: trunk/reactos/boot/freeldr/freeldr/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/debug…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/debug.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -32,15 +32,13 @@ #if defined (DEBUG_ALL) ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_MEMORY | DPRINT_FILESYSTEM | DPRINT_UI | DPRINT_DISK | DPRINT_CACHE | DPRINT_REACTOS | - DPRINT_LINUX | DPRINT_HWDETECT | DPRINT_PELOADER; + DPRINT_LINUX | DPRINT_HWDETECT | DPRINT_PELOADER | DPRINT_WINDOWS; #elif defined (DEBUG_INIFILE) ULONG DebugPrintMask = DPRINT_INIFILE; #elif defined (DEBUG_REACTOS) ULONG DebugPrintMask = DPRINT_REACTOS | DPRINT_REGISTRY; #elif defined (DEBUG_CUSTOM) -ULONG DebugPrintMask = DPRINT_WARNING | - DPRINT_UI | DPRINT_CACHE | DPRINT_REACTOS | - DPRINT_LINUX; +ULONG DebugPrintMask = DPRINT_WARNING | DPRINT_WINDOWS; #else //#elif defined (DEBUG_NONE) ULONG DebugPrintMask = 0; #endif Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -41,8 +41,7 @@ <file>xboxmem.c</file> <file>xboxrtc.c</file> <file>xboxvideo.c</file> - <file>ntsetup.c</file> - <file>wlmemory.c</file> + <file>winldr.c</file> </if> </directory> <directory name="powerpc"> @@ -71,8 +70,7 @@ <if property="ARCH" value="amd64"> <directory name="amd64"> <file>loader.c</file> - <file>ntsetup.c</file> - <file>wlmemory.c</file> + <file>winldr.c</file> </directory> <directory name="i386"> <file>hardware.c</file> @@ -93,7 +91,7 @@ <if property="ARCH" value="arm"> <directory name="arm"> - <file>wlmemory.c</file> + <file>winldr.c</file> </directory> </if> </directory> Modified: trunk/reactos/boot/freeldr/freeldr/fs/ext2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/ex…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/ext2.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -118,7 +118,7 @@ PEXT2_FILE_INFO FileHandle; CHAR SymLinkPath[EXT2_NAME_LEN]; CHAR FullPath[EXT2_NAME_LEN * 2]; - ULONG Index; + ULONG_PTR Index; DPRINTM(DPRINT_FILESYSTEM, "Ext2OpenFile() FileName = %s\n", FileName); Modified: trunk/reactos/boot/freeldr/freeldr/fs/fat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fa…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/fat.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/fat.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -650,7 +650,7 @@ { ULONG EntryCount; ULONG CurrentEntry; - ULONG FileNameLen; + SIZE_T FileNameLen; FATX_DIRENTRY OurDirEntry; PFATX_DIRENTRY DirEntry = &OurDirEntry; Modified: trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/fs/ext2.h [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -183,7 +183,7 @@ #define LOG2_BLOCK_SIZE(sb) (sb->log2_block_size + 10) /* The size of an ext2 block in bytes. */ -#define EXT2_BLOCK_SIZE(sb) (1 << LOG2_BLOCK_SIZE(sb)) +#define EXT2_BLOCK_SIZE(sb) (((SIZE_T)1) << LOG2_BLOCK_SIZE(sb)) /* The revision level. */ #define EXT2_REVISION(sb) (sb->revision_level) Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/mm.h [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -117,7 +117,7 @@ PVOID MmAllocateMemoryAtAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); PVOID MmAllocateHighestMemoryBelowAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_MEMORY MemoryType); -PVOID MmHeapAlloc(ULONG MemorySize); +PVOID MmHeapAlloc(SIZE_T MemorySize); VOID MmHeapFree(PVOID MemoryPointer); #define ExAllocatePool(pool, size) MmHeapAlloc(size) Modified: trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inffi…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/inffile/inffile.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -320,7 +320,7 @@ if (Line->Key != NULL) return NULL; - Line->Key = (PCHAR)MmHeapAlloc (strlen (Key) + 1); + Line->Key = MmHeapAlloc(strlen(Key) + 1); if (Line->Key == NULL) return NULL; @@ -431,7 +431,7 @@ /* push data from current token start up to pos into the current token */ static int push_token( struct parser *parser, const CHAR *pos ) { - unsigned int len = pos - parser->start; + SIZE_T len = pos - parser->start; const CHAR *src = parser->start; CHAR *dst = parser->token + parser->token_len; Modified: trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inifi…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/inifile/inifile.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -93,7 +93,7 @@ return 0; // Return the size of the string plus 1 for the null-terminator - return (strlen(SectionItem->ItemName) + 1); + return (ULONG)(strlen(SectionItem->ItemName) + 1); } ULONG IniGetSectionSettingValueSize(ULONG_PTR SectionId, ULONG SettingIndex) @@ -106,7 +106,7 @@ return 0; // Return the size of the string plus 1 for the null-terminator - return (strlen(SectionItem->ItemValue) + 1); + return (ULONG)(strlen(SectionItem->ItemValue) + 1); } BOOLEAN IniReadSettingByNumber(ULONG_PTR SectionId, ULONG SettingNumber, PCHAR SettingName, ULONG NameSize, PCHAR SettingValue, ULONG ValueSize) Modified: trunk/reactos/boot/freeldr/freeldr/reactos/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/registry.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -27,774 +27,731 @@ VOID RegInitializeRegistry (VOID) { - /* Create root key */ - RootKey = (FRLDRHKEY) MmHeapAlloc (sizeof(KEY)); - - InitializeListHead (&RootKey->SubKeyList); - InitializeListHead (&RootKey->ValueList); - InitializeListHead (&RootKey->KeyList); - - RootKey->SubKeyCount = 0; - RootKey->ValueCount = 0; - - RootKey->NameSize = 4; - RootKey->Name = MmHeapAlloc (4); - wcscpy (RootKey->Name, L"\\"); - - RootKey->DataType = 0; - RootKey->DataSize = 0; - RootKey->Data = NULL; - - /* Create 'SYSTEM' key */ - RegCreateKey (RootKey, - L"Registry\\Machine\\SYSTEM", - NULL); + /* Create root key */ + RootKey = MmHeapAlloc(sizeof(KEY)); + + InitializeListHead(&RootKey->SubKeyList); + InitializeListHead(&RootKey->ValueList); + InitializeListHead(&RootKey->KeyList); + + RootKey->SubKeyCount = 0; + RootKey->ValueCount = 0; + + RootKey->NameSize = 4; + RootKey->Name = MmHeapAlloc(4); + wcscpy (RootKey->Name, L"\\"); + + RootKey->DataType = 0; + RootKey->DataSize = 0; + RootKey->Data = NULL; + + /* Create 'SYSTEM' key */ + RegCreateKey (RootKey, + L"Registry\\Machine\\SYSTEM", + NULL); } LONG RegInitCurrentControlSet(BOOLEAN LastKnownGood) { - WCHAR ControlSetKeyName[80]; - FRLDRHKEY SelectKey; - FRLDRHKEY SystemKey; - FRLDRHKEY ControlSetKey; - FRLDRHKEY LinkKey; - ULONG CurrentSet = 0; - ULONG DefaultSet = 0; - ULONG LastKnownGoodSet = 0; - ULONG DataSize; - LONG Error; - - Error = RegOpenKey(NULL, - L"\\Registry\\Machine\\SYSTEM\\Select", - &SelectKey); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegOpenKey() failed (Error %u)\n", (int)Error); - return(Error); - } - - DataSize = sizeof(ULONG); - Error = RegQueryValue(SelectKey, - L"Default", - NULL, - (PUCHAR)&DefaultSet, - &DataSize); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegQueryValue('Default') failed (Error %u)\n", (int)Error); - return(Error); - } - - DataSize = sizeof(ULONG); - Error = RegQueryValue(SelectKey, - L"LastKnownGood", - NULL, - (PUCHAR)&LastKnownGoodSet, - &DataSize); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegQueryValue('Default') failed (Error %u)\n", (int)Error); - return(Error); - } - - CurrentSet = (LastKnownGood == TRUE) ? LastKnownGoodSet : DefaultSet; - wcscpy(ControlSetKeyName, L"ControlSet"); - switch(CurrentSet) - { - case 1: - wcscat(ControlSetKeyName, L"001"); - break; - case 2: - wcscat(ControlSetKeyName, L"002"); - break; - case 3: - wcscat(ControlSetKeyName, L"003"); - break; - case 4: - wcscat(ControlSetKeyName, L"004"); - break; - case 5: - wcscat(ControlSetKeyName, L"005"); - break; - } - - Error = RegOpenKey(NULL, - L"\\Registry\\Machine\\SYSTEM", - &SystemKey); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegOpenKey(SystemKey) failed (Error %u)\n", (int)Error); - return(Error); - } - - Error = RegOpenKey(SystemKey, - ControlSetKeyName, - &ControlSetKey); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegOpenKey(ControlSetKey) failed (Error %u)\n", (int)Error); - return(Error); - } - - Error = RegCreateKey(SystemKey, - L"CurrentControlSet", - &LinkKey); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegCreateKey(LinkKey) failed (Error %u)\n", (int)Error); - return(Error); - } - - Error = RegSetValue(LinkKey, - NULL, - REG_LINK, - (PCHAR)&ControlSetKey, - sizeof(PVOID)); - if (Error != ERROR_SUCCESS) - { - DPRINTM(DPRINT_REGISTRY, "RegSetValue(LinkKey) failed (Error %u)\n", (int)Error); - return(Error); - } - - return(ERROR_SUCCESS); + WCHAR ControlSetKeyName[80]; + FRLDRHKEY SelectKey; + FRLDRHKEY SystemKey; + FRLDRHKEY ControlSetKey; + FRLDRHKEY LinkKey; + ULONG CurrentSet = 0; + ULONG DefaultSet = 0; + ULONG LastKnownGoodSet = 0; + ULONG DataSize; + LONG Error; + + Error = RegOpenKey(NULL, + L"\\Registry\\Machine\\SYSTEM\\Select", + &SelectKey); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegOpenKey() failed (Error %u)\n", (int)Error); + return Error; + } + + DataSize = sizeof(ULONG); + Error = RegQueryValue(SelectKey, + L"Default", + NULL, + (PUCHAR)&DefaultSet, + &DataSize); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegQueryValue('Default') failed (Error %u)\n", (int)Error); + return Error; + } + + DataSize = sizeof(ULONG); + Error = RegQueryValue(SelectKey, + L"LastKnownGood", + NULL, + (PUCHAR)&LastKnownGoodSet, + &DataSize); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegQueryValue('Default') failed (Error %u)\n", (int)Error); + return Error; + } + + CurrentSet = (LastKnownGood == TRUE) ? LastKnownGoodSet : DefaultSet; + wcscpy(ControlSetKeyName, L"ControlSet"); + switch(CurrentSet) + { + case 1: + wcscat(ControlSetKeyName, L"001"); + break; + case 2: + wcscat(ControlSetKeyName, L"002"); + break; + case 3: + wcscat(ControlSetKeyName, L"003"); + break; + case 4: + wcscat(ControlSetKeyName, L"004"); + break; + case 5: + wcscat(ControlSetKeyName, L"005"); + break; + } + + Error = RegOpenKey(NULL, + L"\\Registry\\Machine\\SYSTEM", + &SystemKey); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegOpenKey(SystemKey) failed (Error %lu)\n", Error); + return Error; + } + + Error = RegOpenKey(SystemKey, + ControlSetKeyName, + &ControlSetKey); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegOpenKey(ControlSetKey) failed (Error %lu)\n", Error); + return Error; + } + + Error = RegCreateKey(SystemKey, + L"CurrentControlSet", + &LinkKey); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegCreateKey(LinkKey) failed (Error %lu)\n", Error); + return Error; + } + + Error = RegSetValue(LinkKey, + NULL, + REG_LINK, + (PCHAR)&ControlSetKey, + sizeof(PVOID)); + if (Error != ERROR_SUCCESS) + { + DPRINTM(DPRINT_REGISTRY, "RegSetValue(LinkKey) failed (Error %lu)\n", Error); + return Error; + } + + return ERROR_SUCCESS; } LONG RegCreateKey(FRLDRHKEY ParentKey, - PCWSTR KeyName, - PFRLDRHKEY Key) -{ - PLIST_ENTRY Ptr; - FRLDRHKEY SearchKey = NULL; - FRLDRHKEY CurrentKey; - FRLDRHKEY NewKey; - PWCHAR p; - PCWSTR name; - int subkeyLength; - int stringLength; - ULONG NameSize; - int CmpResult; - - DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); - - if (*KeyName == L'\\') - { - KeyName++; - CurrentKey = RootKey; - } - else if (ParentKey == NULL) - { - CurrentKey = RootKey; - } - else - { - CurrentKey = ParentKey; - } - - /* Check whether current key is a link */ - if (CurrentKey->DataType == REG_LINK) - { - CurrentKey = (FRLDRHKEY)CurrentKey->Data; - } - - while (*KeyName != 0) - { - DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); - - if (*KeyName == L'\\') - KeyName++; - p = wcschr(KeyName, L'\\'); - if ((p != NULL) && (p != KeyName)) - { - subkeyLength = p - KeyName; - stringLength = subkeyLength + 1; - name = KeyName; - } - else - { - subkeyLength = wcslen(KeyName); - stringLength = subkeyLength; - name = KeyName; - } - NameSize = (subkeyLength + 1) * sizeof(WCHAR); - - Ptr = CurrentKey->SubKeyList.Flink; - CmpResult = 1; - while (Ptr != &CurrentKey->SubKeyList) - { - DPRINTM(DPRINT_REGISTRY, "Ptr 0x%x\n", Ptr); - - SearchKey = CONTAINING_RECORD(Ptr, - KEY, - KeyList); - DPRINTM(DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey); - DPRINTM(DPRINT_REGISTRY, "Searching '%S'\n", SearchKey->Name); - CmpResult = _wcsnicmp(SearchKey->Name, name, subkeyLength); - if (CmpResult == 0 && SearchKey->NameSize == NameSize) - break; - else if (CmpResult == -1) - break; - - Ptr = Ptr->Flink; - } - - if (CmpResult != 0) - { - /* no key found -> create new subkey */ - NewKey = (FRLDRHKEY)MmHeapAlloc(sizeof(KEY)); - if (NewKey == NULL) - return(ERROR_OUTOFMEMORY); - - InitializeListHead(&NewKey->SubKeyList); - InitializeListHead(&NewKey->ValueList); - - NewKey->SubKeyCount = 0; - NewKey->ValueCount = 0; - - NewKey->DataType = 0; - NewKey->DataSize = 0; - NewKey->Data = NULL; - - InsertTailList(Ptr, &NewKey->KeyList); - CurrentKey->SubKeyCount++; - - NewKey->NameSize = NameSize; - NewKey->Name = (PWCHAR)MmHeapAlloc(NewKey->NameSize); - if (NewKey->Name == NULL) - return(ERROR_OUTOFMEMORY); - memcpy(NewKey->Name, name, NewKey->NameSize - sizeof(WCHAR)); - NewKey->Name[subkeyLength] = 0; - - DPRINTM(DPRINT_REGISTRY, "NewKey 0x%x\n", NewKey); - DPRINTM(DPRINT_REGISTRY, "NewKey '%S' Length %d\n", NewKey->Name, NewKey->NameSize); - - CurrentKey = NewKey; - } - else - { - CurrentKey = SearchKey; - - /* Check whether current key is a link */ - if (CurrentKey->DataType == REG_LINK) - { - CurrentKey = (FRLDRHKEY)CurrentKey->Data; - } - } - - KeyName = KeyName + stringLength; - } - - if (Key != NULL) - *Key = CurrentKey; - - return(ERROR_SUCCESS); + PCWSTR KeyName, + PFRLDRHKEY Key) +{ + PLIST_ENTRY Ptr; + FRLDRHKEY SearchKey = NULL; + FRLDRHKEY CurrentKey; + FRLDRHKEY NewKey; + PWCHAR p; + PCWSTR name; + int subkeyLength; + int stringLength; + ULONG NameSize; + int CmpResult; + + DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); + + if (*KeyName == L'\\') + { + KeyName++; + CurrentKey = RootKey; + } + else if (ParentKey == NULL) + { + CurrentKey = RootKey; + } + else + { + CurrentKey = ParentKey; + } + + /* Check whether current key is a link */ + if (CurrentKey->DataType == REG_LINK) + { + CurrentKey = (FRLDRHKEY)CurrentKey->Data; + } + + while (*KeyName != 0) + { + DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); + + if (*KeyName == L'\\') + KeyName++; + p = wcschr(KeyName, L'\\'); + if ((p != NULL) && (p != KeyName)) + { + subkeyLength = p - KeyName; + stringLength = subkeyLength + 1; + name = KeyName; + } + else + { + subkeyLength = wcslen(KeyName); + stringLength = subkeyLength; + name = KeyName; + } + NameSize = (subkeyLength + 1) * sizeof(WCHAR); + + Ptr = CurrentKey->SubKeyList.Flink; + CmpResult = 1; + while (Ptr != &CurrentKey->SubKeyList) + { + DPRINTM(DPRINT_REGISTRY, "Ptr 0x%x\n", Ptr); + + SearchKey = CONTAINING_RECORD(Ptr, KEY, KeyList); + DPRINTM(DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey); + DPRINTM(DPRINT_REGISTRY, "Searching '%S'\n", SearchKey->Name); + CmpResult = _wcsnicmp(SearchKey->Name, name, subkeyLength); + + if (CmpResult == 0 && SearchKey->NameSize == NameSize) break; + else if (CmpResult == -1) break; + + Ptr = Ptr->Flink; + } + + if (CmpResult != 0) + { + /* no key found -> create new subkey */ + NewKey = MmHeapAlloc(sizeof(KEY)); + if (NewKey == NULL) return ERROR_OUTOFMEMORY; + + InitializeListHead(&NewKey->SubKeyList); + InitializeListHead(&NewKey->ValueList); + + NewKey->SubKeyCount = 0; + NewKey->ValueCount = 0; + + NewKey->DataType = 0; + NewKey->DataSize = 0; + NewKey->Data = NULL; + + InsertTailList(Ptr, &NewKey->KeyList); + CurrentKey->SubKeyCount++; + + NewKey->NameSize = NameSize; + NewKey->Name = (PWCHAR)MmHeapAlloc(NewKey->NameSize); + if (NewKey->Name == NULL) return ERROR_OUTOFMEMORY; + + memcpy(NewKey->Name, name, NewKey->NameSize - sizeof(WCHAR)); + NewKey->Name[subkeyLength] = 0; + + DPRINTM(DPRINT_REGISTRY, "NewKey 0x%x\n", NewKey); + DPRINTM(DPRINT_REGISTRY, "NewKey '%S' Length %d\n", NewKey->Name, NewKey->NameSize); + + CurrentKey = NewKey; + } + else + { + CurrentKey = SearchKey; + + /* Check whether current key is a link */ + if (CurrentKey->DataType == REG_LINK) + { + CurrentKey = (FRLDRHKEY)CurrentKey->Data; + } + } + + KeyName = KeyName + stringLength; + } + + if (Key != NULL) *Key = CurrentKey; + + return ERROR_SUCCESS; } LONG RegDeleteKey(FRLDRHKEY Key, - PCWSTR Name) -{ - - - if (wcschr(Name, L'\\') != NULL) - return(ERROR_INVALID_PARAMETER); - - - - return(ERROR_SUCCESS); + PCWSTR Name) +{ + + if (wcschr(Name, L'\\') != NULL) return ERROR_INVALID_PARAMETER; + + return ERROR_SUCCESS; } LONG RegEnumKey(FRLDRHKEY Key, - ULONG Index, - PWCHAR Name, - ULONG* NameSize) -{ - PLIST_ENTRY Ptr; - FRLDRHKEY SearchKey; - ULONG Count = 0; - ULONG Size; - - Ptr = Key->SubKeyList.Flink; - while (Ptr != &Key->SubKeyList) - { - if (Index == Count) - break; - - Count++; - Ptr = Ptr->Flink; - } - - if (Ptr == &Key->SubKeyList) - return(ERROR_NO_MORE_ITEMS); - - SearchKey = CONTAINING_RECORD(Ptr, - KEY, - KeyList); - - DPRINTM(DPRINT_REGISTRY, "Name '%S' Length %d\n", SearchKey->Name, SearchKey->NameSize); - - Size = min(SearchKey->NameSize, *NameSize); - *NameSize = Size; - memcpy(Name, SearchKey->Name, Size); - - return(ERROR_SUCCESS); + ULONG Index, + PWCHAR Name, + ULONG* NameSize) +{ + PLIST_ENTRY Ptr; + FRLDRHKEY SearchKey; + ULONG Count = 0; + ULONG Size; + + Ptr = Key->SubKeyList.Flink; + while (Ptr != &Key->SubKeyList) + { + if (Index == Count) break; + + Count++; + Ptr = Ptr->Flink; + } + + if (Ptr == &Key->SubKeyList) return ERROR_NO_MORE_ITEMS; + + SearchKey = CONTAINING_RECORD(Ptr, KEY, KeyList); + + DPRINTM(DPRINT_REGISTRY, "Name '%S' Length %d\n", SearchKey->Name, SearchKey->NameSize); + + Size = min(SearchKey->NameSize, *NameSize); + *NameSize = Size; + memcpy(Name, SearchKey->Name, Size); + + return ERROR_SUCCESS; } LONG RegOpenKey(FRLDRHKEY ParentKey, - PCWSTR KeyName, - PFRLDRHKEY Key) -{ - PLIST_ENTRY Ptr; - FRLDRHKEY SearchKey = NULL; - FRLDRHKEY CurrentKey; - PWCHAR p; - PCWSTR name; - int subkeyLength; - int stringLength; - ULONG NameSize; - - DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); - - *Key = NULL; - - if (*KeyName == L'\\') - { - KeyName++; - CurrentKey = RootKey; - } - else if (ParentKey == NULL) - { - CurrentKey = RootKey; - } - else - { - CurrentKey = ParentKey; - } - - /* Check whether current key is a link */ - if (CurrentKey->DataType == REG_LINK) - { - CurrentKey = (FRLDRHKEY)CurrentKey->Data; - } - - while (*KeyName != 0) - { - DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); - - if (*KeyName == L'\\') - KeyName++; - p = wcschr(KeyName, L'\\'); - if ((p != NULL) && (p != KeyName)) - { - subkeyLength = p - KeyName; - stringLength = subkeyLength + 1; - name = KeyName; - } - else - { - subkeyLength = wcslen(KeyName); - stringLength = subkeyLength; - name = KeyName; - } - NameSize = (subkeyLength + 1) * sizeof(WCHAR); - - Ptr = CurrentKey->SubKeyList.Flink; - while (Ptr != &CurrentKey->SubKeyList) - { - DPRINTM(DPRINT_REGISTRY, "Ptr 0x%x\n", Ptr); - - SearchKey = CONTAINING_RECORD(Ptr, - KEY, - KeyList); - - DPRINTM(DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey); - DPRINTM(DPRINT_REGISTRY, "Searching '%S'\n", SearchKey->Name); - - if (SearchKey->NameSize == NameSize && - _wcsnicmp(SearchKey->Name, name, subkeyLength) == 0) - break; - - Ptr = Ptr->Flink; - } - - if (Ptr == &CurrentKey->SubKeyList) - { - return(ERROR_PATH_NOT_FOUND); - } - else - { - CurrentKey = SearchKey; - - /* Check whether current key is a link */ - if (CurrentKey->DataType == REG_LINK) - { - CurrentKey = (FRLDRHKEY)CurrentKey->Data; - } - } - - KeyName = KeyName + stringLength; - } - - if (Key != NULL) - *Key = CurrentKey; - - return(ERROR_SUCCESS); + PCWSTR KeyName, + PFRLDRHKEY Key) +{ + PLIST_ENTRY Ptr; + FRLDRHKEY SearchKey = NULL; + FRLDRHKEY CurrentKey; + PWCHAR p; + PCWSTR name; + int subkeyLength; + int stringLength; + ULONG NameSize; + + DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); + + *Key = NULL; + + if (*KeyName == L'\\') + { + KeyName++; + CurrentKey = RootKey; + } + else if (ParentKey == NULL) + { + CurrentKey = RootKey; + } + else + { + CurrentKey = ParentKey; + } + + /* Check whether current key is a link */ + if (CurrentKey->DataType == REG_LINK) + { + CurrentKey = (FRLDRHKEY)CurrentKey->Data; + } + + while (*KeyName != 0) + { + DPRINTM(DPRINT_REGISTRY, "KeyName '%S'\n", KeyName); + + if (*KeyName == L'\\') KeyName++; + p = wcschr(KeyName, L'\\'); + if ((p != NULL) && (p != KeyName)) + { + subkeyLength = p - KeyName; + stringLength = subkeyLength + 1; + name = KeyName; + } + else + { + subkeyLength = wcslen(KeyName); + stringLength = subkeyLength; + name = KeyName; + } + NameSize = (subkeyLength + 1) * sizeof(WCHAR); + + Ptr = CurrentKey->SubKeyList.Flink; + while (Ptr != &CurrentKey->SubKeyList) + { + DPRINTM(DPRINT_REGISTRY, "Ptr 0x%x\n", Ptr); + + SearchKey = CONTAINING_RECORD(Ptr, KEY, KeyList); + + DPRINTM(DPRINT_REGISTRY, "SearchKey 0x%x\n", SearchKey); + DPRINTM(DPRINT_REGISTRY, "Searching '%S'\n", SearchKey->Name); + + if (SearchKey->NameSize == NameSize && + _wcsnicmp(SearchKey->Name, name, subkeyLength) == 0) break; + + Ptr = Ptr->Flink; + } + + if (Ptr == &CurrentKey->SubKeyList) + { + return ERROR_PATH_NOT_FOUND; + } + else + { + CurrentKey = SearchKey; + + /* Check whether current key is a link */ + if (CurrentKey->DataType == REG_LINK) + { + CurrentKey = (FRLDRHKEY)CurrentKey->Data; + } + } + + KeyName = KeyName + stringLength; + } + + if (Key != NULL) + *Key = CurrentKey; + + return ERROR_SUCCESS; } LONG RegSetValue(FRLDRHKEY Key, - PCWSTR ValueName, - ULONG Type, - PCSTR Data, - ULONG DataSize) -{ - PLIST_ENTRY Ptr; - PVALUE Value = NULL; - - DPRINTM(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)) - { - /* set default value */ - if ((Key->Data != NULL) && (Key->DataSize > sizeof(PUCHAR))) - { - MmHeapFree(Key->Data); - } - - if (DataSize <= sizeof(PUCHAR)) - { - Key->DataSize = DataSize; - Key->DataType = Type; - memcpy(&Key->Data, Data, DataSize); - } - else - { - Key->Data = MmHeapAlloc(DataSize); - Key->DataSize = DataSize; - Key->DataType = Type; - memcpy(Key->Data, Data, DataSize); - } - } - else - { - /* set non-default value */ - Ptr = Key->ValueList.Flink; - while (Ptr != &Key->ValueList) - { - Value = CONTAINING_RECORD(Ptr, - VALUE, - ValueList); - - DPRINTM(DPRINT_REGISTRY, "Value->Name '%S'\n", Value->Name); - - if (_wcsicmp(Value->Name, ValueName) == 0) - break; - - Ptr = Ptr->Flink; - } - - if (Ptr == &Key->ValueList) - { - /* add new value */ - DPRINTM(DPRINT_REGISTRY, "No value found - adding new value\n"); - - Value = (PVALUE)MmHeapAlloc(sizeof(VALUE)); - if (Value == NULL) - return(ERROR_OUTOFMEMORY); - - InsertTailList(&Key->ValueList, &Value->ValueList); - Key->ValueCount++; - - Value->NameSize = (wcslen(ValueName)+1)*sizeof(WCHAR); - Value->Name = (PWCHAR)MmHeapAlloc(Value->NameSize); - if (Value->Name == NULL) - return(ERROR_OUTOFMEMORY); - wcscpy(Value->Name, ValueName); - Value->DataType = REG_NONE; - Value->DataSize = 0; - Value->Data = NULL; - } - - /* set new value */ - if ((Value->Data != NULL) && (Value->DataSize > sizeof(PUCHAR))) - { - MmHeapFree(Value->Data); - } - - if (DataSize <= sizeof(PUCHAR)) - { - Value->DataSize = DataSize; - Value->DataType = Type; - memcpy(&Value->Data, Data, DataSize); - } - else - { - Value->Data = MmHeapAlloc(DataSize); - if (Value->Data == NULL) - return(ERROR_OUTOFMEMORY); - Value->DataType = Type; - Value->DataSize = DataSize; - memcpy(Value->Data, Data, DataSize); - } - } - return(ERROR_SUCCESS); + PCWSTR ValueName, + ULONG Type, + PCSTR Data, + ULONG DataSize) +{ + PLIST_ENTRY Ptr; + PVALUE Value = NULL; + + DPRINTM(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)) + { + /* set default value */ + if ((Key->Data != NULL) && (Key->DataSize > sizeof(PUCHAR))) + { + MmHeapFree(Key->Data); + } + + if (DataSize <= sizeof(PUCHAR)) + { + Key->DataSize = DataSize; + Key->DataType = Type; + memcpy(&Key->Data, Data, DataSize); + } + else + { + Key->Data = MmHeapAlloc(DataSize); + Key->DataSize = DataSize; + Key->DataType = Type; + memcpy(Key->Data, Data, DataSize); + } + } + else + { + /* set non-default value */ + Ptr = Key->ValueList.Flink; + while (Ptr != &Key->ValueList) + { + Value = CONTAINING_RECORD(Ptr, VALUE, ValueList); + + DPRINTM(DPRINT_REGISTRY, "Value->Name '%S'\n", Value->Name); + + if (_wcsicmp(Value->Name, ValueName) == 0) break; + + Ptr = Ptr->Flink; + } + + if (Ptr == &Key->ValueList) + { + /* add new value */ + DPRINTM(DPRINT_REGISTRY, "No value found - adding new value\n"); + + Value = (PVALUE)MmHeapAlloc(sizeof(VALUE)); + if (Value == NULL) return ERROR_OUTOFMEMORY; + + InsertTailList(&Key->ValueList, &Value->ValueList); + Key->ValueCount++; + + Value->NameSize = (wcslen(ValueName)+1) * sizeof(WCHAR); + Value->Name = MmHeapAlloc(Value->NameSize); + if (Value->Name == NULL) return ERROR_OUTOFMEMORY; + wcscpy(Value->Name, ValueName); + Value->DataType = REG_NONE; + Value->DataSize = 0; + Value->Data = NULL; + } + + /* set new value */ + if ((Value->Data != NULL) && (Value->DataSize > sizeof(PUCHAR))) + { + MmHeapFree(Value->Data); + } + + if (DataSize <= sizeof(PUCHAR)) + { + Value->DataSize = DataSize; + Value->DataType = Type; + memcpy(&Value->Data, Data, DataSize); + } + else + { + Value->Data = MmHeapAlloc(DataSize); + if (Value->Data == NULL) return ERROR_OUTOFMEMORY; + Value->DataType = Type; + Value->DataSize = DataSize; + memcpy(Value->Data, Data, DataSize); + } + } + return(ERROR_SUCCESS); } LONG RegQueryValue(FRLDRHKEY Key, - PCWSTR ValueName, - ULONG* Type, - PUCHAR Data, - ULONG* DataSize) -{ - ULONG Size; - PLIST_ENTRY Ptr; - PVALUE Value = NULL; - - if ((ValueName == NULL) || (*ValueName == 0)) - { - /* query default value */ - if (Key->Data == NULL) - return(ERROR_INVALID_PARAMETER); - - if (Type != NULL) - *Type = Key->DataType; - if ((Data != NULL) && (DataSize != NULL)) - { - if (Key->DataSize <= sizeof(PUCHAR)) - { - Size = min(Key->DataSize, *DataSize); - memcpy(Data, &Key->Data, Size); - *DataSize = Size; - } - else - { - Size = min(Key->DataSize, *DataSize); - memcpy(Data, Key->Data, Size); - *DataSize = Size; - } - } - else if ((Data == NULL) && (DataSize != NULL)) - { - *DataSize = Key->DataSize; - } - } - else - { - /* query non-default value */ - Ptr = Key->ValueList.Flink; - while (Ptr != &Key->ValueList) - { - Value = CONTAINING_RECORD(Ptr, - VALUE, - ValueList); - - DPRINTM(DPRINT_REGISTRY, "Searching for '%S'. Value name '%S'\n", ValueName, Value->Name); - - if (_wcsicmp(Value->Name, ValueName) == 0) - break; - - Ptr = Ptr->Flink; - } - - if (Ptr == &Key->ValueList) - return(ERROR_INVALID_PARAMETER); - - if (Type != NULL) - *Type = Value->DataType; - if ((Data != NULL) && (DataSize != NULL)) - { - if (Value->DataSize <= sizeof(PUCHAR)) - { - Size = min(Value->DataSize, *DataSize); - memcpy(Data, &Value->Data, Size); - *DataSize = Size; - } - else - { - Size = min(Value->DataSize, *DataSize); - memcpy(Data, Value->Data, Size); - *DataSize = Size; - } - } - else if ((Data == NULL) && (DataSize != NULL)) - { - *DataSize = Value->DataSize; - } - } - - return(ERROR_SUCCESS); + PCWSTR ValueName, + ULONG* Type, + PUCHAR Data, + ULONG* DataSize) +{ + ULONG Size; + PLIST_ENTRY Ptr; + PVALUE Value = NULL; + + if ((ValueName == NULL) || (*ValueName == 0)) + { + /* query default value */ + if (Key->Data == NULL) return ERROR_INVALID_PARAMETER; + + if (Type != NULL) + *Type = Key->DataType; + if ((Data != NULL) && (DataSize != NULL)) + { + if (Key->DataSize <= sizeof(PUCHAR)) + { + Size = min(Key->DataSize, *DataSize); + memcpy(Data, &Key->Data, Size); + *DataSize = Size; + } + else + { + Size = min(Key->DataSize, *DataSize); + memcpy(Data, Key->Data, Size); + *DataSize = Size; + } + } + else if ((Data == NULL) && (DataSize != NULL)) + { + *DataSize = Key->DataSize; + } + } + else + { + /* query non-default value */ + Ptr = Key->ValueList.Flink; + while (Ptr != &Key->ValueList) + { + Value = CONTAINING_RECORD(Ptr, VALUE, ValueList); + + DPRINTM(DPRINT_REGISTRY, "Searching for '%S'. Value name '%S'\n", ValueName, Value->Name); + + if (_wcsicmp(Value->Name, ValueName) == 0) break; + + Ptr = Ptr->Flink; + } + + if (Ptr == &Key->ValueList) return ERROR_INVALID_PARAMETER; + + if (Type != NULL) *Type = Value->DataType; + if ((Data != NULL) && (DataSize != NULL)) + { + if (Value->DataSize <= sizeof(PUCHAR)) + { + Size = min(Value->DataSize, *DataSize); + memcpy(Data, &Value->Data, Size); + *DataSize = Size; + } + else + { + Size = min(Value->DataSize, *DataSize); + memcpy(Data, Value->Data, Size); + *DataSize = Size; + } + } + else if ((Data == NULL) && (DataSize != NULL)) + { + *DataSize = Value->DataSize; + } + } + + return ERROR_SUCCESS; } LONG RegDeleteValue(FRLDRHKEY Key, - PCWSTR ValueName) -{ - PLIST_ENTRY Ptr; - PVALUE Value = NULL; - - if ((ValueName == NULL) || (*ValueName == 0)) - { - /* delete default value */ - if (Key->Data != NULL) - MmFreeMemory(Key->Data); - Key->Data = NULL; - Key->DataSize = 0; - Key->DataType = 0; - } - else - { - /* delete non-default value */ - Ptr = Key->ValueList.Flink; - while (Ptr != &Key->ValueList) - { - Value = CONTAINING_RECORD(Ptr, - VALUE, - ValueList); - if (_wcsicmp(Value->Name, ValueName) == 0) - break; - - Ptr = Ptr->Flink; - } - - if (Ptr == &Key->ValueList) - return(ERROR_INVALID_PARAMETER); - - /* delete value */ - Key->ValueCount--; - if (Value->Name != NULL) - MmFreeMemory(Value->Name); - Value->Name = NULL; - Value->NameSize = 0; - - if (Value->DataSize > sizeof(PUCHAR)) - { - if (Value->Data != NULL) - MmFreeMemory(Value->Data); - } - Value->Data = NULL; - Value->DataSize = 0; - Value->DataType = 0; - - RemoveEntryList(&Value->ValueList); - MmFreeMemory(Value); - } - return(ERROR_SUCCESS); + PCWSTR ValueName) +{ + PLIST_ENTRY Ptr; + PVALUE Value = NULL; + + if ((ValueName == NULL) || (*ValueName == 0)) + { + /* delete default value */ + if (Key->Data != NULL) MmFreeMemory(Key->Data); + Key->Data = NULL; + Key->DataSize = 0; + Key->DataType = 0; + } + else + { + /* delete non-default value */ + Ptr = Key->ValueList.Flink; + while (Ptr != &Key->ValueList) + { + Value = CONTAINING_RECORD(Ptr, VALUE, ValueList); + if (_wcsicmp(Value->Name, ValueName) == 0) break; + + Ptr = Ptr->Flink; + } + + if (Ptr == &Key->ValueList) return ERROR_INVALID_PARAMETER; + + /* delete value */ + Key->ValueCount--; + if (Value->Name != NULL) MmFreeMemory(Value->Name); + Value->Name = NULL; + Value->NameSize = 0; + + if (Value->DataSize > sizeof(PUCHAR)) + { + if (Value->Data != NULL) MmFreeMemory(Value->Data); + } + Value->Data = NULL; + Value->DataSize = 0; + Value->DataType = 0; + + RemoveEntryList(&Value->ValueList); + MmFreeMemory(Value); + } + return ERROR_SUCCESS; } LONG RegEnumValue(FRLDRHKEY Key, - ULONG Index, - PWCHAR ValueName, - ULONG* NameSize, - ULONG* Type, - PUCHAR Data, - ULONG* DataSize) -{ - PLIST_ENTRY Ptr; - PVALUE Value; - ULONG Count = 0; - - if (Key->Data != NULL) - { - if (Index > 0) - { - Index--; - } - else - { - /* enumerate default value */ - if (ValueName != NULL) - *ValueName = 0; - if (Type != NULL) - *Type = Key->DataType; - if (Data != NULL) - { - if (Key->DataSize <= sizeof(PUCHAR)) + ULONG Index, + PWCHAR ValueName, + ULONG* NameSize, + ULONG* Type, + PUCHAR Data, + ULONG* DataSize) +{ + PLIST_ENTRY Ptr; + PVALUE Value; + ULONG Count = 0; + + if (Key->Data != NULL) + { + if (Index > 0) + { + Index--; + } + else + { + /* enumerate default value */ + if (ValueName != NULL) *ValueName = 0; + if (Type != NULL) *Type = Key->DataType; + if (Data != NULL) { - memcpy(Data, &Key->Data, min(Key->DataSize, *DataSize)); + if (Key->DataSize <= sizeof(PUCHAR)) + { + memcpy(Data, &Key->Data, min(Key->DataSize, *DataSize)); + } + else + { + memcpy(Data, Key->Data, min(Key->DataSize, *DataSize)); + } } - else - { - memcpy(Data, Key->Data, min(Key->DataSize, *DataSize)); - } - } - if (DataSize != NULL) - *DataSize = min(Key->DataSize, *DataSize); - - return(ERROR_SUCCESS); - } - } - - Ptr = Key->ValueList.Flink; - while (Ptr != &Key->ValueList) - { - if (Index == Count) - break; - - Count++; - Ptr = Ptr->Flink; - } - - if (Ptr == &Key->ValueList) - return(ERROR_NO_MORE_ITEMS); - - Value = CONTAINING_RECORD(Ptr, - VALUE, - ValueList); - - /* enumerate non-default value */ - if (ValueName != NULL) - memcpy(ValueName, Value->Name, min(Value->NameSize, *NameSize)); - if (Type != NULL) - *Type = Value->DataType; - - if (Data != NULL) - { - if (Value->DataSize <= sizeof(PUCHAR)) - { - memcpy(Data, &Value->Data, min(Value->DataSize, *DataSize)); - } - else - { - memcpy(Data, Value->Data, min(Value->DataSize, *DataSize)); - } - } - - if (DataSize != NULL) - *DataSize = min(Value->DataSize, *DataSize); - - return(ERROR_SUCCESS); + + if (DataSize != NULL) *DataSize = min(Key->DataSize, *DataSize); + + return ERROR_SUCCESS; + } + } + + Ptr = Key->ValueList.Flink; + while (Ptr != &Key->ValueList) + { + if (Index == Count) break; + + Count++; + Ptr = Ptr->Flink; + } + + if (Ptr == &Key->ValueList) return ERROR_NO_MORE_ITEMS; + + Value = CONTAINING_RECORD(Ptr, VALUE, ValueList); + + /* enumerate non-default value */ + if (ValueName != NULL) + { + memcpy(ValueName, Value->Name, min(Value->NameSize, *NameSize)); + } + if (Type != NULL) *Type = Value->DataType; + + if (Data != NULL) + { + if (Value->DataSize <= sizeof(PUCHAR)) + { + memcpy(Data, &Value->Data, min(Value->DataSize, *DataSize)); + } + else + { + memcpy(Data, Value->Data, min(Value->DataSize, *DataSize)); + } + } + + if (DataSize != NULL) *DataSize = min(Value->DataSize, *DataSize); + + return ERROR_SUCCESS; } ULONG RegGetSubKeyCount (FRLDRHKEY Key) { - return Key->SubKeyCount; + return Key->SubKeyCount; } ULONG RegGetValueCount (FRLDRHKEY Key) { - if (Key->DataSize != 0) - return Key->ValueCount + 1; - - return Key->ValueCount; + if (Key->DataSize != 0) return Key->ValueCount + 1; + + return Key->ValueCount; } /* EOF */ Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -628,7 +628,7 @@ /* Do the machine specific initialization */ WinLdrSetupMachineDependent(LoaderBlock); - /* Turn on paging mode of CPU */ + /* Map pages and create memory descriptors */ WinLdrSetupMemoryLayout(LoaderBlock); /* Save final value of LoaderPagesSpanned */ @@ -639,6 +639,9 @@ DPRINTM(DPRINT_WINDOWS, "Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n", KiSystemStartup, LoaderBlockVA); + + // Zero KI_USER_SHARED_DATA page + memset((PVOID)KI_USER_SHARED_DATA, 0, MM_PAGE_SIZE); WinLdrpDumpMemoryDescriptors(LoaderBlockVA); WinLdrpDumpBootDriver(LoaderBlockVA); Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlmemory.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -324,9 +324,6 @@ MempDump(); #endif - // Zero KI_USER_SHARED_DATA page - memset((PVOID)KI_USER_SHARED_DATA, 0, MM_PAGE_SIZE); - return TRUE; } Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] Thu Sep 1 19:01:19 2011 @@ -11,7 +11,7 @@ #include <freeldr.h> #include <debug.h> -// The only global var here, used to mark mem pages as NLS in WinLdrTurnOnPaging() +// The only global var here, used to mark mem pages as NLS in WinLdrSetupMemoryLayout() ULONG TotalNLSSize = 0; BOOLEAN WinLdrGetNLSNames(LPSTR AnsiName,
13 years, 3 months
1
0
0
0
[tkreuzer] 53525: [NTOSKRNL] Fix condition check for informing the debugger in NtMapViewOfSection Found by Amine Khaldi
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Sep 1 18:55:12 2011 New Revision: 53525 URL:
http://svn.reactos.org/svn/reactos?rev=53525&view=rev
Log: [NTOSKRNL] Fix condition check for informing the debugger in NtMapViewOfSection Found by Amine Khaldi Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Thu Sep 1 18:55:12 2011 @@ -1679,22 +1679,21 @@ AllocationType, Protect); - /* Check if this is an image for the current process */ - if ((Section->AllocationAttributes & SEC_IMAGE) && - (Process == PsGetCurrentProcess()) && - ((Status != STATUS_IMAGE_NOT_AT_BASE) || - (Status != STATUS_CONFLICTING_ADDRESSES))) - { - /* Notify the debugger */ - DbgkMapViewOfSection(Section, - SafeBaseAddress, - SafeSectionOffset.LowPart, - SafeViewSize); - } - /* Return data only on success */ if (NT_SUCCESS(Status)) { + /* Check if this is an image for the current process */ + if ((Section->AllocationAttributes & SEC_IMAGE) && + (Process == PsGetCurrentProcess()) && + (Status != STATUS_IMAGE_NOT_AT_BASE)) + { + /* Notify the debugger */ + DbgkMapViewOfSection(Section, + SafeBaseAddress, + SafeSectionOffset.LowPart, + SafeViewSize); + } + /* Enter SEH */ _SEH2_TRY {
13 years, 3 months
1
0
0
0
[tkreuzer] 53524: [HAL] Don't use enums as bitfields. MSVC doesn't handle it the way gcc does. Fixes clock initialization on MSVC builds. You would wonder how the MSVC build even worked without a c...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Sep 1 18:32:13 2011 New Revision: 53524 URL:
http://svn.reactos.org/svn/reactos?rev=53524&view=rev
Log: [HAL] Don't use enums as bitfields. MSVC doesn't handle it the way gcc does. Fixes clock initialization on MSVC builds. You would wonder how the MSVC build even worked without a clock interrupt :D Modified: trunk/reactos/hal/halx86/include/halp.h Modified: trunk/reactos/hal/halx86/include/halp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?…
============================================================================== --- trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Thu Sep 1 18:32:13 2011 @@ -161,9 +161,9 @@ struct { UCHAR BcdMode:1; - TIMER_OPERATING_MODES OperatingMode:3; - TIMER_ACCESS_MODES AccessMode:2; - TIMER_CHANNELS Channel:2; + UCHAR OperatingMode:3; + UCHAR AccessMode:2; + UCHAR Channel:2; }; UCHAR Bits; } TIMER_CONTROL_PORT_REGISTER, *PTIMER_CONTROL_PORT_REGISTER;
13 years, 3 months
1
0
0
0
[akhaldi] 53523: [USER32] * Attempt to fix the relocation issue in the rbuild build.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Sep 1 17:36:34 2011 New Revision: 53523 URL:
http://svn.reactos.org/svn/reactos?rev=53523&view=rev
Log: [USER32] * Attempt to fix the relocation issue in the rbuild build. Modified: trunk/reactos/baseaddress.rbuild Modified: trunk/reactos/baseaddress.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/baseaddress.rbuild?rev=535…
============================================================================== --- trunk/reactos/baseaddress.rbuild [iso-8859-1] (original) +++ trunk/reactos/baseaddress.rbuild [iso-8859-1] Thu Sep 1 17:36:34 2011 @@ -249,7 +249,7 @@ <property name="BASEADDRESS_ACTIVEDS" value="0x77cb0000" /> <property name="BASEADDRESS_ADVAPI32" value="0x77db0000" /> <property name="BASEADDRESS_USER32" value="0x77e70000" /> - <property name="BASEADDRESS_GDI32" value="0x77fd0000" /> + <property name="BASEADDRESS_GDI32" value="0x77ff0000" /> <property name="BASEADDRESS_DNSAPI" value="0x78020000" /> <property name="BASEADDRESS_MSVCRT" value="0x78050000" /> <property name="BASEADDRESS_MSVCRT20" value="0x781E0000" />
13 years, 3 months
1
0
0
0
[tfaber] 53522: [RTL][NETSHELL] - Fix the remaining issues from preceding commits
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Sep 1 16:58:20 2011 New Revision: 53522 URL:
http://svn.reactos.org/svn/reactos?rev=53522&view=rev
Log: [RTL][NETSHELL] - Fix the remaining issues from preceding commits Modified: trunk/reactos/dll/win32/netshell/lanstatusui.c trunk/reactos/lib/rtl/bitmap.c Modified: trunk/reactos/dll/win32/netshell/lanstatusui.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lanstat…
============================================================================== --- trunk/reactos/dll/win32/netshell/lanstatusui.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netshell/lanstatusui.c [iso-8859-1] Thu Sep 1 16:58:20 2011 @@ -179,7 +179,7 @@ pContext->Status = 3; } } - else if (IfEntry.dwOperStatus == (MIB_IF_OPER_STATUS_UNREACHABLE | MIB_IF_OPER_STATUS_DISCONNECTED)) + else if (IfEntry.dwOperStatus == MIB_IF_OPER_STATUS_UNREACHABLE || IfEntry.dwOperStatus == MIB_IF_OPER_STATUS_DISCONNECTED) { if (pContext->Status != 4) { @@ -187,7 +187,7 @@ pContext->Status = 4; } } - else if (MIB_IF_OPER_STATUS_NON_OPERATIONAL) + else if (IfEntry.dwOperStatus == MIB_IF_OPER_STATUS_NON_OPERATIONAL) { if (pContext->Status != 5) { Modified: trunk/reactos/lib/rtl/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/bitmap.c?rev=53522…
============================================================================== --- trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/bitmap.c [iso-8859-1] Thu Sep 1 16:58:20 2011 @@ -339,7 +339,7 @@ } /* Set all full ULONGs */ - RtlFillMemoryUlong(Buffer, MAXULONG, NumberToSet >> 3); + RtlFillMemoryUlong(Buffer, NumberToSet >> 3, MAXULONG); Buffer += NumberToSet >> 5; /* Set what's left */
13 years, 3 months
1
0
0
0
[dchapyshev] 53521: - Partly revert r53519. Fix build
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Thu Sep 1 16:27:20 2011 New Revision: 53521 URL:
http://svn.reactos.org/svn/reactos?rev=53521&view=rev
Log: - Partly revert r53519. Fix build Modified: trunk/reactos/dll/win32/oleaut32/typelib2.c Modified: trunk/reactos/dll/win32/oleaut32/typelib2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib…
============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib2.c [iso-8859-1] Thu Sep 1 16:27:20 2011 @@ -317,7 +317,7 @@ while (offset != -1) { guidentry = (MSFT_GuidEntry *)&This->typelib_segment_data[MSFT_SEG_GUID][offset]; - if (IsEqualGUID(*guidentry, guid)) return offset; + if (IsEqualGUID(guidentry, guid)) return offset; offset = guidentry->next_hash; }
13 years, 3 months
1
0
0
0
← Newer
1
...
36
37
38
39
40
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
Results per page:
10
25
50
100
200