--- linux-2.2.16/kernel/sys.c Mon Jun 12 13:11:44 2000 +++ linux/kernel/sys.c Mon Jun 12 13:15:26 2000 @@ -21,6 +21,18 @@ int C_A_D = 1; +/* + * Small function to print uptime + */ + +int get_uptime(void) +{ + int uptime = jiffies / HZ; + printk(KERN_EMERG "\nUptime: %dh %dm %ds\n", + (uptime/60)/60, (uptime/60)%60, uptime%60); + return uptime; +} + /* * Notifier list for kernel code which wants to be called @@ -186,6 +198,7 @@ case LINUX_REBOOT_CMD_HALT: notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL); printk(KERN_EMERG "System halted.\n"); + get_uptime(); machine_halt(); do_exit(0); break; @@ -193,6 +206,7 @@ case LINUX_REBOOT_CMD_POWER_OFF: notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL); printk(KERN_EMERG "Power down.\n"); + get_uptime(); machine_power_off(); do_exit(0); break;