The UEFI boot menu countdown was broken for two reasons:
- StallExecutionProcessor and UefiHwIdle were empty stubs, so the countdown
had no actual delay and no proper idle, it ran instantly without waiting
KbHit used ReadKeyStroke to poll for input, which consumed the keystroke
before GetCh could read it.
This fixes both: StallExecutionProcessor and UefiHwIdle now have real
implementations using BootServices->Stall and a timer event.
KbHit is changed to use CheckEvent(WaitForKey) which polls availability
without consuming the key.
CORE-11954
ROSTESTS-416
More and more winetests we import from Wine hardcode the `C:\Windows`
path and thus, are brittle (read: unreliable) whenever they are run
on any other configuration where Windows (or ReactOS) is **NOT**
installed in this path.
Dedicated to Carl Bialorucki ;)
Intel Macs released before late 2008/early 2009 are missing the UEFI GOP,
resulting in a frozen/white screen when booting FreeLoader.
These Macs only have the UGA protocol, which does not support direct
framebuffer access, and Apple's proprietary Graphics Info Protocol
(sometimes also called Screen Info Protocol) which can be used
to get all the graphics information we need.
CORE-11954
Prepare for Console IME Input for East Asian.
JIRA issue: CORE-20243
- Modify .github/labeler.yml.
- Add base/system/conime/ .
- Modify boot/bootdata/hivesft.inf for Console
settings.
- Add imm32!ImmCallImeConsoleIME prototype
into <imm32_undoc.h>.
- Add IMS_CONSOLEIME_1A and IMS_CONSOLEIME_1B
values into <imm32_undoc.h>, for WM_IME_SYSTEM
message.
On many Intel Macs and likely other EFI 1.x devices, allocating
the disk buffer with AllocatePool fails with `EFI_OUT_OF_RESOURCES`.
This causes FreeLoader hardware detection failure on Macs.
Workaround this issue by allocating with `MmAllocateMemoryWithType`
if `AllocatePool` via Boot Services fails.
CORE-11954
Prefer using the syntax:
`FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[k]) + ...;`
which is in general clearer and explicitly specifies the actual
number of resource descriptors used, over the other one:
`sizeof(CM_PARTIAL_RESOURCE_LIST) + (k-1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + ...;`
Based on a suggestion by Dmitry Borisov.
Stop pointless target_sources(xxx PRIVATE $<TARGET_OBJECTS:gcc_ssp_nt>). The only effect it has is to force the object file into the target, which was already done by specifying the libraries as OBJECT libraries, which is also pointless, and only leads to problems.
This commit reworks how the uefidisk code works so it's not longer... completely wrong.
This also allows GPT disks to now be used on uefildr.
It's not perfect (as the correct solution is having freeldr load full efi device paths instead of arc like bootmgr does)
but this will work perfectly fine now. Well should.
Fix minor regression after commits f81c1910ee and e56911f66b (PR #7488).
The `PeLdrImportDllLoadCallback` variable was exported as a function,
instead of as data, which was incorrect since it is a data pointer,
that is set by winldr code (in rosload.exe) to tell the PE loader
(residing in freeldr.sys) to perform an action when an imported DLL
is being loaded.
Enable IMM mode and reduce
imm32_apitest failures.
JIRA issue: CORE-19268
- Enable LoadIMM registry setting.
NOTE: We have already DontLoadCTFIME
setting to avoid loading CTF IME.
Supporting CTF IME will be future work.
- Adjust DRQ timeout to fix some slow ATAPI devices.
- Add a fix for devices that clear BSY before raising the DRQ bit.
- Enable use of 32-bit I/O on Xbox.
CORE-17977 CORE-16216
This is the starting point where both support for generic framebuffer
video driver support (in bootvid and win32k) for XBOX, UEFI etc., and
in FreeLoader itself also for PC VESA, begins.
This command-line option can be used when chainloading freeldr.sys from
another bootloader. In this case, pcvideo.c uses this option to set an
initial display mode.
settings.c: Simplify also parsing the separate options from the command-line.
- Framebuffer routines that output characters with text-like attributes,
or return screen sizes in character units (columns/rows), pertain to a
"framebuffer console" (FbCons) layer.
Their interface may be extended a bit in the future.
- Add Doxygen documentation for some of them.
- The Xbox/UefiVideo* functions that are similarly character-oriented,
invoke these framebuffer console routines.
Addendum to commit 9e64fa837d (PR #8510)
CORE-16216, CORE-17977
pcmem.c: Surround more PC-specific routines in `!SARCH_XBOX || !SARCH_PC98`,
so that they aren't compiled for XBOX or PC98.
pcat.cmake: Inform that pcmem.c is used by pc98mem.c
CORE-16216
Addendum to commit 9e64fa837d (PR #8510)
Fixes GCC complaint when compiling for XBOX (or PC98)
```
boot/freeldr/freeldr/arch/i386/pc/machpc.c:1123:1: error: 'DetectKeyboardController' defined but not used [-Werror=unused-function]
DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
^~~~~~~~~~~~~~~~~~~~~~~~
```
Partial revert of 9decadee83.
It introduced a typo in the assembler code that broke the build.
Also, "Press any key" text fits into 512 bootsector space on both GCC/MSVC.
CORE-19882 CORE-17977
CORE-11954, CORE-16216
Here only moving and adjusting existing code has been done.
In the future, this code will be expanded to support other bits-per-pixel
formats and pixel bitmasks, available in UEFI platforms, and be used to
handle bios-based PC VESA framebuffer.
CORE-16216
machpc.c:
- Surround more PC-specific routines in `#if !defined(SARCH_XBOX)`,
so that they aren't compiled for XBOX.
- In particular since commit 246f2d29db (PR #8418), the PC-specific
`DiskGetConfigType()` was compiled at the same time as the XBOX one.
This is now fixed.
machxbox.c
- Add a dummy `ChainLoadBiosBootSectorCode()` to make freeldr exports working.
xboxdisk.c
- Minimal Disk I/O error support routines.
- Add a dummy `DiskResetController()`, invoked in pchw.c
- Add a dummy `DiskStopFloppyMotor()`, needed for entry.S/linux.S
miscboot.c
- Still compile `LoadAndBootSector()` (avoids lots of changes elsewhere),
but display an error message if it's run, and directly return with an error.
pcat.cmake
- Remove unnecessary dependencies on pcdisk.c and pcvesa.c
This allows FreeLoader to know which initial video mode it has been
started with (e.g. if chainloaded from another bootloader that has
set the display to something different from 80x25 text mode), and,
either update its internal state and use the video mode if supported,
or, fall back to a known supported video mode (80x25 text).
Cache the type when initializing the video, instead of invoking every time
`PcVideoDetectVideoCard()`. Indeed, the video card is not going to change
magically at runtime by the user :D
It contains the symbols & macros used for the embedded VGA font.
- Adjust users to use `const UCHAR*` instead of `PUCHAR` pointer;
- pc98video.c: Capture the current `FontPtr[Line]` into an `UCHAR`,
so as to safely modify it.
- `PcVideoDetectVideoCard()`: Fix the call to Int 10h AX=1A00h.
A 23-year old regression from commit 425bbb1543 (r3782), introduced
by a copy-pasta error when converting video code from ASM to C.
- `PcVideoSetMode80x50_80x43()`: Fix setting the 80x50 VGA text-mode,
which _is_ based on the 80x25 text-mode BIOS 0x03, see e.g.
https://github.com/torvalds/linux/blob/c2f2b01b74be8b40a2173372bcd770723f87e7b2/arch/x86/boot/video-vga.c
A 18-year old regression from commit 1b3e649577 (r25751), where the
correct mode 0x03 was replaced by a VGA graphics mode 0x12, whereas
the intent in this commit was to only switch to mode 0x12 only in
`PcVideoPrepareForReactOS()` -- this was because at that time, bootvid
and hal didn't support changing the video mode to what they needed.
This has been fixed since.
CORE-14603
The differentiation between a regular file loaded as a RamDisk and a
storage device volume, is done by invoking `ArcGetFileInformation()`
and looking at the `Information.Type` value.
CORE-14603
- Each filesystem exposes a `*GetVolumeSize()` routine that returns the
volume size it claims it reports (this is based on data from FAT/NTFS
BIOS Parameter Blocks, or EXTn/BTRFS superblocks, similarly to what
their NT filesystem drivers do).
- Given a device ID corresponding to a mountable drive, a top-level
`FsGetVolumeSize()` routine attempts to mount the corresponding filesystem.
This may fail if the device is not a drive, or if the filesystem is
not recognized. If it succeeds, then the per-filesytem `*GetVolumeSize()`
is invoked and the corresponding volume size is returned.