memconsole: a virtual console to record the Oops message for debugging purpose.

From

Changli Gao <>

Dear Linus:

In the production environment, it is hard to find the causion of anOops message if a bug causes the kernel panics. Though the Oopsmessage is printed on the screen, we can't read the whole message inmost cases due to the size of the screen, and it is hard to save theOops message for debugging. I know kdump is a choice, but it needsmore memory, and in most cases, Oops messages are enough to find outthe bugs. The other choices are netconsole and serial line, but theyboth need extra computers.

memconsole as a virtual console, will save the messages into a blockof boot memory reserved. Because the memory won't be cleaned(if theself-check on memory is disabled) between two starts, the oopsmessages as the other console messages will be saved between them, andyou have a chance to see what happened in the last start.

In order to avoid the corruption of the memory used by memconsole, Ifind the memory from the end to the start.

Here is the code, and the code is mess currently. Am I in the rightdirection? Are my assumptions right?