Shell 0.4.52. "killall" added & bugfixes

git-svn-id: svn://kolibrios.org@1673 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Nasarus 2010-10-24 14:32:14 +00:00
parent 503a9f7a93
commit 9bd77b61cd
15 changed files with 48 additions and 16 deletions

View File

@ -1,9 +1,16 @@
DDDD@@@@@@@@@@@@!!!!!!!!!!!!!!!!!!!!! Shell 0.4.52 // 25.10.2010 // Pterox
=======================================
* Добавлена команда "killall" - убивает все процессы кроме OS/IDLE.
* Фиксы
Shell 0.4.51 // 21.10.2010 // Pterox
=======================================
* Команда "turnoff" переименована в "shutdown", "kerver" удалена - теперь её заменяет "ver kernel"; фиксы.
Shell 0.4.5 // 19.10.2010 // Pterox Shell 0.4.5 // 19.10.2010 // Pterox
======================================= =======================================
Программа теперь многоязыковая (английский, и русский язык). Программа полностью русифицированна. Программа теперь многоязыковая (английский, и русский язык). Программа полностью русифицированна.
* Команда "free" перименована в "memory" - для точности. * Команда "free" переименована в "memory" - для точности.
* Добавлены команды turnoff (выключить компьютер), kerver (версия ядра KoOS), uptime; reboot теперь может перезагружать ядро ("reboot kernel") * Добавлены команды turnoff (выключить компьютер), kerver (версия ядра KoOS), uptime; reboot теперь может перезагружать ядро ("reboot kernel")
Shell 0.4.4 // 20.08.2010 // Albom Shell 0.4.4 // 20.08.2010 // Albom

View File

@ -37,6 +37,7 @@
#include "cmd/cmd_sleep.c" #include "cmd/cmd_sleep.c"
#include "cmd/cmd_shutdown.c" #include "cmd/cmd_shutdown.c"
#include "cmd/cmd_uptime.c" #include "cmd/cmd_uptime.c"
#include "cmd/cmd_killall.c"
#include "modules/module_command.c" #include "modules/module_command.c"
#include "modules/module_program.c" #include "modules/module_program.c"

View File

@ -0,0 +1,15 @@
int cmd_killall(char process_name[])
{
unsigned i;
if (!strlen(process_name))
{
for (i = 2;i<256;i++)
{
kol_kill_process(i);
}
return TRUE;
}
return TRUE;
}

View File

