Warm/Cold boot status

On QNX4.25:

Is there a way to determine whether a cold or warm boot occurred and
whether the proper shutdown procedure was performed?

I want to write a simple logging program that logs all QNX restarts to
a central server. 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?

Thanks in advance

William Morris
wrm@innovation-tk.com

“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?

If you have a clean shutdown procedure you could create a dummy file
on the HD when the procedure is invoked. On power up you check
if the file exists, if it does you know you are back from a clean shutdown.

However someone might have hit the reset button. All design i’ve
seen that wanted 100% reliability to detect from cold or warm boot
used custom hardware.

I want to write a simple logging program that logs all QNX restarts to
a central server. 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.

You could do it backward as well, on startup create a file. If you
have a clean shutdown procedure it should erase the file. Upon
next startup, check for the existance of the file. If it’s there that means
you’re back from an abnormal restart (but it doesn’t say if it’s a cold
a warm restart).


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).

On the HD? This assume you have a clean shutdown procedure.
Depending on hardware and BIOS, after a reboot the RAM may
have been totaly wiped out. You would have to do this
before rebooting.

Is it
likely that anything useful could be gleaned from such an approach and
what tools might one use to analyse such a dump?

I don’t know of any tools do analyse the content of the system ram.
Everything is possible but I beleive it would be EXTREMELY
difficult to make out any usefull info out of the content of the ram image.

Thanks in advance

William Morris
wrm@innovation-tk.com

Yes. Look at the output of the ‘sin in’ utility. It indicates when the
system booted, weather it was a netboot or disk boot and if it was an
altboot. All of this information is available from the osinfo() call.
Check the header file for details.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“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?

I want to write a simple logging program that logs all QNX restarts to
a central server. 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?

Thanks in advance

William Morris
wrm@innovation-tk.com

Mario Charest <mcharest@clipzinformatic.com> wrote:

If you have a clean shutdown procedure you could create a dummy file
on the HD when the procedure is invoked. On power up you check
if the file exists, if it does you know you are back from a clean shutdown.

However someone might have hit the reset button. All design i’ve
seen that wanted 100% reliability to detect from cold or warm boot
used custom hardware.

Maybe I can organise that. It sounds best.

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).

On the HD? This assume you have a clean shutdown procedure.
Depending on hardware and BIOS, after a reboot the RAM may
have been totaly wiped out. You would have to do this
before rebooting.

Mmm. I hadn’t thought about the BIOS clearing RAM. And I
cannot do it before rebooting as its purpose is only to
analyse those few times when the system hangs and cannot be
shutdown properly.

Is it likely that anything useful could be gleaned from such an
approach and what tools might one use to analyse such a dump?

I don’t know of any tools do analyse the content of the system ram.
Everything is possible but I beleive it would be EXTREMELY
difficult to make out any usefull info out of the content of the ram image.

I thought it sounded like a lot of work. I was just hoping
someone else had already done it!

Many thanks for your advice

William Morris
wrm@innovation-tk.com

Bill Caroselli <qtps@earthlink.net> wrote:

Yes. Look at the output of the ‘sin in’ utility. It indicates when the
system booted, weather it was a netboot or disk boot and if it was an
altboot. All of this information is available from the osinfo() call.
Check the header file for details.

Thanks. I didn’t know that info was available.

Regards

William Morris
wrm@innovation-tk.com

“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 :slight_smile: 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