Commit graph

13 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 7b4f42470f
[FREELDR] Reformat the boot editor strings in the code. 2024-04-17 22:25:14 +02:00
Hermès Bélusca-Maïto a01398b034
[FREELDR] Adjust a boot-options editor example. 2021-12-30 03:42:00 +01:00
Hermès Bélusca-Maïto 4792c007aa
[FREELDR] Add the possibility to change the boot load options from TXTSETUP.SIF
at runtime from the boot selection menu or from FREELDR.INI.

CORE-17350, CORE-9023

For a proper override of the options by new user options, specify the
/SIFOPTIONSOVERRIDE switch in addition. Otherwise, user options are
merged with those retrieved from TXTSETUP.SIF, with priority given to
the former ones.

- Update the documentation for the 'ReactOSSetup' OS type in the
  FREELDR.INI file template.

- Use a different prompt in the custom boot options editor for the
  'ReactOSSetup' OS type, with adequate explanation.

- Get rid of the ReactOS-specific TXTSETUP.SIF 'DbgOsLoadOptions' value,
  and use instead the Windows-compatible 'SetupDebugOptions' value that
  is added to the other load options when debugging is to be enabled.
2020-11-04 19:59:28 +01:00
Hermès Bélusca-Maïto 63e22b8287
[FREELDR] Add support for loading Linux in x64 FreeLdr. Part 2/2: C code.
- Re-enable custom and Linux boot menu entries.
- Fix compilation and add address limit checks for x64 build of linux loader.
2019-10-08 01:30:25 +02:00
Hermès Bélusca-Maïto fc29a6c41c
[FREELDR] Minor code improvements + 1 bug-fix.
- "FrldrBootPath" -> "FrLdrBootPath";
- Get rid of GetFreeLoaderVersionString() and use FrLdrVersionString
  directly instead;
- Rephrase some comments;
- Use RTL_NUMBER_OF();
- Reduce indent level in LoadOperatingSystem() and EditOperatingSystemEntry().

Bug fix:
- Fix DissectArcPath() for "ramdisk(0)" case.
2019-09-17 23:24:51 +02:00
Hermès Bélusca-Maïto eeff926ede
[FREELDR] Limit the usage of DiskStopFloppyMotor() in hardware/platform-specific code.
- Move DiskStopFloppyMotor() calls into the implementations of
  Boot(New)LinuxKernel() and Reboot() HW functions, and the explanation
  comments in ChainLoadBiosBootSectorCode().

- Remove unneeded DiskStopFloppyMotor() dummies in ARM and PPC code.

- Use more adequate bitmask value to be sent to floppy's Digital Output
  Register for shutting down its motor (based on OSDev & our floppy
  controller driver).
2019-09-13 15:18:27 +02:00
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
Yaroslav Kibysh bc7c689448
[FREELDR] Add ReactOS Setup as a custom boot type. (#1763)
CORE-9023 CORE-16260

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2019-08-07 18:50:26 +02:00
Yaroslav Kibysh b34d516e81
[FREELDR] Add "Edit Boot Command Line" feature. (#1763)
CORE-9023 CORE-16260

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2019-08-07 18:50:23 +02:00
Hermès Bélusca-Maïto 5d5b6a5600
[FREELDR] Some enhancements for the UI code. (#1763)
- EditBox: Display the initial contents of the text buffer.
  This allows modifying already existing text in the passed buffer.

- Menu:
  * Make both MenuHeader and MenuFooter optional (but the latter is
    more "optional" than the former...).

  * Allow passing a user-provided "Context" structure to the key-press
    filter callback, and pass also the index of the menu item that has
    been selected.

- Minor formatting fixes.
2019-08-07 18:50:20 +02:00
Hermès Bélusca-Maïto d05be0da3f
[FREELDR] Some ARC-spec compatibility refactoring + simplifications & fixes.
CORE-9023

- During loading and initialization of the list of operating systems
  available in freeldr.ini, convert any legacy operating system entry
  encountered -- they are like those in NTLDR's boot.ini file, i.e.:

    ArcOsLoadPartition="LoadIdentifier" /List /of /Options

  into a new operating system INI entry, like those used by default in
  FreeLoader. This allows us to avoid treating this corner-case later in
  different parts of the code. Also, the "BootType" value is now
  determined there, only once.

- Convert the OS loaders entry-points to ARC-compatible ones, following
  the "Advanced RISC Computing Specification, Version 1.2" specification
  https://www.netbsd.org/docs/Hardware/Machines/ARC/riscspec.pdf

- Introduce helpers for retrieving options values from the argument vector
  in a simple way.

- Simplify LoadOperatingSystem(), since now the "BootType" value has
  been determined once while loading the list of OSes (see above) and
  is well-defined there. Use the BuildArgvForOsLoader() helper to build
  the ARC-compatible argument vector from the corresponding INI settings
  for the selected operating system entry, and use it when calling the
  corresponding OS loader.

- In the OS loaders, since we can now directly read the settings from
  the argument vector (instead of using INI settings), we can avoid
  using a bunch of fixed-size string buffers, and avoid potentially
  failing IniOpenSection() calls as well.

- Simplify code in the Linux loader (and the RemoveQuotes() function).

- Add UiShowMessageBoxesInArgv() that acts on the "MessageBox=" settings
  passed through the argument vector (equivalent to
  UiShowMessageBoxesInSection() ).

- Use string-safe functions where needed (copy/concatenation/printf on
  fixed-size buffers).
2019-08-06 23:40:05 +02:00
Hermès Bélusca-Maïto d272866550
[FREELDR] Minor code formatting; constify some non-mutable data. 2019-01-06 18:42:01 +01:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Renamed from reactos/boot/freeldr/freeldr/custom.c (Browse further)