For the GNU/Linux case, there are mainly 3 ways to install:
- Using a LiveCD/DVD/USB. In this case, the installer from the LiveCD either extracts the SquashFS filesystem directly to the hard drive (after partitioning it), then does some adjustments, or copies the currently mounted root filesystem, which is a virtual filesystem consisting of the SquashFS archive and a RAM disk storing temporary modification when running the LiveCD. This is more or less a simple copy/paste from one filesystem to another.
- Using an installation CD/DVD/USB. Here, the installer, which is generally loaded in RAM in an init RAM disk, will extract packages located on the installation medium to the target filesystem, and execute some post-install script (the same way when you install software in a running GNU/Linux system). It might need to store some temporary files on the target filesystem; those should be located in
/var/cache, for example.
- Using a netboot installer. This is the same as above, but since the installation medium doesn't contain the packages needed for installation, it has to download them. They are temporarily stored on the target filesystem, generally in /var/cache/<package_manager> or /tmp too.
(I'm not sure about the following information.)
Windows NT6+ (from Windows Vista) loads the boot.wim file in RAM, it contains a WinPE image with the installation software. Basically, it copies the content of install.wim (the right subdirectory for the current Windows edition) to the hard drive, then runs some scripts to finalize the installation. But the installation really finishes after the first boot.
Windows NT5 (2000-XP) contains 3 phases:
- Boot on a minimal text-installer. This one loads all drivers available, partitions and formats the disk, then extracts files from the
i386 folder to the hard drive. It also installs a bootloader on the MBR.
- Boot on the hard drive, which now contains a minimalist Windows installation. It runs an installer which extracts remaining files from the installation medium, and performs some drivers/settings adjustments and other configuration.
- First boot up finalizes the installation.
Windows 3 (and maybe 1 and 2) is the same as the above, but the installation is already finished before the first boot. Also, the installer is run from an MS-DOS system, which is installed on the first floppy disk or already on the hard drive.
Don't know for Windows 95-98-Me, but it should look like Windows 3. Don't know for NT3-NT4.
If you look at the content of your hard drive between phase 1 and 2, you'll see something looking like a minimal Windows installation.