Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1646 → Rev 1647

/programs/system/shell/cmd_date.c
File deleted
/programs/system/shell/cmd_help.c
File deleted
/programs/system/shell/cmd_kill.c
File deleted
/programs/system/shell/cmd_more.c
File deleted
/programs/system/shell/cmd_cd.c
File deleted
/programs/system/shell/cmd_about.c
File deleted
/programs/system/shell/readme.txt
File deleted
/programs/system/shell/module_program.c
File deleted
/programs/system/shell/cmd_ls.c
File deleted
/programs/system/shell/cmd_touch.c
File deleted
/programs/system/shell/cmd_rmdir.c
File deleted
/programs/system/shell/cmd_ps.c
File deleted
/programs/system/shell/cmd_rm.c
File deleted
/programs/system/shell/module_command.c
File deleted
/programs/system/shell/stdlib.h
File deleted
/programs/system/shell/module_alias.c
File deleted
/programs/system/shell/cmd_ver.c
File deleted
/programs/system/shell/cmd_alias.c
File deleted
/programs/system/shell/string.h
File deleted
/programs/system/shell/module_script.c
File deleted
/programs/system/shell/cmd_mkdir.c
File deleted
/programs/system/shell/cmd_pwd.c
File deleted
/programs/system/shell/module_executable.c
File deleted
/programs/system/shell/console.c
File deleted
/programs/system/shell/cmd_reboot.c
File deleted
/programs/system/shell/cmd_free.c
File deleted
/programs/system/shell/kolibri.h
File deleted
/programs/system/shell/cmd_echo.c
File deleted
/programs/system/shell/cmd_exit.c
File deleted
/programs/system/shell/all.h
1,39 → 1,43
 
/// ===========================================================
 
#include "kolibri.h"
#include "stdlib.h"
#include "string.h"
#include "system/boolean.h"
#include "system/kolibri.h"
#include "system/stdlib.h"
#include "system/string.h"
 
#include "globals.h"
#include "prototypes.h"
 
#include "console.c"
#include "system/console.c"
 
#include "cmd_about.c"
#include "cmd_help.c"
#include "cmd_ver.c"
#include "cmd_pwd.c"
#include "cmd_ls.c"
#include "cmd_ps.c"
#include "cmd_kill.c"
#include "cmd_echo.c"
#include "cmd_date.c"
#include "cmd_exit.c"
#include "cmd_cd.c"
#include "cmd_free.c"
#include "cmd_reboot.c"
#include "cmd_mkdir.c"
#include "cmd_rmdir.c"
#include "cmd_rm.c"
#include "cmd_touch.c"
#include "cmd_alias.c"
#include "cmd_more.c"
#include "cmd/cmd_about.c"
#include "cmd/cmd_help.c"
#include "cmd/cmd_ver.c"
#include "cmd/cmd_pwd.c"
#include "cmd/cmd_ls.c"
#include "cmd/cmd_ps.c"
#include "cmd/cmd_kill.c"
#include "cmd/cmd_echo.c"
#include "cmd/cmd_date.c"
#include "cmd/cmd_exit.c"
#include "cmd/cmd_cd.c"
#include "cmd/cmd_free.c"
#include "cmd/cmd_reboot.c"
#include "cmd/cmd_mkdir.c"
#include "cmd/cmd_rmdir.c"
#include "cmd/cmd_rm.c"
#include "cmd/cmd_touch.c"
#include "cmd/cmd_alias.c"
#include "cmd/cmd_more.c"
#include "cmd/cmd_clear.c"
#include "cmd/cmd_ccpuid.c"
#include "cmd/cmd_sleep.c"
 
#include "module_command.c"
#include "module_program.c"
#include "module_script.c"
#include "module_executable.c"
#include "module_alias.c"
#include "modules/module_command.c"
#include "modules/module_program.c"
#include "modules/module_script.c"
#include "modules/module_executable.c"
#include "modules/module_alias.c"
 
/// ===========================================================
/programs/system/shell/compile.bat
1,7 → 1,9
del shell.kex
del shell.o
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,9 → 1,6
 
#define FALSE 0
#define TRUE 1
#define SHELL_VERSION "0.4.4"
 
#define SHELL_VERSION "0.4"
 
extern char PATH[256];
extern char PARAM[256];
 
31,52 → 28,70
 
/// ===========================================================
 
const NUM_OF_CMD = 19;
int NUM_OF_CMD;
 
const char HELP_COMMANDS[][10]=
/// ===========================================================
 
typedef struct
{
"about",
"alias",
"cd",
"date",
"echo",
"exit",
"free",
"help",
"kill",
"ls",
"mkdir",
"more",
"ps",
"pwd",
"reboot",
"rm",
"rmdir",
"touch",
"ver"
};
const char* name;
const char* help;
const void* handler;
} command_t;
 
const char HELP_DESC [][70]=
/// ===========================================================
 
int cmd_about(char arg[]);
int cmd_alias(char arg[]);
int cmd_ccpuid(char dir[]);
int cmd_cd(char dir[]);
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_help(char cmd[]);
int cmd_kill(char process[]);
int cmd_ls(char dir[]);
int cmd_mkdir(char dir[]);
int cmd_more(char file[]);
int cmd_ps(char arg[]);
int cmd_pwd(char arg[]);
int cmd_reboot(char arg[]);
int cmd_rm(char file[]);
int cmd_rmdir(char dir[]);
int cmd_touch(char file[]);
int cmd_ver(char arg[]);
int cmd_sleep(char arg[]);
 
/// ===========================================================
 
const command_t COMMANDS[]=
{
" Displays information about the program\n\r",
" Allows the user view the current aliases\n\r",
" Changes directories\n\r",
" Returns the date and time\n\r",
" Echoes the data to the screen\n\r",
" Exits program\n\r",
" Displays total, free and used memory\n\r",
" Gives help\n\r",
" Stops a running process\n\r",
" Lists the files in a directory\n\r",
" Makes directory\n\r",
" Displays a data file to the screen\n\r",
" Lists the current processes running\n\r",
" Displays the name of the working directory\n\r",
" Reboots the computer\n\r",
" Removes files\n\r",
" Removes directories\n\r",
" Creates an empty file or updates the time/date stamp on a file\n\r",
" Displays version\n\r"
{"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.c
104,6 → 104,8
void kol_main()
{
 
NUM_OF_CMD = sizeof(COMMANDS)/sizeof(COMMANDS[0]);
 
strcpy(title, "SHELL ");
strcat(title, SHELL_VERSION);
CONSOLE_INIT(title);
113,6 → 115,8
 
con_set_cursor_height(con_get_font_height()-1);
 
ALIASES = malloc(128*1024);
 
if (strlen(PARAM) > 0)
strcpy(CMD, PARAM);
else
/programs/system/ss/trunk/@SS.ASM
36,6 → 36,8
shl eax, 16
mov [top_right_corner], eax
 
mcall 66, 4, 57, 0 ; hot key for {Space}
mcall 66, 4, 28, 0 ; hot key for {Enter}
still:
movzx ebx, [time]
imul ebx, 60*100
62,6 → 64,14
jmp still
key:
mcall ; eax = 2
cmp al, 2 ; hot key?
jne still ; no hotkey, evenets handling go on
xor edx, edx
mov dl, ah
mov eax, 72
mov ebx, 1
mov ecx, 2
mcall ; transfer key code to active window after interception
jmp still
 
create_ss_thread: