中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-31 12:48
47,815 topics / 349,930 posts / today 0 new / 48,290 members
DOS开发编程 & 发展交流 (开发室) » How to determine the system's boot mode?
Printable Version  1,418 / 13
Floor1 willsort Posted 2003-04-01 00:00
元老会员 Posts 1,512 Credits 4,432
To All:

I am working on a batch file program, and in it I need to determine which of the following the most recent system startup mode was:
1. cold boot
2. warm boot
3. reset boot
Please tell me what approach can be used to solve this?
Floor2 MYS Posted 2003-04-02 00:00
元老会员 Posts 1,637 Credits 5,170 From 广东佛山
The question is, where in the computer do these three boot modes leave recorded information?
In fact, these three boot modes do not leave any differing recorded information inside the computer. Therefore it is impossible to distinguish between these three modes.
Floor3 willsort Posted 2003-04-04 00:00
元老会员 Posts 1,512 Credits 4,432
To mys:

There should be some difference.

It is said that the difference between a warm boot and a cold boot is that during a warm boot the memory is not checked again. Of course, it is possible that both clear memory, but at least this shows that the BIOS program entry point they use is different, and the former does not involve powering on. I want to know whether there are any hardware ports or CMOS chips that can record these differences.
Floor4 LanE Posted 2003-04-04 00:00
银牌会员 Posts 648 Credits 1,835
I seem to remember that a mark was made somewhere in memory, but because programs read and write memory while running, that does not seem very likely.
Floor5 Wengier Posted 2003-05-03 00:00
系统支持 Posts 10,521 Credits 27,736
Finally found a way to determine it. Using a piece of software called OnBoot can easily solve the problem.
Floor6 LanE Posted 2003-05-03 00:00
银牌会员 Posts 648 Credits 1,835
Boss, post it up here.
Floor7 willsort Posted 2004-02-02 00:00
元老会员 Posts 1,512 Credits 4,432
Re Wengier:

Some time ago I found onboot, but after testing it on my old AVI 386 notebook, it treated both warm boot and cold boot as cold boot. Is it a machine-specific problem? That notebook has no reset button, and uses an AMI BIOS.
Floor8 willsort Posted 2004-02-05 00:00
元老会员 Posts 1,512 Credits 4,432
Re Wengier:

Finally found a bit of information. In the BIOS communication area at a low memory address there is a marker word:

At 0040:0072, the 2-byte content is 0000h during reset or cold boot, and 1234h during a CAD warm boot.

But I doubt whether this location can be accessed directly under WINDOWS protected mode.
Floor9 walu Posted 2004-02-20 00:00
高级用户 Posts 201 Credits 916
So how exactly was it solved, can willsort talk about it?
Also, I tried the onboot software introduced by the moderator, but I don't know how to use it. Moderator, can you teach me?
I used it like this:
onboot warm goto ok

k
echo ok!

But when doing a warm boot, it still doesn't jump to OK and display OK
Floor10 笑傲江湖 Posted 2004-02-20 00:00
初级用户 Posts 61 Credits 271
What the poster above said is correct,

There is such a marker word in the BIOS data area:
0040:0072 word is 0000h during reset or cold boot;
during a warm boot it is 1234h;
this part is the BIOS data area and will not be occupied by other programs.
Floor11 allan^ Posted 2004-03-23 00:00
初级用户 Posts 5 Credits 110
It may also be 4321h, or 0064h, so there are still slight differences here.

At 40:72h,
0000h cold boot checks memory, all memory contents are lost.
1234h warm boot ignores memory check, all memory contents may be lost.
4321h warm boot ignores memory check, RAM remains unchanged.
0064h BIOS loop test

In addition, most notebook BIOSes provide a record called Powerlog. This LOG is one or two BYTEs, written in EEPROM. It records the conditions of the previous few power-ons. Among them it can tell whether it was a cold boot or warm boot, whether shutdown was normal or abnormal, and even whether it was a WINDOWS shutdown. For example, DELL machines all have this LOG.
Floor12 willsort Posted 2004-03-23 00:00
元老会员 Posts 1,512 Credits 4,432
Re allan^:

Question: are the things you mentioned closely related to the BIOS version? On relatively old models (for example the AVI386 I mentioned, or other 386-class desktops), are there any related records or byte contents?

Also, I actually observed the byte content at 42:70 under different conditions with DEBUG, and tested a total of three different machine types, including two notebooks and two desktops. Each time I entered WINDOWS DOS real mode, and found that whether it was a cold boot, warm boot, or reset boot, the content was always 0000. What is the reason for this?

Finally, I want to ask brother allan^, where can detailed related materials be found? Many thanks!
Floor13 allan^ Posted 2004-03-24 00:00
初级用户 Posts 5 Credits 110
POWER LOG is indeed closely related to the BIOS, and old BIOSes probably do not support it.

Also, the rewriting of 42:70 in the BDA (BIOS DATA AREA) is effective in real mode, not under WINDOWS Vx86 mode; under WINDOWS this place is no longer used.
I suggest you use a pure DOS environment, such as DOS6.22, to verify it.

As for the BDA part, Frank van Gilluwe's The Undocumented PC (PC Technical Inside Story) explains it. As for POWERLOG, I think books currently on the market probably do not mention it.
Floor14 willsort Posted 2004-04-13 00:00
元老会员 Posts 1,512 Credits 4,432
Re allan^:

Very sorry, I have been very busy for a while and did not reply in time.

By the pure DOS environment you mentioned, you mean a real-mode DOS environment without loading EMM386, right? I will go back and try it, hope it works.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023