reactos/base/setup/lib
Hermès Bélusca-Maïto 47a1acedf7
[SETUPLIB][USETUP] Improve disk HW numbering, removable disk support, and "super-floppy" partitioning.
Nowadays more and more people try to install ReactOS from removable
drives (e.g. USB sticks) onto fixed HDDs, or try to install it into
USB sticks too.

Both fixed and removable drives, as well as partitions on these, are
represented in NT using the same device name format:

  \Device\HarddiskM\PartitionN ,

with an increasing disk number M. Using this number for building the
corresponding firmware-specific ARC multi(x)disk(y)rdisk(z) path used
by the NT/ROS loader (FreeLdr, ...) is then prone to error since there
may have  been  removable drives  inserted  and  accounted for in the
calculation  of  the disk number.  These drives must be  correctly
subtracted in order to generate the correct ARC path, valid once all
the removable drives have been ejected (which should also be the
situation seen from the BIOS when booting up, except of course if you
boot on a USB stick).

This problem is now solved. Note that it matters only for the disks
that have also been enumerated by the firmware (BIOS; Int 13h). We
don't have to care about the other drives, since the ARC path will be
of a different format and will not use the disk number (instead, the
SCSI coordinates are used).

We also try to enumerate all the disks found in all the possible disk
adapters and  controllers enumerated  in the Hardware registry tree
(and that are visible by FreeLdr) in order to cover all.

Finally, we detect whether a disk reports as  a "super-floppy",  i.e.
an unpartitioned disk with a valid VBR. This is indeed how a standard
floppy disk looks like, or how USB sticks are partitioned on Windows.
Such disk is reported has having only one single partition starting at
the beginning of the disk, with partition number == 0, its type being
FAT16 non-bootable.
This allows us to forbid creating any new partitions on such disks.
Note that accessing either \Device\HarddiskN\Partition0 or Partition1
on such a disk returns the same data.
Note also that on the contrary, regular MBR-partitioned disks would
report at least four partitions entries, instead of just one.

The other improvements are:

- Do *NOT* write any MBR on a disk partitioned as "super-floppy".
  CORE-13703

- Fix the computed disk identifier, of format: %08x-%08x-%c .
  The numbers are respectively the checksum of the first sector, and
  the disk signature. The terminating letter is A or X, depending
  whether the first sector ends with 0x55AA/0xAA55 or not (see also
  commit 5053f1f5).

- Warn if the user attempts to install ReactOS on a disk that is not
  visible by the  firmware of his computer,  because it may not be
  bootable.
2019-03-12 02:17:11 +01:00
..
lang [BOOTDATA][SETUPLIB] Setup the Romanian Stdandard Keyboard layout. (#861) 2018-12-08 18:53:18 +01:00
spapisup [SETUPLIB][REACTOS][USETUP] Further improve the interfacing with INF and File-Queue APIs. 2018-11-01 18:55:43 +01:00
utils [SETUPLIB][USETUP] Improve disk HW numbering, removable disk support, and "super-floppy" partitioning. 2019-03-12 02:17:11 +01:00
bootsup.c [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
bootsup.h [USETUP][SETUPLIB] Move the bootsup.c code into the setuplib, and perform the necessary adjustments. 2018-10-27 22:09:32 +02:00
CMakeLists.txt [SETUPLIB][USETUP] Move all the code that performs file copying into the SETUPLIB. 2018-11-05 23:18:47 +01:00
errorcode.h [SETUPLIB] Remove a deprecated error number (that gets merged with ERROR_TXTSETUP_SECTION). 2018-10-28 01:43:56 +02:00
fsutil.c [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
fsutil.h [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
install.c [BOOTDATA][SETUPLIB][REACTOS] INF support fixes. 2018-11-06 00:04:19 +01:00
install.h [SETUPLIB][USETUP] Move all the code that performs file copying into the SETUPLIB. 2018-11-05 23:18:47 +01:00
mui.c [SETUPLIB][USETUP] Use NT RTL String Safe functions instead of Win32-oriented ones (and remove usage of HRESULT too). 2018-10-28 00:58:46 +02:00
mui.h [SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. 2018-10-28 00:13:07 +02:00
muifonts.h [SETUP][INF] Add font substitute for CJK. (#1346) 2019-02-10 15:46:19 +01:00
muilanguages.h [SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. 2018-10-28 00:13:07 +02:00
precomp.h [SETUPLIB] Move the files that implement utility functions into their own subdirectory. The files remaining in the main directory implement setup procedures that use the utility functions. 2018-10-27 22:09:34 +02:00
registry.c [SETUP] Silence some noisy DPRINT1 2019-01-01 10:08:02 +01:00
registry.h [SETUPLIB][USETUP] Move the registry-update procedure into setuplib. 2018-10-28 14:42:00 +01:00
settings.c [SETUP] Silence some noisy DPRINT1 2019-01-01 10:08:02 +01:00
settings.h [SETUPLIB][USETUP] Don't store UI-related display strings in GENERIC_LIST_ENTRY-ies, + other code adaptations. 2018-10-28 01:32:15 +02:00
setuplib.c [SETUPLIB][USETUP] Improve disk HW numbering, removable disk support, and "super-floppy" partitioning. 2019-03-12 02:17:11 +01:00
setuplib.h [SETUPLIB][USETUP] Remove CurrentDisk/Partition from the partlist lib code, and move these into the UI code. 2019-03-11 00:05:37 +01:00