首页
编程语言
数据库
网络开发
Algorithm算法
移动开发
系统相关
金融统计
人工智能
其他
首页
>
> 详细
013230998X辅导、Systems留学生讲解、辅导C/C++语言、讲解c/c++程序设计 辅导Python程序|辅导R语言程序
PROGRAMMING PROJECT ONE
DEVELOPING A SHELL
William Stallings
Copyright 2011
Supplement to
Operating Systems, Seventh Edition
Prentice Hall 2011
The Shell or Command Line Interpreter is the fundamental User interface to
an Operating System. Your first project is to write a simple shell - myshell -
that has the following properties:
1. The shell must support the following internal commands:
i. cd
- Change the current default directory to
. If the
argument is not present, report
the current directory. If the directory does not exist an appropriate
error should be reported. This command should also change the PWD
environment variable.
ii. clr - Clear the screen.
iii. dir
- List the contents of directory
.
iv. environ - List all the environment strings.
v. echo
- Display
on the display followed by a
new line (multiple spaces/tabs may be reduced to a single space).
vi. help - Display the user manual using the more filter.
vii. pause - Pause operation of the shell until 'Enter' is pressed.
viii. quit - Quit the shell.
ix. The shell environment should contain shell=
/myshell
where
/myshell is the full path for the shell executable
(not a hardwired path back to your directory, but the one from which
it was executed).
2. All other command line input is interpreted as program invocation,
which should be done by the shell forking and execing the programs as
its own child processes. The programs should be executed with an
environment that contains the entry: parent=
/myshell
where
/myshell is as described in 1.ix. above.
–3–
3. The shell must be able to take its command line input from a file. That
is, if the shell is invoked with a command line argument:
myshell batchfile
then batchfile is assumed to contain a set of command lines for the
shell to process. When the end-of-file is reached, the shell should exit.
Obviously, if the shell is invoked without a command line argument, it
solicits input from the user via a prompt on the display.
4. The shell must support i/o-redirection on either or both stdin and/or
stdout. That is, the command line
programname arg1 arg2 < inputfile > outputfile
will execute the program programname with arguments arg1 and arg2,
the stdin FILE stream replaced by inputfile and the stdout FILE
stream replaced by outputfile.
stdout redirection should also be possible for the internal commands
dir, environ, echo, & help.
With output redirection, if the redirection character is > then the
outputfile is created if it does not exist and truncated if it does. If the
redirection token is >> then outputfile is created if it does not exist
and appended to if it does.
5. The shell must support background execution of programs. An
ampersand (&) at the end of the command line indicates that the shell
–4–
should return to the command line prompt immediately after launching
that program.
6. The command line prompt must contain the pathname of the current
directory.
Note: You can assume that all command line arguments (including the
redirection symbols, <, > & >> and the background execution symbol, &) will
be delimited from other command line arguments by white space - one or
more spaces and/or tabs (see the command line in 4. above).
Project Requirements
1. Design a simple command line shell that satisfies the above criteria and
implement it on the specified UNIX platform.
2. Write a simple manual describing how to use the shell. The manual
should contain enough detail for a beginner to UNIX to use it. For
example, you should explain the concepts of I/O redirection, the
program environment, and background program execution. The manual
MUST be named readme and must be a simple text document capable of
being read by a standard Text Editor.
For an example of the sort of depth and type of description required,
you should have a look at the online manuals for csh and tcsh (man
csh, man tcsh). These shells obviously have much more functionality
than yours and thus, your manuals don’t have to be quite so large.
You should NOT include building instructions, included file lists or source
code - we can find that out from the other files you submit. This should
–5–
be an Operator’s manual not a Developer’s manual.
3. The source code MUST be extensively commented and appropriately
structured to allow your peers to understand and easily maintain the
code. Properly commented and laid out code is much easier to interpret,
and it is in your interests to ensure that the person marking your
project is able to understand your coding without having to perform
mental gymnastics!
4. Details of submission procedures will be supplied well before the
deadline.
5. The submission should contain only source code file(s), include file(s), a
makefile (all lower case please), and the readme file (all lowercase,
please). No executable program should be included. The person marking
your project will be automatically rebuilding your shell program from the
source code provided. If the submitted code does not compile it cannot
be marked!
6. The makefile (all lowercase, please) MUST generate the binary file
myshell (all lower case please). A sample makefile would be
# Joe Citizen, s1234567 - Operating Systems Project 1
# CompLab1/01 tutor: Fred Bloggs
myshell: myshell.c utility.c myshell.h
gcc -Wall myshell.c utility.c -o myshell
The program myshell is then generated by just typing make at the
command line prompt.
–6–
Note: The fourth line in the above makefile MUST begin with a tab.
7. In the instance shown above, the files in the submitted directory would
be:
makefile
myshell.c
utility.c
myshell.h
readme
Submission
A makefile is required. All files in your submission will be copied to the
same directory, therefore, do not include any paths in your makefile. The
makefile should include all dependencies that build your program. If a
library is included, your makefile should also build the library.
Do not hand in any binary or object code files. All that is required is
your source code, a makefile and readme file. Test your project by copying
the source code only into an empty directory and then compile it by entering
the command make.
We shall be using a shell script that copies your files to a test directory,
deletes any pre-existing myshell, *.a, and/or *.o files, performs a make,
copies a set of test files to the test directory, and then exercises your shell
with a standard set of test scripts through stdin and command line
arguments. If this sequence fails due to wrong names, wrong case for
names, wrong version of source code that fails to compile, nonexistence of
files, etc. then the marking sequence will also stop. In this instance, the only
–7–
marks that can be awarded will be for the tests completed at that point and
the source code and manual.
Required Documentation
Your source code will be assessed and marked as well as the readme
manual. Commenting is definitely required in your source code. The user
manual can be presented in a format of your choice (within the limitations of
being displayable by a simple Text Editor). Again, the manual should contain
enough detail for a beginner to UNIX to use the shell. For example, you
should explain the concepts of I/O redirection, the program environment and
background execution. The manual MUST be named readme (all lowercase,
please, NO .txt extension).
联系我们
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-21:00
微信:codinghelp
热点文章
更多
mgt202辅导 、讲解 java/pytho...
2025-06-28
讲解 pbt205—project-based l...
2025-06-28
辅导 comp3702 artificial int...
2025-06-28
辅导 cs3214 fall 2022 projec...
2025-06-28
辅导 turnitin assignment讲解...
2025-06-28
辅导 finite element modellin...
2025-06-28
讲解 stat3600 linear statist...
2025-06-28
辅导 problem set #3讲解 matl...
2025-06-28
讲解 elen90066 embedded syst...
2025-06-28
讲解 automatic counting of d...
2025-06-28
讲解 ct60a9602 functional pr...
2025-06-28
辅导 stat3600 linear statist...
2025-06-28
辅导 csci 1110: assignment 2...
2025-06-28
辅导 geography调试r语言
2025-06-28
辅导 introduction to informa...
2025-06-28
辅导 envir 100: introduction...
2025-06-28
辅导 assessment 3 - individu...
2025-06-28
讲解 laboratory 1讲解 留学生...
2025-06-28
辅导 ct60a9600 renewable ene...
2025-06-28
辅导 economics 140a homework...
2025-06-28
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 99515681 微信:codinghelp
© 2024
www.7daixie.com
站长地图
程序辅导网!