Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 1668 → Rev 1667

/programs/system/shell/compile_eng.bat
File deleted
\ No newline at end of file
/programs/system/shell/compile_rus.bat
File deleted
\ No newline at end of file
/programs/system/shell/History.txt
File deleted
/programs/system/shell/locale/eng/.shell
File deleted
/programs/system/shell/locale/eng/globals.h
File deleted
\ No newline at end of file
/programs/system/shell/locale/eng
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/system/shell/locale/rus/.shell
File deleted
/programs/system/shell/locale/rus/globals.h
File deleted
\ No newline at end of file
/programs/system/shell/locale/rus
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/system/shell/locale
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/system/shell/bin/eng/shell.kex
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/system/shell/bin/eng/.shell
File deleted
/programs/system/shell/bin/eng
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/system/shell/bin/rus/.shell
File deleted
/programs/system/shell/bin/rus/shell.kex
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/system/shell/bin/rus
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/system/shell/bin/.shell
0,0 → 1,5
#SHS
 
about
echo Type 'help' for help
echo
/programs/system/shell/bin/shell.kex
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/system/shell/clean.bat
0,0 → 1,2
del shell.kex
del *.o
/programs/system/shell/cmd/cmd_memory.c
File deleted
/programs/system/shell/cmd/cmd_turnoff.c
File deleted
/programs/system/shell/cmd/cmd_uptime.c
File deleted
\ No newline at end of file
/programs/system/shell/cmd/cmd_kerver.c
File deleted
\ No newline at end of file
/programs/system/shell/cmd/cmd_about.c
2,7 → 2,6
int cmd_about(char param[])
{
 
#if LANG_ENG
char message[] = {
"\
\n\r\
12,17 → 11,6
e-mail: albom85@yandex.ru\n\r\
site: http://albom85.narod.ru/\n\r\n\r\
"};
#elif LANG_RUS
char message[] = {
"\
\n\r\
Shell ¤«ï KolibriOS\n\r\
¢¥àá¨ï %s\n\r\n\r\
 ¢â®à: €«¥ªá ­¤à ®£®¬ § aka Albom\n\r\
e-mail: albom85@yandex.ru\n\r\
á ©â: http://albom85.narod.ru/\n\r\n\r\
"};
#endif
 
printf(message, SHELL_VERSION);
return TRUE;
/programs/system/shell/cmd/cmd_cd.c
7,11 → 7,7
 
if (NULL == dir)
{
#if LANG_ENG
printf(" cd <directory>\n\r");
#elif LANG_RUS
printf(" cd <äèðåêòîðèÿ>\n\r");
#endif
printf(" cd directory\n\r");
return FALSE;
}
 
/programs/system/shell/cmd/cmd_date.c
6,11 → 6,7
unsigned time;
 
date = kol_system_date_get();
#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
printf(" date [dd.mm.yy]: %x%x.%x%x.%x%x",
(date&0xf00000)>>20, (date&0xf0000)>>16, // day
(date&0xf000)>>12, (date&0xf00)>>8, //month
(date&0xf0)>>4, (date&0xf) ); // year
18,11 → 14,7
 
time = kol_system_time_get();
 
#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
printf("\n\r time [hh:mm:ss]: %x%x:%x%x:%x%x\n\r",
(time&0xf0)>>4, (time&0xf), // hours
(time&0xf000)>>12, (time&0xf00)>>8, // minutes
(time&0xf00000)>>20, (time&0xf0000)>>16 ); // seconds
/programs/system/shell/cmd/cmd_help.c
4,11 → 4,7
 
int i;
 
#if LANG_ENG
char available[]={" %d commands available:\n\r"};
#elif LANG_RUS
char available[]={" Š®«-¢® ¤®áâ㯭ëå ª®¬ ­¤: %d\n\r"};
#endif
 
if ( !strlen(cmd) )
{
26,11 → 22,7
return TRUE;
}
 
#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);
/programs/system/shell/cmd/cmd_kill.c
24,7 → 24,7
 
if (NULL == process)
{
printf(" kill <PID>\n\r");
printf(" kill PID\n\r");
return FALSE;
}
else
/programs/system/shell/cmd/cmd_mkdir.c
8,11 → 8,7
 
if (NULL == dir)
{
#if LANG_ENG
printf(" mkdir <directory>\n\r");
#elif LANG_RUS
printf(" mkdir <¤¨à¥ªâ®à¨ï>\n\r");
#endif
printf(" mkdir directory\n\r");
return FALSE;
}
 
/programs/system/shell/cmd/cmd_more.c
5,17 → 5,13
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)
{
#if LANG_ENG
printf (" more <filename>\n\r");
#elif LANG_RUS
printf (" more <¨¬ï ä ©« >\n\r");
#endif
printf (" less filename\n\r");
return FALSE;
}
 
45,11 → 41,11
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();
67,7 → 63,7
k70.p20 = 0;
k70.p21 = temp;
 
result = kol_file_70(&k70); // ç⥭¨¥ 80 ᨬ¢®«®¢
result = kol_file_70(&k70); // ÷òåíèå 80 ñèìâîëîâ
for (i=0; i<80; i++)
{
 
/programs/system/shell/cmd/cmd_reboot.c
1,14 → 1,6
 
int cmd_reboot(char param[])
{
if (strcmp(param, "kernel"))
{
kol_system_end(4);
return TRUE;
}
else
{
kol_system_end(3);
return TRUE;
}
}
/programs/system/shell/cmd/cmd_rm.c
8,11 → 8,7
 
if (NULL == file)
{
#if LANG_ENG
printf (" rm <filename>\n\r");
#elif LANG_RUS
printf (" rm <¨¬ï ä ©« >\n\r");
#endif
printf (" rm filename\n\r");
return FALSE;
}
 
/programs/system/shell/cmd/cmd_rmdir.c
8,11 → 8,7
 
if (NULL == dir)
{
#if LANG_ENG
printf(" rmdir <directory>\n\r");
#elif LANG_ENG
printf(" rmdir <¤¨à¥ªâ®à¨ï>\n\r");
#endif
printf(" rmdir directory\n\r");
return FALSE;
}
 
/programs/system/shell/cmd/cmd_touch.c
8,11 → 8,7
 
if (NULL == file)
{
#if LANG_ENG
printf(" touch <filename>\n\r");
#elif LANG_RUS
printf(" touch <¨¬ï ä ©« >\n\r");
#endif
printf(" touch filename\n\r");
return FALSE;
}
 
/programs/system/shell/modules/module_executable.c
5,18 → 5,14
{
 
char exec[256];
#if LANG_ENG
char error_starting[]={" No such command '%s'.\n\r"};
#elif LANG_RUS
char error_starting[]={" ¥ â ª®© ª®¬ ­¤ë - '%s'.\n\r"};
#endif
int result;
 
if ( '/' == cmd[0]) // ¥á«¨ ¯ãâì  ¡á®«¡â­ë©
if ( '/' == cmd[0]) // åñëè ïóòü àáñîëáòíûé
{
strcpy(exec, cmd);
 
if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
if ( !file_check(exec) ) // ïðîâåðÿåì ñóùåñòâîâàíèå ôàéëà
{
printf(error_starting, cmd);
return FALSE;
25,14 → 21,14
 
else
{
strcpy(exec, cur_dir); // ¯à®¢¥à塞 ä ©« ¢ ⥪ã饬 ª â «®£¥
strcpy(exec, cur_dir); // ïðîâåðÿåì ôàéë â òåêóùåì êàòàëîãå
strcat(exec, cmd);
if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
if ( !file_check(exec) ) // ïðîâåðÿåì ñóùåñòâîâàíèå ôàéëà
{
strcpy(exec, "/rd/1/"); // ¯à®¢¥à塞 ä ©« ­  ¢¨àâã «ì­®¬ ¤¨áª¥
strcpy(exec, "/rd/1/"); // ïðîâåðÿåì ôàéë íà âèðòóàëüíîì äèñêå
strcat(exec, cmd);
if ( !file_check(exec) ) // ¯à®¢¥à塞 áãé¥á⢮¢ ­¨¥ ä ©« 
if ( !file_check(exec) ) // ïðîâåðÿåì ñóùåñòâîâàíèå ôàéëà
{
printf(error_starting, cmd);
return FALSE;
46,15 → 42,11
return script_run(exec, args);
}
 
/* § ¯ã᪠¯à®£à ¬¬ë */
/* çàïóñê ïðîãðàììû */
result = program_run(exec, args);
if (result > 0)
{
#if LANG_ENG
printf (" '%s' started. PID = %d\n\r", cmd, result);
#elif LANG_RUS
printf (" '%s' § ¯ã饭. PID = %d\n\r", cmd, result);
#endif
return TRUE;
}
else
/programs/system/shell/system/kolibri.c
410,8 → 410,3
{
asm ("int $0x40"::"a"(18), "b"(18), "c"(process));
}
 
void kol_get_kernel_ver(char buff16b[])
{
asm ("int $0x40"::"a"(18), "b"(13), "c"(buff16b));
}
/programs/system/shell/system/kolibri.h
88,4 → 88,3
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[]);
/programs/system/shell/all.h
1,8 → 1,6
 
/// ===========================================================
 
#include "lang.h"
 
#include "system/boolean.h"
#include "system/kolibri.h"
#include "system/stdlib.h"
24,7 → 22,7
#include "cmd/cmd_date.c"
#include "cmd/cmd_exit.c"
#include "cmd/cmd_cd.c"
#include "cmd/cmd_memory.c"
#include "cmd/cmd_free.c"
#include "cmd/cmd_reboot.c"
#include "cmd/cmd_mkdir.c"
#include "cmd/cmd_rmdir.c"
35,9 → 33,6
#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"
/programs/system/shell/compile.bat
0,0 → 1,9
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
kpack shell.kex
pause
/programs/system/shell/globals.h
1,5 → 1,5
 
#define SHELL_VERSION "0.4.5"
#define SHELL_VERSION "0.4.4"
 
extern char PATH[256];
extern char PARAM[256];
49,7 → 49,7
int cmd_date(char arg[]);
int cmd_echo(char text[]);
int cmd_exit(char arg[]);
int cmd_memory(char arg[]);
int cmd_free(char arg[]);
int cmd_help(char cmd[]);
int cmd_kill(char process[]);
int cmd_ls(char dir[]);
63,17 → 63,34
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[]);
 
/// ===========================================================
 
#if LANG_ENG
#include "locale/eng/globals.h"
#elif LANG_RUS
#include "locale/rus/globals.h"
#endif
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},
};
 
/// ===========================================================
 
/programs/system/shell/.shell
0,0 → 1,5
#SHS
 
about
echo Type 'help' for help
echo