Пример #1
0
static void time_init(void)
{
	struct tm time;

	do {
		time.tm_sec = CMOS_READ(0);
		time.tm_min = CMOS_READ(2);
		time.tm_hour = CMOS_READ(4);
		time.tm_mday = CMOS_READ(7);
		time.tm_mon = CMOS_READ(8);
		time.tm_year = CMOS_READ(9);
	} while (time.tm_sec != CMOS_READ(0));
	BCD_TO_BIN(time.tm_sec);
	BCD_TO_BIN(time.tm_min);
	BCD_TO_BIN(time.tm_hour);
	BCD_TO_BIN(time.tm_mday);
	BCD_TO_BIN(time.tm_mon);
	BCD_TO_BIN(time.tm_year);
	time.tm_mon--;
	startup_time = kernel_mktime(&time);
}
Пример #2
0
void proccmd(char * cmd)
{
	if (strcmp(cmd, "clear") == 0) {
		clrscr();
		gotoxy(0, -1);	/* csr_y = -1 because of "\n" in prompt */
	} else if (strcmp(cmd, "minios") == 0)
		about();
	else if (strcmp(cmd, "reboot") == 0) {
		printk("\nrebooting...\n");
		timer_wait(10);
		printk("\n[NOW]");
		timer_wait(5);
		reboot();
	} else if (strcmp(cmd, "help") == 0)
		help();
	else if (strcmp(cmd, "date") == 0) {
		struct time t;
		kernel_mktime(&t);
                printk("\n%02d/%02d\t%02d:%02d:%02d IST\t%04d\n", t.month, t.day, t.hour, t.min, t.sec, t.year);
	} else
		printk("\nMINI shell : %s : command not found\n", cmd);
}