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
March 2010
----- 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
19 participants
896 discussions
Start a n
N
ew thread
[hpoussin] 45817: [freeldr] Don't write twice the delay method and how to read the RTC. Use those in the HAL
by hpoussin@svn.reactos.org
Author: hpoussin Date: Thu Mar 4 00:13:06 2010 New Revision: 45817 URL:
http://svn.reactos.org/svn/reactos?rev=45817&view=rev
Log: [freeldr] Don't write twice the delay method and how to read the RTC. Use those in the HAL Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c trunk/reactos/boot/freeldr/freeldr/include/freeldr.h trunk/reactos/hal/halx86/generic/bios.c Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/pcrtc.c [iso-8859-1] Thu Mar 4 00:13:06 2010 @@ -19,63 +19,25 @@ #include <freeldr.h> -#define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f)) +BOOLEAN +NTAPI +HalQueryRealTimeClock(OUT PTIME_FIELDS Time); TIMEINFO* PcGetTime(VOID) { static TIMEINFO TimeInfo; - REGS Regs; + TIME_FIELDS Time; - /* Some BIOSes, such as the 1998/07/25 system ROM - * in the Compaq Deskpro EP/SB, leave CF unchanged - * if successful, so CF should be cleared before - * calling this function. */ - __writeeflags(__readeflags() & ~EFLAGS_CF); + if (!HalQueryRealTimeClock(&Time)) + return NULL; - /* Int 1Ah AH=04h - * TIME - GET REAL-TIME CLOCK DATE (AT,XT286,PS) - * - * AH = 04h - * CF clear to avoid bug - * Return: - * CF clear if successful - * CH = century (BCD) - * CL = year (BCD) - * DH = month (BCD) - * DL = day (BCD) - * CF set on error - */ - Regs.b.ah = 0x04; - Int386(0x1A, &Regs, &Regs); - - TimeInfo.Year = 100 * BCD_INT(Regs.b.ch) + BCD_INT(Regs.b.cl); - TimeInfo.Month = BCD_INT(Regs.b.dh); - TimeInfo.Day = BCD_INT(Regs.b.dl); - - /* Some BIOSes leave CF unchanged if successful, - * so CF should be cleared before calling this function. */ - __writeeflags(__readeflags() & ~EFLAGS_CF); - - /* Int 1Ah AH=02h - * TIME - GET REAL-TIME CLOCK TIME (AT,XT286,PS) - * - * AH = 02h - * CF clear to avoid bug - * Return: - * CF clear if successful - * CH = hour (BCD) - * CL = minutes (BCD) - * DH = seconds (BCD) - * DL = daylight savings flag (00h standard time, 01h daylight time) - * CF set on error (i.e. clock not running or in middle of update) - */ - Regs.b.ah = 0x02; - Int386(0x1A, &Regs, &Regs); - - TimeInfo.Hour = BCD_INT(Regs.b.ch); - TimeInfo.Minute = BCD_INT(Regs.b.cl); - TimeInfo.Second = BCD_INT(Regs.b.dh); + TimeInfo.Year = Time.Year; + TimeInfo.Month = Time.Month; + TimeInfo.Day = Time.Day; + TimeInfo.Hour = Time.Hour; + TimeInfo.Minute = Time.Minute; + TimeInfo.Second = Time.Second; return &TimeInfo; } Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Thu Mar 4 00:13:06 2010 @@ -39,6 +39,7 @@ #include <ndk/asm.h> #include <ndk/rtlfuncs.h> #include <ndk/ldrtypes.h> +#include <ndk/halfuncs.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> Modified: trunk/reactos/hal/halx86/generic/bios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bios.c?…
============================================================================== --- trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] Thu Mar 4 00:13:06 2010 @@ -235,7 +235,6 @@ longjmp(HalpSavedContext, 1); UNREACHABLE; } -#endif /* V8086 ENTER ****************************************************************/ @@ -278,6 +277,7 @@ /* Exit to V86 mode */ HalpExitToV86((PKTRAP_FRAME)&V86TrapFrame); } +#endif /* FUNCTIONS ******************************************************************/ @@ -432,6 +432,7 @@ while (i--) HalpSavedIoMap[HalpSavedIoMapData[i][0]] = HalpSavedIoMapData[i][1]; } +#ifndef _MINIHAL_ VOID NTAPI HalpMapRealModeMemory(VOID) @@ -499,7 +500,6 @@ HalpFlushTLB(); } -#ifndef _MINIHAL_ VOID NTAPI HalpSwitchToRealModeTrapHandlers(VOID)
14 years, 9 months
1
0
0
0
[tkreuzer] 45816: - sort wdm.h a bit more - add missing NTAPI - move TIMER_TYPE to ntdef.h - remove duplicate port and register functions - add volatile keyword where appropriate to register access inline functions - Use result variable in IoGetRemainingStackSize inline function to avoid a warning
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Mar 4 00:02:02 2010 New Revision: 45816 URL:
http://svn.reactos.org/svn/reactos?rev=45816&view=rev
Log: - sort wdm.h a bit more - add missing NTAPI - move TIMER_TYPE to ntdef.h - remove duplicate port and register functions - add volatile keyword where appropriate to register access inline functions - Use result variable in IoGetRemainingStackSize inline function to avoid a warning Modified: branches/header-work/include/ddk/wdm.h branches/header-work/include/ddk/winddk.h branches/header-work/include/psdk/ntdef.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
Modified: branches/header-work/include/ddk/winddk.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
Modified: branches/header-work/include/psdk/ntdef.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/ntdef.…
14 years, 9 months
1
0
0
0
[hpoussin] 45815: [freeldr] Add some functions to read partition tables Add some stubs, link to mini-HAL
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Mar 3 23:59:32 2010 New Revision: 45815 URL:
http://svn.reactos.org/svn/reactos?rev=45815&view=rev
Log: [freeldr] Add some functions to read partition tables Add some stubs, link to mini-HAL Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/halstub.c (with props) trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c (with props) trunk/reactos/boot/freeldr/freeldr/include/ntoskrnl.h (with props) Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c trunk/reactos/boot/freeldr/freeldr/disk/partition.c trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild trunk/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild trunk/reactos/boot/freeldr/freeldr/include/freeldr.h Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/halstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/halstub.c (added) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/halstub.c [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -1,0 +1,97 @@ +/* +* PROJECT: ReactOS Kernel +* LICENSE: GPL - See COPYING in the top level directory +* FILE: boot/freeldr/freeldr/arch/i386/hal/halstub.c +* PURPOSE: I/O Stub HAL Routines +* PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) +*/ + +/* INCLUDES ******************************************************************/ + +#include <ntoskrnl.h> +#define NDEBUG +#include <debug.h> + +/* FUNCTIONS *****************************************************************/ + +NTSTATUS +FASTCALL +xHalIoReadPartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer) +{ + return IoReadPartitionTable(DeviceObject, + SectorSize, + ReturnRecognizedPartitions, + PartitionBuffer); +} + +UCHAR +NTAPI +xHalVectorToIDTEntry(IN ULONG Vector) +{ + /* Return the vector */ + return Vector; +} + +VOID +NTAPI +xHalHaltSystem(VOID) +{ + /* Halt execution */ + while (TRUE); +} + +/* GLOBALS *******************************************************************/ + +HAL_DISPATCH HalDispatchTable = +{ + HAL_DISPATCH_VERSION, + (pHalQuerySystemInformation)NULL, + (pHalSetSystemInformation)NULL, + (pHalQueryBusSlots)NULL, + 0, + (pHalExamineMBR)NULL, + (pHalIoAssignDriveLetters)NULL, + (pHalIoReadPartitionTable)xHalIoReadPartitionTable, + (pHalIoSetPartitionInformation)NULL, + (pHalIoWritePartitionTable)NULL, + (pHalHandlerForBus)NULL, + (pHalReferenceBusHandler)NULL, + (pHalReferenceBusHandler)NULL, + (pHalInitPnpDriver)NULL, + (pHalInitPowerManagement)NULL, + (pHalGetDmaAdapter)NULL, + (pHalGetInterruptTranslator)NULL, + (pHalStartMirroring)NULL, + (pHalEndMirroring)NULL, + (pHalMirrorPhysicalMemory)NULL, + (pHalEndOfBoot)NULL, + (pHalMirrorVerify)NULL +}; + +HAL_PRIVATE_DISPATCH HalPrivateDispatchTable = +{ + HAL_PRIVATE_DISPATCH_VERSION, + (pHalHandlerForBus)NULL, + (pHalHandlerForConfigSpace)NULL, + (pHalLocateHiberRanges)NULL, + (pHalRegisterBusHandler)NULL, + (pHalSetWakeEnable)NULL, + (pHalSetWakeAlarm)NULL, + (pHalTranslateBusAddress)NULL, + (pHalAssignSlotResources)NULL, + (pHalHaltSystem)xHalHaltSystem, + (pHalFindBusAddressTranslation)NULL, + (pHalResetDisplay)NULL, + (pHalAllocateMapRegisters)NULL, + (pKdSetupPciDeviceForDebugging)NULL, + (pKdReleasePciDeviceForDebugging)NULL, + (pKdGetAcpiTablePhase0)NULL, + (pKdCheckPowerButton)NULL, + (pHalVectorToIDTEntry)xHalVectorToIDTEntry, + (pKdMapPhysicalMemory64)NULL, + (pKdUnmapVirtualAddress)NULL +}; Propchange: trunk/reactos/boot/freeldr/freeldr/arch/i386/halstub.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/loader.c [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -17,7 +17,6 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _NTSYSTEM_ #include <freeldr.h> #define NDEBUG Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c (added) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -1,0 +1,114 @@ +#include <ntoskrnl.h> +#define NDEBUG +#include <arch.h> + +VOID +NTAPI +KeInitializeEvent( + IN PRKEVENT Event, + IN EVENT_TYPE Type, + IN BOOLEAN State) +{ +} + +VOID +FASTCALL +KiAcquireSpinLock( + IN PKSPIN_LOCK SpinLock) +{ +} + +VOID +FASTCALL +KiReleaseSpinLock( + IN PKSPIN_LOCK SpinLock) +{ +} + +VOID +NTAPI +KeSetTimeIncrement( + IN ULONG MaxIncrement, + IN ULONG MinIncrement) +{ +} + +NTKERNELAPI +VOID +FASTCALL +IoAssignDriveLetters( + IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, + IN PSTRING NtDeviceName, + OUT PUCHAR NtSystemPath, + OUT PSTRING NtSystemPathString) +{ +} + +NTKERNELAPI +NTSTATUS +FASTCALL +IoSetPartitionInformation( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG PartitionNumber, + IN ULONG PartitionType) +{ + return STATUS_NOT_IMPLEMENTED; +} + +NTKERNELAPI +NTSTATUS +FASTCALL +IoWritePartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN ULONG SectorsPerTrack, + IN ULONG NumberOfHeads, + IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer) +{ + return STATUS_NOT_IMPLEMENTED; +} + +NTHALAPI +VOID +NTAPI +KeStallExecutionProcessor( + IN ULONG MicroSeconds) +{ + REGS Regs; + ULONG usec_this; + + // Int 15h AH=86h + // BIOS - WAIT (AT,PS) + // + // AH = 86h + // CX:DX = interval in microseconds + // Return: + // CF clear if successful (wait interval elapsed) + // CF set on error or AH=83h wait already in progress + // AH = status (see #00496) + + // Note: The resolution of the wait period is 977 microseconds on + // many systems because many BIOSes use the 1/1024 second fast + // interrupt from the AT real-time clock chip which is available on INT 70; + // because newer BIOSes may have much more precise timers available, it is + // not possible to use this function accurately for very short delays unless + // the precise behavior of the BIOS is known (or found through testing) + + while (MicroSeconds) + { + usec_this = MicroSeconds; + + if (usec_this > 4000000) + { + usec_this = 4000000; + } + + Regs.b.ah = 0x86; + Regs.w.cx = usec_this >> 16; + Regs.w.dx = usec_this & 0xffff; + Int386(0x15, &Regs, &Regs); + + MicroSeconds -= usec_this; + } +} Propchange: trunk/reactos/boot/freeldr/freeldr/arch/i386/ntoskrnl.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/boot/freeldr/freeldr/disk/partition.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/disk/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/disk/partition.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/disk/partition.c [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -240,4 +240,152 @@ return TRUE; } +NTSTATUS +NTAPI +IopReadBootRecord( + IN PDEVICE_OBJECT DeviceObject, + IN ULONGLONG LogicalSectorNumber, + IN ULONG SectorSize, + OUT PMASTER_BOOT_RECORD BootRecord) +{ + ULONG FileId = (ULONG)DeviceObject; + LARGE_INTEGER Position; + ULONG BytesRead; + ULONG Status; + + Position.QuadPart = LogicalSectorNumber * SectorSize; + Status = ArcSeek(FileId, &Position, SeekAbsolute); + if (Status != ESUCCESS) + return STATUS_IO_DEVICE_ERROR; + + Status = ArcRead(FileId, BootRecord, SectorSize, &BytesRead); + if (Status != ESUCCESS || BytesRead != SectorSize) + return STATUS_IO_DEVICE_ERROR; + + return STATUS_SUCCESS; +} + +BOOLEAN +NTAPI +IopCopyPartitionRecord( + IN BOOLEAN ReturnRecognizedPartitions, + IN ULONG SectorSize, + IN PPARTITION_TABLE_ENTRY PartitionTableEntry, + OUT PARTITION_INFORMATION *PartitionEntry) +{ + BOOLEAN IsRecognized; + + IsRecognized = TRUE; /* FIXME */ + if (!IsRecognized && ReturnRecognizedPartitions) + return FALSE; + + PartitionEntry->StartingOffset.QuadPart = (ULONGLONG)PartitionTableEntry->SectorCountBeforePartition * SectorSize; + PartitionEntry->PartitionLength.QuadPart = (ULONGLONG)PartitionTableEntry->PartitionSectorCount * SectorSize; + PartitionEntry->HiddenSectors = 0; + PartitionEntry->PartitionNumber = 0; /* Will be filled later */ + PartitionEntry->PartitionType = PartitionTableEntry->SystemIndicator; + PartitionEntry->BootIndicator = (PartitionTableEntry->BootIndicator & 0x80) ? TRUE : FALSE; + PartitionEntry->RecognizedPartition = IsRecognized; + PartitionEntry->RewritePartition = FALSE; + + return TRUE; +} + +NTKERNELAPI +NTSTATUS +FASTCALL +IoReadPartitionTable( + IN PDEVICE_OBJECT DeviceObject, + IN ULONG SectorSize, + IN BOOLEAN ReturnRecognizedPartitions, + OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer) +{ + PMASTER_BOOT_RECORD MasterBootRecord; + PDRIVE_LAYOUT_INFORMATION Partitions; + ULONG NbPartitions, i, Size; + NTSTATUS ret; + + *PartitionBuffer = NULL; + + if (SectorSize < sizeof(MASTER_BOOT_RECORD)) + return STATUS_NOT_SUPPORTED; + + MasterBootRecord = ExAllocatePool(NonPagedPool, SectorSize); + if (!MasterBootRecord) + return STATUS_NO_MEMORY; + + /* Read disk MBR */ + ret = IopReadBootRecord(DeviceObject, 0, SectorSize, MasterBootRecord); + if (!NT_SUCCESS(ret)) + { + ExFreePool(MasterBootRecord); + return ret; + } + + /* Check validity of boot record */ + if (MasterBootRecord->MasterBootRecordMagic != 0xaa55) + { + ExFreePool(MasterBootRecord); + return STATUS_NOT_SUPPORTED; + } + + /* Count number of partitions */ + NbPartitions = 0; + for (i = 0; i < 4; i++) + { + NbPartitions++; + + if (MasterBootRecord->PartitionTable[i].SystemIndicator == PARTITION_EXTENDED || + MasterBootRecord->PartitionTable[i].SystemIndicator == PARTITION_XINT13_EXTENDED) + { + /* FIXME: unhandled case; count number of partitions */ + UNIMPLEMENTED; + } + } + + if (NbPartitions == 0) + { + ExFreePool(MasterBootRecord); + return STATUS_NOT_SUPPORTED; + } + + /* Allocation space to store partitions */ + Size = FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION, PartitionEntry) + + NbPartitions * sizeof(PARTITION_INFORMATION); + Partitions = ExAllocatePool(NonPagedPool, Size); + if (!Partitions) + { + ExFreePool(MasterBootRecord); + return STATUS_NO_MEMORY; + } + + /* Count number of partitions */ + NbPartitions = 0; + for (i = 0; i < 4; i++) + { + if (IopCopyPartitionRecord(ReturnRecognizedPartitions, + SectorSize, + &MasterBootRecord->PartitionTable[i], + &Partitions->PartitionEntry[NbPartitions])) + { + Partitions->PartitionEntry[NbPartitions].PartitionNumber = NbPartitions + 1; + NbPartitions++; + } + + if (MasterBootRecord->PartitionTable[i].SystemIndicator == PARTITION_EXTENDED || + MasterBootRecord->PartitionTable[i].SystemIndicator == PARTITION_XINT13_EXTENDED) + { + /* FIXME: unhandled case; copy partitions */ + UNIMPLEMENTED; + } + } + + Partitions->PartitionCount = NbPartitions; + Partitions->Signature = MasterBootRecord->Signature; + ExFreePool(MasterBootRecord); + + *PartitionBuffer = Partitions; + return STATUS_SUCCESS; +} + #endif Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freel…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/freeldr.rbuild [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -7,6 +7,7 @@ <library>freeldr_startup</library> <library>freeldr_base64k</library> <library>freeldr_base</library> + <library>mini_hal</library> <library>freeldr_arch</library> <library>freeldr_main</library> <library>rossym</library> 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] Wed Mar 3 23:59:32 2010 @@ -7,6 +7,7 @@ <include base="ReactOS">include/reactos/libs</include> <include base="ReactOS">include/reactos/elf</include> <define name="_NTHAL_" /> + <define name="_NTSYSTEM_" /> <directory name="arch"> <directory name="i386"> <if property="ARCH" value="i386"> @@ -14,6 +15,7 @@ <file>archmach.c</file> <file>custom.c</file> <file>drivemap.c</file> + <file>halstub.c</file> <file>hardware.c</file> <file>hwacpi.c</file> <file>hwapm.c</file> @@ -24,6 +26,7 @@ <file>loader.c</file> <file>machpc.c</file> <file>miscboot.c</file> + <file>ntoskrnl.c</file> <file>pccons.c</file> <file>pcdisk.c</file> <file>pcmem.c</file> Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -60,6 +60,8 @@ #include <reactos.h> #include <registry.h> #include <winldr.h> +#include <ntdddisk.h> +#include <internal/hal.h> /* file system headers */ #include <fs/ext2.h> #include <fs/fat.h> Added: trunk/reactos/boot/freeldr/freeldr/include/ntoskrnl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/ntoskrnl.h (added) +++ trunk/reactos/boot/freeldr/freeldr/include/ntoskrnl.h [iso-8859-1] Wed Mar 3 23:59:32 2010 @@ -1,0 +1,19 @@ +#include <ntdef.h> +#undef _NTHAL_ +#undef DECLSPEC_IMPORT +#define DECLSPEC_IMPORT +#undef NTSYSAPI +#define NTSYSAPI + +#include <wdm.h> + +typedef GUID UUID; + +/* Windows Device Driver Kit */ +#include <winddk.h> +#include <ndk/haltypes.h> + +/* Disk stuff */ +typedef PVOID PLOADER_PARAMETER_BLOCK; +#include <ntdddisk.h> +#include <internal/hal.h> Propchange: trunk/reactos/boot/freeldr/freeldr/include/ntoskrnl.h ------------------------------------------------------------------------------ svn:eol-style = native
14 years, 9 months
1
0
0
0
[hpoussin] 45814: [freeldr] Add KeBugCheckEx
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Mar 3 23:54:51 2010 New Revision: 45814 URL:
http://svn.reactos.org/svn/reactos?rev=45814&view=rev
Log: [freeldr] Add KeBugCheckEx Modified: trunk/reactos/boot/freeldr/freeldr/debug.c 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] Wed Mar 3 23:54:51 2010 @@ -328,3 +328,22 @@ return 0; } +NTKERNELAPI +DECLSPEC_NORETURN +VOID +NTAPI +KeBugCheckEx( + IN ULONG BugCheckCode, + IN ULONG_PTR BugCheckParameter1, + IN ULONG_PTR BugCheckParameter2, + IN ULONG_PTR BugCheckParameter3, + IN ULONG_PTR BugCheckParameter4) +{ + char Buffer[64]; + sprintf(Buffer, "*** STOP: 0x%08lX (0x%08lX, 0x%08lX, 0x%08lX, 0x%08lX)", + BugCheckCode, BugCheckParameter1, BugCheckParameter2, + BugCheckParameter3, BugCheckParameter4); + UiMessageBoxCritical(Buffer); + assert(FALSE); + for (;;); +}
14 years, 9 months
1
0
0
0
[tkreuzer] 45813: revert change to IoCreateFile
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Mar 3 23:48:21 2010 New Revision: 45813 URL:
http://svn.reactos.org/svn/reactos?rev=45813&view=rev
Log: revert change to IoCreateFile Modified: branches/header-work/ntoskrnl/io/iomgr/file.c Modified: branches/header-work/ntoskrnl/io/iomgr/file.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/ntoskrnl/io/iomgr/f…
============================================================================== --- branches/header-work/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original) +++ branches/header-work/ntoskrnl/io/iomgr/file.c [iso-8859-1] Wed Mar 3 23:48:21 2010 @@ -1655,7 +1655,7 @@ IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength, IN CREATE_FILE_TYPE CreateFileType, - IN PVOID InternalParameters OPTIONAL, + IN PVOID ExtraCreateParameters OPTIONAL, IN ULONG Options) { KPROCESSOR_MODE AccessMode;
14 years, 9 months
1
0
0
0
[hpoussin] 45812: [freeldr] Allow opening of the raw device
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Mar 3 23:39:32 2010 New Revision: 45812 URL:
http://svn.reactos.org/svn/reactos?rev=45812&view=rev
Log: [freeldr] Allow opening of the raw device Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c Modified: trunk/reactos/boot/freeldr/freeldr/fs/fs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/fs…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/fs.c [iso-8859-1] Wed Mar 3 23:39:32 2010 @@ -319,6 +319,13 @@ FileData[DeviceId].FuncTable = NULL; return ret; } + else if (!*FileName) + { + /* Done, caller wanted to open the raw device */ + *FileId = DeviceId; + pDevice->ReferenceCount++; + return ESUCCESS; + } /* Try to detect the file system */ #ifndef _M_ARM
14 years, 9 months
1
0
0
0
[hpoussin] 45811: [freeldr] Add some more memory management functions
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Mar 3 23:35:10 2010 New Revision: 45811 URL:
http://svn.reactos.org/svn/reactos?rev=45811&view=rev
Log: [freeldr] Add some more memory management functions Modified: trunk/reactos/boot/freeldr/freeldr/include/mm.h trunk/reactos/boot/freeldr/freeldr/mm/mm.c 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] Wed Mar 3 23:35:10 2010 @@ -116,3 +116,7 @@ PVOID MmHeapAlloc(ULONG MemorySize); VOID MmHeapFree(PVOID MemoryPointer); + +#define ExAllocatePool(pool, size) MmHeapAlloc(size) +#define ExAllocatePoolWithTag(pool, size, tag) MmHeapAlloc(size) +#define ExFreePool(p) MmHeapFree(p) Modified: trunk/reactos/boot/freeldr/freeldr/mm/mm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/mm/mm…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/mm/mm.c [iso-8859-1] Wed Mar 3 23:35:10 2010 @@ -345,3 +345,54 @@ return RealPageLookupTable; } + +#undef ExAllocatePoolWithTag +NTKERNELAPI +PVOID +NTAPI +ExAllocatePoolWithTag( + IN POOL_TYPE PoolType, + IN SIZE_T NumberOfBytes, + IN ULONG Tag) +{ + return MmHeapAlloc(NumberOfBytes); +} + +#undef ExFreePool +NTKERNELAPI +VOID +NTAPI +ExFreePool( + IN PVOID P) +{ + MmHeapFree(P); +} + +PVOID +NTAPI +RtlAllocateHeap( + IN PVOID HeapHandle, + IN ULONG Flags, + IN SIZE_T Size) +{ + PVOID ptr; + + ptr = MmHeapAlloc(Size); + if (ptr && (Flags & HEAP_ZERO_MEMORY)) + { + RtlZeroMemory(ptr, Size); + } + + return ptr; +} + +BOOLEAN +NTAPI +RtlFreeHeap( + IN PVOID HeapHandle, + IN ULONG Flags, + IN PVOID HeapBase) +{ + MmHeapFree(HeapBase); + return TRUE; +}
14 years, 9 months
1
0
0
0
[fireball] 45810: - GetBitmapBits and SetBitmapBits should get/set bitmaps bits in a particular format described in MSDN, not in the format they are stored in internally. Reimplement them based on winex11.drv implementation. Could use some optimisation, but they are deprecated non time-critical functions. Thanks to Maarten Kroese for finding this problem. Fixes issue #28 in Arwinss wiki.
by fireball@svn.reactos.org
Author: fireball Date: Wed Mar 3 23:33:50 2010 New Revision: 45810 URL:
http://svn.reactos.org/svn/reactos?rev=45810&view=rev
Log: - GetBitmapBits and SetBitmapBits should get/set bitmaps bits in a particular format described in MSDN, not in the format they are stored in internally. Reimplement them based on winex11.drv implementation. Could use some optimisation, but they are deprecated non time-critical functions. Thanks to Maarten Kroese for finding this problem. Fixes issue #28 in Arwinss wiki. Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/surfobj.c [iso-8859-1] Wed Mar 3 23:33:50 2010 @@ -257,27 +257,224 @@ LONG FASTCALL GreGetBitmapBits(PSURFACE pSurf, ULONG ulBytes, PVOID pBits) { - /* Don't copy more bytes than the buffer has */ - ulBytes = min(ulBytes, pSurf->SurfObj.cjBits); - - /* Copy actual bits */ - RtlCopyMemory(pBits, pSurf->SurfObj.pvBits, ulBytes); - - /* Return amount copied */ + LONG height, width, bytewidth; + LPBYTE tbuf, startline; + int h, w; + COLORREF cr; + PFN_DIB_GetPixel DibGetPixel; + + DPRINT("(bmp=%p, buffer=%p, count=0x%x)\n", pSurf, pBits, ulBytes); + + /* Check ulBytes */ + if (!ulBytes) return 0; + + bytewidth = pSurf->SurfObj.lDelta; + if (bytewidth < 0) bytewidth = -bytewidth; + + height = ulBytes / bytewidth; + width = pSurf->SurfObj.sizlBitmap.cx; + + /* Get getpixel routine address */ + DibGetPixel = DibFunctionsForBitmapFormat[pSurf->SurfObj.iBitmapFormat].DIB_GetPixel; + + /* copy bitmap to 16 bit padded image buffer with real bitsperpixel */ + startline = pBits; + switch (BitsPerFormat(pSurf->SurfObj.iBitmapFormat)) + { + case 1: + for (h=0;h<height;h++) + { + tbuf = startline; + *tbuf = 0; + for (w=0;w<width;w++) + { + if ((w%8) == 0) + *tbuf = 0; + cr = DibGetPixel(&pSurf->SurfObj, w, h); + *tbuf |= cr<<(7-(w&7)); + if ((w&7) == 7) ++tbuf; + } + startline += bytewidth; + } + break; + case 4: + for (h=0;h<height;h++) + { + tbuf = startline; + for (w=0;w<width;w++) + { + if (!(w & 1)) + *tbuf = DibGetPixel(&pSurf->SurfObj, w, h) << 4; + else + *tbuf++ |= DibGetPixel(&pSurf->SurfObj, w, h) & 0x0f; + } + startline += bytewidth; + } + break; + case 8: + for (h=0;h<height;h++) + { + tbuf = startline; + for (w=0;w<width;w++) + *tbuf++ = DibGetPixel(&pSurf->SurfObj, w, h); + startline += bytewidth; + } + break; + case 15: + case 16: + for (h=0;h<height;h++) + { + tbuf = startline; + for (w=0;w<width;w++) + { + long pixel = DibGetPixel(&pSurf->SurfObj, w, h); + + *tbuf++ = pixel & 0xff; + *tbuf++ = (pixel>>8) & 0xff; + } + startline += bytewidth; + } + break; + case 24: + for (h=0;h<height;h++) + { + tbuf = startline; + for (w=0;w<width;w++) + { + long pixel = DibGetPixel(&pSurf->SurfObj, w, h); + + *tbuf++ = pixel & 0xff; + *tbuf++ = (pixel>> 8) & 0xff; + *tbuf++ = (pixel>>16) & 0xff; + } + startline += bytewidth; + } + break; + + case 32: + for (h=0;h<height;h++) + { + tbuf = startline; + for (w=0;w<width;w++) + { + long pixel = DibGetPixel(&pSurf->SurfObj, w, h); + + *tbuf++ = pixel & 0xff; + *tbuf++ = (pixel>> 8) & 0xff; + *tbuf++ = (pixel>>16) & 0xff; + *tbuf++ = (pixel>>24) & 0xff; + } + startline += bytewidth; + } + break; + default: + DPRINT1("Unhandled bits:%d\n", BitsPerFormat(pSurf->SurfObj.iBitmapFormat)); + } return ulBytes; } LONG FASTCALL GreSetBitmapBits(PSURFACE pSurf, ULONG ulBytes, PVOID pBits) { + LONG height, width, bytewidth; + const BYTE *sbuf, *startline; + int h, w; + PFN_DIB_PutPixel DibPutPixel; + /* Check ulBytes */ if (!ulBytes) return 0; - /* Don't copy more bytes than the surface has */ - ulBytes = min(ulBytes, pSurf->SurfObj.cjBits); - - /* Copy actual bits */ - RtlCopyMemory(pSurf->SurfObj.pvBits, pBits, ulBytes); + DPRINT("(bmp=%p, buffer=%p, count=0x%x)\n", pSurf, pBits, ulBytes); + + bytewidth = pSurf->SurfObj.lDelta; + if (bytewidth < 0) bytewidth = -bytewidth; + + height = ulBytes / bytewidth; + width = pSurf->SurfObj.sizlBitmap.cx; + + /* Get getpixel routine address */ + DibPutPixel = DibFunctionsForBitmapFormat[pSurf->SurfObj.iBitmapFormat].DIB_PutPixel; + + /* copy bitmap to 16 bit padded image buffer with real bitsperpixel */ + startline = pBits; + switch (BitsPerFormat(pSurf->SurfObj.iBitmapFormat)) + { + case 1: + for (h=0;h<height;h++) + { + sbuf = startline; + for (w=0;w<width;w++) + { + DibPutPixel(&pSurf->SurfObj, w, h, (sbuf[0]>>(7-(w&7))) & 1); + if ((w&7) == 7) + sbuf++; + } + startline += bytewidth; + } + break; + case 4: + for (h=0;h<height;h++) + { + sbuf = startline; + for (w=0;w<width;w++) + { + if (!(w & 1)) + DibPutPixel(&pSurf->SurfObj, w, h, *sbuf >> 4); + else + DibPutPixel(&pSurf->SurfObj, w, h, *sbuf++ & 0xf); + } + startline += bytewidth; + } + break; + case 8: + for (h=0;h<height;h++) + { + sbuf = startline; + for (w=0;w<width;w++) + DibPutPixel(&pSurf->SurfObj, w, h, *sbuf++); + startline += bytewidth; + } + break; + case 15: + case 16: + for (h=0;h<height;h++) + { + sbuf = startline; + for (w=0;w<width;w++) + { + DibPutPixel(&pSurf->SurfObj, w, h, sbuf[1]*256+sbuf[0]); + sbuf+=2; + } + startline += bytewidth; + } + break; + case 24: + for (h=0;h<height;h++) + { + sbuf = startline; + for (w=0;w<width;w++) + { + DibPutPixel(&pSurf->SurfObj, w, h, (sbuf[2]<<16)+(sbuf[1]<<8)+sbuf[0]); + sbuf += 3; + } + startline += bytewidth; + } + break; + case 32: + for (h=0;h<height;h++) + { + sbuf = startline; + for (w=0;w<width;w++) + { + DibPutPixel(&pSurf->SurfObj, w, h, (sbuf[3]<<24)+(sbuf[2]<<16)+(sbuf[1]<<8)+sbuf[0]); + sbuf += 4; + } + startline += bytewidth; + } + break; + default: + DPRINT1("Unhandled bits:%d\n", BitsPerFormat(pSurf->SurfObj.iBitmapFormat)); + } /* Return amount copied */ return ulBytes;
14 years, 9 months
1
0
0
0
[hpoussin] 45809: [hal] Add a mini-HAL static library Mostly the same thing as the real one, except interrupts and DMA
by hpoussin@svn.reactos.org
Author: hpoussin Date: Wed Mar 3 22:56:52 2010 New Revision: 45809 URL:
http://svn.reactos.org/svn/reactos?rev=45809&view=rev
Log: [hal] Add a mini-HAL static library Mostly the same thing as the real one, except interrupts and DMA Modified: trunk/reactos/hal/halx86/generic/bios.c trunk/reactos/hal/halx86/generic/bus/halbus.c trunk/reactos/hal/halx86/generic/bus/pcibus.c trunk/reactos/hal/halx86/generic/bus/pcidata.c trunk/reactos/hal/halx86/generic/display.c trunk/reactos/hal/halx86/generic/dma.c trunk/reactos/hal/halx86/generic/halinit.c trunk/reactos/hal/halx86/generic/misc.c trunk/reactos/hal/halx86/generic/pic.c trunk/reactos/hal/halx86/generic/reboot.c trunk/reactos/hal/halx86/generic/systimer.S trunk/reactos/hal/halx86/generic/timer.c trunk/reactos/hal/halx86/generic/usage.c trunk/reactos/hal/halx86/hal_generic.rbuild trunk/reactos/hal/halx86/include/hal.h Modified: trunk/reactos/hal/halx86/generic/bios.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bios.c?…
============================================================================== --- trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/bios.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -196,6 +196,7 @@ /* V86 TRAP HANDLERS **********************************************************/ +#ifndef _MINIHAL_ VOID FASTCALL DECLSPEC_NORETURN @@ -234,6 +235,7 @@ longjmp(HalpSavedContext, 1); UNREACHABLE; } +#endif /* V8086 ENTER ****************************************************************/ @@ -497,6 +499,7 @@ HalpFlushTLB(); } +#ifndef _MINIHAL_ VOID NTAPI HalpSwitchToRealModeTrapHandlers(VOID) @@ -517,6 +520,7 @@ // KeRegisterInterruptHandler(6, HalpTrap06); } +#endif VOID NTAPI @@ -626,6 +630,7 @@ HalpFlushTLB(); } +#ifndef _MINIHAL_ BOOLEAN NTAPI HalpBiosDisplayReset(VOID) @@ -695,5 +700,6 @@ __writeeflags(Flags); return TRUE; } +#endif /* EOF */ Modified: trunk/reactos/hal/halx86/generic/bus/halbus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/hal…
============================================================================== --- trunk/reactos/hal/halx86/generic/bus/halbus.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/bus/halbus.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -27,8 +27,10 @@ KdReleasePciDeviceforDebugging = HalpReleasePciDeviceForDebugging; /* Register memory functions */ +#ifndef _MINIHAL_ KdMapPhysicalMemory64 = HalpMapPhysicalMemory64; KdUnmapVirtualAddress = HalpUnmapVirtualAddress; +#endif /* Register ACPI stub */ KdCheckPowerButton = HalpCheckPowerButton; Modified: trunk/reactos/hal/halx86/generic/bus/pcibus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/pci…
============================================================================== --- trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/bus/pcibus.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -702,6 +702,7 @@ NTAPI HalpQueryPciRegistryInfo(VOID) { +#ifndef _MINIHAL_ WCHAR NameBuffer[8]; OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyName, ConfigName, IdentName; @@ -924,6 +925,9 @@ /* Return it */ return PciRegistryInfo; +#else + return NULL; +#endif } VOID Modified: trunk/reactos/hal/halx86/generic/bus/pcidata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/bus/pci…
============================================================================== --- trunk/reactos/hal/halx86/generic/bus/pcidata.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/bus/pcidata.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -14,6 +14,7 @@ /* GLOBALS *******************************************************************/ +#ifndef _MINIHAL_ CHAR ClassTable[3922] = { 0x43, 0x20, 0x30, 0x30, 0x20, 0x20, 0x55, 0x6E, 0x63, 0x6C, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, @@ -40415,3 +40416,4 @@ 0x20, 0x49, 0x6C, 0x6C, 0x65, 0x67, 0x61, 0x6C, 0x20, 0x56, 0x65, 0x6E, 0x64, 0x6F, 0x72, 0x20, 0x49, 0x44, 0x00, }; +#endif Modified: trunk/reactos/hal/halx86/generic/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/display…
============================================================================== --- trunk/reactos/hal/halx86/generic/display.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/display.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -31,8 +31,10 @@ NTAPI HalDisplayString(IN PCH String) { +#ifndef _MINIHAL_ /* Call the Inbv driver */ InbvDisplayString(String); +#endif } /* Modified: trunk/reactos/hal/halx86/generic/dma.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/dma.c?r…
============================================================================== --- trunk/reactos/hal/halx86/generic/dma.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/dma.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -75,11 +75,15 @@ #define NDEBUG #include <debug.h> +#ifndef _MINIHAL_ static KEVENT HalpDmaLock; static LIST_ENTRY HalpDmaAdapterList; static PADAPTER_OBJECT HalpEisaAdapter[8]; +#endif static BOOLEAN HalpEisaDma; +#ifndef _MINIHAL_ static PADAPTER_OBJECT HalpMasterAdapter; +#endif static const ULONG_PTR HalpEisaPortPage[8] = { FIELD_OFFSET(DMA_PAGE, Channel0), @@ -92,6 +96,7 @@ FIELD_OFFSET(DMA_PAGE, Channel7) }; +#ifndef _MINIHAL_ static DMA_OPERATIONS HalpDmaOperations = { sizeof(DMA_OPERATIONS), (PPUT_DMA_ADAPTER)HalPutDmaAdapter, @@ -111,6 +116,7 @@ NULL /*(PBUILD_SCATTER_GATHER_LIST)HalBuildScatterGatherList*/, NULL /*(PBUILD_MDL_FROM_SCATTER_GATHER_LIST)HalBuildMdlFromScatterGatherList*/ }; +#endif #define MAX_MAP_REGISTERS 64 @@ -118,6 +124,7 @@ /* FUNCTIONS *****************************************************************/ +#ifndef _MINIHAL_ VOID HalpInitDma(VOID) { @@ -154,6 +161,7 @@ */ HalGetDmaAdapter = HalpGetDmaAdapter; } +#endif /** * @name HalpGetAdapterMaximumPhysicalAddress @@ -185,6 +193,7 @@ return HighestAddress; } +#ifndef _MINIHAL_ /** * @name HalpGrowMapBuffers * @@ -428,6 +437,7 @@ return AdapterObject; } +#endif /** * @name HalpDmaInitializeEisaAdapter @@ -564,6 +574,7 @@ return TRUE; } +#ifndef _MINIHAL_ /** * @name HalGetAdapter * @@ -896,6 +907,7 @@ Length, CacheEnabled ? MmCached : MmNonCached); } +#endif /** * @name HalpDmaGetDmaAlignment @@ -984,6 +996,7 @@ return Count; } +#ifndef _MINIHAL_ /** * @name HalpGrowMapBufferWorker * @@ -1893,6 +1906,7 @@ */ return PhysicalAddress; } +#endif /** * @name HalFlushCommonBuffer 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] Wed Mar 3 22:56:52 2010 @@ -91,8 +91,10 @@ KeBugCheckEx(MISMATCHED_HAL, 1, Prcb->MajorVersion, 1, 0); } +#ifndef _MINIHAL_ /* Initialize the PICs */ HalpInitializePICs(TRUE); +#endif /* Force initial PIC state */ KfRaiseIrql(KeGetCurrentIrql()); @@ -107,9 +109,17 @@ HalQuerySystemInformation = HaliQuerySystemInformation; HalSetSystemInformation = HaliSetSystemInformation; HalInitPnpDriver = NULL; // FIXME: TODO +#ifndef _MINIHAL_ HalGetDmaAdapter = HalpGetDmaAdapter; +#else + HalGetDmaAdapter = NULL; +#endif HalGetInterruptTranslator = NULL; // FIXME: TODO +#ifndef _MINIHAL_ HalResetDisplay = HalpBiosDisplayReset; +#else + HalResetDisplay = NULL; +#endif HalHaltSystem = HaliHaltSystem; /* Register IRQ 2 */ @@ -125,8 +135,10 @@ /* Setup busy waiting */ HalpCalibrateStallExecution(); +#ifndef _MINIHAL_ /* Initialize the clock */ HalpInitializeClock(); +#endif /* * We could be rebooting with a pending profile interrupt, @@ -142,6 +154,7 @@ /* Initialize bus handlers */ HalpInitBusHandler(); +#ifndef _MINIHAL_ /* Enable IRQ 0 */ HalpEnableInterruptHandler(IDT_DEVICE, 0, @@ -160,6 +173,7 @@ /* Initialize DMA. NT does this in Phase 0 */ HalpInitDma(); +#endif /* Do some HAL-specific initialization */ HalpInitPhase1(); Modified: trunk/reactos/hal/halx86/generic/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/misc.c?…
============================================================================== --- trunk/reactos/hal/halx86/generic/misc.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/misc.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -28,6 +28,7 @@ return; } +#ifndef _MINIHAL_ PVOID NTAPI HalpMapPhysicalMemory64(IN PHYSICAL_ADDRESS PhysicalAddress, @@ -51,6 +52,7 @@ // MmUnmapIoSpace(VirtualAddress, NumberPages << PAGE_SHIFT); } +#endif VOID NTAPI @@ -122,6 +124,7 @@ NTAPI HalHandleNMI(IN PVOID NmiInfo) { +#ifndef _MINIHAL_ SYSTEM_CONTROL_PORT_B_REGISTER SystemControl; // @@ -202,6 +205,7 @@ // Halt the system // InbvDisplayString("\n*** The system has halted ***\n"); +#endif // // Enter the debugger if possible Modified: trunk/reactos/hal/halx86/generic/pic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/pic.c?r…
============================================================================== --- trunk/reactos/hal/halx86/generic/pic.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/pic.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -14,6 +14,7 @@ /* GLOBALS ********************************************************************/ +#ifndef _MINIHAL_ /* * This table basically keeps track of level vs edge triggered interrupts. * Windows has 250+ entries, but it seems stupid to replicate that since the PIC @@ -1335,3 +1336,28 @@ } } +#else + +KIRQL +NTAPI +KeGetCurrentIrql(VOID) +{ + return PASSIVE_LEVEL; +} + +VOID +FASTCALL +KfLowerIrql( + IN KIRQL OldIrql) +{ +} + +KIRQL +FASTCALL +KfRaiseIrql( + IN KIRQL NewIrql) +{ + return NewIrql; +} + +#endif Modified: trunk/reactos/hal/halx86/generic/reboot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/reboot.…
============================================================================== --- trunk/reactos/hal/halx86/generic/reboot.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/reboot.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -98,8 +98,10 @@ case HalHaltRoutine: case HalRebootRoutine: +#ifndef _MINIHAL_ /* Acquire the display */ InbvAcquireDisplayOwnership(); +#endif /* Call the internal reboot function */ HalpReboot(); Modified: trunk/reactos/hal/halx86/generic/systimer.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/systime…
============================================================================== --- trunk/reactos/hal/halx86/generic/systimer.S [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/systimer.S [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -329,6 +329,7 @@ ret .endfunc +#ifndef _MINIHAL_ .globl _KeStallExecutionProcessor@4 .func KeStallExecutionProcessor@4 _KeStallExecutionProcessor@4: @@ -359,6 +360,7 @@ /* Return */ ret 4 .endfunc +#endif .global _KeQueryPerformanceCounter@4 .func KeQueryPerformanceCounter@4 Modified: trunk/reactos/hal/halx86/generic/timer.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/timer.c…
============================================================================== --- trunk/reactos/hal/halx86/generic/timer.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/timer.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -109,6 +109,7 @@ HalpCurrentRollOver = RollOver; } +#ifndef _MINIHAL_ VOID FASTCALL HalpClockInterruptHandler(IN PKTRAP_FRAME TrapFrame) @@ -160,6 +161,7 @@ /* Spurious, just end the interrupt */ KiEoiHelper(TrapFrame); } +#endif /* PUBLIC FUNCTIONS ***********************************************************/ Modified: trunk/reactos/hal/halx86/generic/usage.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c…
============================================================================== --- trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -63,6 +63,7 @@ HalpIDTUsage[SystemVector].BusReleativeVector = BusVector; } +#ifndef _MINIHAL_ VOID NTAPI HalpEnableInterruptHandler(IN UCHAR Flags, @@ -87,6 +88,7 @@ /* Enable the interrupt */ HalEnableSystemInterrupt(SystemVector, Irql, Mode); } +#endif /* * @unimplemented 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] Wed Mar 3 22:56:52 2010 @@ -35,4 +35,41 @@ <pch>hal.h</pch> </directory> </module> + <module name="mini_hal" type="objectlibrary"> + <include>include</include> + <include base="ntoskrnl">include</include> + <define name="_NTHAL_" /> + <define name="_NTSYSTEM_" /> + <define name="_MINIHAL_" /> + <directory name="generic"> + <directory name="bus"> + <file>bushndlr.c</file> + <file>isabus.c</file> + <file>halbus.c</file> + <file>pcibus.c</file> + <file>pcidata.c</file> + <file>sysbus.c</file> + </directory> + <file>beep.c</file> + <file>bios.c</file> + <file>cmos.c</file> + <file>dma.c</file> + <file>display.c</file> + <file>drive.c</file> + <file>misc.c</file> + <file>pic.c</file> + <file>portio.c</file> + <file>processor.c</file> + <file>profil.c</file> + <file>reboot.c</file> + <file>spinlock.c</file> + <file>sysinfo.c</file> + <file>systimer.S</file> + <file>timer.c</file> + <file>usage.c</file> + </directory> + <directory name="up"> + <file>halinit_up.c</file> + </directory> + </module> </group> Modified: trunk/reactos/hal/halx86/include/hal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/hal.h?r…
============================================================================== --- trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] (original) +++ trunk/reactos/hal/halx86/include/hal.h [iso-8859-1] Wed Mar 3 22:56:52 2010 @@ -17,8 +17,12 @@ #undef _NTHAL_ #undef DECLSPEC_IMPORT #define DECLSPEC_IMPORT +#ifndef _MINIHAL_ #undef NTSYSAPI #define NTSYSAPI __declspec(dllimport) +#else +#undef _NTSYSTEM_ +#endif /* IFS/DDK/NDK Headers */ #include <ntifs.h>
14 years, 9 months
1
0
0
0
[fireball] 45808: - GreSetDIBits: Don't leak a surface lock in case parameters check fails. - GreSetDIBits: Add a (now commented out) optimisation for directly copying bits if source and target bitmaps parameters closely match. Based on a similar winex11.drv optimisation in this function.
by fireball@svn.reactos.org
Author: fireball Date: Wed Mar 3 22:50:51 2010 New Revision: 45808 URL:
http://svn.reactos.org/svn/reactos?rev=45808&view=rev
Log: - GreSetDIBits: Don't leak a surface lock in case parameters check fails. - GreSetDIBits: Add a (now commented out) optimisation for directly copying bits if source and target bitmaps parameters closely match. Based on a similar winex11.drv optimisation in this function. Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c Modified: branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
============================================================================== --- branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c [iso-8859-1] (original) +++ branches/arwinss/reactos/subsystems/win32/win32k/gre/bitblt.c [iso-8859-1] Wed Mar 3 22:50:51 2010 @@ -596,7 +596,10 @@ } if (!ScanLines || (StartScan >= bitmap->SurfObj.sizlBitmap.cy)) + { + SURFACE_Unlock(bitmap); return 0; + } if (StartScan + ScanLines > bitmap->SurfObj.sizlBitmap.cy) ScanLines = bitmap->SurfObj.sizlBitmap.cy - StartScan; @@ -706,6 +709,41 @@ PALETTE_FreePaletteByHandle(DIB_Palette); EngUnlockSurface(SourceSurf); EngDeleteSurface((HSURF)SourceBitmap); + +#if 0 + /* optimisation for the case where the input bits are in exactly the same + * format as the internal representation and copying to the app bits is + * cheap - saves a round trip to the X server */ + if (bmi->bmiHeader.biCompression == BI_RGB && + ColorUse == DIB_RGB_COLORS && + bmi->bmiHeader.biBitCount == BitsPerFormat(bitmap->SurfObj.iBitmapFormat)/* && bmi->bmiHeader.biBitCount != 1*/) + { + unsigned int srcwidthb = abs(bitmap->SurfObj.lDelta); + int dstwidthb = abs(bitmap->SurfObj.lDelta);//DIB_GetDIBWidthBytes( bmi->bmiHeader.biWidth, bmi->bmiHeader.biBitCount ); + LPBYTE dbits = bitmap->SurfObj.pvBits, sbits = (LPBYTE)Bits + (StartScan * srcwidthb); + int widthb; + UINT y; + + //DPRINT("syncing compatible set bits to app bits\n"); + if ((bmi->bmiHeader.biHeight < 0) ^ (bitmap->SurfObj.lDelta > 0)) + { + dbits += dstwidthb * (ScanLines-1); + dstwidthb = -dstwidthb; + } + + widthb = min(srcwidthb, abs(dstwidthb)); + + DPRINT1("srcwidthb %d, dstwidthb %d, widthb %d\n", srcwidthb, dstwidthb, widthb); + DPRINT1("src bitcount %d, dst bitformat %d, dst bytesize %d vs scanlines * width %d\n", + bmi->bmiHeader.biBitCount, bitmap->SurfObj.iBitmapFormat, bitmap->SurfObj.cjBits, + ScanLines * dstwidthb); + + for (y = 0; y < ScanLines; y++, dbits += dstwidthb, sbits += srcwidthb) + memcpy(dbits, sbits, widthb); + + result = ScanLines; + } +#endif SURFACE_Unlock(bitmap);
14 years, 9 months
1
0
0
0
← Newer
1
...
79
80
81
82
83
84
85
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200