To All:
Implementing a startup menu under the pure DOS layer (excluding the boot layer before DOS startup and the application layer after DOS startup) usually uses the Config/Autoexec files for configuration. However, this configured menu is limited by the DOS kernel and cannot be extended more functionally.
Therefore, using a shell - layer application to extend the startup menu is a relatively short cut. But due to the closed nature of the DOS startup process, it is not very easy to insert our own extended menu in it; because the selection of the startup menu may mean the loading of different drivers, so the extension must be executed before the driver is loaded, which restricts the position of the extension program to the config.sys file, before any driver loading and DOS configuration statements. At the same time, the processing method of DOS for config.sys is relatively unique, similar to the compilation environment of a high - level language. They will pre - process config.sys first and then symbolize it, and Boot.sys/bootcon.sys and so on use the "gaps" in these processing processes to relatively typically realize the extension of the startup menu.
However, any extended program is not omnipotent and may not fully meet the user's usage needs. So it is necessary to allow users to customize the menu functions. But no one will study the DOS kernel just for the function of extending the startup menu. So it seems necessary to create a "slot" that can accommodate user - written menu "plugins".
I put this slot in autoexec.bat because various resources of the application layer such as batch processing, third - party scripts, and graphical interface menus can be conveniently used in it. The basic idea is as follows: After the first startup of DOS, directly single - boot into autoexec.bat. In it, create a custom menu interface and complete the interaction with the user. Then, according to the interaction result, generate a new config/autoexec file, which contains various device drivers, program calls, and environment configuration commands required by the user's selection as well as an entry to restore the original c/a files. Then, reboot DOS without restarting the computer to load the new config/autoexec file. After that, restore the original c/a files and wait for the user's next restart.
The implementation idea of this "secondary boot" has actually been implemented by many DOS boot enhancement programs. But they also made closed interfaces, and it is difficult for users to carry out secondary development; at the same time, most of them use restart instead of re - boot to load the new menu, so such a startup menu has a large "startup gap".
(To be continued...)
[ Last edited by willsort on 2006 - 1 - 8 at 16:54 ]
Implementing a startup menu under the pure DOS layer (excluding the boot layer before DOS startup and the application layer after DOS startup) usually uses the Config/Autoexec files for configuration. However, this configured menu is limited by the DOS kernel and cannot be extended more functionally.
Therefore, using a shell - layer application to extend the startup menu is a relatively short cut. But due to the closed nature of the DOS startup process, it is not very easy to insert our own extended menu in it; because the selection of the startup menu may mean the loading of different drivers, so the extension must be executed before the driver is loaded, which restricts the position of the extension program to the config.sys file, before any driver loading and DOS configuration statements. At the same time, the processing method of DOS for config.sys is relatively unique, similar to the compilation environment of a high - level language. They will pre - process config.sys first and then symbolize it, and Boot.sys/bootcon.sys and so on use the "gaps" in these processing processes to relatively typically realize the extension of the startup menu.
However, any extended program is not omnipotent and may not fully meet the user's usage needs. So it is necessary to allow users to customize the menu functions. But no one will study the DOS kernel just for the function of extending the startup menu. So it seems necessary to create a "slot" that can accommodate user - written menu "plugins".
I put this slot in autoexec.bat because various resources of the application layer such as batch processing, third - party scripts, and graphical interface menus can be conveniently used in it. The basic idea is as follows: After the first startup of DOS, directly single - boot into autoexec.bat. In it, create a custom menu interface and complete the interaction with the user. Then, according to the interaction result, generate a new config/autoexec file, which contains various device drivers, program calls, and environment configuration commands required by the user's selection as well as an entry to restore the original c/a files. Then, reboot DOS without restarting the computer to load the new config/autoexec file. After that, restore the original c/a files and wait for the user's next restart.
The implementation idea of this "secondary boot" has actually been implemented by many DOS boot enhancement programs. But they also made closed interfaces, and it is difficult for users to carry out secondary development; at the same time, most of them use restart instead of re - boot to load the new menu, so such a startup menu has a large "startup gap".
(To be continued...)
[ Last edited by willsort on 2006 - 1 - 8 at 16:54 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!


ISC0000