reactos/base/setup/usetup
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 [USETUP] Improve lang/ReadMe.txt 2019-01-30 14:59:10 +09:00
spapisup [USETUP] Check for invalid INF handles before doing operations. 2018-12-23 20:37:13 +01:00
chkdsk.c [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
chkdsk.h [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
CMakeLists.txt [SETUPLIB][REACTOS][USETUP] Further improve the interfacing with INF and File-Queue APIs. 2018-11-01 18:55:43 +01:00
cmdcons.c [SETUP] Remove myself from the 1st stage setup code 2018-05-27 21:33:07 +02:00
cmdcons.h [SETUP] Remove myself from the 1st stage setup code 2018-05-27 21:33:07 +02:00
console.c [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
console.h [SETUP] Remove myself from the 1st stage setup code 2018-05-27 21:33:07 +02:00
consup.c [USETUP] Introduce some -V functions for CONSOLE_ConOutPrintf, CONSOLE_SetStatusText and CONSOLE_SetStatusTextX. 2018-10-28 14:41:57 +01:00
consup.h [USETUP] Introduce some -V functions for CONSOLE_ConOutPrintf, CONSOLE_SetStatusText and CONSOLE_SetStatusTextX. 2018-10-28 14:41:57 +01:00
devinst.c [USETUP] Modify the integrated user-mode PnP manager along the lines of UMPNPMGR, so that we can wait until all the queued device installations finish before continuing the installation further. 2018-12-23 20:37:14 +01:00
devinst.h [USETUP] Modify the integrated user-mode PnP manager along the lines of UMPNPMGR, so that we can wait until all the queued device installations finish before continuing the installation further. 2018-12-23 20:37:14 +01:00
format.c [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
format.h [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
fslist.c [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
fslist.h [SETUPLIB][USETUP] Factor out the usage of FS provider structures. 2019-03-10 15:41:05 +01:00
genlist.c [SETUPLIB][USETUP] Remove the deprecated GenericListHasSingleEntry() function and use instead GetNumberOfListEntries(). 2018-10-28 15:04:33 +01:00
genlist.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
keytrans.c [USETUP] Remove the WIN32 support because usetup is a native-only application 2018-05-15 23:35:17 +02:00
keytrans.h [USETUP] Remove the WIN32 support because usetup is a native-only application 2018-05-15 23:35:17 +02:00
mui.c [SETUPLIB] Remove a deprecated error number (that gets merged with ERROR_TXTSETUP_SECTION). 2018-10-28 01:43:56 +02:00
mui.h [USETUP] Add new file-operation-related messages for deletion, moving and renaming. 2018-10-28 01:58:55 +02:00
muilanguages.h [SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. 2018-10-28 00:13:07 +02:00
partlist.c [USETUP] Use for-loops; simplify the code. 2019-03-11 00:05:37 +01:00
partlist.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
progress.c [USETUP] Progress-bar: minor improvements. 2018-08-27 23:55:58 +02:00
progress.h [USETUP] Progress-bar: minor improvements. 2018-08-27 23:55:58 +02:00
usetup.c [SETUPLIB][USETUP] Improve disk HW numbering, removable disk support, and "super-floppy" partitioning. 2019-03-12 02:17:11 +01:00
usetup.h [USETUP] Add SETUP_INIT_PAGE in the list of virtual pages. 2018-12-23 21:02:08 +01:00
usetup.rc [SETUPLIB][USETUP] Diverse additions. 2018-06-03 22:12:45 +02:00