From 4b4d896f8afb36fc380b4b2dc9dc265babfdb47d Mon Sep 17 00:00:00 2001 From: Nasarus Date: Wed, 20 Oct 2010 23:58:36 +0000 Subject: [PATCH] Shell 0.4.5: Multilanguage, russification, some new commands (see History.txt for details) git-svn-id: svn://kolibrios.org@1668 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/shell/History.txt | 102 ++++++++++++++++++ programs/system/shell/all.h | 7 +- programs/system/shell/{ => bin/eng}/.shell | 0 programs/system/shell/bin/eng/shell.kex | Bin 0 -> 5263 bytes programs/system/shell/bin/rus/.shell | 5 + programs/system/shell/bin/rus/shell.kex | Bin 0 -> 5375 bytes programs/system/shell/bin/shell.kex | Bin 4713 -> 0 bytes programs/system/shell/clean.bat | 2 - programs/system/shell/cmd/cmd_about.c | 12 +++ programs/system/shell/cmd/cmd_cd.c | 6 +- programs/system/shell/cmd/cmd_date.c | 12 ++- programs/system/shell/cmd/cmd_help.c | 12 ++- programs/system/shell/cmd/cmd_kerver.c | 27 +++++ programs/system/shell/cmd/cmd_kill.c | 2 +- programs/system/shell/cmd/cmd_memory.c | 18 ++++ programs/system/shell/cmd/cmd_mkdir.c | 6 +- programs/system/shell/cmd/cmd_more.c | 14 ++- programs/system/shell/cmd/cmd_reboot.c | 12 ++- programs/system/shell/cmd/cmd_rm.c | 6 +- programs/system/shell/cmd/cmd_rmdir.c | 6 +- programs/system/shell/cmd/cmd_touch.c | 6 +- programs/system/shell/cmd/cmd_turnoff.c | 6 ++ programs/system/shell/cmd/cmd_uptime.c | 19 ++++ .../shell/{compile.bat => compile_eng.bat} | 6 ++ programs/system/shell/compile_rus.bat | 15 +++ programs/system/shell/globals.h | 37 ++----- .../system/shell/{bin => locale/eng}/.shell | 0 programs/system/shell/locale/eng/globals.h | 28 +++++ programs/system/shell/locale/rus/.shell | 5 + programs/system/shell/locale/rus/globals.h | 28 +++++ .../system/shell/modules/module_executable.c | 26 +++-- programs/system/shell/system/kolibri.c | 5 + programs/system/shell/system/kolibri.h | 1 + 33 files changed, 375 insertions(+), 56 deletions(-) create mode 100644 programs/system/shell/History.txt rename programs/system/shell/{ => bin/eng}/.shell (100%) create mode 100644 programs/system/shell/bin/eng/shell.kex create mode 100644 programs/system/shell/bin/rus/.shell create mode 100644 programs/system/shell/bin/rus/shell.kex delete mode 100644 programs/system/shell/bin/shell.kex delete mode 100644 programs/system/shell/clean.bat create mode 100644 programs/system/shell/cmd/cmd_kerver.c create mode 100644 programs/system/shell/cmd/cmd_memory.c create mode 100644 programs/system/shell/cmd/cmd_turnoff.c create mode 100644 programs/system/shell/cmd/cmd_uptime.c rename programs/system/shell/{compile.bat => compile_eng.bat} (54%) create mode 100644 programs/system/shell/compile_rus.bat rename programs/system/shell/{bin => locale/eng}/.shell (100%) create mode 100644 programs/system/shell/locale/eng/globals.h create mode 100644 programs/system/shell/locale/rus/.shell create mode 100644 programs/system/shell/locale/rus/globals.h diff --git a/programs/system/shell/History.txt b/programs/system/shell/History.txt new file mode 100644 index 000000000..81f65e9de --- /dev/null +++ b/programs/system/shell/History.txt @@ -0,0 +1,102 @@ +Shell 0.4.5 // 19.10.2010 // Pterox +======================================= +Программа теперь многоязыковая (английский, и русский язык). Программа полностью русифицированна. +* Команда "free" перименована в "memory" - для точности. +* Добавлены команды turnoff (выключить компьютер), kerver (версия ядра KoOS), uptime; reboot теперь может перезагружать ядро ("reboot kernel") + +Shell 0.4.4 // 20.08.2010 // Albom +======================================= +1) шелл корректно завершается при закрытии окна +2) исправлено ещё 2 ошибки +3) добавлены 2 команды: +* sleep - ждать. параметр - время в сотых частях секунды. только целое число. +* ccpuid - вывод в консоль информации (пока скудно) о процессоре. пользы мало, но давно хотел с командой cpuid разобраться (в следующем семестре буду студентам курс читать, включил разбор команды в программу). + +есть много идей. некоторые легко реализуются, некоторые сложнее. если интересно: +1) добавить переменную (одну!), в которую будет результат в текстовой форме (не то что возвращает ф-ция) записываться. с ней можно будет работать из командной строки. +2) внедрить простую стековую машину для вычислений с вещественными числами. + +Shell 0.4.3 // 20.08.2010 // Albom +======================================= +* Смесь версий 0.4.1 и 0.4.2. Теперь в архиве все исходные файлы, необходимые для компиляции (раньше использовались объектники с моими обёртками, исходники я с шеллом не выкладывал) + +Shell 0.4.2 // 28.08.2009 // diamond +======================================= +* Добавил корректное завершение работы при закрытии окна консоли, работает только начиная с последней на данный момент версией библиотеки (лежит на svn, включена в ночную сборку). Перекомпилировал в VS2008 с LTCG, ещё пошаманил с оптимизацией по размеру. + +Shell 0.4.1 // 16.03.2009 // Albom +======================================= +* версия с исправленными ошибками. +* работает команда alias, добавлена команда clear. + +Shell 0.4 // 12.08.2008 // Albom +======================================= +1) Работает схема псевдонимов (до 256 команд) +- просмотр по команде alias (без параметров) +- добавление псевдонима команды с клавиатуры или в скрипте (в том числе и .shell): alias новая команда = старая команда +- команды регистрозависимые, поэтому поклонникам ДОС придётся внести в .shell строки такого вида +alias dir = ls +alias DIR = ls +alias Dir = ls +alias DIr = ls +и т.д. +- встроенные команды переназвать невозможно, например, бессмысленна команда: +alias ls=somecommand +- при отладке получал странную информацию, но так как у меня всё работает, то пока изменений вносить не планирую + +2) Теперь шелл можно запускать с параметром (из самого себя, например). +- синтаксис: +shell команда +- пример: +shell /sys/somescript +- при этом .shell не запускается + +3) Реализована команда more. ( MEMENTO MORI! - Моментально... в море! ) +- просмотр текстовых и бинарных файлов (вроде бы задача простая, но пришлось повозиться с управляющими символами) +- очень не рекомендуется просматривать большие файлы + +Shell 0.3 // 07.08.2008 // Albom +======================================= +1) Возможность запуска скриптов. +* каждая строка должна представляет собой команду +* строкой считается набор символов, который заканчивается CR+LF (Windows) или LF(UNIX) или CR(Mac) +* если строка начинается с #, то вся строка (т.е. комментарий) игнорируется +* скрипт должен начитаться с #SHS +* при запуске шелла автоматически запускается скрипт .shell + +2) История из 5 (можно изменить при компиляции) введённых команд. +* перемещение по истории - UP/DOWN + +3) Команда alias, которая позволяет вводить синонимы для команд. +* до 256 (можно изменить при компиляции) синонимов +* пока работает только добавление и просмотр синонимов, а отработка пока не реализована. + +Shell 0.2 // 04.08.2008 // Albom +======================================= +* добавил новые функции +* написал собственную процедуру ввода команды + +Shell 0.11 // 01.08.2008 // Albom +======================================= +* Добавил команды free и reboot, внёс некоторые изменения, исправил найденные ошибки. + +Shell 0.1 // 29.07.2008 // Albom +======================================= +* Реализованы (не полностью) команды: about, cd, date, echo, exit, help, kill, ls, ps, pwd, ver +* При запуске программы (если не указан полный путь) она ищется в каталоге /rd/1 и текущем каталоге. + +Shell 0.02 // 27.07.2008 // Albom +======================================= +* Реализовал команды: + exit - выход + ls (с параметром и без) - вывод списка директории + pwd - текущий каталог + ps - список процессов и их PID + kill - завершить процесс по PID + help (с параметром и без) - помощь + +Shell 0.01 // 27.07.2008 // Albom +======================================= +* Решил написать функциональный шелл на Си с использованием console.obj. +* Пока сделал функцию отделения команды и параметров, а также реализовал команды help (пока без параметров), ver и exit. + diff --git a/programs/system/shell/all.h b/programs/system/shell/all.h index 7b91a967a..9f81ae058 100644 --- a/programs/system/shell/all.h +++ b/programs/system/shell/all.h @@ -1,6 +1,8 @@ /// =========================================================== +#include "lang.h" + #include "system/boolean.h" #include "system/kolibri.h" #include "system/stdlib.h" @@ -22,7 +24,7 @@ #include "cmd/cmd_date.c" #include "cmd/cmd_exit.c" #include "cmd/cmd_cd.c" -#include "cmd/cmd_free.c" +#include "cmd/cmd_memory.c" #include "cmd/cmd_reboot.c" #include "cmd/cmd_mkdir.c" #include "cmd/cmd_rmdir.c" @@ -33,6 +35,9 @@ #include "cmd/cmd_clear.c" #include "cmd/cmd_ccpuid.c" #include "cmd/cmd_sleep.c" +#include "cmd/cmd_turnoff.c" +#include "cmd/cmd_kerver.c" +#include "cmd/cmd_uptime.c" #include "modules/module_command.c" #include "modules/module_program.c" diff --git a/programs/system/shell/.shell b/programs/system/shell/bin/eng/.shell similarity index 100% rename from programs/system/shell/.shell rename to programs/system/shell/bin/eng/.shell diff --git a/programs/system/shell/bin/eng/shell.kex b/programs/system/shell/bin/eng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=Y(UQdH5Rxf1(qvbw+k<7A6ZAG7aJhgUtpCm}oUp%Qk4cqH0ylvrl|x^+ zrH4!v5#Wl(d)|{mi@vnfEr?3_Dfm$+6@Yhk$pON;&&Z2+J>>4Nw?l}*Lh+d4p~4DT z2X6u?8=_Z$lzQd{8yB6E43v{z!6~8xTL%wQR8me}q(0(SxZ|^nn_>(5F)jHq-HLR+ z=HeY|H7437>*i$PB;-B)V}c(%JZNmNFT^x79L(a!=$J@|@%Z?2X_sn7f1|Yy VQcKG5>RYPMwd<4|*!Tbd002&^CbIwl literal 0 HcmV?d00001 diff --git a/programs/system/shell/bin/rus/.shell b/programs/system/shell/bin/rus/.shell new file mode 100644 index 000000000..6f527d4f0 --- /dev/null +++ b/programs/system/shell/bin/rus/.shell @@ -0,0 +1,5 @@ +#SHS + +about +echo ‚ўҐ¤ЁвҐ 'help' ¤«п бЇа ўЄЁ +echo diff --git a/programs/system/shell/bin/rus/shell.kex b/programs/system/shell/bin/rus/shell.kex new file mode 100644 index 0000000000000000000000000000000000000000..b3528929f8e168a74a7a3db94680e2d7693c0433 GIT binary patch literal 5375 zcmVP(w>BJOBWJ00001Mv*2LLXK;4&&M{gp_Fc6hj->@fU~5-Lap%bVd6S= zvRw`FXq!}VP(D1#U%-8nTn4nS`*DWb<{(@}$|et?8H*wb=z%x_e+XPT_9yexDq-9M zwU6RK+aPt`zapc#H_QklHBaP4PACe6H6PvZm1M#HeKMKM)NJ7v0V_qFN4_?CkT^^l7Bs}X# zT|6y@)%Uv5y_N%b?O2yK+xn?sy?}E_9W3@6bzV%_mGwohQYhleJp4Mk`rs@tf*+Lv zNZ#mR(-ftlN+8aTNgw^xju3_m5v}Tt7>An(lb3)D@7}_wcb~IPbrjgN8d#ie2mGeC zxR3U&$o)*ky~Vwi!Y`;#Fu`xF>jsYJ4SM5xNLqXK;-7?8?cGX68+ZYH=x&2xJWG}u zrmdX+5`ARWECbD|Flt{UG07IBTklVHU>rd;9~hrYer_3`(;v-M@Mrs?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IYtk8F-kMranxtEs-96?iFTpMgZauX-8q21q< z74?!hriQ}UZ>dKgf*0yTar<^2<@6711tIc$DAL^fNK8oI2_wdp%Qy$c!s$qjbB;KN zKCd<~p|o>TLud926j&gI;Eq*dWafRgwzZ+S`}AgZoWrpN2}~xXc9&1CJ8R(=vNe$p zTJi8uUKf0y z$nyEbwBT)WEmr5+E>5*f9h!e}>U!9Wfj?$R5`@Z8H%*_M^SwTFo4thpF$_7}P}&Da z((;vq%T-|f-A;QnOzg>Ic`iLB`v63Pyi2whthoxKLKA_%TdNGZW;Bf$cPDS|rD}2Yrh>2!0*cIFmfN6r>MC(}mIcX{c=5fA z^)M)C2v?D9q?dC2(a1}U&T3&4pkO0lDy70-HLLD@t4Fw9my=dNI`PWc5*L^~N5}Qs z_HQ1i1VD!_KP$L20}w#wI|1TI>TmU#dpGeAwdMmxP0w;N5!Gx)ouqQ0(N-q_`!Bhg za2#NFDgbR{nNCxcT-qenG_#zmielajtV7&tJ(>z?7c&#q?&x|uedx(;?0hME)xS2y zMrexErtT_UdjTgo2=v(u?_ zbk5ddR(L}J%Dy){KTZo*`<%twtTWh1IbvEIYen+^qO~*Xo7e(M*x(0xOr&J;@9m2h ddm?6lPeY3G*%xgWljO+}P=azPTKE6}001BgWR?H` literal 0 HcmV?d00001 diff --git a/programs/system/shell/bin/shell.kex b/programs/system/shell/bin/shell.kex deleted file mode 100644 index 07b30a48e9f565925a68b45fc7449058369573de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4713 zcmV-v5|-^tP(w@1Hvj;E00001Mv*2LLXK;4&&M{gp_WjK+AFYWlP7+=hq{_28ii1Y z{=n}^Q(@xmLVoX?H}cm^7NwS1diSf*WyEY7!&{IF89Q?LKsw@7S=REGGe~@YT&e*& z$nE}K;F6)V^#?kEO10BEW{z-?0xEB2fT~49x5BaiwxC0MfxJ*(lA4C0g}9@V{Sj0C z&~xOdEa;gc{R?YiU@;icF-2^$qZ-VEq_)ok5WZ#`0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R4=~4we1*KP6K0Od?zV6>$I;TJ`qV*u%`zGYkI)uuUV}pnbENk}dL-mgEnUa$EGm?pk>hS)&@>;rHRc zM+^CqdxdC>WcLaz>~1H4{+XV@FHT!ysdv#L5bFb|_1|7)Ig|CIYxB5Nu~g zb%Dt7(UWnGL$Vk1-gysa#fDOJg`Xm+;c78_M1JJK3}z`Hz4F|+#pptR|~d1(Sf)OqBbT-kl6_ol;_sRIVB_$^L_QJS!gcJp;jk}U&0 zmWDP>OWY+}|I}1AZ+m1I)|z{Mr^qs`4K`O;KINN9LUy8DjE&Z3+r~_N!!>i`17*{m zBa~Ycce{_tzgb66k)0hO6h>o$tnj=;aXq40sTpQo%uUqTNkhH0PgqOzU)D|APPu_r rA\n\r"); + #elif LANG_RUS + printf(" cd <директория>\n\r"); + #endif return FALSE; } diff --git a/programs/system/shell/cmd/cmd_date.c b/programs/system/shell/cmd/cmd_date.c index 5015ce1a3..3e185127a 100644 --- a/programs/system/shell/cmd/cmd_date.c +++ b/programs/system/shell/cmd/cmd_date.c @@ -6,7 +6,11 @@ unsigned date; unsigned time; date = kol_system_date_get(); -printf(" date [dd.mm.yy]: %x%x.%x%x.%x%x", +#if LANG_ENG + printf(" Date [dd.mm.yy]: %x%x.%x%x.%x%x", +#elif LANG_RUS + printf(" „ в  [¤¤.¬¬.ЈЈ]: %x%x.%x%x.%x%x", +#endif (date&0xf00000)>>20, (date&0xf0000)>>16, // day (date&0xf000)>>12, (date&0xf00)>>8, //month (date&0xf0)>>4, (date&0xf) ); // year @@ -14,7 +18,11 @@ printf(" date [dd.mm.yy]: %x%x.%x%x.%x%x", time = kol_system_time_get(); -printf("\n\r time [hh:mm:ss]: %x%x:%x%x:%x%x\n\r", +#if LANG_ENG + printf("\n\r Time [hh:mm:ss]: %x%x:%x%x:%x%x\n\r", +#elif LANG_RUS + printf("\n\r ‚६п [зз:¬¬:бб]: %x%x:%x%x:%x%x\n\r", +#endif (time&0xf0)>>4, (time&0xf), // hours (time&0xf000)>>12, (time&0xf00)>>8, // minutes (time&0xf00000)>>20, (time&0xf0000)>>16 ); // seconds diff --git a/programs/system/shell/cmd/cmd_help.c b/programs/system/shell/cmd/cmd_help.c index 02fb18c67..12711f866 100644 --- a/programs/system/shell/cmd/cmd_help.c +++ b/programs/system/shell/cmd/cmd_help.c @@ -4,7 +4,11 @@ int cmd_help(char cmd[]) int i; -char available[]={" %d commands available:\n\r"}; +#if LANG_ENG + char available[]={" %d commands available:\n\r"}; +#elif LANG_RUS + char available[]={" Љ®«-ў® ¤®бвгЇ­ле Є®¬ ­¤: %d\n\r"}; +#endif if ( !strlen(cmd) ) { @@ -22,7 +26,11 @@ else return TRUE; } - printf (" Command \'%s\' not found.\n\r", cmd); + #if LANG_ENG + printf (" Command \'%s\' not found.\n\r", cmd); + #elif LANG_RUS + printf (" Љ®¬ ­¤  \'%s\' ­Ґ ­ ©¤Ґ­ .\n\r", cmd); + #endif printf (available, NUM_OF_CMD); for (i = 0; i < NUM_OF_CMD; i++) printf(" %s\n\r", COMMANDS[i].name); diff --git a/programs/system/shell/cmd/cmd_kerver.c b/programs/system/shell/cmd/cmd_kerver.c new file mode 100644 index 000000000..455319dc0 --- /dev/null +++ b/programs/system/shell/cmd/cmd_kerver.c @@ -0,0 +1,27 @@ +int cmd_kerver(char param[]) +{ +char *kvbuf; +char *vA, *vB, *vC, *vD; +unsigned *Rev; + +kvbuf = malloc(16); +kol_get_kernel_ver(kvbuf); +vA = kvbuf+0; +vA = *vA; +vB = kvbuf+1; +vB = *vB; +vC = kvbuf+2; +vC = *vC; +vD = kvbuf+3; +vD = *vD; +Rev = kvbuf+5; +Rev = *Rev; + +#if LANG_ENG + printf (" KolibriOS v%d.%d.%d.%d. Kernel SVN-rev.: %d\n\r", vA, vB, vC, vD, Rev); +#elif LANG_RUS + printf (" Љ®«ЁЎаЁЋ‘ v%d.%d.%d.%d. SVN-ॢ. п¤а : %d\n\r", vA, vB, vC, vD, Rev); +#endif +free(kvbuf); +return TRUE; +} \ No newline at end of file diff --git a/programs/system/shell/cmd/cmd_kill.c b/programs/system/shell/cmd/cmd_kill.c index d54ba083e..8c326c3f7 100644 --- a/programs/system/shell/cmd/cmd_kill.c +++ b/programs/system/shell/cmd/cmd_kill.c @@ -24,7 +24,7 @@ int result; if (NULL == process) { - printf(" kill PID\n\r"); + printf(" kill \n\r"); return FALSE; } else diff --git a/programs/system/shell/cmd/cmd_memory.c b/programs/system/shell/cmd/cmd_memory.c new file mode 100644 index 000000000..d0e04500a --- /dev/null +++ b/programs/system/shell/cmd/cmd_memory.c @@ -0,0 +1,18 @@ + +int cmd_memory(char param[]) +{ +unsigned total, free, used; + +total = kol_system_mem(); +free = kol_system_memfree(); +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", +#endif + total, total/1024, free, free/1024, (free*100)/total, used, total/1024-free/1024, 100-(free*100)/total ); + +return TRUE; +} diff --git a/programs/system/shell/cmd/cmd_mkdir.c b/programs/system/shell/cmd/cmd_mkdir.c index b2d2533ee..d9ff2a1c4 100644 --- a/programs/system/shell/cmd/cmd_mkdir.c +++ b/programs/system/shell/cmd/cmd_mkdir.c @@ -8,7 +8,11 @@ unsigned result; if (NULL == dir) { - printf(" mkdir directory\n\r"); + #if LANG_ENG + printf(" mkdir \n\r"); + #elif LANG_RUS + printf(" mkdir <¤ЁаҐЄв®аЁп>\n\r"); + #endif return FALSE; } diff --git a/programs/system/shell/cmd/cmd_more.c b/programs/system/shell/cmd/cmd_more.c index 8fdee4582..2235b3e9d 100644 --- a/programs/system/shell/cmd/cmd_more.c +++ b/programs/system/shell/cmd/cmd_more.c @@ -5,13 +5,17 @@ int cmd_more(char file[]) kol_struct70 k70; kol_struct_BDVK bdvk; unsigned result, filesize, pos, i; -char buf[81]; //буфер +char buf[81]; //ЎгдҐа char temp[256]; unsigned flags; if (NULL == file) { - printf (" less filename\n\r"); + #if LANG_ENG + printf (" more \n\r"); + #elif LANG_RUS + printf (" more <Ё¬п д ©« >\n\r"); + #endif return FALSE; } @@ -41,11 +45,11 @@ k70.p16 = &bdvk; k70.p20 = 0; k70.p21 = temp; -result = kol_file_70(&k70); // получаем информацию о файле +result = kol_file_70(&k70); // Ї®«гз Ґ¬ Ё­д®а¬ жЁо ® д ©«Ґ if ( 0 != result ) return FALSE; -filesize = bdvk.p32[0]; // получаем размер файла +filesize = bdvk.p32[0]; // Ї®«гз Ґ¬ а §¬Ґа д ©«  buf[80]=0; flags = con_get_flags(); @@ -63,7 +67,7 @@ for (pos=0;pos\n\r"); + #elif LANG_RUS + printf (" rm <Ё¬п д ©« >\n\r"); + #endif return FALSE; } diff --git a/programs/system/shell/cmd/cmd_rmdir.c b/programs/system/shell/cmd/cmd_rmdir.c index ce95bd01b..a31911cf4 100644 --- a/programs/system/shell/cmd/cmd_rmdir.c +++ b/programs/system/shell/cmd/cmd_rmdir.c @@ -8,7 +8,11 @@ unsigned result; if (NULL == dir) { - printf(" rmdir directory\n\r"); + #if LANG_ENG + printf(" rmdir \n\r"); + #elif LANG_ENG + printf(" rmdir <¤ЁаҐЄв®аЁп>\n\r"); + #endif return FALSE; } diff --git a/programs/system/shell/cmd/cmd_touch.c b/programs/system/shell/cmd/cmd_touch.c index 3e0ff2b9a..23298cb00 100644 --- a/programs/system/shell/cmd/cmd_touch.c +++ b/programs/system/shell/cmd/cmd_touch.c @@ -8,7 +8,11 @@ unsigned result; if (NULL == file) { - printf(" touch filename\n\r"); + #if LANG_ENG + printf(" touch \n\r"); + #elif LANG_RUS + printf(" touch <Ё¬п д ©« >\n\r"); + #endif return FALSE; } diff --git a/programs/system/shell/cmd/cmd_turnoff.c b/programs/system/shell/cmd/cmd_turnoff.c new file mode 100644 index 000000000..cb7d07e10 --- /dev/null +++ b/programs/system/shell/cmd/cmd_turnoff.c @@ -0,0 +1,6 @@ + +int cmd_turnoff(char param[]) +{ +kol_system_end(2); +return TRUE; +} diff --git a/programs/system/shell/cmd/cmd_uptime.c b/programs/system/shell/cmd/cmd_uptime.c new file mode 100644 index 000000000..860f8af2a --- /dev/null +++ b/programs/system/shell/cmd/cmd_uptime.c @@ -0,0 +1,19 @@ + +int cmd_uptime(char param[]) +{ +unsigned time_tick, up_days, up_hours, up_minutes, up_seconds, up_millisecs; + +time_tick = kol_time_tick(); +up_days = (time_tick/(24*60*60*100)); +up_hours = (time_tick/(60*60*100))%24; +up_minutes = (time_tick/(60*100))%60; +up_seconds = (time_tick/100)%60; +up_millisecs = (time_tick*10)%100; + +#if LANG_ENG + printf (" Uptime: %d day(s), %d:%d:%d.%d\n\r", up_days, up_hours, up_minutes, up_seconds, up_millisecs); +#elif LANG_RUS + printf (" Uptime: %d ¤­Ґ©, %d:%d:%d.%d\n\r", up_days, up_hours, up_minutes, up_seconds, up_millisecs); +#endif +return TRUE; +} \ No newline at end of file diff --git a/programs/system/shell/compile.bat b/programs/system/shell/compile_eng.bat similarity index 54% rename from programs/system/shell/compile.bat rename to programs/system/shell/compile_eng.bat index ef87f155a..e845753f5 100644 --- a/programs/system/shell/compile.bat +++ b/programs/system/shell/compile_eng.bat @@ -1,3 +1,6 @@ +@echo off +erase shell.kex lang.h +echo #define LANG_ENG 1 > lang.h fasm start.asm start.o gcc -c shell.c gcc -c system/kolibri.c @@ -5,5 +8,8 @@ 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 +erase lang.h start.o shell.o kolibri.o stdlib.o string.o kpack shell.kex +move shell.kex bin\eng\ +copy locale\eng\.shell bin\eng\ pause \ No newline at end of file diff --git a/programs/system/shell/compile_rus.bat b/programs/system/shell/compile_rus.bat new file mode 100644 index 000000000..652c676ff --- /dev/null +++ b/programs/system/shell/compile_rus.bat @@ -0,0 +1,15 @@ +@echo off +erase shell.kex lang.h +echo #define LANG_RUS 1 > lang.h +fasm start.asm start.o +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 +erase lang.h start.o shell.o kolibri.o stdlib.o string.o +kpack shell.kex +move shell.kex bin\rus\ +copy locale\rus\.shell bin\rus\ +pause \ No newline at end of file diff --git a/programs/system/shell/globals.h b/programs/system/shell/globals.h index e5c292a66..fae15d122 100644 --- a/programs/system/shell/globals.h +++ b/programs/system/shell/globals.h @@ -1,5 +1,5 @@ -#define SHELL_VERSION "0.4.4" +#define SHELL_VERSION "0.4.5" extern char PATH[256]; extern char PARAM[256]; @@ -49,7 +49,7 @@ int cmd_clear(char arg[]); int cmd_date(char arg[]); int cmd_echo(char text[]); int cmd_exit(char arg[]); -int cmd_free(char arg[]); +int cmd_memory(char arg[]); int cmd_help(char cmd[]); int cmd_kill(char process[]); int cmd_ls(char dir[]); @@ -63,34 +63,17 @@ int cmd_rmdir(char dir[]); int cmd_touch(char file[]); int cmd_ver(char arg[]); int cmd_sleep(char arg[]); +int cmd_turnoff(char arg[]); +int cmd_kerver(char arg[]); +int cmd_uptime(char param[]); /// =========================================================== -const command_t COMMANDS[]= -{ - {"about", " Displays information about the program\n\r", &cmd_about}, - {"alias", " Allows the user view the current aliases\n\r", &cmd_alias}, - {"ccpuid"," Displays CPU information\n\r", &cmd_ccpuid}, - {"cd", " Changes directories\n\r", &cmd_cd}, - {"clear", " Clears the display\n\r", &cmd_clear}, - {"date", " Returns the date and time\n\r", &cmd_date}, - {"echo", " Echoes the data to the screen\n\r", &cmd_echo}, - {"exit", " Exits program\n\r", &cmd_exit}, - {"free", " Displays total, free and used memory\n\r", &cmd_free}, - {"help", " Gives help\n\r", &cmd_help}, - {"kill", " Stops a running process\n\r", &cmd_kill}, - {"ls", " Lists the files in a directory\n\r", &cmd_ls}, - {"mkdir", " Makes directory\n\r", &cmd_mkdir}, - {"more", " Displays a data file to the screen\n\r", &cmd_more}, - {"ps", " Lists the current processes running\n\r", &cmd_ps}, - {"pwd", " Displays the name of the working directory\n\r", &cmd_pwd}, - {"reboot"," Reboots the computer\n\r", &cmd_reboot}, - {"rm", " Removes files\n\r", &cmd_rm}, - {"rmdir", " Removes directories\n\r", &cmd_rmdir}, - {"sleep", " Stops the shell for the desired period\n\r", &cmd_sleep}, - {"touch", " Creates an empty file or updates the time/date stamp on a file\n\r", &cmd_touch}, - {"ver", " Displays version\n\r", &cmd_ver}, -}; +#if LANG_ENG + #include "locale/eng/globals.h" +#elif LANG_RUS + #include "locale/rus/globals.h" +#endif /// =========================================================== diff --git a/programs/system/shell/bin/.shell b/programs/system/shell/locale/eng/.shell similarity index 100% rename from programs/system/shell/bin/.shell rename to programs/system/shell/locale/eng/.shell diff --git a/programs/system/shell/locale/eng/globals.h b/programs/system/shell/locale/eng/globals.h new file mode 100644 index 000000000..08524e153 --- /dev/null +++ b/programs/system/shell/locale/eng/globals.h @@ -0,0 +1,28 @@ +const command_t COMMANDS[]= +{ + {"about", " Displays information about Shell\n\r", &cmd_about}, + {"alias", " Allows the user view the current aliases\n\r", &cmd_alias}, + {"ccpuid", " Displays CPU information\n\r", &cmd_ccpuid}, + {"cd", " Changes current directory. Usage:\n\r cd \n\r", &cmd_cd}, + {"clear", " Clears the screen\n\r", &cmd_clear}, + {"date", " Returns the current date and time\n\r", &cmd_date}, + {"echo", " Echoes the data to the screen. Usage:\n\r echo \n\r", &cmd_echo}, + {"exit", " Exits from Shell\n\r", &cmd_exit}, + {"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 ;help on command\n\r", &cmd_help}, + {"kerver", " Displays the information about a version of KoOS kernel\n\r", &cmd_kerver}, + {"kill", " Stops a running process. Usage:\n\r kill \n\r", &cmd_kill}, + {"ls", " Lists the files in a directory. Usage:\n\r ls ;lists the files in current directory\n\r ls ;lists the files at specified folder\n\r", &cmd_ls}, + {"mkdir", " Makes directory. Usage:\n\r mkdir ;creates the folder in working directory\n\r mkdir ;create folder by specified path\n\r", &cmd_mkdir}, + {"more", " Displays a file data to the screen. Usage:\n\r more \n\r", &cmd_more}, + {"ps", " Lists the current processes running\n\r", &cmd_ps}, + {"pwd", " Displays the name of the working directory\n\r", &cmd_pwd}, + {"reboot", " Reboots the computer or KoOS kernel. Usage:\n\r reboot ;reboot a PC\n\r reboot kernel ;reboot the KoOS kernel\n\r", &cmd_reboot}, + {"rm", " Removes a file. Usage:\n\r rm file name>\n\r", &cmd_rm}, + {"rmdir", " Removes a folder. Usage:\n\r rmdir \n\r", &cmd_rmdir}, + {"sleep", " Stops the shell for the desired period. Usage:\n\r sleep