• R/O
  • SSH
  • HTTPS

chnosproject: Commit


Commit MetaInfo

Revisión177 (tree)
Tiempo2010-10-17 00:48:52
Autorhikarupsp

Log Message

dateコマンドと、resetコマンドを追加。中身は言わなくてもわかりますよね…

Cambiar Resumen

Diferencia incremental

--- beta/tolset_chn_000/chnos_007/chnos/console.c (revision 176)
+++ beta/tolset_chn_000/chnos_007/chnos/console.c (revision 177)
@@ -105,7 +105,7 @@
105105
106106 void cons_command_start(struct WINDOWINFO *win, struct POSITION_2D *prompt, struct POSITION_2D *cursor, unsigned char *cmdline, unsigned int *cmdlines, bool *cmdline_overflow)
107107 {
108- unsigned char s[128];
108+ unsigned char s[128], t[7];
109109 int i, j;
110110 unsigned char *p;
111111
@@ -140,6 +140,12 @@
140140 }
141141 }
142142 }
143+ } else if(strcmp(cmdline, "reset") == 0){
144+ reset_cpu();
145+ } else if(strcmp(cmdline, "date") == 0){
146+ readrtc(t);
147+ sprintf(s, "%02X%02X.%02X.%02X %02X:%02X:%02X\n", t[6], t[5], t[4], t[3], t[2], t[1], t[0]);
148+ cons_put_str(win, prompt, cursor, s);
143149 } else if(strncmp(cmdline, "type ", 5) == 0){
144150 for(j = 0; j < 11; j++){
145151 s[j] = ' ';
--- beta/tolset_chn_000/chnos_007/chnos/io.c (revision 176)
+++ beta/tolset_chn_000/chnos_007/chnos/io.c (revision 177)
@@ -77,3 +77,11 @@
7777 return;
7878 }
7979
80+void reset_cpu(void)
81+{
82+ wait_KBC_sendready();
83+ io_out8(PORT_KEYCMD, 0xfe);
84+ for (;;) { io_hlt(); }
85+}
86+
87+
--- beta/tolset_chn_000/chnos_007/chnos/core.h (revision 176)
+++ beta/tolset_chn_000/chnos_007/chnos/core.h (revision 177)
@@ -480,6 +480,7 @@
480480 void send_serial(unsigned char *s);
481481 void fdc_motor_on(unsigned char d);
482482 void fdc_motor_off(unsigned char d);
483+void reset_cpu(void);
483484
484485 /*timer.c*/
485486 void inthandler20(int *esp);
Show on old repository browser