4 ms·
Kernel panic was as simple as: volatile void panic(const char * s) { printk("Kernel panic: %s\n\r",s); for(;;); }
by zeeone 15y ago
Kernel panic was as simple as:
volatile void panic(const char * s)
{
printk("Kernel panic: %s\n\r",s);
for(;;);
}
- nknight 15y agoIt's interesting to compare it to the modern version [1]. In a way, it really isn't much more complicated now. It's changed to take a format string, but beyond that, once you rip out the platform-specific ifdefs, the SMP/lock code, and the automatic reboot code, you're still left with a pretty simple function that does basically the same thing. [1] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=kernel/panic.c;h=80aed44e345abc648f7ac3d0e7560a05e453c7fd;hb=fde7d9049e55ab85a390be7f415d74c9f62dd0f9 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git...