Commit graph

126 commits

Author SHA1 Message Date
Justin Miller
0a951f1112
[BOOTDATA] Add SMP Entry (#5859)
[HALX86] Enable SMP Hal for x86
[BOOTDATA] add livecd and set entrys
2023-11-01 06:43:44 -07:00
Hermès Bélusca-Maïto
bd0eaa924d
[HALX86] HalHandleNMI: Re-enable debugger-entering code. 2023-08-03 13:26:24 +02:00
Adam Słaboń
ce2d4740a6
[SDK][HAL] Enable x86Bios on x86 (#5454)
This will be needed for compatibility with x86 Windows Vista/7 videoprt.sys builds.
Might be also useful in future for platforms (x86 , ...) where V86 mode is not available or buggy.

CORE-11954, CORE-18185
2023-07-20 21:44:44 +02:00
Hermès Bélusca-Maïto
18815558d1
[HALX86] Update the PCI hardware IDs database.
Extracted from the pci.ids database at https://pci-ids.ucw.cz/ from 2023-06-19 03:15:02.
Maintained by Albert Pool, Martin Mares, and other volunteers from the PCI ID Project.
2023-07-16 20:52:07 +02:00
Hermès Bélusca-Maïto
eba1244b00
[HALX86] Convert the PCI Ids files to LF ('\n') endlines, and adjust the parsing code. (#4905)
This allows to somewhat reduce their size, and the resulting size
of the generated hal.dll file.

pci_classes.ids
Before: 6,207 bytes
After : 5,968 bytes
Reduction: 239 bytes --> 4%

pci_vendors.ids
Before: 1,370,248 bytes
After : 1,334,622 bytes
Reduction: 35,626 bytes --> 2.6%

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2023-07-16 20:51:56 +02:00
Hermès Bélusca-Maïto
3854a5d8e9
[CODEBASE] Fix "uknown" / "unkown" etc. typos.
Only done in our own code, not in 3rd-party or in PSDK headers
(official ones also have such typos in defines...)

(NOTE: apparent "Uknown" typo in dll/cpl/sysdm/smbios.c is on-purpose:
typo by the manufacturer.)
2023-07-15 14:19:04 +02:00
Victor Perevertkin
16882dcfa4
[HALX86] Bugcheck in case the ACPI initialization failed (for ACPI HAL) (#5376)
CORE-16302
2023-07-02 02:01:11 +03:00
Hermès Bélusca-Maïto
bd5209d9f4
[HALX86] These HalpNo* functions are actually _implemented_. Document their purpose.
Remove the misleading comment in HalpNoBusData().
Update the SAL annotations.
2023-06-25 21:25:06 +02:00
Hermès Bélusca-Maïto
9ba1849a97
[HAL][MINIHAL] Minor cleanup in reboot.c files (#5359)
And remove pic/processor.c from minihal compilation.
2023-06-25 19:39:44 +02:00
Hermès Bélusca-Maïto
3fa613b9da
[MINIHAL] Remove sysinfo.c from compilation. 2023-06-20 22:40:58 +02:00
Hermès Bélusca-Maïto
d6a78d580b
[HALX86] Tabs to 4-space indentation in generic/sysinfo.c + Fix typo "ALMI" -> "AMLI" 2023-06-20 22:40:57 +02:00
Hermès Bélusca-Maïto
d03fc32e7d
[MINIHAL] Remove unneeded files from compilation. 2023-06-20 18:39:01 +02:00
Hermès Bélusca-Maïto
7e1510eb9c
[HALX86] Implement HalpcGetCmosData and HalpcSetCmosData. 2023-06-19 21:09:03 +02:00
Hermès Bélusca-Maïto
113656563a
[HALX86] Minor fixes in HaliFindBusAddressTranslation()
- Remove ContextValue variable. This variable erroneously truncated
  *Context value (that can contain a pointer value) to 32 bits.

- Gracefully fail instead of asserting.
2023-06-14 11:27:24 +02:00
Hermès Bélusca-Maïto
5871716c64
[HALX86] Update the PCI hardware IDs database.
Extracted from the pci.ids database at https://pci-ids.ucw.cz/ from 2022-11-25 03:15:01 .
Maintained by Albert Pool, Martin Mares, and other volunteers from the PCI ID Project.
2022-11-25 16:17:10 +01:00
Timo Kreuzer
3381bf39db [HAL/x64] Fix x86BiosCall
Use an INT call stub and exit on the address after the stub instead or using iret (some BIOS code uses int / iret internally). This fixes the messed up display when trying to switch modes.
2022-11-24 21:17:58 +02:00
Serge Gautherie
ba1ed89f91
[HALX86] HalpQueryInterface(): Debug log InterfaceType param (#4772)
This should help to find out which GUIDs are actually wanted.
Based on CircularTriangle06's patch.

CORE-11632
2022-11-15 02:04:04 +03:00
Timo Kreuzer
f8b6cc249e [HAL] Add missing I/O port to int 10 BIOS emulator 2022-08-04 16:15:24 +02:00
Dmitry Borisov
734cd5e842 [PCI][HALX86] Support PCI debugging devices
Also optimize the PCI bus scanning

CORE-17360
2022-06-06 01:47:21 +03:00
Dmitry Borisov
6f4be52a1c
[HALX86] Print the correct size of the BAR in HalpDebugPciDumpBus()
Reference: https://wiki.osdev.org/PCI#Address_and_size_of_the_BAR

To determine the amount of address space needed by a PCI device,
you must save the original value of the BAR, write a value
of all 1's to the register, then read it back.

Note: 64-bit BARs are not supported yet.
2022-05-26 16:40:17 +03:00
Hermès Bélusca-Maïto
94c25baf85
[HAL][HALARM] The HAL should only use KPCR.
And why the ARM HAL uses KPCR::InterruptRoutine, a field only defined
in *powerpc*/ketypes.h, is beyond me, but OK...

See Timo vs. Alex discussion, explaining that KIPCR is a ReactOS-only
thing: https://reactos.org/archives/public/ros-dev/2008-August/010549.html
2022-05-08 17:21:44 +02:00
Hermès Bélusca-Maïto
c026b5950e
[FREELDR][MINIHAL] Move KefAcquireSpinLockAtDpcLevel stub back to HAL, #ifdef'ed in _MINIHAL_ where it's only needed. 2022-05-08 17:21:43 +02:00
Hermès Bélusca-Maïto
39b8d45592
[MINIHAL] Compile with _NTSYSTEM_ since it's also part of the bootloader.
Fixes compilation because the Hal(Private)DispatchTable's, defined in
the bootloader's NTOS stub, are not external imports, as they would be
for a standard HAL.
2022-05-08 04:15:51 +02:00
Victor Perevertkin
4295b007ae
[HALX86] Do not define unnamed enums 2022-04-26 03:38:37 +03:00
Dmitry Borisov
269f3a2b24 [HALXBOX] Do not claim interrupt resources for the KD COM port
The actual COM port lacks SERIRQ, IRQ 4 is hardwired to the NIC

CORE-15872 CORE-16216
2022-04-16 11:54:24 +03:00
Hermès Bélusca-Maïto
e5d17a0219
[HALX86:ACPI] Use the correct PCH file for compilation.
This also removes the following warnings, that were present because,
as the ACPICA acpi.h header was used as PCH (instead of none, or the
hal's own main header), it was "included" before any other header
-- and in particular, before hal.h -- and as a result, colliding defines
were still defined even if the #undef tricks were used for them.

rosbuilds\sdk\include\reactos\mc\bugcodes.h(1417): warning C4005: 'ACPI_BIOS_ERROR': macro redefinition
reactos\drivers\bus\acpi\acpica\include\acoutput.h(243): note: see previous definition of 'ACPI_BIOS_ERROR'
reactos\hal\halx86\include\hal.h(41): warning C4109: unexpected identifier '_read'
reactos\hal\halx86\include\hal.h(42): warning C4109: unexpected identifier '_read'
2022-04-09 20:18:03 +02:00
Justin Miller
eebe11ae0c
[HALX86] Add support for parsing ACPI MADT tables 2022-04-07 22:54:32 +03:00
Justin Miller
5c79900519
[HALX86] Add a way to print the ProcessorTable data on bootup 2022-04-07 22:54:32 +03:00
Justin Miller
a09f925c1c
[HALX86] Implement HalpSetupProcessorsTable
Add a helper function for getting a pointer to the PRCB of every processor
in the system and assign it to the PROCESSOR_IDENTITY struct.
2022-04-07 22:54:31 +03:00
Justin Miller
0fc21e5a9b
[HALX86] Add function prototypes needed for parsing ACPI MADT table
- Use ACPICA headers to gather the information.
- Add PROCESSOR_IDENTITY structure that will be used by all APIC HALs.
2022-04-07 22:54:13 +03:00
Hermès Bélusca-Maïto
215148267e
[HALX64] Do not claim to handle display reset if you don't. Fix bootvid display initialization in x64 as a result.
The HalpBiosDisplayReset() function is currently stub-plemented.
Returning FALSE will make bootvid take the route of fully
re-initializing the VGA display all by itself.
2022-03-28 00:32:25 +02:00
Thomas Faber
6eccbe27ec
[HAL:APIC] Ensure the interrupt gets requested immediately in ApicRequestSelfInterrupt. CORE-17663 2022-02-13 17:15:00 -05:00
Serge Gautherie
0fd3e51580
[HALX86] HalpDmaAllocateChildAdapter(): Fix memory leak, on error (#4156)
Simplify code, instead of adding 2 missing ObDereferenceObject().
(Note that ObInsertObject() always dereferences the object in case of failure.)

CORE-17904
2021-12-20 21:14:36 +01:00
Hervé Poussineau
b39ae9f32b [HALX86] Implement HalBuildScatterGatherList
Make HalGetScatterGatherList a wrapper around it.
2021-11-07 14:07:57 +01:00
Hervé Poussineau
eb283043d5 [HALX86] Partly implement HalCalculateScatterGatherListSize 2021-11-07 14:07:55 +01:00
Hervé Poussineau
88839d9726 [HALX86] Stub-implement scatter/gather DMA operations
These are required when we ask for a DMA_ADAPTER version 2.
2021-11-01 18:16:25 +01:00
Victor Perevertkin
8e1fa03456
[CMAKE] Replace custom scripts in compilerflags with standard ones
- add_target_link_flags changed to target_link_options
- add_target_property changed to set_property(... APPEND ...)
2021-09-14 17:56:22 +03:00
Hermès Bélusca-Maïto
9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Serge Gautherie
6a5472a754 [HALX86:APIC] apic.c: Use new defines some more
Follow-up to b7a149f.
2021-09-03 23:20:10 +03:00
Timo Kreuzer
3e1454c739 [HAL/APIC] Make the real time clock more precise
The interval time is now calculated in 0.1ns precision and a running fraction on the 100ns interval is updated on each clock interrupt.
Also adjust minimum, maximum and default clock rate to what Windows uses.
2021-07-19 23:05:03 +02:00
Timo Kreuzer
aa3ef4c632 [HAL/APIC] Fix clock initialization
Previously we enabled the timer interrupt, before the kernel was notified of our time increment, so when a clock interrupt happened, it would increment the tick count, but add 0 to the system time, resulting in an invalid state, in which timers would be inserted into the wrong timer table slot. Fixes CORE-16253
2021-07-19 23:05:03 +02:00
Timo Kreuzer
aedb97df47 [HAL/APIC] Use APIC_CLOCK_VECTOR everywhere, instead of keeping separate definitions 2021-07-19 23:05:03 +02:00
Jérôme Gardou
56d0bc31ce [HAL] Hack KeTryToAcquireQueuedSpinlock & KeTryToAcquireQueuedSpinLockRaiseToSynch into a somewhat working implementation 2021-06-29 11:49:20 +02:00
Timo Kreuzer
16e988d108 [HAL:APIC] Improve code
- Use an enum for the APIC registers
- Add support routine for SMP.
2021-06-26 21:10:43 +02:00
Timo Kreuzer
400af0cfc5 [HAL] Add smp component and build x64 smp hal
Like the up component it contains the spinlock code and now also the HalpBuildType variable.
2021-06-19 12:17:18 +02:00
Timo Kreuzer
a0fb02f7f3 [HAL] Fix build with CONFIG_SMP 2021-06-19 12:17:18 +02:00
Timo Kreuzer
5ee09256de [HAL] Add APIC hals to setup and livecd 2021-06-17 23:27:44 +02:00
Timo Kreuzer
64e52088d1 [HAL:APIC] Fix interrupt assignment
This is probably not how it is supposed to work, but the results are somewhat similar to what Windows has.
2021-06-17 23:27:44 +02:00
Timo Kreuzer
235d7472ba [HAL:APIC] Remove obsolete hacks
These hacks were used to work around broken VBox. VBox works fine without the hacks these days.
2021-06-17 23:27:44 +02:00
Timo Kreuzer
b7a149fcec [HAL:APIC] Code fixes
* Fix some broken code
* Add some ASSERTs
* Use ApicWriteIORedirectionEntry where appropriate
* Use KeQueryInterruptHandler/KeRegisterInterruptHandler to save/restore the old handler instead of saving the KIDTENTRY
* Move HalpProfileInterruptHandler to apictimer.c and implement it
* Use READ/WRITE_REGISTER macros
* Add some symbolic names
2021-06-17 23:27:44 +02:00