The HyperNews Linux KHG Discussion Pages

Disagree: Why not to get a memory snapshot?

Forum: The Linux Kernel Hackers' Guide
Re: Question How to get a Memory snapshot ? (Manuel Porras Brand)
Keywords: UPS memory-image
Date: Fri, 30 May 1997 21:37:28 GMT
From: Jukka Santala <[email protected]>

Altough I normally disagree with study assignments "done" thru Usenet etc. (check any resource on netiquette etc. :P) that assignment sounds weird enough to warrant a quick note.

That being that "technically", there's little you can do once the power goes down... the first warnign you get is, well, err, when the power goes down and the processor stops executing instructions ;) Incidentally (and luckily, for many) there's a thing called Uninterruptable Power Supply, or UPS for short, which can warn the operating-system once the power goes bad, and feed emergency power to the system until it has managed a controlled shut-down or the power goes up again.

Ofcourse, if you "simply" need to know _what_ the OS was doing when the power went down, that may be a bit of an overkill. This is how we finalyl get into slightly kernel-related stuff. One approach might be to let kernel log all program executions/forks into syslog thru syslogd - however, since all disk-access is cached this will be slightly out of date if the computer just suddenly gets switched off. A bit of clever coding might be used to avoid the cache in writing (Or does syslog already do that? Would make sense) or another solution might be to use battery-backed bubble-ram or something similiar with very short access times if one is worried about performance.

But shortly put, memory-images once the power actually goes down are out of question ;) However, if the issue is simply about kernel bug-tracking... well, that's another issue (and more appropriate for this place, I might add :P) indeed.