Kernel 0.5.7-r6; ips2ip support unix domain sockets now ! You can use
[ZeXOS.git] / kernel / core / commands.c
blob0e0b23e4bbc5ddfb9315ac31babc1f324e26018d
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <system.h>
21 #include <x86.h>
22 #include <string.h>
23 #include <partition.h>
24 #include <env.h>
25 #include <dev.h>
26 #include <vfs.h>
27 #include <fs.h>
28 #include <tty.h>
29 #include <proc.h>
30 #include <stdlib.h>
31 #include <net/socket.h>
32 #include <module.h>
33 #include <commands.h>
34 #include <signal.h>
35 #include <build.h>
36 #include <net/if.h>
37 #include <net/net.h>
39 command_t command_list;
41 unsigned char test[80];
43 typedef void (*void_fn_void_t)(void);
45 extern task_t task_list;
46 extern vfs_t vfs_list;
47 extern int cstrcmp (char *one, char *two);
48 extern unsigned long file_cache_id;
49 extern task_t *_curr_task;
50 extern module_t *module_load (char *modname);
52 char *argparse (char *cmd)
54 unsigned cmd_len = strlen (cmd);
55 unsigned p = 1;
57 while (p < cmd_len) {
58 if (cmd[p] == ' ')
59 return cmd + p + 1;
61 p ++;
64 return "";
67 #define WAIT 0xFFFFFL
68 static void wait (void)
70 unsigned long wait;
72 for(wait = WAIT; wait != 0; wait--)
73 /* nothing */;
76 /*************************************************************\
77 | OMMANDs |
78 \*************************************************************/
80 unsigned command_help (char *command, unsigned len)
82 command_t *ctx;
84 unsigned i = 0;
86 tty_t *tty = currtty;
88 for (ctx = command_list.next; ctx != &command_list; ctx = ctx->next) {
89 i ++;
91 printf ("\n%s : %s", ctx->name, ctx->desc);
93 if (i >= 24) {
94 settextcolor (0, 15);
95 printf ("\nPress enter to continue");
97 /* wait, until enter key is pressed */
98 while (getkey () != '\n')
99 schedule ();
101 settextcolor (15, 0);
103 tty_cls (tty);
104 i = 0;
108 printf ("\n");
110 return 1;
113 unsigned command_hdd (char *command, unsigned len)
115 int t;
116 int m;
117 int c;
118 int c2;
119 int h;
120 int s;
122 outportb (0x70, 0x12);
123 t = inportb (0x71);
125 if (t >> 4 == 0)
127 printf ("/dev/hda not installed\n");
129 else
131 outportb (0x70, 0x1b);
132 c = inportb (0x71);
133 outportb (0x70, 0x1c);
134 c2 = inportb (0x71);
135 outportb (0x70, 0x1d);
136 h = inportb (0x71);
137 outportb (0x70, 0x23);
138 s = inportb (0x71);
139 printf ("/dev/hda installed - CHS=%d-%d:%d:%d\n", c, c2, h, s);
142 if (t & 0xF == 0)
144 printf ("/dev/hdb not installed\n");
146 else
148 outportb (0x70, 0x24);
149 c = inportb (0x71);
150 outportb (0x70, 0x25);
151 c2 = inportb (0x71);
152 outportb (0x70, 0x26);
153 h = inportb (0x71);
154 outportb (0x70, 0x2c);
155 s = inportb (0x71);
156 printf ("/dev/hdb installed - CHS=%d-%d:%d:%d\n", c, c2, h, s);
159 return 1;
162 unsigned command_reboot (char *command, unsigned len)
164 outportb (0x64, 0xFE);
166 while (1);
168 return 1;
171 unsigned command_halt (char *command, unsigned len)
173 halt ();
175 puts ("\nSystem halted\nPlease press power button ..");
177 disable ();
179 while(1);
181 return 1;
184 unsigned command_tasks (char *command, unsigned len)
186 puts ("name\tpriority\n");
188 task_t *task;
189 for (task = task_list.next; task != &task_list; task = task->next)
190 printf ("%s\t%u\n", task->name, task->priority);
192 return 1;
195 unsigned command_ps (char *command, unsigned len)
197 proc_display ();
199 return 1;
202 unsigned command_uptime (char *command, unsigned len)
204 uptime ();
206 return 1;
209 unsigned command_version (char *command, unsigned len)
211 osinfo ();
213 return 1;
216 unsigned command_debug (char *command, unsigned len)
218 if (!debug) {
219 debug = 1;
220 DPRINT ("developer mode was enabled.");
222 return 1;
225 DPRINT ("developer mode was disabled.");
226 debug = 0;
228 return 1;
231 unsigned command_mount (char *command, unsigned len)
233 strcpy (test, argparse (command));
234 char devname[20];
235 char mountpoint[32];
237 unsigned l = strlen (test);
238 unsigned x = 0;
239 while (x < l) {
240 if (test[x] == ' ')
241 break;
242 x ++;
245 memcpy (devname, test, x);
246 devname[x] = '\0';
247 strcpy (mountpoint, argparse (test));
248 unsigned y = strlen (mountpoint);
250 if (mountpoint[y-1] != '/') {
251 mountpoint[y] = '/';
252 mountpoint[y+1] = '\0';
255 if (x && y) {
256 partition_t *p = partition_find (devname);
258 if (p)
259 mount (p, "", mountpoint);
260 else
261 printf ("ERROR -> partition %s does not exists\n", devname);
262 } else
263 mount_display ();
265 return 1;
268 unsigned command_env (char *command, unsigned len)
270 env_display ();
272 return 1;
275 unsigned command_cd (char *command, unsigned len)
277 strcpy (test, argparse (command));
279 cd (test);
281 return 1;
284 unsigned command_ls (char *command, unsigned len)
286 strcpy (test, argparse (command));
288 ls (test);
290 return 1;
293 unsigned command_cat (char *command, unsigned len)
295 strcpy (test, argparse (command));
296 unsigned file_len = strlen (test);
298 char pwd[64];
299 strcpy (pwd, (char *) env_get ("PWD"));
301 vfs_t *vfs;
302 for (vfs = vfs_list.next; vfs != &vfs_list; vfs = vfs->next)
303 if (!strcmp (vfs->mountpoint, pwd) &&
304 !cstrcmp (test, vfs->name)) {
305 if (vfs->attrib & VFS_FILEATTR_DIR) {
306 printf ("ERROR -> this is a directory, not an file\n");
307 return 0;
310 /* check permissions */
311 if (vfs->attrib & VFS_FILEATTR_SYSTEM && strcmp ((char *) env_get ("USER"), "root")) {
312 printf ("ERROR -> only root can do that\n");
313 return 0;
317 if (vfs->attrib & VFS_FILEATTR_MOUNTED) {
318 partition_t *p = (partition_t *) mount_find ((char *) env_get ("PWD"));
320 if (p)
321 cat (p, test);
322 else {
323 printf ("ERROR -> device not respond\n");
324 return 0;
328 env_set ("PWD", pwd);
330 return 0;
333 printf ("No such file : %s\n", test);
335 return 1;
338 unsigned command_mkdir (char *command, unsigned len)
340 strcpy (test, argparse (command));
342 mkdir (test);
344 return 1;
347 unsigned command_exec (char *command, unsigned len)
349 if (!strncmp ("./", command, 2))
350 strcpy (test, command+2);
351 else
352 strcpy (test, argparse (command));
355 unsigned arg_len = strlen (argparse (test));
356 char arg[arg_len+1];
357 strcpy (arg, argparse (test));
358 arg[arg_len] = '\0';
360 unsigned test_len = strlen (test);
361 test [test_len-arg_len] = '\0';
363 if (!exec (test))
364 return 0;
366 //printf ("l: %llu\n", file_cache_id);
368 unsigned char *bin = (unsigned char *) kmalloc (sizeof (char) * file_cache_id + 1);
370 memcpy (bin, file_cache, file_cache_id);
371 bin[file_cache_id] = '\0';
373 unsigned entry;
374 int err = exec_elf (bin, &entry);
376 if (err != NULL) {
377 printf ("ERROR -> invalid ELF exec\n");
378 return 0;
381 tty_lock (currtty);
384 proc_t *proc = proc_create (currtty, test, entry);
386 if (!proc) {
387 printf ("ERROR -> Invalid process: %s\n", test);
388 return 0;
391 /* well, set argument for out app */
392 proc_arg_set (proc, arg, arg_len);
394 /* wait here, until pid != 0*/
395 while (proc->pid)
396 schedule ();
398 /* enable interrupts */
399 enable ();
401 /* unlock tty console - user can write in */
402 tty_unlock (proc->tty);
404 _curr_task = proc->tty->task; // this is pretty needed for correct return to our tty task
406 if (!proc_done (proc))
407 while (1) // NOTE: heh, this is good stuff :P
408 schedule ();
410 /* free image of app */
411 flush_elf ();
413 /* switch to next task */
414 schedule ();
416 return 1;
419 unsigned command_lsdev (char *command, unsigned len)
421 dev_display ();
423 return 1;
426 unsigned command_login (char *command, unsigned len)
428 currtty->user = NULL;
429 currtty->logged = false;
431 settextcolor (7, 0);
432 puts ("login: ");
434 return 1;
437 unsigned command_serialw (char *command, unsigned len)
439 dev_t *dev = dev_find ("/dev/com0");
441 if (dev) {
442 unsigned len = strlen (argparse (command));
443 char data[len+1];
444 memcpy (data, argparse (command), len);
445 data[len] = '\0';
447 dev->handler (DEV_ACT_WRITE, data, len);
449 printf ("serialw: %s\n", data);
452 return 1;
455 unsigned command_serialr (char *command, unsigned len)
457 dev_t *dev = dev_find ("/dev/com0");
459 if (dev) {
460 char data[11];
462 dev->handler (DEV_ACT_READ, data, 1);
464 printf ("serialr: %s\n", data);
467 return 1;
470 unsigned command_fdisk (char *command, unsigned len)
472 fdisk ();
474 return 1;
477 unsigned command_hdcat (char *command, unsigned len)
479 partition_t *p = partition_find (argparse (command));
481 if (p) {
482 dev_t *dev = (dev_t *) dev_findbypartition (p);
483 int c, d = 0;
484 unsigned char block[512];
486 printf ("dev: %s\n", dev->devname);
488 while (!key_pressed (1)) {
489 if (key_pressed (72) == 1) {
490 printf ("##block: %d\n", d);
491 dev->handler (DEV_ACT_READ, p, block, "", d);
493 for (c = 0; c < 512; c ++)
494 putch ((unsigned)block[c]);
495 d ++;
498 usleep (5);
500 } else
501 printf ("Please specify partition, example: hdcat /dev/hda0\n");
503 return 1;
506 unsigned command_free (char *command, unsigned len)
508 util_cmdfree ();
510 return 1;
513 unsigned command_date (char *command, unsigned len)
515 rtc_getcurrtime ();
517 printf ("%02u:%02u:%02u, %u.%u.%u\n", realtime->tm_hour, realtime->tm_min, realtime->tm_sec,
518 realtime->tm_mday, realtime->tm_mon, realtime->tm_year);
520 return 1;
524 Tón Frekvence (Hz)
525 C 130.8
526 D 146.8
527 E 164.8
528 F 174.6
529 G 196.0
530 A 220.0
531 H 246.9
533 C 261.6
534 D 293.7
535 E 329.6
536 F 349.2
537 G 392.0
538 A 440.0
539 H 493.9
541 C 523.3
542 D 587.3
543 E 659.3
544 F 698.5
545 G 784.0
546 A 880.0
547 H 987.8
549 C 1046.5
550 D 1174.7
551 E 1318.5
552 F 1396.9
553 G 1568.0
554 A 1760.0
555 H 1975.5
558 void play_tone (dev_t *dev, char tone, char type, char time)
560 unsigned t = 2;
562 switch (type) {
563 case '1':
564 t = 1;
565 break;
566 case '2':
567 t = 2;
568 break;
569 case '3':
570 t = 3;
571 break;
572 case '4':
573 t = 4;
574 break;
578 unsigned tt = 1;
580 printf ("play_tone (.., %c, %d, %d);\n", tone, t, tt);
582 switch (tone) {
583 case 'c':
584 dev->handler (DEV_ACT_PLAY, 131*t);
585 break;
586 case 'd':
587 dev->handler (DEV_ACT_PLAY, 147*t);
588 break;
589 case 'e':
590 dev->handler (DEV_ACT_PLAY, 165*t);
591 break;
592 case 'f':
593 dev->handler (DEV_ACT_PLAY, 175*t);
594 break;
595 case 'g':
596 dev->handler (DEV_ACT_PLAY, 196*t);
597 break;
598 case 'a':
599 dev->handler (DEV_ACT_PLAY, 220*t);
600 break;
601 case 'h':
602 dev->handler (DEV_ACT_PLAY, 247*t);
603 break;
604 case 'C':
605 dev->handler (DEV_ACT_PLAY, 136*t);
606 break;
607 case 'F':
608 dev->handler (DEV_ACT_PLAY, 188*t);
609 break;
612 switch (time) {
613 case '0':
614 timer_wait (2500);
615 break;
616 case '1':
617 timer_wait (1250);
618 break;
619 case '2':
620 timer_wait (625);
621 break;
626 printf ("end: play_tone ();\n");
628 dev->handler (DEV_ACT_PLAY, 0);
631 void play_song (dev_t *dev, char *data)
633 printf ("play_song ();\n");
634 unsigned i = 0, l = strlen (data);
635 unsigned time = 1;
636 while (i != l) {
637 switch (data[i]) {
638 printf ("switch ()\n");
639 case 'p':
641 switch (data[i+1]) {
642 case '0':
643 timer_wait (2500);
644 break;
645 case '1':
646 timer_wait (1250);
647 break;
648 case '2':
649 timer_wait (625);
650 break;
654 i ++;
655 break;
656 case ' ':
657 break;
658 default:
659 play_tone (dev, data[i], data[i+1], data[i+2]);
660 i += 2;
661 break;
664 i ++;
669 unsigned command_spk (char *command, unsigned len)
671 unsigned int freq = 20;
673 dev_t *dev = dev_find ("/dev/pcspk");
675 if (dev) {
677 We wish you a merry christmas v1.0
679 D2(1/8) G2(1/8) G2(1/16) A2(1/16) G2(1/16) Fis2(1/16) E2(1/8) C2(1/8) E2(1/8) A2(1/8) A2(1/16) H2(1/16) A2(1/16) G2(1/16) Fis2(1/8) D2(1/4) H2(1/8) H2(1/16) C3(1/16) H2(1/16) A2(1/16) G2(1/8) E2(1/8) D2(1/16) D2(1/16) E2(1/8) A2(1/8) Fis2(1/8) G2(1/8)
682 play_song (dev, "d21 g21 g22 a22 g22 F22 e21 c21 e21 a21 a22 h22 a22 g22 F21 d20 h21 h22 c32 h22 a22 g21 e21 d22 d22 e21 a21 F21 g21");
684 timer_wait (2000);
687 We wish you a merry christmas v3.0
689 G2(1/8) C3(1/8) C3(1/16) D3(1/16) C3(1/16) H2(1/16) A2(1/4) D3(1/8) D3(1/16) E3(1/16) D3(1/16) C3(1/16) H2(1/4) G2(1/8) E3(1/8) E3(1/16) F3(1/16) E3(1/16) D3(1/16) C3(1/8) A2(1/8) G2(1/8) A2(1/8) D3(1/8) H2(1/8) C3(1/8)
692 play_song (dev, "g21 c31 c32 d32 c32 h22 a20 d31 d32 e32 d32 c32 h20 g21 e31 e32 f32 e32 d32 c31 a21 g21 a21 d31 h21 c31");
694 timer_wait (2000);
697 Dallas v2.0
698 G2(1/8) C3(1/8) P(1/16) G2(1/16) G3(1/8) C3(1/16) E3(1/8) D3(1/16) E3(1/16) C3(1/8) G2(1/8) C3(1/8) A3(1/8) G3(1/8) E3(1/16) F3(1/16) G3(1/8) G3(1/16) P(1/16) G2(1/8) C3(1/8) A3(1/8) G3(1/8) E3(1/16) F3(1/16) G3(1/8) D3(1/16) E3(1/16) C3(1/8) G2(1/8) C3(1/8) E3(1/16) F3(1/16) D3(1/8) G3(1/8) G3(1/8)
700 /* play_song (dev, "g21 c31 p2 g22 g31 c32 e31 d32 e32 c31 g21 c31 a31 g31 e32 f32 g31 g32 p2 g21 c31 a31 g31 e32 f32 g31 d32 e32 c31 g21 c31 e32 f32 d31 g31 g31");*/
702 //timer_wait (2000);
705 return 1;
708 extern bool bus_pci_acthandler (unsigned act, char *block, unsigned block_len);
709 extern netif_t netif_list;
710 extern void ext2_dump ();
711 unsigned command_test (char *command, unsigned len)
713 //ext2_dump ();
715 /*ipv4_addr_t sender_ipaddr;
716 sender_ipaddr = IPV4_DOTADDR_TO_ADDR (192, 168, 1, 1);
718 ipv4_addr_t ip_addr;
719 ip_addr = IPV4_DOTADDR_TO_ADDR (192, 168, 1, 2);
721 netif_t *netif;
722 for (netif = netif_list.next; netif != &netif_list; netif = netif->next) {
723 if (!netif)
724 continue;
725 arp_send_request(netif, sender_ipaddr, ip_addr);
726 } */
728 /* dev_t *eth = dev_find ("/dev/pcnet32");
730 if (!eth)
731 return 0;
733 char *buf = (char *) kmalloc (512 * sizeof (char));*/
734 /*memcpy (buf, "Ahoj hovna !!", 14);
735 eth->handler (DEV_ACT_WRITE, buf, 14);
737 printf ("pcnet32->write '%s'\n", buf);*/
740 /*eth->handler (DEV_ACT_READ, buf, 10);
742 printf ("pcnet32->read '%s'\n", buf);*/
744 //kfree (buf);
746 //InitVGA ();
749 partition_t *p = partition_find ("/dev/fd0");
751 if (p)
752 mount (p, "", "/mnt/floppy/");
753 else
754 printf ("WARNING -> partition /dev/fd0 does not exists\n");
757 cd ((char *) "/mnt/floppy");
759 command_exec ("exec websrv 1959", 16); // irc 207.158.1.150 6667
761 cd ("..");
762 cd ("..");
764 return 1;
767 extern void ps2mouse_get_status (int *x, int *y, int *state);
768 extern unsigned ps2mouse_install ();
769 unsigned command_mouse (char *command, unsigned len)
771 printf ("PS/2 Mouse test\n");
773 ps2mouse_install ();
775 int x, y, state;
776 int x2, y2, state2;
778 while (1) {
780 ps2mouse_get_status (&x, &y, &state);
782 if (x != x2 && y != y2)
783 printf ("mys: %d %d %d\n", x, y, state);
785 x2 = x;
786 y2 = y;
787 state2 = state;
789 schedule ();
792 return 1;
795 unsigned command_vesa (char *command, unsigned len)
797 if (!init_video_vesa ())
798 printf ("vesa -> failed\n");
800 return 1;
803 unsigned command_kill (char *command, unsigned len)
805 strcpy (test, argparse (currtty->shell));
807 pid_t pid = (pid_t) atoi (test);
809 proc_t *proc = proc_findbypid (pid);
811 if (!proc) {
812 printf ("kill: (%s) - No such process\n", test);
813 return 0;
816 /* send SIGTERM to selected process */
817 if (!proc_signal (proc, SIGTERM))
818 return 0;
820 return 1;
823 unsigned command_modprobe (char *command, unsigned len)
825 unsigned arg_len = strlen (argparse (currtty->shell));
826 char arg[arg_len+1];
827 strcpy (arg, argparse (currtty->shell));
828 arg[arg_len] = '\0';
830 module_load (arg);
832 return 1;
835 unsigned command_lsmod (char *command, unsigned len)
837 module_display ();
839 return 1;
842 #ifdef CONFIG_DRV_PCI
843 unsigned command_lspci (char *command, unsigned len)
845 pcidev_display ();
847 return 1;
849 #endif
851 unsigned command_iflist (char *command, unsigned len)
853 iflist_display ();
855 return 1;
858 /*************************************************************\
859 | COMMAND's UTILS |
860 \*************************************************************/
862 unsigned command_parser (char *command, unsigned len)
864 command_t *ctx;
866 for (ctx = command_list.next; ctx != &command_list; ctx = ctx->next) {
867 if (!cstrcmp (ctx->name, command)) {
868 ctx->handler (command, len);
869 return 1;
874 /* error -> command not found */
875 printf ("%s: command not found\n", command);
877 return 0;
880 void commands (int i)
882 command_parser (currtty->shell, currtty->shell_len);
884 return;
887 if (!cstrcmp ("killall", currtty->shell))
889 strcpy (test, argparse (currtty->shell));
891 task_t *task;
892 for (task = task_list.next; task != &task_list; task = task->next) {
893 if (!strcmp (task->name, test))
894 task_done (task);
897 return;
902 unsigned command_register (char *name, char *desc, command_handler_t *handler, unsigned flags)
904 command_t *c;
905 /* we dont want commands with same name */
906 for (c = command_list.next; c != &command_list; c = c->next)
907 if (!strcmp(c->name, name))
908 return 0;
910 command_t *ctx;
912 // alloc and init context
913 ctx = (command_t *) malloc (sizeof (command_t));
915 unsigned name_len = strlen (name);
916 ctx->name = (char *) malloc (sizeof (char) * name_len +1);
917 memcpy (ctx->name, name, name_len);
918 ctx->name[name_len] = '\0';
920 unsigned desc_len = strlen (desc);
921 ctx->desc = (char *) malloc (sizeof (char) * desc_len +1);
922 memcpy (ctx->desc, desc, desc_len);
923 ctx->desc[desc_len] = '\0';
925 ctx->handler = handler;
926 ctx->flags = flags;
928 ctx->next = &command_list;
929 ctx->prev = command_list.prev;
930 ctx->prev->next = ctx;
931 ctx->next->prev = ctx;
933 return 1;
936 unsigned command_unregister (char *name)
938 command_t *ctx;
940 for (ctx = command_list.next; ctx != &command_list; ctx = ctx->next) {
941 if (!strcmp(ctx->name, name)) {
942 ctx->next->prev = ctx->prev;
943 ctx->prev->next = ctx->next;
945 return 1;
949 return 0;
952 /*************************************************************\
953 | INITIALIZATION OF COMMANDS |
954 \*************************************************************/
956 unsigned int init_commands ()
958 command_list.next = &command_list;
959 command_list.prev = &command_list;
961 // reg commands
962 command_register ("help", "Displays list of available commands", &command_help, 0);
963 command_register ("hdd", "Detect HDD", &command_hdd, 0);
964 command_register ("reboot", "Reboot computer", &command_reboot, 0);
965 command_register ("halt", "Shutdown computer", &command_halt, 0);
966 command_register ("tasks", "Print all tasks", &command_tasks, 0);
967 command_register ("ps", "Print all process", &command_ps, 0);
968 command_register ("uptime", "Print uptime in seconds", &command_uptime, 0);
969 command_register ("version", "Displays a version of system", &command_version, 0);
970 command_register ("debug", "Change to developer mode", &command_debug, 0);
971 command_register ("mount", "Mount device to selected directory", &command_mount, 0);
972 command_register ("env", "Displays all env variables", &command_env, 0);
973 command_register ("cd", "Change directory", &command_cd, 0);
974 command_register ("ls", " Displays files in current directory", &command_ls, 0);
975 command_register ("cat", "Displays text in selected file", &command_cat, 0);
976 command_register ("mkdir", "Create a directory", &command_mkdir, 0);
977 command_register ("exec", "Execute a selected program", &command_exec, 0);
978 command_register ("lsdev", "Displays found devices", &command_lsdev, 0);
979 command_register ("login", "Login as another user", &command_login, 0);
980 command_register ("serialw", "Write data on rs232", &command_serialw, 0);
981 command_register ("serialr", "Read data from rs232", &command_serialr, 0);
982 command_register ("fdisk", "Partition table manipulator", &command_fdisk, 0);
983 command_register ("hdcat", "Read selected block of data from drive", &command_hdcat, 0);
984 command_register ("free", "Display amount of free and used memory", &command_free, 0);
985 command_register ("date", "Show current date and time", &command_date, 0);
986 //command_register ("xmastime", "play noel on pc-speaker", &command_spk, 0);
987 //command_register ("test", "Some test", &command_test, 0);
988 //command_register ("vesa", "Some test", &command_vesa, 0);
989 command_register ("kill", "Send a signal to process", &command_kill, 0);
990 command_register ("modprobe", "program to add modules from the kernel", &command_modprobe, 0);
991 command_register ("lsmod", "program to show the status of modules", &command_lsmod, 0);
992 #ifdef CONFIG_DRV_PCI
993 command_register ("lspci", "list all pci devices", &command_lspci, 0);
994 #endif
995 // command_register ("mouse", "ps2 mouse test", &command_mouse, 0);
996 command_register ("iflist", "Show network interface", &command_iflist, 0);
998 return 1;