3 /* Este archivo tiene como Ășnico fin realizar el debug de la
6 #include "routix/time.h"
7 #include "routix/timer.h"
10 #include "routix/system.h"
14 #define cmd(comando) ( ! strcmp(msg,comando) )
22 void time_debug(void) {
26 kprintf("tmdebug > ");
29 if ( cmd("exit") ) { return; }
30 else if ( cmd("dump") ) { dump_tm(); }
31 else if ( cmd("bis") ) { bisiestos(); }
32 else if ( cmd("tod") ) { kprintf("tod: %d\n",mktime( localtime(NULL
) )); }
33 else if ( cmd("localtime") ) { local(); }
34 else if ( cmd("asctime") ) { asctime( localtime(NULL
) ); }
35 else if ( cmd("jiffies") ) { kprintf("jiffies: %d\n",jiffies
); }
36 else if ( cmd("excepcion") ) { dword
*prueba
=(dword
*) 0xfffffff; *prueba
=2; }
51 kprintf(" tm_seg=%d\n tm_min=%d\n tm_hour=%d\n",tm
->tm_sec
,tm
->tm_min
,tm
->tm_hour
);
52 kprintf(" tm_mday=%d\n tm_mon=%d\n tm_year=%d\n",tm
->tm_mday
,tm
->tm_mon
,tm
->tm_year
);
53 kprintf(" tm_wday=%d\n tm_yday=%d",tm
->tm_wday
,tm
->tm_yday
);
65 for ( counter
=0; counter
< 10; counter
++,i
++) {
66 if ( es_bisiesto(i
) ) { kprintf("%d es bisiesto\n",i
); }
67 else { kprintf("%d no es bisiesto\n",i
); }
78 tod
= mktime( localtime(NULL
) );
83 kprintf(" tm_seg=%d\n tm_min=%d\n tm_hour=%d\n",tm
->tm_sec
,tm
->tm_min
,tm
->tm_hour
);
84 kprintf(" tm_mday=%d\n tm_mon=%d\n tm_year=%d\n",tm
->tm_mday
,tm
->tm_mon
,tm
->tm_year
);
85 kprintf(" tm_wday=%d\n",tm
->tm_wday
);
87 kprintf("\ntod: %d\n",tod
);
91 kprintf(" tm_seg=%d\n tm_min=%d\n tm_hour=%d\n",tm
->tm_sec
,tm
->tm_min
,tm
->tm_hour
);
92 kprintf(" tm_mday=%d\n tm_mon=%d\n tm_year=%d\n",tm
->tm_mday
,tm
->tm_mon
,tm
->tm_year
);
93 kprintf(" tm_wday=%d\n",tm
->tm_wday
);