@ -10,7 +10,7 @@ used = total - free;
#if LANG_ENG #if LANG_ENG
printf (" Total [kB / MB / %%]: %-7d / %-5d / 100\n\r Free [kB / MB / %%]: %-7d / %-5d / %d\n\r Used [kB / MB / %%]: %-7d / %-5d / %d\n\r", printf (" Total [kB / MB / %%]: %-7d / %-5d / 100\n\r Free [kB / MB / %%]: %-7d / %-5d / %d\n\r Used [kB / MB / %%]: %-7d / %-5d / %d\n\r",
#elif LANG_RUS #elif LANG_RUS
printf (" ‚ᥣ® [Š<> / Œ<> / %%]: %-7d / %-5d / 100\n\r ‘¢®¡®¤­® [Š<> / Œ<> / %%]: %-7d / %-5d / %d\n\r ˆá¯®«ì§ã¥âáï [Š<> / Œ<> / %%]: %-7d / %-5d / %d\n\r", printf (" ‚ᥣ® [Š<> / Œ<> / %%]: %-7d / %-5d / 100\n\r ‘¢®¡®¤­® [Š<> / Œ<> / %%]: %-7d / %-5d / %d\n\r ˆá¯®«ì§ã¥âáï [Š<> / Œ<> / %%]: %-7d / %-5d / %d\n\r",
#endif #endif
total, total/1024, free, free/1024, (free*100)/total, used, total/1024-free/1024, 100-(free*100)/total ); total, total/1024, free, free/1024, (free*100)/total, used, total/1024-free/1024, 100-(free*100)/total );

View File

@ -1,7 +1,7 @@
int cmd_reboot(char param[]) int cmd_reboot(char param[])
{ {
if (strcmp(param, "kernel")) if (!strcmp(param, "kernel"))
{ {
kol_system_end(4); kol_system_end(4);
return TRUE; return TRUE;

View File

@ -6,10 +6,10 @@ gcc -c shell.c
gcc -c system/kolibri.c gcc -c system/kolibri.c
gcc -c system/stdlib.c gcc -c system/stdlib.c
gcc -c system/string.c gcc -c system/string.c
ld -nostdlib -T kolibri.ld -o shell.kex start.o kolibri.o stdlib.o string.o shell.o ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o shell.o
objcopy shell.kex -O binary objcopy shell -O binary
erase lang.h start.o shell.o kolibri.o stdlib.o string.o erase lang.h start.o shell.o kolibri.o stdlib.o string.o
kpack shell.kex kpack shell
move shell.kex bin\eng\ move shell bin\eng\
copy locale\eng\.shell bin\eng\ copy locale\eng\.shell bin\eng\
pause pause

View File

@ -6,10 +6,10 @@ gcc -c shell.c
gcc -c system/kolibri.c gcc -c system/kolibri.c
gcc -c system/stdlib.c gcc -c system/stdlib.c
gcc -c system/string.c gcc -c system/string.c
ld -nostdlib -T kolibri.ld -o shell.kex start.o kolibri.o stdlib.o string.o shell.o ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o shell.o
objcopy shell.kex -O binary objcopy shell -O binary
erase lang.h start.o shell.o kolibri.o stdlib.o string.o erase lang.h start.o shell.o kolibri.o stdlib.o string.o
kpack shell.kex kpack shell
move shell.kex bin\rus\ move shell bin\rus\
copy locale\rus\.shell bin\rus\ copy locale\rus\.shell bin\rus\
pause pause

View File

@ -1,5 +1,5 @@
#define SHELL_VERSION "0.4.51" #define SHELL_VERSION "0.4.52"
extern char PATH[256]; extern char PATH[256];
extern char PARAM[256]; extern char PARAM[256];
@ -65,6 +65,7 @@ int cmd_ver(char arg[]);
int cmd_sleep(char arg[]); int cmd_sleep(char arg[]);
int cmd_shutdown(char arg[]); int cmd_shutdown(char arg[]);
int cmd_uptime(char param[]); int cmd_uptime(char param[]);
int cmd_killall(char process_name[]);
/// =========================================================== /// ===========================================================

View File

@ -11,6 +11,7 @@ const command_t COMMANDS[]=
{"memory", " Displays total, free and used memory\n\r", &cmd_memory}, {"memory", " Displays total, free and used memory\n\r", &cmd_memory},
{"help", " Gives help on commands. Usage:\n\r help ;it lists all builtins\n\r help <command> ;help on command\n\r", &cmd_help}, {"help", " Gives help on commands. Usage:\n\r help ;it lists all builtins\n\r help <command> ;help on command\n\r", &cmd_help},
{"kill", " Stops a running process. Usage:\n\r kill <PID of process>\n\r", &cmd_kill}, {"kill", " Stops a running process. Usage:\n\r kill <PID of process>\n\r", &cmd_kill},
{"killall", " Kills all running processes\n\r", &cmd_killall},
{"ls", " Lists the files in a directory. Usage:\n\r ls ;lists the files in current directory\n\r ls <directory> ;lists the files at specified folder\n\r", &cmd_ls}, {"ls", " Lists the files in a directory. Usage:\n\r ls ;lists the files in current directory\n\r ls <directory> ;lists the files at specified folder\n\r", &cmd_ls},
{"mkdir", " Makes directory. Usage:\n\r mkdir <folder name> ;creates the folder in working directory\n\r mkdir <path><folder name> ;create folder by specified path\n\r", &cmd_mkdir}, {"mkdir", " Makes directory. Usage:\n\r mkdir <folder name> ;creates the folder in working directory\n\r mkdir <path><folder name> ;create folder by specified path\n\r", &cmd_mkdir},
{"more", " Displays a file data to the screen. Usage:\n\r more <file name>\n\r", &cmd_more}, {"more", " Displays a file data to the screen. Usage:\n\r more <file name>\n\r", &cmd_more},

View File

@ -11,6 +11,7 @@ const command_t COMMANDS[]=
{"memory", " <20>®ª §ë¢ ¥â ®¡êñ¬ ¯ ¬ïâ¨: ¢á¥©, ᢮¡®¤­®© ¨ ¨á¯®«ì§ã¥¬®©\n\r", &cmd_memory}, {"memory", " <20>®ª §ë¢ ¥â ®¡êñ¬ ¯ ¬ïâ¨: ¢á¥©, ᢮¡®¤­®© ¨ ¨á¯®«ì§ã¥¬®©\n\r", &cmd_memory},
{"help", " ‘¯à ¢ª  ¯® ª®¬ ­¤ ¬. ˆá¯®«ì§®¢ ­¨¥:\n\r help ;ᯨ᮪ ¢á¥å ª®¬ ­¤\n\r help <ª®¬ ­¤ > ;á¯à ¢ª  ¯® ª®¬ ­¤¥\n\r", &cmd_help}, {"help", " ‘¯à ¢ª  ¯® ª®¬ ­¤ ¬. ˆá¯®«ì§®¢ ­¨¥:\n\r help ;ᯨ᮪ ¢á¥å ª®¬ ­¤\n\r help <ª®¬ ­¤ > ;á¯à ¢ª  ¯® ª®¬ ­¤¥\n\r", &cmd_help},
{"kill", " “¡¨¢ ¥â ¯à®æ¥áá. ˆá¯®«ì§®¢ ­¨¥:\n\r kill <PID ¯à®æ¥áá >\n\r", &cmd_kill}, {"kill", " “¡¨¢ ¥â ¯à®æ¥áá. ˆá¯®«ì§®¢ ­¨¥:\n\r kill <PID ¯à®æ¥áá >\n\r", &cmd_kill},
{"killall", " “¡¨¢ ¥â ¢á¥ § ¯ã饭­ë¥ ¯à®æ¥ááë\n\r", &cmd_killall},
{"ls", " ‚뢮¤¨â ᯨ᮪ ä ©«®¢. ˆá¯®«ì§®¢ ­¨¥:\n\r ls ;ᯨ᮪ ä ©«®¢ ¢ ⥪ã饬 ª â «®£¥\n\r ls <¤¨à¥ªâ®à¨ï> ;ᯨ᮪ ä ©«®¢ ¨§ § ¤ ­­®© ¤¨à¥ªâ®à¨¨\n\r", &cmd_ls}, {"ls", " ‚뢮¤¨â ᯨ᮪ ä ©«®¢. ˆá¯®«ì§®¢ ­¨¥:\n\r ls ;ᯨ᮪ ä ©«®¢ ¢ ⥪ã饬 ª â «®£¥\n\r ls <¤¨à¥ªâ®à¨ï> ;ᯨ᮪ ä ©«®¢ ¨§ § ¤ ­­®© ¤¨à¥ªâ®à¨¨\n\r", &cmd_ls},
{"mkdir", " ‘®§¤ ¥â ª â «®£. ˆá¯®«ì§®¢ ­¨¥:\n\r mkdir <¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¢ ⥪ã饬 ª â «®£¥\n\r mkdir <¯ãâì><¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¯® 㪠§ ­­®¬ã ¯ãâ¨\n\r", &cmd_mkdir}, {"mkdir", " ‘®§¤ ¥â ª â «®£. ˆá¯®«ì§®¢ ­¨¥:\n\r mkdir <¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¢ ⥪ã饬 ª â «®£¥\n\r mkdir <¯ãâì><¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¯® 㪠§ ­­®¬ã ¯ãâ¨\n\r", &cmd_mkdir},
{"more", " ‚뢮¤¨â ᮤ¥à¦¨¬®¥ ä ©«  ­  íªà ­. ˆá¯®«ì§®¢ ­¨¥:\n\r more <¨¬ï ä ©« >\n\r", &cmd_more}, {"more", " ‚뢮¤¨â ᮤ¥à¦¨¬®¥ ä ©«  ­  íªà ­. ˆá¯®«ì§®¢ ­¨¥:\n\r more <¨¬ï ä ©« >\n\r", &cmd_more},

View File

@ -8,11 +8,11 @@ char exec[256];
#if LANG_ENG #if LANG_ENG
char error_starting[]={" No such command '%s'.\n\r"}; char error_starting[]={" No such command '%s'.\n\r"};
#elif LANG_RUS #elif LANG_RUS
char error_starting[]={" <20>¥ â ª®© ª®¬ ­¤ë - '%s'.\n\r"}; char error_starting[]={" <20>¥â â ª®© ª®¬ ­¤ë - '%s'.\n\r"};
#endif #endif
int result; int result;
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì  ¡á®«¡â­ë© if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì  ¡á®«îâ­ë©
{ {
strcpy(exec, cmd); strcpy(exec, cmd);

View File

@ -411,6 +411,11 @@ int kol_process_kill_pid(unsigned process)
asm ("int $0x40"::"a"(18), "b"(18), "c"(process)); asm ("int $0x40"::"a"(18), "b"(18), "c"(process));
} }
int kol_kill_process(unsigned process)
{
asm ("int $0x40"::"a"(18), "b"(2), "c"(process));
}
void kol_get_kernel_ver(char buff16b[]) void kol_get_kernel_ver(char buff16b[])
{ {
asm ("int $0x40"::"a"(18), "b"(13), "c"(buff16b)); asm ("int $0x40"::"a"(18), "b"(13), "c"(buff16b));

View File

@ -89,3 +89,4 @@ unsigned kol_sound_speaker(char data[]);
unsigned kol_process_info(unsigned slot, char buf1k[]); unsigned kol_process_info(unsigned slot, char buf1k[]);
int kol_process_kill_pid(unsigned process); int kol_process_kill_pid(unsigned process);
void kol_get_kernel_ver(char buff16b[]); void kol_get_kernel_ver(char buff16b[]);
int kol_kill_process(unsigned process);