You are on page 1of 2

CS490 Windows Internals

Project 1: A Simple Bash Shell for Windows

Purpose
The main goal for this project is for you to dig deeper into Windows internals and get familiarized
with some Windows APIs. In this project, you are asked to write a bash shell program which
works very much like the bash shell of Linux, but only this time, it runs on Windows and behaves
like a command prompt. In addition, you are asked to produce a document that descriptions how
you implemented this bash shell, and how to use it.

Requirements
1. Your program should start with a DOS command prompt-like window with Bash prompt
(assuming the machine name is Mango and the username is kzhu):

kzhu@Mango:~$

2. The user can type simple bash commands into the window and the shell produces expected
output. Here are some examples:
kzhu@Mango:~$ ls
abc.txt doc kzhu-svn pads
kzhu@Mango:~$ cp abc.txt abc1.txt
kzhu@Mango:~$ ls
abc.txt abc1.txt doc kzhu-svn pads
kzhu@Mango:~$ mv abc1.txt abc.txt
kzhu@Mango:~$ ls
abc.txt doc kzhu-svn pads
kzhu@Mango:~$ ls -l
total 6
-rw-r--r-- 1 kzhu None 4 2010-11-17 15:03 abc.txt
lrwxrwxrwx 1 kzhu None 15 2010-09-27 14:20 doc -> /cygdrive/d/doc
drwxr-xr-x+ 1 kzhu None 4096 2010-11-16 12:56 kzhu-svn
drwxr-xr-x+ 1 kzhu None 0 2010-09-29 15:36 pads
kzhu@Mango:~$ date
Wed Nov 17 15:06:11 CST 2010
kzhu@Mango:~$ cat abc.txt
abc
kzhu@Mango:~$ cat abc.txt > abc1.txt
kzhu@Mango:~$ ls
abc.txt abc1.txt doc kzhu-svn pads
kzhu@Mango:~$ cd doc
kzhu@Mango:~/doc$
kzhu@Mango:~/doc$ exit

3. Your program should at least support the following bash commands:


a) exit
b) ls (including the –l switch)
c) cd
d) cp
e) mv
f) cat
g) unix stream redirection ( >)
The more commands you support the higher score you will get for this part of the project.

4. Program your shell in C/C++ code and be sure that the compiled executable can run on
Windows 7.
5. Write a documentation in Word or PDF that include the following two parts:
a) The implementation details of your bash shell (explanation of your code)
b) A user manual of your bash shell (include how to compile your code, how to use it, with
detailed explanation of each command that your shell supports).
Please include the names and contacts of all the group members on the front page of your
documentation.

Submission
You should hand in your source code, binary executable program and the documentation for the
program. You will submit a zip or rar file to Kaiqi (kaiqi_zhao@163.com). Your compressed file
should uncompress to the following directory structure:
src\ -- put your source code in this directory
bin\ -- put your binary release in this directory
report.pdf -- the documentation of the program

The deadline of this project is midnight of December 20th, 2010.

You might also like