- Rename INIT_FUNCTION to INIT_SECTION and put it at the top of functions for consistency with __declspec declarations (it is actually possible to do this via __declspec in newer MSVC versions).
svn path=/trunk/; revision=69037
- Use a global variable HalpBuildType instead of a define when checking the BUILD (we don't recompile this code for SMP hal)
- Move registering IRQ2 out of the generic init code into HalInitializePICs
- Modify legacy HalpGetRootInterruptVector to use HalpIrqToVector and HalpVectorToIrql so it works with APIC, too
svn path=/trunk/; revision=53675
- give apic hal its own halinit_apic
- give minihal an own halinit_mini.c containing function stubs
- move HalInitializeProcessor to halinit.c and add hal specific function HalpInitProcessor
- get rid of all the #ifndef _MINIHAL_ in halinit.c and move the file to lib_hal_generic
- improve the hal version/build check
- Update spec file for amd64
svn path=/trunk/; revision=53625
- Add missing call to HalInitPnpDriver during I/O manager initialization. The HAL PnP driver was never getting initialized.
- Add HAL callback for HalInitPnpDriver. It's going to be needed in future for eVb's PCI driver to fully work (interrupt translation, among other things).
svn path=/trunk/; revision=48740
As a result, none of the Hal*Bus HALDISPATCH routines were implemented, which bus drivers expect to find when they're not on ACPI systems (ReactOS today). eVb's new PCI driver was crashing, for example.
Furthermore, legacy systems suffer, because the ACPI HAL Bus routines (that we currently have) expect perfect ACPI-style-compliant systems, not the legacy crap from the early 90ies. This works fine in VMs and new hardware, but old hardware is left behind.
This patch basically corrects the first part of the problem, by making the bus handling support separate between ACPI and non-ACPI HALs. For now, the code remains 100% the same in functionality between both.
However, I have started adding the first few elements:
[HAL]: Implement HalRegisterBusHandler HALDISPATCH routine.
[HAL]: On legacy HALs, register the CMOS, ISA, SYSTEM handlers.
[HAL]: Add cmosbus.c. Stub all bus-specific bus handler routines in the xxxbus.c files.
No real functionality change occurs with this patch, yet.
svn path=/trunk/; revision=47649
[HALACPI]: Support depends on boot loader creating the ACPI BIOS Multi Node structure in MultiFunctionAdapter in the hardware tree. It seems that FreeLdr does this (wow!) correctly!
[HALACPI]: Implement HAL ACPI Table Cache.
[HALACPI]: HAL ACPI Table Overrides from the boot loader are not supported (doubt FreeLdr does this).
[HALACPI]: The next steps are to write the HAL ACPI PnP Driver and HAL ACPI Power Driver.
svn path=/trunk/; revision=46613
[HAL]: Although currently implemented for ACPI support (to come), these APIs can now also be used to enable DMA in Phase 0 like NT, instead of only in Phase 1 like ReactOS.
svn path=/trunk/; revision=46612
[HAL]: Add code to detect EISA systems with ELCR (Edge/Level Control Register). Since the current HAL does not support these, warn users about any level/shared interrupts, since they are likely to cause trouble.
svn path=/trunk/; revision=45180
- Move the resource routines to their own file instead of sysinfo.c.
- Add missing members to PCIPBUSDATA.
- Kill old, unused generic.rbuild.
svn path=/trunk/; revision=43991
- Protect CMOS access with the CMOS spinlock.
- Add CMOS initialization to set up the default value of the CMOS century byte offset (not used yet).
- Stub out profile interrupt support in HAL. Register and stub out the profile interrupt handler, but don't handle it yet as vital parts of the rest of the implementation is missing.
- Fix several bugs in the kernel profile implementation:
- Don't hardcode to PROFILE_LEVEL when raising IRQL : HAL can override this, so use KiProfileIrql. Also, starting/stopping profile interrupts must be done at the profile IRQL, so don't lower it back before calling HAL, which is now enabled.
- Fix KeSet/QueryIntervalProfile to properly set/query profile intervals through HAL -- pass the correct structures and handle the ProfileAlignmentFixup case properly, and call HAL when setting the timer interval as the interval may be overridden by it.
- KeStartProfile returns BOOLEAN to tell if the profile was started or not, just like KeStopProfile.
- Make the interrupt implementation more portable for non-PIC architectures.
- Fix HalSystemVectorDispatchEntry; it returns a type (UCHAR), not TRUE/FALSE (BOOLEAN).
- Begin implementing the framework for querying HAL resource usage (keeping track of internal address space and vector registrations/usage).
svn path=/trunk/; revision=43832
- Fail on physical memory write like we do for read too.
- Don't handle OldVlm1/2 as they appear to be deprecated and unhandled in Windows.
- Implement HalHaltSystem to halt execution in a portable way. Default to xHalHaltSystem, a simple infinite loop, if we get called before HAL has initialized. Use this in KiBugCheckDebugBreak and the system shutdown handler instead of x86/AMD64/ARM intrinsics.
- Don't try to halt the CPU if KeBugCheck has been called 3 times or more -- if this happens, something has gone very wrong, and we shouldn't try to do anything special. Just loop infinitely.
- Fix KiBugCheckDebugBreak -- it shouldn't halt execution when called for the first chance as bugcheck callbacks have not been invoked at this point (nor has the BSOD been displayed). Use SEH to protect against a crash instead of checking KdDebuggerNotPresent as the debugger, if it is present, *could* disconnect while the trap is being handled. Also, don't halt execution if the debugger handled the breakpoint, just break again.
- Don't call MmMapIoSpace from HalpReboot! The reboot might take place at elevated IRQL (as high as HIGH_LEVEL if called from KeBugCheck), and thus can't use any Mm support routines. Use a PTE from the reserved HAL region and map it ourselves instead as done in the BIOS call code.
- Acquire the display ownership in HalReturnToFirmware in case the caller hasn't done so (as done in the KD reboot routine, for example).
- Just include ntndk.h in hal.h instead of including 6 NDK headers (which turns into more than half of the NDK anyway since those headers include other NDK headers).
- Crashing and rebooting from KD now works properly.
svn path=/trunk/; revision=43380
- Reimplement HalpCalibrateStallExecution which was removed in r24964. Real Windows uses a different algorithm, however existing one seems to work acceptably. This patch is critical for devices support on real hardware. The only downside is that uniata initialization takes a substantial amount of time now, this is going to be investigated. Patch by Daniel Zimmermann.
See issue #4600 for more details.
svn path=/trunk/; revision=43364
- Implement HalResetDisplay using those routines.
- Uncomment a display reset in bootvid (as real Windows bootvid does).
- Remove 1 sec delay from the shutdown thread.
- As a result, no more red screen flashing at the end of the 1st stage, shutdown quotes are displayed again, and BSODs are shown correctly.
svn path=/trunk/; revision=31251
Revert r31198 and part of r31194, and replace them by compile-time define in pci.c
Don't use one rbuild file per hal, but merge them into one
Share halinit.c between UP and MP versions
svn path=/trunk/; revision=31207
- Move sysbus.c contents (a 4 line function) into bus.c.
- Unify initialization code.
- Delete and disable stall execution calibration (currently using the default). Will implement later in a more precise manner (this routine was bizarly setting the MHz of the CPU in the PRCB in some cases...).
svn path=/trunk/; revision=24964
- Only map the 0x0 physical address in HalpReboot when enabling warm-reboot, there's no need to map it during init and keep it allocated during the whole time.
svn path=/trunk/; revision=24962
- Implement KeStallExecutionProcessor in its own assembly file isntead of using inlined GCC assembly, and align the loop to 16 bytes for more streamlined execution speed.
- Mask out clock interrupt during Phase 0 and Initialize clock interrupt on HAL Phase 1. This enables the HAL clock interrupt which was already written.
- Make the clock interrupt use HalpCurrentTimeIncrement instead of hardcoding a value.
- Re-implement HalpInitializeClock to allow for dynamic increments from 1ms to 15ms with appropriate rollovers and to call KeSetTimeIncrement to update timer values with the kernel.
- Implement HalSetTimeIncrement to allow changing the clock ms increment (but this isn't yet respected).
- Remove system/runtime update routines from the deprecated IRQ implementation and use the newer assembly ones already written, since we're now using the HAL clock interrupt. Remove other unused code.
- Fix more bugs in new hal IRQ implementation (that still isn't used yet due to regressions) and implement HalClearSoftwareInterrupt.
svn path=/trunk/; revision=24908
- Initailize the clock increment separately from the calibration of stall execution.
- Raise IRQL to the current IRQL (basically a no-op) to force a standard PIC state. Will be needed for the new IRQ implementation when it'll work.
- Scan commandline for PCILOCK and BREAK parameters during hal initalization. The former is not supported, only saved, while the latter causes a breakpoint just like the windows implemetnation.
- Get the bus type (ISA, EISA, MCA) on startup to support bootup from NTLDR.
- Validate HAL to match the kernel (checked kernel and UP kernel). Also make the kernel set the proper PRCB flags for this.
- Initialize the CMOS lock.
- Setup HAL Dispatch table and enable call to HalQuerySystemInformation in the kernel since it now works.
- Rewrite bus functions to get rid of the idea of "Bus handlers". This is a deprecated NT4 concept that ReactOS copied and only slows down performance.
- Support custom private dispatch table PCI functions.
- Provide default PCI functions.
- Rewrite PCI functions using clean structures and code instead of magic macros and undocumented magic values. Use simple macros to generate PCI bus operations for write/read uchar, ushort and ulong.
- Simplify function definitions for CMOS access.
- Unify some dupli/tripi-cated code.
- Fix definition of HaliSetSystemInformation.
- Fix definitions of Bus Handler functions (add NTAPI).
- Add official BUS_HANDLER definition to NDK.
- Fix definition of HAL_PRIVATE_DISPATCH.
- Remove some derecated code (isa.c and mca.c).
svn path=/trunk/; revision=24872
- Matching HAL MP HalStartNextProcessor() and commenting out a call to HaliStartApplicationProcessor() (because it needs ProcessorContext). Proper fix should be done.
- Removing HalReportResourceUsage from MP version, and marking what it did differently as FIXME in the generic version.
svn path=/trunk/; revision=24763
- Remove fmutex.c and fastmutex functions from HAL. The whole point of having the Exi ones in the kernel was that HAL calls them through forward exports now (so any old driver can still link with HAL). Now we don't duplicate the implementation anymore.
- Remove DriverEntry, it's useless. Also move HalReportResourceUsage to halinit because it's a call-once-on-boot function much akin a HalInitPhase2 function, so delete resource.c
- Keep track of interrupt affinity and active processor mask each time a new CPU initializes.
svn path=/trunk/; revision=24762
- Implement (or cleanup + mark as implemented, these are 4 line functions) HalDisplayString, HalAcquireDisplayOwnership, HalSetDisplayParameters, HalQueryDisplayParameters, HalInitailizeProcessor, HalAllProcessorsStarted, HalStartNextProcessor, HalProcessorIdle, HalRequestIpi.
- Fix some prototype definitions and cleanup some formatting.
svn path=/trunk/; revision=24759
- HAL DMA enhancements by Filip Navara.
- CSRSS Console enhancements by Filip Navara.
- Win32k Primitive Queue/Input/Painting/Focus enhancements by Filip Navara.
- Other misc win32k/CSR bug fixes by Filip Navara.
- The new bootvid code has some bugs, but try out a GUI Boot!
svn path=/trunk/; revision=24464
- Implemented KiRosFrldrLpbtoNtLpb to do a lightweight conversion and setup. Next patches will try to get rid of PLOADER_MODULE and use LDR_DATA_TABLE_ENTRY as well as increase bootstrap compatibility.
svn path=/trunk/; revision=24305
- Basically revert the new HAL/KERNEL IRQ code by putting the old one in, but without the actual pain of svn reverting and losing all the previous code.
- The old code goes in ntoskrnl\deprecated, and we only add a comment to the .rbuild file, re-export an old function, and initialize the old code in kernel.c. All the other kernel changes stay in-place to be tested.
- Same for hal, basically replace irq.S with irql.c in the .rbuild file, and disable the call to Halpinit1. All the other changes remain.
svn path=/trunk/; revision=23707
- Remove KrnlFun entry - IRQs are now done through a typical NT/ROS trap frame and are synchronized and compatible with trap.S.
- Enable 2nd entry interrupt calls in HalBeginSystemInterrupt, since IRQs now use the right trap frame.
svn path=/trunk/; revision=23697
- Enable clock.S versions of KeUpdateSystem/RunTime and export them properly.
- Enable systimer.S to call into kernel's KeUpdateSystemTime.
- Enable Hal's Clock Interrupt during Phase 1.
- Remove most of the code that was still left in irq.c
- Only one large problem remains now, which is the spurious firing of the clock interrupt before we're ready to handle it... I will try to fix this today.
svn path=/trunk/; revision=23692
- Implement KeDisconnectInterrupt with the new implementation.
- Put Clock Interrupt initialization in the right place (might still be too late: must investigate more).
- Added a debug print when unexpected interrupts are called, just noticed this happens on my checked machine, and it's a useful tracing tool.
svn path=/trunk/; revision=23678
- Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were defined in the NDK in one way, but implemented another way, and since the HAL didn't include its own NDK file, the compiler didn't realize this. Calls of these functions might've experienced serious problems.
- Also fix HalHandleNmi and HalInitSystem definitions.
- Add stub code to actually setup the Clock Interrupt.
svn path=/trunk/; revision=23670
- Remove some internal APIs/types from public headers.
- Make PSECTION_OBJECT a PVOID unless really needed (which should only be inside \mm)
- Make hal buildable on msvc.
- Fix some other misc. various msvc/ddk incompatibilities.
svn path=/trunk/; revision=20696
ShowTime=No
MinimalUI=Yes
MenuBox=No
CenterMenu=No
TimeText=Seconds until highlighted choice will be started automatically:
Also make sure the following are set:
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
SelectedTextColor=Black
SelectedColor=Gray.
- Also made the boot-up screen black, not blue, since that's the actual color it's been after NT4. If booting without NOGUIBOOT, this results in a much nicer transition to the boot screen (especially if using the NTLDR theme)
- Some other minor changes done to simplify transitions while booting. Hoping for filip to finish his Bootvid patch to remove the last annoying gui->text->gui switch near the end :).
svn path=/trunk/; revision=20366