首页 新闻 聚焦 科技 财经 创业 综合 图片 视频

IT界

旗下栏目: 行业 生态 IT界 创新

COMP2211编程设计辅导、辅导Python,Java程序

来源:互联网 发布时间:2021-10-17
COMP2211编程设计辅导、辅导Python,Java程序
Operating Systems (COMP2211)
Coursework 1: Shell implementation
Submission You must submit your work to the appropriate submission point on Gradescope.
You should submit a single file called mysh.c, any other files you submit will be ignored and
will not be marked.
Deadline See Gradescope submission date
Weighting This piece of summative coursework is worth 25% of the module grade.
Learning outcomes In this coursework you will demonstrate:
- An understanding of how processes are created by the operating system
- An understanding of file descriptors and their relationship to pipes and redirection.
- The ability to program components of an operating system.
You should provide your implementation in a new file called mysh.c. You may use any helper
functions provided by the Xv6 kernel or user libraries. For each of the following items implement
the feature into your shell, as you progress the features to implement become hard. Your
implementation should not require you to modify any file other than mysh.c and Makefile.
Here are some simple instructions to get you started:
1. To start with create a file in the user directory for the Xv6 operating system source code
called mysh.c.
2. Insert the appropriate headers and a main function into your mysh.c.
3. Modify the Makefile to include your shell in the build process.
4. Test that your new executable is being included by running make qemu. You should be able
to execute your new program by typing mysh at the command prompt.
Continue to implement the following features.
1 Execute simple commands (5 Marks)
Implement the execution of simple commands. Your shell should be able to:
1. Prompt the user for a command by printing “>>>” as a command prompt.
2. Execute a command inputted to the command prompt.
3. Loop indefinitely until the shell is exited.
4. Handle the “cd” command (this is a special case so will need to be handled separately to
other commands, why?).
1
2 Input/Output redirection (6 Marks)
Implement Input/Output redirection. Your shell should be able to:
1. Handle two element redirections. For example,
echo "Hello world" > foo, or
cat < foo
3 Pipes (6 Marks)
Implement Pipes. Your shell should be able to:
1. Handle two element pipelines. For example,
ls | grep mysh, or cat README | grep github
4 Additional features (8 Marks)
Implement the following advanced features:
1. Implement multi element pipelines. For example,
ls | head -3 | tail -1
2. Implement non-trivial combinations of pipes and redirection. For example,
ls | head -3 | tail -1 > myoutput
3. Implement the “;” operator that allows a list of shell commands to be given and executed
sequentially.
请加QQ:99515681 或邮箱:99515681@qq.com   WX:codehelp
  免责声明:珠穆朗玛网对于有关本网站的任何内容、信息或广告,不声明或保证其正确性或可靠性,用户自行承担使用网站信息发布内容的真假风险。
责任编辑:珠穆朗玛网