Mastering some simple knowledge of DOS boot principles has far-reaching significance. It is very helpful both for DOS itself and for system maintenance under WINDOWS (in fact, the initial startup of WINDOWS is also like this). I will try to introduce this knowledge bit by bit in plain and easy-to-understand language. I hope that forum friends with some basic DOS knowledge can gain a deeper understanding of DOS from this. Once you understand these things, you will find that solving problems during computer startup is so simple.
Keywords: BOOT、IO.SYS、MSDOS.SYS、COMMAND.COM、CONFIG.SYS、AUTOEXEC.BAT、SYSINIT、DOSINIT、CMDINIT
MS-DOS consists of the boot loader (BOOT) and three layers of modules (IO.SYS, MSDOS.SYS, and COMMAND.COM). A disk storing these files is called a DOS system disk.
So-called booting DOS means loading the 3 basic DOS modules on the disk into main memory, and having them direct the various parts of the computer to work in coordination. IO.SYS and MSDOS.SYS are two hidden system files. When using the DIR command to list the directory, the user can only see the COMMAND.COM file, but cannot see these two files.
The bootstrap program in ROM-BIOS first tests the floppy drive boot device, then tests the hard disk (this is the preset setting; if the boot order set in BIOS is not A, C, CDROM, then it is slightly different, but the basic principle is similar). The purpose of the test is to determine which device will guide the boot process. No matter whether the system disk is a floppy in drive A or a hard disk in drive C, the bootstrap
program always first reads physical sector 0 of that disk into memory. But there are still some differences at the very beginning between booting from a floppy and booting from a hard disk.
For floppy booting, what is read in is the DOS boot sector, so the BOOT boot loader is executed immediately; for hard disk booting, since what is read in first is the hard disk master boot sector, the master boot program in it must be executed first; it finds the DOS primary partition, that is, the partition that can be activated, and only then can the DOS boot sector of that partition be read in, after which execution switches to the BOOT boot loader. After that, the entire boot process is exactly the same.
The BOOT program checks whether the two files IO.SYS and MSDOS.SYS exist, whether they are the first two files, and whether IO.SYS is in the first position. After this check is completed and confirmed correct, it reads the IO.SYS module into main memory, and control is transferred to the initialization program SYSINIT. It initializes basic input/output management, reads the DOS kernel module MSDOS.SYS into memory, calls the kernel initialization program DOSINIT, and completes kernel initialization. After this, it returns to SYSINIT to execute the system configuration file CONFIG.SYS, setting up the system environment, then reads the command processor module COMMAND.COM into memory, and only then hands control over to CMDINIT.
CMDINIT does some related initialization work, then checks whether the AUTOEXEC.BAT file exists. If that file exists, it is executed. Finally, control is handed over to the transient module CCPT of COMMAND.COM, the DOS prompt appears on the screen, and the entire boot process is complete.
As for booting from a CD, it simulates floppy booting. Usually a floppy disk image file is placed on the CD, and its basic principle is the same as booting from a floppy.
The boot process is as follows:
hard disk
ROM-BIOS—bootstrap program—read sector 0 of the boot disk———— hard disk master boot sector—master boot program
| |
|floppy |
|disk |
|_____________________________________|
_______________________________________|
|
|
DOS boot sector—BOOT program checks the first two basic files—read in IO.SYS module——
SYSINIT program initializes the BIOS module—read in and locate MSDOS.SYS—execute CONFIG.SYS
| |
___________________________________________| read in COMMAND.COM—BIOS module
| |
MSDOS.SYS—DOSINITT program—initialize the kernel—kernel module |
_________________________________________________________|
|
COMMAND.COM—CMDINIT program performs initialization—execute AUTOEXEC.BAT—display DOS prompt
—transient module (CCPT)
—resident module (CCPR)
Keywords: BOOT、IO.SYS、MSDOS.SYS、COMMAND.COM、CONFIG.SYS、AUTOEXEC.BAT、SYSINIT、DOSINIT、CMDINIT
MS-DOS consists of the boot loader (BOOT) and three layers of modules (IO.SYS, MSDOS.SYS, and COMMAND.COM). A disk storing these files is called a DOS system disk.
So-called booting DOS means loading the 3 basic DOS modules on the disk into main memory, and having them direct the various parts of the computer to work in coordination. IO.SYS and MSDOS.SYS are two hidden system files. When using the DIR command to list the directory, the user can only see the COMMAND.COM file, but cannot see these two files.
The bootstrap program in ROM-BIOS first tests the floppy drive boot device, then tests the hard disk (this is the preset setting; if the boot order set in BIOS is not A, C, CDROM, then it is slightly different, but the basic principle is similar). The purpose of the test is to determine which device will guide the boot process. No matter whether the system disk is a floppy in drive A or a hard disk in drive C, the bootstrap
program always first reads physical sector 0 of that disk into memory. But there are still some differences at the very beginning between booting from a floppy and booting from a hard disk.
For floppy booting, what is read in is the DOS boot sector, so the BOOT boot loader is executed immediately; for hard disk booting, since what is read in first is the hard disk master boot sector, the master boot program in it must be executed first; it finds the DOS primary partition, that is, the partition that can be activated, and only then can the DOS boot sector of that partition be read in, after which execution switches to the BOOT boot loader. After that, the entire boot process is exactly the same.
The BOOT program checks whether the two files IO.SYS and MSDOS.SYS exist, whether they are the first two files, and whether IO.SYS is in the first position. After this check is completed and confirmed correct, it reads the IO.SYS module into main memory, and control is transferred to the initialization program SYSINIT. It initializes basic input/output management, reads the DOS kernel module MSDOS.SYS into memory, calls the kernel initialization program DOSINIT, and completes kernel initialization. After this, it returns to SYSINIT to execute the system configuration file CONFIG.SYS, setting up the system environment, then reads the command processor module COMMAND.COM into memory, and only then hands control over to CMDINIT.
CMDINIT does some related initialization work, then checks whether the AUTOEXEC.BAT file exists. If that file exists, it is executed. Finally, control is handed over to the transient module CCPT of COMMAND.COM, the DOS prompt appears on the screen, and the entire boot process is complete.
As for booting from a CD, it simulates floppy booting. Usually a floppy disk image file is placed on the CD, and its basic principle is the same as booting from a floppy.
The boot process is as follows:
hard disk
ROM-BIOS—bootstrap program—read sector 0 of the boot disk———— hard disk master boot sector—master boot program
| |
|floppy |
|disk |
|_____________________________________|
_______________________________________|
|
|
DOS boot sector—BOOT program checks the first two basic files—read in IO.SYS module——
SYSINIT program initializes the BIOS module—read in and locate MSDOS.SYS—execute CONFIG.SYS
| |
___________________________________________| read in COMMAND.COM—BIOS module
| |
MSDOS.SYS—DOSINITT program—initialize the kernel—kernel module |
_________________________________________________________|
|
COMMAND.COM—CMDINIT program performs initialization—execute AUTOEXEC.BAT—display DOS prompt
—transient module (CCPT)
—resident module (CCPR)
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
uploadImages/200311161145850422.swf



