forked from KolibriOS/kolibrios
Shell 0.4.52. "killall" added & bugfixes
git-svn-id: svn://kolibrios.org@1673 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
503a9f7a93
commit
9bd77b61cd
@ -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
|
||||
=======================================
|
||||
Программа теперь многоязыковая (английский, и русский язык). Программа полностью русифицированна.
|
||||
* Команда "free" перименована в "memory" - для точности.
|
||||
* Команда "free" переименована в "memory" - для точности.
|
||||
* Добавлены команды turnoff (выключить компьютер), kerver (версия ядра KoOS), uptime; reboot теперь может перезагружать ядро ("reboot kernel")
|
||||
|
||||
Shell 0.4.4 // 20.08.2010 // Albom
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "cmd/cmd_sleep.c"
|
||||
#include "cmd/cmd_shutdown.c"
|
||||
#include "cmd/cmd_uptime.c"
|
||||
#include "cmd/cmd_killall.c"
|
||||
|
||||
#include "modules/module_command.c"
|
||||
#include "modules/module_program.c"
|
||||
|
Binary file not shown.
Binary file not shown.
15
programs/system/shell/cmd/cmd_killall.c
Normal file
15
programs/system/shell/cmd/cmd_killall.c
Normal 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;
|
||||
}
|
@ -10,7 +10,7 @@ used = total - free;
|
||||
#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",
|
||||
#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
|
||||
total, total/1024, free, free/1024, (free*100)/total, used, total/1024-free/1024, 100-(free*100)/total );
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
int cmd_reboot(char param[])
|
||||
{
|
||||
if (strcmp(param, "kernel"))
|
||||
if (!strcmp(param, "kernel"))
|
||||
{
|
||||
kol_system_end(4);
|
||||
return TRUE;
|
||||
|
@ -6,10 +6,10 @@ gcc -c shell.c
|
||||
gcc -c system/kolibri.c
|
||||
gcc -c system/stdlib.c
|
||||
gcc -c system/string.c
|
||||
ld -nostdlib -T kolibri.ld -o shell.kex start.o kolibri.o stdlib.o string.o shell.o
|
||||
objcopy shell.kex -O binary
|
||||
ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o shell.o
|
||||
objcopy shell -O binary
|
||||
erase lang.h start.o shell.o kolibri.o stdlib.o string.o
|
||||
kpack shell.kex
|
||||
move shell.kex bin\eng\
|
||||
kpack shell
|
||||
move shell bin\eng\
|
||||
copy locale\eng\.shell bin\eng\
|
||||
pause
|
@ -6,10 +6,10 @@ gcc -c shell.c
|
||||
gcc -c system/kolibri.c
|
||||
gcc -c system/stdlib.c
|
||||
gcc -c system/string.c
|
||||
ld -nostdlib -T kolibri.ld -o shell.kex start.o kolibri.o stdlib.o string.o shell.o
|
||||
objcopy shell.kex -O binary
|
||||
ld -nostdlib -T kolibri.ld -o shell start.o kolibri.o stdlib.o string.o shell.o
|
||||
objcopy shell -O binary
|
||||
erase lang.h start.o shell.o kolibri.o stdlib.o string.o
|
||||
kpack shell.kex
|
||||
move shell.kex bin\rus\
|
||||
kpack shell
|
||||
move shell bin\rus\
|
||||
copy locale\rus\.shell bin\rus\
|
||||
pause
|
@ -1,5 +1,5 @@
|
||||
|
||||
#define SHELL_VERSION "0.4.51"
|
||||
#define SHELL_VERSION "0.4.52"
|
||||
|
||||
extern char PATH[256];
|
||||
extern char PARAM[256];
|
||||
@ -65,6 +65,7 @@ int cmd_ver(char arg[]);
|
||||
int cmd_sleep(char arg[]);
|
||||
int cmd_shutdown(char arg[]);
|
||||
int cmd_uptime(char param[]);
|
||||
int cmd_killall(char process_name[]);
|
||||
|
||||
/// ===========================================================
|
||||
|
||||
|
@ -11,6 +11,7 @@ const command_t COMMANDS[]=
|
||||
{"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},
|
||||
{"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},
|
||||
{"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},
|
||||
|
@ -11,6 +11,7 @@ const command_t COMMANDS[]=
|
||||
{"memory", " <20>®ª §ë¢ ¥â ®¡êñ¬ ¯ ¬ïâ¨: ¢á¥©, ᢮¡®¤®© ¨ ¨á¯®«ì§ã¥¬®©\n\r", &cmd_memory},
|
||||
{"help", " ‘¯à ¢ª ¯® ª®¬ ¤ ¬. ˆá¯®«ì§®¢ ¨¥:\n\r help ;ᯨ᮪ ¢á¥å ª®¬ ¤\n\r help <ª®¬ ¤ > ;á¯à ¢ª ¯® ª®¬ ¤¥\n\r", &cmd_help},
|
||||
{"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},
|
||||
{"mkdir", " ‘®§¤ ¥â ª â «®£. ˆá¯®«ì§®¢ ¨¥:\n\r mkdir <¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¢ ⥪ã饬 ª â «®£¥\n\r mkdir <¯ãâì><¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¯® 㪠§ ®¬ã ¯ãâ¨\n\r", &cmd_mkdir},
|
||||
{"more", " ‚뢮¤¨â ᮤ¥à¦¨¬®¥ ä ©« íªà . ˆá¯®«ì§®¢ ¨¥:\n\r more <¨¬ï ä ©« >\n\r", &cmd_more},
|
||||
|
@ -8,11 +8,11 @@ char exec[256];
|
||||
#if LANG_ENG
|
||||
char error_starting[]={" No such command '%s'.\n\r"};
|
||||
#elif LANG_RUS
|
||||
char error_starting[]={" <20>¥ â ª®© ª®¬ ¤ë - '%s'.\n\r"};
|
||||
char error_starting[]={" <20>¥â â ª®© ª®¬ ¤ë - '%s'.\n\r"};
|
||||
#endif
|
||||
int result;
|
||||
|
||||
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì ¡á®«¡âë©
|
||||
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì ¡á®«îâë©
|
||||
{
|
||||
strcpy(exec, cmd);
|
||||
|
||||
|
@ -411,6 +411,11 @@ int kol_process_kill_pid(unsigned 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[])
|
||||
{
|
||||
asm ("int $0x40"::"a"(18), "b"(13), "c"(buff16b));
|
||||
|
@ -88,4 +88,5 @@ unsigned kol_time_tick();
|
||||
unsigned kol_sound_speaker(char data[]);
|
||||
unsigned kol_process_info(unsigned slot, char buf1k[]);
|
||||
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);
|
Loading…
Reference in New Issue
Block a user