And deprecate corresponding boot types "Drive" and "Partition".
These are replaced by the more general "BootSector" boot type.
Finish the unification of the code, started in commit ff85aa0c3,
that loads and boots disk MBR, partition VBR or boot sector in file.
A "WarnDeprecated()" helper is added to warn the user about the
deprecated features, and to inform them to adjust their FREELDR.INI
file in accordance.
In addition, bump FreeLoader version to 3.2 (at last!): a lot of
features have been added or deprecated since its last release.
[FREELDR] Add "WindowsVista" boot type
[FREELDR] Set GDT correctly for Vista
[FREELDR] Map first page of memory, this is an observed behavior, and
also increases stability boot Checked windows 2003 SP2 ntoskrnl with
freeloader.
[SDK] Don't assert on big keys in bootloader
Co-authored-by: Justin Miller <justin.miller@reactos.org>
- UiMessageBox(): Enlarge the default buffer used to printf msgbox strings.
- TuiUpdateDateTime(): When displaying the time, don't pad too much
with spaces on the left.
- TuiDrawShadow():
* Pre-calculate whether we need to show the right/bottom shadows,
and whether the right-shadow has a double width.
* Cap the right and bottom upper-bound coordinates before looping,
in order to avoid buffer overflows if the given coordinates go
beyond the screen.
- TuiDrawMsgBoxCommon(): Improve how the message box centering
calculations are done:
* When the "full-UI" is used (and center-menu is used), try to
center the message box in the space between the header and
the status bar.
* Ensure the top-left box corner is inside the screen, in case
the calculated message box borders go off-screen.
- TuiCalcMenuBoxSize():
* Uniformize the way the menu box coordinates are calculated.
* Reduce the space between menu box margins and the longest item.
* Ensure the top-left menu corner is inside the screen, in case
the calculated menu box borders go off-screen.
A NULL pointer (not necessarily the terminating one) is a valid entry
in the Argv argument vector, according to the ARC specification
(Section 4.4 "Loaded-Program Conventions").
Thus, such pointer needs to be ignored when searching over the
argument vector.
Addendum to commits d05be0da3 and bd451f240.
This is required for POSIX compliance, which the ARC specification obeys.
See Section 2.1.2.2.1 (ANSI X3.159-1989) or 5.1.2.2.1 (ISO/IEC 9899:x)
"Program startup":
```
If they are declared, the parameters to the main function shall obey
the following constraints:
— The value of argc shall be nonnegative.
— argv[argc] shall be a null pointer.
[...]
```
See also https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
Granted, if the while-loop is not run, this means there is no memory
available at all on the computer where FreeLdr is running, which is
quite unexpected. But do the initialization anyways, in order to avoid
more obscure bugs down the line.
On the other hand, PageLookupTableMemAddress doesn't need to be
pre-initialized, since it gets initialized unconditionally afterwards.
Avoids dereferencing list entries to sections/items when these lists are empty.
IniParseFile(): Emit an error to the debug log when a candidate setting
is outside a section and skip it, instead of popping up an error on the UI.
This was a MinGW-specific, non-MS-DDK/WDK-compatible define, that was
used to mark NTOS kernel/hal exports, instead of NTSYSAPI etc.
We have since fixed that, and changed the way Freeldr (and rossym)
manages these, see commits:
186c8b72d (r16028), 51f0dfd30 (r17651) and 526efd2ee (r24359)
Co-authored-by: Victor Perevertkin <victor.perevertkin@reactos.org>
Introduce the initial changes needed to get other processors up and into kernel mode.
This only supports x86 as of now but is the first real step towards using other system processors.
The newly implemented code for registry recovery makes the FreeLdr binary to grow
in size, to the point that it would BSOD because the PE image is too big.
For now we have to temporarily disable any of the newly added code, until
either FreeLdr is split into a basic PE bootloader image itself and a
"FreeLdrlib" that is used by the PE image to access various bootloader APIs
or another proper solution is found.
Validate the SYSTEM hive with CmCheckRegistry and purge volatile data with the same function when initializing a hive descriptor for SYSTEM.
Also implement SYSTEM recovery code that takes use of SYSTEM log in case something is fishy with the hive. If hive repair doesn't have fully recovered the SYSTEM hive, FreeLdr will load the alternate variant of the SYSTEM hive, aka SYSTEM.ALT.
If FreeLdr repairs the hive with a LOG, it will mark it with HBOOT_BOOT_RECOVERED_BY_HIVE_LOG on BootRecover field of the header. All the recovered data that is present as dirty in memory will have to be flushed by the kernel once it is in charge of the system.
Otherwise if the system boot occurred by loading SYSTEM.ALT instead, FreeLdr will mark HBOOT_BOOT_RECOVERED_BY_ALTERNATE_HIVE, the kernel will start recovering the main hive as soon as it does any I/O activity into it.
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
- Allow to boot NT kernel on UEFI systems with our 2 primary supported architectures
- Implement remaining code needed to pass execution to x86 and amd64 kernels
CORE-11954
Implement NTFS boot sector that loads FreeLdr from a NTFS partition.
CORE-17474
- Able to find/parse root directory;
- Handle fixups in FILE MFT record;
- Implement directory tree search;
- Implement loading found file from disk;
- Handle fixups in INDX records;
- Fail if compressed or sparse;
- Attempt to support 64-bit disks.
Some TO-DOs for later:
- Handle "weird" NTFS partition with uncommon sector sizes / sectors per cluster / sectors per index record;
- Better implementation for file loading;
- 64-bit LCN support.
In both lines 451 and 474:
uefidisk.c: warning C4553: '==': result of expression not used; did you intend '='?
It's "funny" that GCC builds doesn't catch those...
CORE-17604
- Disable some functions for ARM32;
- Remove some link options not used on ARM;
- Add get _controlfp() to LIBCNTPR to link properly on ARM;
- Unify Freeldr UI Drawing on ARM;
- Add qemu UART debugging for ARM32/ARM64.
CORE-11954
- EFI binaries have a different subsystem in the PE header;
- ENVIRON: Make sure INTN and UINTN are 64bit for 64bit platforms;
- Handle UEFI Memory maps and translate it for freeldr;
- Add FAILED_TO_EXIT_BOOTSERVICES Freeldr BSoD code.
First batch of changes to implement a UEFI version of freeldr:
- Compile freeldr as EFI binary on top of the existing loader.
- Stub out various functions so we can create a UEFI machine-type in freeldr.
- Implement all of the video output functions so we can display a pretty freeldr BSoD :)
- Keep the common definitions and file lists in CMakeLists.txt
- Move PC-AT & compatibles (PC-98, XBOX) definitions in pcat.cmake
- Future UEFI-specific definitions will be in an uefi.cmake