CMOSTimer
The program CMOSTimer can be used to start a PC from
soft off (ATX) mode at a given time. This is done with the BIOS
function "Wake up on RTC Alarm".
Actual version: 1.16 (Important: This
new version 1.16 is not compatible with the old 1.0 version. To
updatefrom version 1.0
you must replace the old version with the new one, rerun CMOSConfig and
save the new parameters!)
WARNING
This program writes direct to the NVRAM (Non Volatile
RAM) where the BIOS saves the system configuration (CMOS settings).
THIS IS DANGEROUS
You may use the program on your own risk. Neither me nor anyone else
(like the BIOS manufacturer) can be made responsible for any damage
directly or indirectly caused by the use of this program. (The worst
thing that happened to me was that my computer started with
BIOS-default
settings. The necessary reconfiguration took me around 2 minutes - but
that doesn't mean that this is the worst case that could happen...)
Nevertheless a similar program (NVRAM-WakeUP see http://sourceforge.net/projects/nvram-wakeup)
is used under LINUX by a lot of people without problems.
Download:
CMOSTimer - downloads: 2371
(VB Runtime necessary)
Requirements:
- Administrator rights
- Auto - Login
- All files (CMOSConfig, CMOSTimer, WinIO.sys ...) in one directory
(like ..\WinSTB\Utilities).
- No active screensaver
Short description:
CMOSTimer uses the BIOS function "Wake up on RTC Alarm"
(the wording may be different depending on the BIOS manufacturer) which
is supported by most mainboards To write the wakeup time into the BIOS
under Windows the free system driver WinIO (WinIO v2.0 Copyright
1998-2002 Yariv Kaplan http://www.internals.com)
) is used. The necessary parameters (BIOS addresses for the wakeup
time) have to be known or investigated and saved in the windows
registry
by the program CMOSConfig. The CMOSTimer can then be invoked with the
commandline parameter /wakeup=dd.mm.yyyy hh:mm (windows long date
format)
and the corresponding entry in the BIOS is made. Some mainboards need a
reboot to "accept" these changes, therefore the CMOSTimer can create an
autostart entry in the registry, reboot the PC and power down
afterwards. Starting CMOSTimer with the commandline option /off deletes
the wakeup entry form the BIOS. If you want to take care for shutdown
(and reboot) by yourself, use /wakeuponly=dd.mm.yyyy
hh:mm or /offonly.
Starting from version 1.15 a database with the settings
for approx. 150
different mainboards is included. Unfortunately the entries are not
always unique, so that you should run own tests
in any case, before you start the CMOSTimer
program. For the determination of the mainboard the DMI entry is
used, and compared with the entries in the data base. If no valid
DMI entry is found or the mainboard is not contained in the database,
that does not inevitable indicate that the program does not work. But
in this case you must determine the parameters 'by hand'.
Start the database search after the start of CMOSConfig with LookUpMainboard.
In case the mainboard is found (and is unique), you can transfer the
settings to the CMOSConfig "main window" with Set
Config. If several "suitable" entries
were found, you may select one entry from the list 'Matching Database
Entries' and transfer these settings (if the
settings are 'wrong', you can select the other entries with the next
try...). Then close the DMI info window with Close.
If nothing suitable is found at all, simply close
the DMI info window with Close and read
on here. In order to accomplish a first
test for the examination of the settings, click
on DumpBIOS in
the CMOSConfig 'main window'. Thus the Bios data is read in and shown
in the below listbox.
According to the current settings the WakeUp time
is calculated from the BIOS data. If you find an "impossible" time
(e.g. 35:77), then the settings are wrong in each case. Otherwise please compare the calculated time with the time you have entered
in your BIOS set up. If these times fit, you can already
save the settings with WriteReg and
skip the next paragraph. Before you believe in these settings
finally, you should do a simulation test
with "CreateTestFile". If you do not understand the explanation
there, read the description of the
individual parameters first.
How to find the necessary
parameters manually:
For this purpose two programs are included: CmosDos and
CMOSConfig. In the first step a manual test with the usual BIOS-setup
procedure should be made, to test the functionality for your specific
mainboard.
As each change in the BIOS setup requires a reboot (you can only load
the BIOS setup during boot...), you should use a DOS BOOT-Disc for the
first tests (booting a DOS-disk is still much faster than booting
Windows). Copy CmosDos to your DOS-disc and start it from there. All
128
BIOS bytes are then read by the program, shown on the screen and saved
as a text file (B#.txt, where # stands for a numeric value which is
automatically increased by the program each time you start it). In
addition all differences to the prior runs of CmosDos are shown and
saved also.
You may edit these files, but please only the first line, otherwise the
differences to the prior runs cannot be examined correctly. These files
are compatible between CmosDos and CMOSConfig (the windows tool where
you have the same functionality). Limitation: The new 256 byte modes
are only supported by CMOSConfig. As these modes are still very
experimental, use them with great care.
I would purpose the following
procedure:
For the first run of the program disable "Wake up on RTC Alarm" in your
BIOS setup. Run CmosDos (or CMOSConfig with the option "Readwritefile"
=
on, if you prefer to work in windows). Enable "Wake up on RTC Alarm" in
your BIOS setup and use a easy to find date and time for wakeup (like
day=01, hour=02, minute=03). Rerun CmosDos (or CMOSConfig) and have a
look to the differences (see a rather detailed example for my mainboard
below). Enter a more complicated date and time for wakeup in your
BIOS-setup, rerun CmosDos (or CMOSConfig) and so on. Important: Use
extreme values for date/time (like day 01, hour 00, minute 00, and
day=31, hour=23, minute=59) to get both bytes of the CMOS checksum (if
any).
All values of the BIOS-Bytes are shown decimal, hex (&h##) and
binary (&b########) by CmosDos and CMOSConfig
Example of a B#.txt file (from MSI 6570 = K7N2-L)
Now: H:0
M:5 S:56 H=Byte4 M=Byte2 S=Byte0
Byte: 0= 85
&h55 &b01010101
Byte: 1=
0 &h00 &b00000000
Byte: 2=
5 &h05 &b00000101
Byte: 3=
0 &h00 &b00000000
Byte: 4=
0 &h00 &b00000000
Byte: 5=
0 &h00 &b00000000
Byte: 6=
2 &h02 &b00000010
......
For the first orientation you should have a look the first few bytes,
where you can find the current system time (which is also written in
the
first line):
In the example:
Byte 0 = &h55 corresponds 55 seconds
Byte 2 = &h05 corresponds 05 minutes
Byte 4 = &h00 corresponds 00 hours
Actual Systemtime (see first line) 00:05:56
You can also recognize that these values are BCD coded (will be
described more detailed below)
Next example (second run "Wake up on RTC Alarm" enabled, no other
changes in BIOS setup)
.....
Byte: 84=122
&h7A &b01111010
Byte: 85= 57
&h39 &b00111001
Byte: 86= 2
&h02 &b00000010
Byte: 87= 0
&h00 &b00000000
Byte: 88= 0
&h00 &b00000000
....
Byte: 123= 10
&h0A &b00001010
Byte: 124= 83
&h53 &b01010011
Byte: 125= 0
&h00 &b00000000
Byte: 126= 0
&h00 &b00000000
Byte: 127= 76
&h4C &b01001100
OldByte: 0= 85
&h55 &b01010101
NewByte: 0= 52
&h34 &b00110100
OldByte: 2=
5 &h05 &b00000101
NewByte: 2=
8 &h08 &b00001000
OldByte: 84=114
&h72 &b01110010
NewByte: 84=122
&h7A &b01111010
OldByte: 124= 75
&h4B &b01001011
NewByte: 124= 83
&h53 &b01010011
The differences between first and second run:
Byte0 and Byte2 are (as expected) different, as the second run has been
made nearly 3 minutes after the first run (at 00:08:34) These
differences will not be mentioned in the following description. More
interesting are the other differences:
On Byte 84 there is only one bit changed (marked red)
Byte124 is also changed for the same amount (8)
=> Byte 84 seems to be responsible for on/off of the wakeup function
and the corresponding bit is 3 (the bits are numbered from right to
left
starting with 0)
=> Byte 124 seems to be part of the BIOS checksum
Third run: "Wake up on RTC Alarm" enabled, wakeup set on day=01,
hour=02, minute=03)
.....
Byte: 84=122
&h7A &b01111010
Byte: 85= 57
&h39 &b00111001
Byte: 86= 1
&h01 &b00000001
Byte: 87= 2
&h02 &b00000010
Byte: 88= 3
&h03 &b00000011
....
Byte: 123= 10
&h0A &b00001010
Byte: 124= 87
&h57 &b01010111
Byte: 125= 0
&h00 &b00000000
Byte: 126= 0
&h00 &b00000000
Byte: 127= 76
&h4C &b01001100
OldByte: 86= 2
&h02 &b00000010
NewByte: 86= 1
&h01 &b00000001
OldByte: 87= 0
&h00 &b00000000
NewByte: 87= 2
&h02 &b00000010
OldByte: 88= 0
&h00 &b00000000
NewByte: 88= 3
&h03 &b00000011
OldByte: 124= 83
&h53 &b01010011
NewByte: 124= 87
&h57 &b01010111
As you can easily see, the byte 86 corresponds to the day, byte 87 to
hour and byte 88 to minute. The estimation that byte 124 is a part of
the checksum is hardened
Fourth run: "Wake up on RTC Alarm" enabled, wakeup set on day=11,
hour=12, minute=13)
.....
Byte: 84=122
&h7A &b01111010
Byte: 85= 57
&h39 &b00111001
Byte: 86= 11
&h0B &b00001011
Byte: 87= 12
&h0C &b00001100
Byte: 88= 13
&h0D &b00001101
....
Byte: 123= 10
&h0A &b00001010
Byte: 124=117
&h75 &b01110101
Byte: 125= 0
&h00 &b00000000
Byte: 126= 0
&h00 &b00000000
Byte: 127= 76
&h4C &b01001100
OldByte: 86= 1
&h01 &b00000001
NewByte: 86= 11
&h0B &b00001011
OldByte: 87= 2
&h02 &b00000010
NewByte: 87= 12
&h0C &b00001100
OldByte: 88= 3
&h03 &b00000011
NewByte: 88= 13
&h03 &b00001101
OldByte: 124= 87
&h57 &b01010111
NewByte: 124=117
&h75 &b01110101
As already estimated in the third run, the byte 86 corresponds to the
day, byte 87 to hour and byte 88 to minute. Furthermore one can see
that
these values are coded decimal and not BCD (~Hex) like the values in
the
RTC (Real Time Clock) on the bytes 00, 02 and 04. The byte 124 still
seems to be part of the checksum.
Fifth run: "Wake up on RTC Alarm" enabled, wakeup set on day=31,
hour=23, minute=59)
....
Byte: 84=122
&h7A &b01111010
Byte: 85= 57
&h39 &b00111001
Byte: 86= 31
&h1F &b00011111
Byte: 87= 23
&h17 &b00010111
Byte: 88= 59
&h3B &b00111011
.....
Byte: 123= 10
&h0A &b00001010
Byte: 124=194
&hC2 &b11000010
Byte: 125= 0
&h00 &b00000000
Byte: 126= 0
&h00 &b00000000
Byte: 127= 76
&h4C &b01001100
....
OldByte: 124=117
&h75 &b01110101
NewByte: 124=194
&hC2 &b11000010
(I skip the other differences) In this case only one byte of the
checksum could be found even with extreme values. To find the second
byte an additional change in the System BIOS should be made like the
setting for other power management functions.
Sixth (and last) run: "Wake up on RTC Alarm" enabled, wakeup set on
day=01, hour=00, minute=00, Harddisk off in Suspend mode disabled (was
enabled before)
....
Byte: 123=
09 &h09 &b00001001
Byte: 124=210
&hD2 &b11010010
....
OldByte:
123= 10
&h0A &b00001010
NewByte: 123= 09 &h09 &b00001001
OldByte: 124=194
&hC2 &b11000010
NewByte: 124=210
&hD2 &b11010010
Now the second byte of the checksum is found.
(A second more complicated example for the examination of the necessary
parameters can be found at the end of this text)
Summary of the results:
Wake up on RTC Alarm on/off = Byte 84 Bit 3 (named "ByteOnOff" und
BitOnOff in the following text)
Wake up day = Byte 86 (named "ByteDay" in the following text)
Wake up hour = Byte 87 (named "ByteHour" in the following text)
Wake up minute = Byte 88 (named "ByteMinute" in the following
text)
All values are decimal coded
First (high order) byte of the checksum: 123 (named "ByteCheckSumH" in
the following text)
Second (low order) byte of the checksum: 124 (named "ByteCheckSumL" in
the following text)
These values can now be entered in the CMOSConfig program and saved in
the windows registry for use by CMOSTimer (especially these values are
default, as they apply for my mainboard).
Screendump of CMOSConfig
Description for the
commands and settings:
DumpBIOS reads
the actual 126 bytes from the BIOS and shows them in the list window.
Like in CmosDos each value is shown in decimal, hex and binary. If the
option "ReadWriteFile" is
activated (off by default) the CMOSConfig program creates a B#.txt file
each time you click on DumpBIOS (like CmosDos) where the current values
and the differences to prior runs are saved.
With Compare you may compare
the content of the actual BIOSDump from the list window with any B#.txt
file (from either CMOSConfig or CmosDos). The differences are shown at
the bottom of the list window. If you click on Compare without a
BIOSDump in the list window you may select a B#.txt file as starting
values for further comparisons. This can be useful if you want to
compare "old" B#.txt files.
Quit ends the CMOSConfig
program
without any question.
In the Config window you can enter the found parameters and save them
with WriteReg to the windows
registry.
ByteDay: On this byte the BIOS
saves the wakeup day. Dependent on the coding of this value (decimal or
BCD) 5 bits or 6 bits are used (the other bits are untouched by the
program). Which bits should be used is determined also by the value of
BitDay. Here you can enter a "shift" of the value for the wakeup day
(only necessary for some mainboards, usually 0). The bits are numbered
from right to left with 0 to 7.
Bit
76543210
value:(example)
&b10101010
In
my opinion some examples for this settings are more descriptive than
long discussions, so here they are:
For all the following examples the wakeup day is 15; only the red
marked bits will be used (or changed) by the program.
The most simple case: Wakeup day is decimal coded, nothing else is
coded on this byte and there is no shift for the value.
Byte:
ByteDay= 15 &h0F &b00001111 => BitDay=0 HexD=off
Second simple case: Wakeup day is BCD coded, nothing
else is coded on this byte and there is no shift for the value.
Byte:
ByteDay= 21 &h15 &b00010101 => BitDay=0 HexD=on
The following examples are more difficult to
interpret...
Wakeup day is decimal coded, something else is coded on this byte (the
blue marked bits) and there is no shift for the value.
Byte:
ByteDay=143 &h8F &b10001111 => BitDay=0 HexD=off
Wakeup day is BCD coded, something else is coded on
this byte (the blue marked bits) and there is no shift for the value.
Byte:
ByteDay=213 &h8F &b11010101 => BitDay=0 HexD=on
Wakeup day is decimal coded, something else is coded on
this byte (the blue marked bits) and there is a 1 bit shift for the
value (i.e. the bit 0 is used for something else, the wakeup day is
coded on bits 1 to 5).
Byte:
ByteDay=223 &hDF &b11011111
=> BitDay=1 HexD=off
ByteHour:
On this byte the wakeup hour is saved. A shift for this value can be
accomplished by setting BitHour
> 0. In principle the same logic is used as described for ByteDay.
ByteMinute: On this byte the
wakeup minute is saved. A shift for this value can be accomplished by
setting BitMinute > 0. In
principle the same logic is used as described for ByteDay with the
exception that 6 bits are used for decimal coding and 7 bits for BCD
coding.
ByteOnOff: On this byte the
BIOS saves if wakeup is enabled or disabled. Only one bit is used.
BitOnOff: This is the bit which
determines if wakeup is enabled or disabled on the byte ByteOnOff.
ChkD, ChkH, ChkM and Check01: These checkboxes determine
if the corresponding bytes (ByteDay, ByteHour, ByteMinute and
ByteOnOff) are part of the checksum or not. Normally either all or none
of the bytes are part of the checksum, but maybe there is a mainboard
where the wakeup time is on the RTC bytes 1,3,5 (usually NOT part of
the checksum) and the ByteOnOff is 101 (usually part of the checksum).
HexD, HexH and HexM: These checkboxes determine if
the corresponding bytes (ByteDay, ByteHour and ByteMinute) are coded
decimal or BCD (Hex). If you enter a '15' as wakeup day and the
corresponding BIOSDump looks like this: (may be a different byte than
86 on your system)
Byte:
86= 15 &h0F &b00001111
then this value is decimal coded. If the corresponding BIOSDump looks
like this
Byte:
86= 21 &h15 &b00010101
(you find the '15' as &h15) then this value is coded in BCD (~Hex)
and you have to activate the check for HexD. The same logic applies for
HexH and HexM.
ByteCheckSumH: High order byte
of the BIOS checksum (normally the lower value, or the byte that does
not change each time you change the wakeup time in your BIOS)
ByteCheckSumL: Low order byte
of the BIOS checksum (normally the higher value, or the byte that
changes each time you change the wakeup time in your BIOS)
Some word on the checksum: On my mainboard the checksum is calculated
by summing up each value of the bytes 64 to 122 (including). This sum
is (naturally) higher than 255. Therefore two bytes are necessary to
save these amount. You may think of the two checksum bytes as one 16
bit value where the higher 8 bits are on the ByteCheckSumH and the
lower 8 bits are on ByteCheckSumL (inside the program a 16 bit value is
used).
Some mainboards do not need a checksum at
all, in this case you can just unset the option "CheckSumRequired". There is still
the requirement that ByteCheckSumH and ByteCheckSumL have any value,
but these values are not used. In this case you do not have to bother
how the checksum is calculated or where it is saved. Setting all the
checkboxes ChkD, ChkH, ChkM and Check01 off has
the same effect.
ReBootRequired: Some
mainboards
(also my own MSI 6570) do accept the changes in the BIOS only after a
reboot. Therefore CMOSTimer (and CMOSConfig) can do a reboot after the
new values for wakeup are written to the BIOS and shutdown the system
afterwards. To test if this is necessary on your PC, you can just unset
the option, write the wakeup day and time to the BIOS and try if your
PC
wakes up at the configured time... If your PC does not start at the
configured time you will need a reboot to "activate" the settings.
The "Required ReBoot time" (in
seconds) should be set to a slightly higher value as your PC needs to
shut down and reboot (you can lower this value if everything works
fine). This gives you the possibility to interrupt the process if
anything goes wrong.
The Test window contains some functions to
test the above described
parameters.
Day -
Hour - Minute contains default test values for
the wakeup time and date (around 20 minutes after the start of
CMOSConfig). You may enter any (valid! No day '32') values here.
TimerOnOff This concerns the
BitOnOff on the ByteOnOff and enables or disables the BIOS setting
"Wakeup on RTC alarm" (If disabled, the date and time are not written
to
the BIOS).
CreateTestFile: This is the
most important function to test your parameters. With this command a
B#.txt file is created which contains a virtual biosdump as it WOULD be
AFTER the test wakeup time and date (and the checksum) have been
written
to the BIOS (but nothing is actually written to the BIOS by the
program).
I would propose the following procedure:
Enter all necessary parameters in the Config window. Save this values
to the windows registry (with WriteReg).
Set the test wakeup time and date to "nice" values.
Click on CreateTestFile to write a testfile (B#.txt) with this values.
Reboot your PC and enter the same test wakeup time and date as above
into the BIOS with the normal BIOS setup. Start windows and load
CMOSConfig. Click on DumpBIOS
to
show the current BIOS settings in the list window. Click Compare and select the prior created
testfile (normally the B#.txt file with the highest # value) You should
find no differences except the RTC bytes 00, 02 and maybe 04.
If this test succeeds, you can do a "real" test: Select a wakeup time
and date around 20 minutes after the current time and date (like the
default values in CMOSConfig). Click on "Write to CMOS". Click on DumpBIOS to
have a look in the list window if all values are correct. If you think
that there is realy something wrong, you may try to "repair" the values
by hand:
Enter the number of the "suspect" byte into the Byte field and the (hopefully)
correct value in the Value
field. Click on WriteByte to
write that value to the BIOS.
If everything looks correct, click on "ReBoot
+ Shutdown" (or "Shutdown"
if your system does not need a reboot) or just (reboot and) shutdown
your system by hand.
Wait if your PC starts at the configured time...
If also this test succeeds, you can use CMOSTimer from the WinSTBTimer
program or also from other programs (or the windows internal task
scheduler) who can run CMOSTimer with the correct commandline.
Have fun,
Borax
Attachment:
Here you will find a second example how to determine the necessary
program parameters. The example is for a MSI MS-6380 mainboard (I don't
know the revision), where the coding for the wakeup time and date is
quite complicated. The wakeup time and date is actually saved two times
in the BIOS, but only one set of bytes is really used. Example: The
wakeup day is to be found on byte 125 and this byte is not part of the
checksum. If you use WriteByte and change the value for this byte, you
can find the change in a new biosdump. But after a reboot the "old"
value is restored by the bios!
I will show only the interesting bytes in the text, the complete files
B1.txt to B6a.txt can be downloaded here.
Download:
B1-6a - downloads: 272
1. First run: WakeUp in BIOS disabled, wakeup time and date still have
"old" values (day=15, hour=12, minute=30, second=30).
Byte: 1= 0 &h00 &b00000000
Byte: 3=
0 &h00 &b00000000
Byte: 5=
0 &h00 &b00000000
Byte: 62= 61
&h3D &b00111101
Byte: 63=239
&hEF &b11101111
Byte: 101= 94
&h5E &b01011110
Byte: 102= 76
&h4C &b01001100
Byte: 103= 30
&h1E &b00011110
Byte: 104= 30
&h1E &b00011110
Byte: 125= 0
&h00 &b00000000
2. Second run: WakeUp in BIOS enabled, no
other changes in BIOS setup, wakeup time and date still have "old"
values (day=15, hour=12, minute=30, second=30).
Byte: 1= 48 &h30 &b00110000
Byte: 3= 48
&h30 &b00110000
Byte: 5= 18
&h12 &b00010010
Byte: 62= 61
&h3D &b00111101
Byte: 63=240
&hF0 &b11110000
Byte: 101= 95
&h5F &b01011111
Byte: 102= 76
&h4C &b01001100
Byte: 103= 30
&h1E &b00011110
Byte: 104= 30
&h1E &b00011110
Byte: 125= 21
&h15 &b00010101
OldByte: 1=
0 &h00 &b00000000
NewByte: 1= 48
&h30 &b00110000
OldByte: 3=
0 &h00 &b00000000
NewByte: 3= 48
&h30 &b00110000
OldByte: 5=
0 &h00 &b00000000
NewByte: 5= 18
&h12 &b00010010
OldByte: 63=239
&hEF &b11101111
NewByte: 63=240
&hF0 &b11110000
OldByte: 101= 94
&h5E &b01011110
NewByte: 101= 95
&h5F &b01011111
OldByte: 125= 0
&h00 &b00000000
NewByte: 125= 21
&h15 &b00010101
On the first view one could guess the following:
ByteDay=125, ByteHour=5, ByteMinute=3 (and ByteSecond=1) all this bytes
are BCD coded and not part of the checksum. ByteOnOff = 101 with
BitOnOff=0 and this byte is included in the checksum. ByteCheckSumL=63
(the value of this byte changes by 1 as for byte 101, but not on a
specific bit). But this guess is wrong as we will see in the next run:
3. Third run: WakeUp in BIOS enabled, wakeup time and date set to
day=01, hour=02, minute=03, second=04.
Byte:
1= 4 &h04 &b00000100
Byte: 3=
3 &h03 &b00000011
Byte: 5=
2 &h02 &b00000010
Byte: 62= 61
&h3D &b00111101
Byte: 63=149
&h95 &b10010101
Byte: 101= 67
&h43 &b01000011
Byte: 102= 66
&h42 &b01000010
Byte: 103= 3
&h03 &b00000011
Byte: 104= 4
&h04 &b00000100
Byte: 125= 1
&h01 &b00000001
OldByte: 1= 48
&h30 &b00110000
NewByte: 1=
4 &h04 &b00000100
OldByte: 3= 48
&h30 &b00110000
NewByte: 3=
3 &h03 &b00000011
OldByte: 5= 18
&h12 &b00010010
NewByte: 5=
2 &h02 &b00000010
OldByte: 63=240
&hF0 &b11110000
NewByte: 63=149
&h95 &b10010101
OldByte: 101= 95
&h5F &b01011111
NewByte: 101= 67
&h43 &b01000011
OldByte: 102= 76
&h4C &b01001100
NewByte: 102= 66
&h42 &b01000010
OldByte: 103= 30
&h1E &b00011110
NewByte: 103= 3
&h03 &b00000011
OldByte: 104= 30
&h1E &b00011110
NewByte: 104= 4
&h04 &b00000100
OldByte: 125= 21
&h15 &b00010101
NewByte: 125= 1
&h01 &b00000001
Now you can see the following:
ByteMinute=3 (BCD coded) AND ByteMinute= 103 (decimal coded). Similar
ByteSecond=1 (BCD coded) AND ByteSecond=104 (decimal coded). Byte 101
is not only the byte ByteOnOff, but does something other in addition.
Byte 102 also changes, but the meaning is not clear... The Byte 63 is
really one byte of the checksum, but also the bytes 102 to 104 have to
be taken into account to calculate the checksum. Therefore the first
guess that only the ByteOnOff is part of the checksum must be wrong.
The next run is even more illustrative:
4. Fourth run: WakeUp in BIOS enabled, wakeup time and date set to
day=11, hour=12, minute=13, second=14.
Byte: 1= 20 &h14 &b00010100
Byte: 3= 19
&h13 &b00010011
Byte: 5= 18
&h12 &b00010010
Byte: 62= 61
&h3D &b00111101
Byte: 63=199
&hC7 &b11000111
Byte: 101= 87
&h57 &b01010111
Byte: 102= 76
&h4C &b01001100
Byte: 103= 13
&h0D &b00001101
Byte: 104= 14
&h0E &b00001110
Byte: 125= 17
&h11 &b00010001
OldByte: 1=
4 &h04 &b00000100
NewByte: 1= 20
&h14 &b00010100
OldByte: 3=
3 &h03 &b00000011
NewByte: 3= 19
&h13 &b00010011
OldByte: 5=
2 &h02 &b00000010
NewByte: 5= 18
&h12 &b00010010
OldByte: 63=149
&h95 &b10010101
NewByte: 63=199
&hC7 &b11000111
OldByte: 101= 67
&h43 &b01000011
NewByte: 101= 87
&h57 &b01010111
OldByte: 102= 66
&h42 &b01000010
NewByte: 102= 76
&h4C &b01001100
OldByte: 103= 3
&h03 &b00000011
NewByte: 103= 13
&h0D &b00001101
OldByte: 104= 4
&h04 &b00000100
NewByte: 104= 14
&h0E &b00001110
OldByte: 125= 1
&h01 &b00000001
NewByte: 125= 17
&h11 &b00010001
As before, you can see that ByteMinute=3 (BCD coded) AND ByteMinute=
103 decimal coded), ByteSecond=1 (BCD coded) AND ByteSecond=104
(decimal coded). If you have a look to the bit strings of the bytes
102, 103 and 104 you can see that they form a increasing sequence:
Byte: 102
.....1100
Byte: 103 .....1101
Byte: 104 .....1110
These values correspond to 12,13 and 14. Therefore the wakeup hour is
on the byte 102, where the bit 6 on the byte 102 is used for something
else, but that doesn't matter, as only the lower 6 bits are needed. The
only disadvantage is that it is harder to see as the value of this byte
is not 12 but 76.
The interpretation of byte 101 is even a little bit harder, but as we
already know the bytes for wakeup hour, minute and second the missing
one is day... and it will be clear soon that byte 101 really is the
ByteDay.
Now it is time to use a calculator: If you look at the difference of
the configured wakeup days between run 4 and run 3 you get a delta1 of
10 (11-1). If you calculate the difference between oldbyte 101 and
newbyte 101 you get a delta2 of 20 (87-67). Now let's do the same for
run 3 and run 2: Difference in configured days delta1 = 14 (15-1) and
difference in bytes 101 (oldbyte 101 and newbyte 101) delta2 = 28
(95-67). The difference between the configured days is always the
double of the difference in the values of byte 101. And this is logical
as the bit 0 of byte 101 is the BitOnOff. Therefore you can think about
the coded wakeup day as if a zero is added to the binary value which
corresponds to a doubling of the value in decimal. The wakeup day is
thus saved on the byte 101 on the bits 1 to 5, therefore you must use a
shift of one bit: BitDay has to be set to '1'.
5. Fifth run: WakeUp in BIOS enabled, wakeup time and date set to
day=01, hour=00, minute=00, second=00.
Byte: 1= 0 &h00 &b00000000
Byte: 3=
0 &h00 &b00000000
Byte: 5=
0 &h00 &b00000000
Byte: 62= 61
&h3D &b00111101
Byte: 63=140
&h8C &b10001100
Byte: 101= 67
&h43 &b01000011
Byte: 102= 64
&h40 &b01000000
Byte: 103= 0
&h00 &b00000000
Byte: 104= 0
&h00 &b00000000
Byte: 125= 1
&h01 &b00000001
Here you can also see the wakeup day on the byte 101
bit 1
6. Last run: WakeUp in BIOS enabled, wakeup time and date set to
day=31, hour=23, minute=59, second=00.
Byte: 1= 0 &h00 &b00000000
Byte: 3= 89
&h59 &b01011001
Byte: 5= 35
&h23 &b00100011
Byte: 62= 62
&h3E &b00111110
Byte: 63= 26
&h1A &b00011010
Byte: 101=127
&h7F &b01111111
Byte: 102= 87
&h57 &b01010111
Byte: 103= 59
&h3B &b00111011
Byte: 104= 0
&h00 &b00000000
Byte: 125= 49
&h31 &b00110001
OldByte: 62= 61
&h3D &b00111101
NewByte: 62= 62
&h3E &b00111110
OldByte: 63=140
&h8C &b10001100
NewByte: 63= 26
&h1A &b00011010
Now we have the second byte of the
checksum : ByteCheckSumH = 62!
Summary of the results:
ByteOnOff=101
BitOnOff=0
ByteDay=101
BitDay=1
ByteHour=102
BitHour=0
ByteMinute=103
BitMinute=0
ChkD, ChkH, ChkM und Chk01 all set to on
HexD, HexH und HexM all set to off
ByteCheckSumH=62
ByteCheckSumL=63
Screendump of corresponding Config settings:
Tests:
The file B1.txt has been loaded (with Compare without prior BIOSDump).
The settings as shown in the above screenshot have been used and a
testfile B2a.txt was created. The program was closed, reopened and file
B2.txt loaded (also with Compare without prior BIOSDump). Then file
B2a.txt has been loaded (again with Compare) and the comparison shows
that only the bytes 0,1,2,3,5 and 125 are different. Bytes 0 and 2 are
the actual system time, therefore the difference is normal. Bytes 1,3,5
and 125 are the second copy of the wakeup date and time which is not
used by the BIOS. The important bytes 101 to 104 and the two checksum
bytes 62 and 63 have no differences!
With a similar approach the file B5.txt has been loaded and with the
above settings the testfile B6a.txt was created. The testday, testhour
and testminute have been set to 31,23 and 59 respectively. The
comparison with the "real" file B6.txt shows the same differences: Only
bytes 0,2,3,5 and 125.