Linux is Open Source
Windows is commercial and licensed by Microsoft. Its price ranges between $99 to $199.
Linux comes with high security, however, has certain flaws which can be removed by OS hardening and installing security modules.
Windows10 comes with built-in antivirus protection with Windows Defender Security Center.
Linux is highly customizable, encouraging programmers to make their distributions or distros.
On Windows customization is done for enhancing personalized experience available for look and feel, background, and interface tweak settings.
Linux can boot either from the primary or logical partition and involves six stages.
- BIOS (Basic Input/Output System): checks the system integrity, searches the Master Boot record in floppy, CD-RAM or Hard-disk, loads into the memory and execute it to give control.
- MBR (Master Boot Record) located in the 1st sector of the bootable disk named as /dev/hda or /dev/sda. It is of less than 512 bytes in size, which includes primary boot loader info in the first 466 bytes, partition table info in next 64 byres and validation check in last 2 bytes. MBR loads and executes the GRUB boot loader.
- GRUB (Grand Unified Bootloader): A user can select from multiple images of the Kernel installed on the system to be executed. It no input is provided GRUB loads the default Kernel image specified in the grub configuration file
- Kernel: Mount the root file system defined in the ‘root' in grub.conf and executes /sbin/init program, which gets the PID (Process ID) as 1, as the first program to run.
ps -ef : grep init
Till real root system is mounted, Kernel uses initrd (Initial RAM Disk) as a temporary file system. It contains necessary drivers compiled inside, that helps to access the hard-drive partitions and other hardware.
- Init: It identifies default initlevel from /etc/inittab to load the appropriate program. You can run the command to identify default runlevel
grep initdefault /etc/inittab
1 Single User Mode
2 Multiuser without NFS or Networking
3 Full multiuser
- Runlevel programs: Depending on default inittab configuration file level setting, the system execute the program from one of the following directories:
Run Level 0 /etc/rc.d/rc0.d/
Run Level 1 /etc/rc.d/rc1.d/
Run Level 2 /etc/rc.d/rc2.d/
Run Level 3 /etc/rc.d/rc3.d/
Run Level 4 /etc/rc.d/rc4.d/
Run Level 5 /etc/rc.d/rc5.d/
Run Level 7 /etc/rc.d/rc6.d/
Symbolic links for these directories are available under /etc directly. Under /etc/rc.d/rc?.d/ deamon starting with S for startup and K for killdown or kill resides. The sequence number is there in the right of S or K in the program names.
Sequence No. Deamon
Windows must boot from the primary partition. The Windows Startup process includes:
- Power-on self-test (POST): When the Power is turned on, it runs POST routines to determine the amount of physical memory and the other hardware components present. The plug and play BIOS recognizes the hardware and configuration. The BIOS locates the boot device, loads and run Master Boot Record. MBR is of 512 Bytes in size and consists of bootstrap code and partition table of 64 bytes, limiting the number of Hard-disk partitions to only four.
- Bootloader: The operating system loader file, Ntldr, switches the microprocessor from the real mode, in which 640k of RAM reserved for MS-DOS and rest designated as extended memory, to 32-bit flat memory mode which OS uses all of the available memory.
Ntldr starts the build-in mini-file system drivers to find partitions formatted to FAT or NTFS and begin the startup process on them.
- Operating System Selection: If multiple operating systems installed on the computer, the Boot.ini file is configured to present a list of operating systems, then Start Menu appears so that user can select an operating system. Ntldr runs Ntdetect, if Windws has chosen, for other runs Bootsect. dos and relinquishes control of the system. If a user does not select any, after some time the default operating system loads.
- Detect and configure hardware phase: Ntdetect collects a list of currently installed hardware components and returns the list to Ntldr, which is further used to create the Hardware key in the registry. The components detected include bus and adaptor types, video adaptors, communications ports, parallel ports, floating-point coprocessors, removable media, keyboards, and pointing devices.
- Kernel loading phase: The operating system components loaded into memory. Ntldr loads Ntoskrnl.exe, containing the Windows XP kernel, without initializing it.
Ntldr then loads the HAL.dll file. Next, the HKEY_LOCAL_MACHINE\SYSTEM registry key loads and Ntldr reads the SELECT key to determine which control set to load.
- Logon Sequence: The Winlogon.exe starts the Local Security Authority (LSA), and the Logon screen or logon dialog box appears.
Linux separates directory branches with a forward slash (/) and Windows with a backward slash (\).
On Linux everything is case sensitive, so ls command is entirely different from LS. While Windows is case insensitive regarding file names.
Linux uses EXT2, EXT3, EXT4, Reisers FS, XFS, and JFS file system. It does not use drive letters as Windows does. It mounts filesystems to mount points, named identical to directories. Letters assigned to device names in the /dev directory. E.g.,/dev/sda is the first SCSI Drive and /dev/sdb is the second. sda1 indicates the first partition on the drive. ‘root' is the name of the administrator. It's also the name of the base of a filesystem (/), and there is separate home directory for root (/root).
Windows use a filesystem as FAT, FAT32, NTFS and ReFS
Linux: Monolithic kernel employed for performance purpose, and its modular feature allows most drivers to dynamically loaded and unloaded at runtime. It consumes more running space than Windows which uses the micro kernel which takes less space but system running efficiency is lower than Linux.