“William Morris” <wrm@innovation-tk.com> wrote in message
news:9tt5v5$7bs$1@inn.qnx.com…
On QNX4.25:
Is there a way to determine whether a cold or warm boot occurred and
whether the proper shutdown procedure was performed?
from braun’s interrupts list:
— cut —
----------M00400072--------------------------
MEM 0040h:0072h - POST RESET FLAG
Size: WORD
Desc: specify the action the BIOS should take at the beginning of the
power-on self-test when the machine is reset
SeeAlso: INT 19,MEM F000h:FFF0h
(Table M021)
Values for POST reset flag:
0000h cold boot
0064h Burn-in mode
1234h to bypass memory test (warm boot)
4321h [PS/2 except Mod 25,30] to preserve memory
5678h [Conv] system suspended
9ABCh [Conv] manufacturing test mode
ABCDh [Conv] POST loop mode
— cut —
i.e. when you reboot [afair dosn’t matter how] you can specifiy to BIOS how
to perform boot sequence: cold or warm. so after CPU is halted memory isn’t
affected so it holds previously set let’s suppose 0x1234 value → BIOS finds
it, performs warm boot and leaves it as is so you can check how POST was
performed lately. unlikely that after power shutdown memory contains value
0x1234 at 0x0472.
I want to write a simple logging program that logs all QNX restarts to
a central server.
by restart you mean machine power on or off ? if it’s enough just to log
every time os starts up you just can add all necessary code into your
sysinit startup file so it should work fine. if you want to catch incorrect
system shutdown it’s a bit harder. if you want to catch power failures it’s
about impossible due to no feedback is delivered in ordinary system when
power is switched off assumed that there’s no UPS used etc.
The logs would include environmental info (card
temperatures, voltages) serial numbers and revisions of h/w, software
release info, and a few configuration files. In the case where a
system hung prior to reboot, I want on reboot to be able to detect an
inproper shutdown and pop-up a screen where the user fills-in details
of the crash (LED states, What was being done at the point of
crash…). The hope is that the data gathered might help tracking the
cause of hangups.
It was suggested to me that one might, on reboot save an image of the
entire RAM. This seems to me to be very difficult (for starters,
where would it be saved to prevent QNX wiping it on starting). Is it
likely that anything useful could be gleaned from such an approach and
what tools might one use to analyse such a dump?
with some efforts you can save your current whole RAM image. for example
before performing shotdown operation and it’s not so hard to do. also
futher analysis of saved image [for example from file] dosn’t differ with
analysing of current linear/physical RAM map at runtime and also isn’t so
hard. but it all depends on what d’u want to find out inside this saved RAM
snapshot ?
Thanks in advance
William Morris
wrm@innovation-tk.com
// wbr