reactos/boot/freeldr/freeldr/include
Hermès Bélusca-Maïto bd451f240f
[FREELDR] Code fixes and enhancements.
CORE-9023

FIXES:
======

- Fix parsing of the multiboot options string.
  NOTE: They are not yet treated in a case-insensitive manner!

- Fix a bug in ArcOpen() so that it correctly skips the first path
  separator (after the adapter-controller-peripheral ARC descriptors).
  The path separator can be either a backslash or a slash (both are
  allowed according to the specs); they were also already handled
  correctly in other parts of the code.

- Fix DissectArcPath() so as to:
  * **OPTIONALLY** (and not mandatorily!) return the path part that follows
    the ARC adapter-controller-peripheral elements in the ARC path;

  * make it correctly handle the (yes, optional!!) partition() part in the
    ARC path, for the multi(x)disk(y)rdisk(z) cases.

ENHANCEMENTS:
=============

- Directly retrieve the default OS entry as we enumerate them and
  build their list (i.e. merge the GetDefaultOperatingSystem() helper
  within InitOperatingSystemList()).

- Directly use the opened 'FreeLoader' INI section via its ID in the
  different functions that need it.

- Make the custom-boot and linux loaders honour the boot options they are
  supposed to support (see FREELDR.INI documentation / template).
  This includes the 'BootDrive' and 'BootPartition' (alternatively the ARC
  'BootPath').
  This also allows them to take into account the user-specified choices in the
  FreeLdr custom-boot editors.

- Modify the FreeLdr custom-boot editors so as to correctly honour
  the  priorities of the boot options as specified in the FREELDR.INI
  documentation / template.

- Use stack trick (union of structs) to reduce stack usage in the
  FreeLdr custom-boot editors, because there are strings buffers that are
  used in an alternate manner.

- Extract out from the editors the LoadOperatingSystem() calls, and
  move it back into OptionMenuCustomBoot(), so that when this latter
  function is called there is no risk of having a stack almost full.

- When building the ARC-compatible argument vector for the loaders, add
  the mandatory "SystemPartition" path. This allows the loaders to NOT
  call the machine-specific MachDiskGetBootPath() later on (this data is
  indeed passed to them by the boot manager part of FreeLdr).

- Improve the FsOpenFile() helper so as to make it:
  * return an adequate ARC_STATUS instead of a mere uninformative BOOLEAN;
  * take open options, as well as a default path (optional) that would be
    prepended to the file name in case the latter is a relative one.

- Make RamDiskLoadVirtualFile() return an actual descriptive ARC_STATUS
  value, and make it take an optional default path (same usage as the one
  in FsOpenFile() ).
  + Remove useless NTAPI .

- UiInitialize() and TuiTextToColor(), TuiTextToFillStyle(): load or
  convert named settings into corresponding values using setting table and
  a tight for-loop, instead of duplicating 10x the same parameter reading
  logic.

- UiInitialize(): Open the "Display" INI section just once. Remove usage
  of DisplayModeText[] buffer.

- UiShowMessageBoxesInSection() and UiShowMessageBoxesInArgv(): reduce
  code indentation level.

ENHANCEMENTS for NT OS loader:
==============================

- Don't use MachDiskGetBootPath() but use instead the "SystemPartition"
  value passed via the ARC argument vector by the boot manager
  (+ validation checks). Use it as the "default path" when calling
  FsOpenFile() or loading the ramdisk.

- Honour the FreeLdr-specific "Hal=" and "Kernel=" options by converting
  them into NT standard "/HAL=" and "/KERNEL=" options in the boot
  command line.

  Note that if the latter ones are already present on the standard "Options="
  option line, they would take precedence over those passed via the separate
  "Hal=" and "Kernel=" FreeLdr-specific options.

  Also add some documentation links to Geoff Chappell's website about
  how the default HAL and KERNEL names are chosen depending on the
  detected underlying platform on which the NT OS loader is running.
2019-08-31 01:42:46 +02:00
..
arch [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
fs [FREELDR] Rework EXT2 filesystem to interface with ARC and not be tied to the boot volume. 2019-08-10 16:41:29 +02:00
ntldr [FREELDR] Move files where they are only used. 2019-08-11 22:01:36 +02:00
ui [FREELDR] Move files where they are only used. 2019-08-11 22:01:36 +02:00
arcemul.h
arcname.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
arcsupp.h [FREELDR] Some ARC-spec compatibility refactoring + simplifications & fixes. 2019-08-06 23:40:05 +02:00
bytesex.h
cache.h
cmdline.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
comm.h
conversion.h
custom.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
debug.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
disk.h [FREELDR] Move around & static-ify some disk/partition functions. 2019-08-31 00:25:06 +02:00
freeldr.h [FREELDR] Move files where they are only used. 2019-08-11 22:01:36 +02:00
fs.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
inifile.h [FREELDR] Add an INI helper that allows modifying an existing setting's value in memory. 2019-08-06 23:39:53 +02:00
keycodes.h
linux.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
machine.h [FREELDR] Abstract VGA BIOS specific code (#1736) 2019-07-18 23:09:59 +02:00
miscboot.h [FREELDR] Some ARC-spec compatibility refactoring + simplifications & fixes. 2019-08-06 23:40:05 +02:00
mm.h [FREELDR] Introduce a MSVC "linker script" file that centralizes the commands for defining section-limit symbols, and the ordering and merging of PE sections, and the necessary CMake code to use it. (#1224) 2019-01-27 00:51:25 +01:00
multiboot.h
ntoskrnl.h
of.h
options.h [FREELDR] Add "Edit Boot Command Line" feature. (#1763) 2019-08-07 18:50:23 +02:00
oslist.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
peloader.h [FREELDR] Move files where they are only used. 2019-08-11 22:01:36 +02:00
ramdisk.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
ui.h [FREELDR] Code fixes and enhancements. 2019-08-31 01:42:46 +02:00
ver.h [FREELDR] Minor code formatting; constify some non-mutable data. 2019-01-06 18:42:01 +01:00