Skip to content

ngsitrong26/OS-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<<<<<<< HEAD

Welcome to our TinyShell

TinyShell is an open-source, basic, simple, user-friendly terminal application like Command Prompt, PowerShell. Its main features include working with process, running executable/batch files, and more to discover.

Table of Contents
  1. About The Project
  2. Aims
  3. Features
  4. Contributors
  5. Getting Started
  6. Usage
    1. Process Mode
    2. Process Management
    3. Run apps/files
    4. Environment Variables
    5. Dir
    6. Other commands
  7. Issues
  8. Contact

Aims

  • Study about Windows process management APIs.
  • Understand how to setup and work with Shell.

Features

  • Working with process: Create, Stop, Resume and Kill Processes with Foreground and Background Mode
  • Working with Directory Path
  • Working with environment variables
  • Open Notepad, Calculator, executable/batch/text files, etc

Contributors

This program is created by 3 Students of Talented in Computer Science - K66, HUST

(back to top)

Getting Started

Prerequisites

The program works in Windows Machine with a C++ compiler installed (MinGW, VC++ or Clang) with standard C++11 or higher.

Instalation

To run this program, download this repository from Github. If you have Git installed, you can clone this repository to your machine:

git clone https://github.com/ngsitrong26/OS-Project
cd TinyShell

Run Tiny.exe directly from Windows Explorer or using Command Prompt:

./Tiny

If there are any errors while running the app, see Issues

(back to top)

Usage

1. Process Mode

1. Foreground mode

Shell must wait for the process to finish

<Command> [-fore|-f]

Example:

run notepad -fore

2. Background mode

Shell and process run in parallel

<Command> [-back|-b]

Example:

run notepad -back

2. Process management (background mode)

1. List

Print out list of the processes (process Id, Cmd name, status)

process [list|l]

2. Stop

Stop a running process

process [stop|s] <Id/Name>

3. Resume

Resume a stopped process

process [resume|r] <Id/Name>

4. Kill

Kill a process:

process [kill|k] <Id/Name>

To kill all processes:

process [kill|k] [-all|-a]

3. Run apps/files

Run Notepad with mode:

run notepad <Mode>

Run Calculator with mode:

run calc <Mode>

Run executable/batch file with mode:

run path/to/file <Mode>

4. Environment Variables

1. Show environment variables

Display the value of an environment variable

env <Id>

To print list of environment variables:

env [list|l]

2. Add

Add new environment variable

env [add|a] <Name> <Value>

3.Delete

Delete existing environment variable

env [delete|del|d] <Name>

5. Dir

1. cd

Show list contents of the current directory

cd

2. Change current directory

Change current directory to <Path>

cd <Path>

Change current directory to its parent directory:

cd ..

3. Reset

Reset current directory to the Initial Path

cd [reset|r]

6. Other commands

1. Show command history

history

To clear command history:

clear

2. Time

Display current date and time

time

Run countdown program (With mode):

time [countdown|c] <Mode>

3. Exit TinyShell

exit

And more commands to discover!

(back to top)

Issues

a. Error when running the program

Recompile Tiny.cpp with flag -std=c++11 and run again.

Example: using g++

g++ -std=c++11 Tiny.cpp -o Tiny && ./Tiny

b. Error when running countdown clock

Recompile src/commands/time/countDown.cpp with flag -std=c++11 and try again

Example: using g++

g++ -std=c++11 src/commands/time/countDown.cpp -o src/commands/time/countDown

c. Error when running The Impossible Tic Tac Toe game

Recompile tic_tac_toe/TheImpossibleTicTacToe.cpp with flag -std=c++11 and try again

Example: using g++

g++ -std=c++11 tic_tac_toe/TheImpossibleTicTacToe.cpp -o tic_tac_toe/TheImpossibleTicTacToe

(back to top)

Contact

Nguyễn Sỹ Trọng - Outlook
Project link: https://github.com/ngsitrong26/OS-Project

(back to top)

======= # OS-Project >>>>>>> 2250990f5858ff6f3dd780038a9a5afef7392f50

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors