Computer Systems Homework: DOS/Linux Commands, Deadlock, and Files

Verified

Added on  2019/09/16

|10
|980
|384
Homework Assignment
AI Summary
This document provides comprehensive solutions to a computer science assignment. It begins with explanations of the Fetch-Decode-Execute cycle and the von Neumann architecture, followed by an analysis of the Little-Man Computer model and its components. The assignment includes programming a simple addition operation using the Little-Man Computer's instruction set. Further, the solutions detail the functionality of various DOS and Linux/Bash commands. The assignment delves into data structures such as queues, stacks, and heaps, along with an explanation of job scheduling and process states, including a diagram of state transitions and the fields within a Process Control Block (PCB). The document also addresses deadlock, file management, and physical file storage allocation schemas (contiguous, non-contiguous, and indexed storage), and concludes with a discussion on Access Control Matrices, accompanied by an illustrative example.
Document Page
Please as much as you can don’t write an essay
for the question try to draw diagram and if write
a long answer try to under line the most
important words and try to simplify and write a
clear answer not an essay the important point
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1. (a) Explain what is meant by the Fetch-Decode-Execute cycle.
(5
Ma
rks
)
1. (b) Briefly describe what is meant by the term
von Neuman Architecture.
(5
Ma
rks
)
1. (c) The Little-Man Computer provides an
analogy for the execution of a computer
program, explain what each of the following
represent in the analogy to a real computer:
(i) The Pigeon-holes
(2
Ma
rks
)
(ii) The In-Tray
(2
Ma
rks
)
(iii) The Program Counter
(2
Ma
rks
)
(iv) The Calculator
(2
Ma
rks
)
(v) The Out-Tray
(2
Ma
rks
)
Document Page
Question One is continued overleaf
PAGE 2 OF 7
Document Page
1. (d) The Little Man model uses a single-digit op-
code and a 2-digit memory addressing and
has the following instructions defined where
the address portion is shown as xx.
OpCode Instruction Description
1xx ADD Add the value of a given memory location to
calculator
2xx SUBTRACT Subtract the value of a given memory location to
calculator
3xx STORE Copy the value from the calculator into a given
memory location
5xx LOAD Copy the value from a given memory location into
the calculator
6xx BRANCH Unconditional branch. Set the Program Counter to
value xx
7xx BRANCH IF Conditional branch. If the accumulator is zero,
ZERO branch to xx
8xx BRANCH IF Conditional branch. If the accumulator is positive,
POSITIVE branch to xx
901 INPUT Get the value from the IN-TRAY and put it into the
calculator
902 OUTPUT Put the value in the calculator into the OUT-TRAY
000 HALT Take a break
Write a program using these codes to take two
numbers which are contained in the IN-TRAY
and display the sum (+) of those numbers in the
OUT-TRAY. Comment every instruction.
(20
Mar
ks)
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PAGE 3 OF 7
Document Page
2. (a) Explain what the following DOS commands do:
(i) dir
(2 Marks)
(ii) path
(2 Marks)
(iii) help
(2 Marks)
(iv) echo
(2 Marks)
(v) tree
(2 Marks)
2. (b) Explain what the following Linux/Bash commands do:
(i) cat
(2 Marks)
(ii) clear
(2 Marks)
(iii) pwd
(2 Marks)
(iv) ls
(2 Marks)
(v) man
(2 Marks)
Question Two is
continued overleaf
PAGE 4 OF 7
Document Page
2. (c) Write a DOS Batch script to automatically
recursively backup files from a specified directory
(and all its sub-directories), to a newly create
directory called BackupFolder (with the same
sub-directories). Finally list all the files
recursively in the new BackupFolder.
(3 Marks)
Suggest a name that you would give to
the file with the instructions in it?
(1
Ma
rk)
What would you type in to the command prompt to execute it?
(1
Ma
rk)
2. (d) Write a Bash/Linux script to automatically
recursively backup files from a specified directory
(and all its sub-directories), to a newly create
directory called BackupFolder (with the same
sub-directories). Finally list all the files
recursively in the new BackupFolder.
(3 Marks)
Suggest a name that you would give to
the file with the instructions in it?
(1
Ma
rk)
What would you type in to the command prompt to execute it?
(1
Ma
rk)
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PAGE 5 OF 7
Document Page
3. (a) Explain the following data structures,
including in each explanation a diagram:
(i) A Queue
(2
Ma
rks
)
(ii) A Stack
(2
Ma
rks
)
(iii) A Heap
(2
Ma
rks
)
3. (b) Explain the purpose of the Job Scheduler.
(6 Marks)
3. (c) What are the five (5) statuses a process can
have, and what transitions are permissible
between states. Illustrate your answer with a
diagram, and an explanation of each state.
(9
Ma
rks
)
3. (d) What are the fields in the Process Control
Block (PCB)? Provide an explanation for
each field.
(9 Marks)
Document Page
PAGE 6 OF 7
chevron_up_icon
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]