首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导COSC 1114语言、c++、Java编程辅导
项目预算:
开发周期:
发布时间:
要求地区:
RMIT Classification: Trusted
COSC 1114 Operating Systems Principles
Semester 2, 2021
Programming Assignment 2
Assessment
Type
Individual assignment.
Marks are awarded for meeting requirements as closely as possible.
Clarifications/updates may be made via announcements/relevant discussion forums.
Submission
Policy
Submit online to Canvas → Assignments → PrgAsg2 .
2 submissions are required . The first in week 13, and the final submission in start of week 14.
Late final submissions are penalized at the rate of 10% per day, pro-rata to 1%. In other words,
the formula is floor(hoursLate*10/24) as percentage of the mark received. So 12 hours late for a
submission given the mark 20/30 will be penalized as per
newMark = origMark * (1 – (floor(hoursLate*10/24) / 100)) = 20 * (1 – 0.05) = 19
to 19/30.
NB. In any dispute over late submissions, GitHub commit dates (which can be falsified) will NOT
be considered acceptable as evidence.
Submission
Due Date
Start of week 14.
Marks 30 (30% of semester)
1. Overview
One of the other large areas in operating systems beyond process management is the domain of File Systems. As you can see
in the Group Project title list, there are a lot of them. But they all have some features in common, and in this assignment, we
will cover some of these common features.
In this assignment, you will build a very simple file system (VSFS), which is essentially a large text file. You will write a program
or script that will insert entries from outside into this FS and vice-versa, as well as many other common file actions. For
documentation, you will reflect how certain additions, such as file blocking, FS compression, FS defragmentation, could be
implemented into your code (without doing it). For higher marks, you will implement some of these
2. Learning Outcomes
This assessment relates to all the learning outcomes of the course which are:
• Summarise the full range of considerations in the design of file systems, summarise techniques for achieving
synchronisation in an operation system,
3. Project Details
3.1 Command Line
You must create a program, called, say, VSFS, that creates a file system called, say, FS, that can be called from the command
line and will work as follows. (General format: “VSFS command FS rags…”, where command is {list copyin; copyout; mldir;
rm; rmdir…})
1. VSFS list FS List the contents of FS in “ls -lR” format
a. Format:
AAAAAAA NNN OOOOOOOO GGGGGGGG SSSSSSSS DATETIME [PATH/]FILENAME
Where
All elements are separated by a single space char.
A = attribute. Use the same file attribute as the FS, except where d=”-” if the entry
is a file, and “d” if a directory.
Page 2 of 6
RMIT Classification: Trusted
N = number of hard link if a file or number of subdirs if a fir.
Use “ 1” (3 chars) for file as links not allowed, else use number of dirs. 1 level below.
O,G = owner and group of the VSFS file Use the owner/group of the FS
S = size of the file in bytes
(optional, make size = nyuumber of lines in the file)
Datetime = datetime of the FS file in “ls -l” format.
Path/file = the note name
Example:
drwxr-xr-x+ 3 W8431514+ronvs W8431514+None 0 Oct 22 2020 usr/libexec/mc/extfs.d/
drwxr-xr-x+ 1 W8431514+ronvs W8431514+None 0 Oct 12 12:45 usr/libexec/mc/extfs.d/README
As you can see, the owner/group strings can vary in length from the standard.
2. VSFS copyin FS EF IF Copy the external file, EF, into the FS as internal file named IF
3. VSFS copyout FS IF EF Copy the internal file IF within FS to external file EF
4. VSFS mkdir FS ID creates empty internal directory ID in FS
5. VSFS rm FS IF Remove internal file IF from FS
6. VSFS rmdir FS ID Remove internal directory ID from FS
7. VSFS defrag FS Defragment FS, removing all deleted entries
8. VSFS index FS (Re-)Create a global index for FS
Where the parameters are defined as follows:
• “IF” can be a path without the leading “/” and ending in a file name but not ending with a “/”.
o The path referred to here is the internal path, NOT the Unix path.
o IF should never be “.” Or “..” or “/”
• For copyin and cioyout, the internal and external paths must already exist else error
• For mkdir the ID must NOT already exist else error
• For rm and rmdir, the IF / ID must/dir exist, else error.
• “EF” can be a filename, or a path ending in a filename. If it is only a file, it is copied to the local directory. If OF is a
path, then all folders along the path must already exist. The path is relative to the local directory unless preceded
by a “/”
• The command mkdir and rmdir require a directory, but in this case, the trailing “/” is optional
o mkdir creates a file called “ID”
o rmdir calls rm for each file within ID and dir containing that path, and then rmdir the ID
• “FS” can be a standard Unix file (and can include a path).
• “ID” is the same as “IF” except that it must be a directory.
Think of the Unix program “zip” and its command line arguments. The ZIP file is the system, and you use “zip” and “unzip” to
manipulate the FS, but there are also programs like “WinZIP” that do both.
Suggestion for developers: Get all the above working for files first, then later put in the path handling.
3.2 File format
In the list above, “VSFS” is the name of a Very Simple File System (VSFS) file. For this assignment, we will implement a
notes file format, so the VSFS format will have a default extension of “.notes”.
The notes file format is described as follows.
1. It is a text file with variable length records.
2. A record is terminated with “\n”, so a C function fgets() would return it as a string.
3. Maximum record length is 255 characters including “\n”. When using copyin, all longer records are
truncated.
4. All records starting with “#” are ignored.
5. The first record in the VSFS file starts with “NOTES V1.0”. A valid notes file must contain this text in the
first line.
6. A file name record starts with “@” as the first character followed by a “path/…/file” entry. If path is
omitted, path = “”. That is, there is no leading “/” in the name. So a plain file “abc” is encoded as “@abc”
7. A directory record is a file record starting with “=” and ending with a path ending in “/”.
8. A content record contains a “ ” (space) in the first character and must succeed a file record. All
subsequent content records go in the same file entry, until a non-content record is encountered.
9. A file may be deleted. In that case, the file record and any following content records will have the first
character set to “#”.
10. A new file using copyin is always appended to the VSFS.
Page 3 of 6
RMIT Classification: Trusted
11. If copyin is used to replace a file, that file is first deleted, and the new file appended.
12. When using copyin to insert a file, always prepend the content records with a “ ” (space).
13. When using copyout to extract a file, always remove the first character (“ ”) before saving.
14. Only records starting with one of the first characters described above are allowed in the VSFS file. Any
other character should result in an error.
15. No two notes should have identical names at the same directory level.
16. All errors should result in a “Invalid VSFS” message to stderr, and exit code of 1 (eg. “exit(1)“ (
17. When reading a FS, any deleted records should not be acted upon, but should also not be removed. This
way deleted files should remain in the VSFS until explicitly removed.
Sample file:
3.3 Midnight Commander, mc.
The program mc (“Midnight Commander”) is a program that resembles Windows Explorer, or Finder on the Mac, except that
it runs in text mode. The program is already installed on Titan, so just run it using “mc”. The program provides a wealth of
capabilities for dealing with files and is commonly used to maintain broken Linux systems that are running in single-user mode
with mc as a TUI in console mode.
It opens with two screens, which can move independently through the Unix file system. Normally you press TAB to swap
screens. You can press function keys such as F5 to copy the highlighted file to the directory in the other screen. This is
somewhat equivalent to a drag-and-drop operation.
mc has an interface that allows it to decompress ZIP, TAR.GZ and other compressed files, and render them just as it does on
normal files. You simply cursor to a file (say, abc.zip) that contains folder A and B, with files a/aa and b/bb, then if you press
return while on abc.zip, it will open up the window with two directories, a, b, and if you enter a, you will find aa. This
functionality is called an external file system, or extfs, and mc allows new entries to be added.
You can find all the configured file locations using the command “mc -F”, On titan, the extfs folder is
“/usr/libexec/mc/extfs.d“. If you look at the files here, you will find script files that implement the same interface as the VSFS
program described above – even a README that explains the interface. You might like to look at UZIP which uses zip and
unzip to maintain zip files, and is written in Perl. Or look at UZOO, which uses the zoo archiver, which has a similar interface
to zip, but is written in BASH shell.. 7z, vz, gz, and rzr are also there. Even GitHub is there!
The ultimate goal of this assignment, is for you to create a new script, link it into the mc system, and enjoy a new file system
that you built yourself.
While debugging, VSFS can be called from the command line as per section 3.1. But you can also deploy it as an extfs file
system within, mc.. This would require the insertion of several settings within your personal mc directories. See the help
(F1) for details.. You can add your own extfs file system into the directory ~/.local/mc/extfs.d/. You nay need to create it,
NOTES V1.0
@note1
This is the first note. Notice the leading space.
Another line
@note2
The next note is empty.
@emptynote
=dir1/
=dir2/
@dir1/note1
Although this is also note1, it is not in the root dir as the first was.
Dir2 above is an empty dir
#deletednote
#these lines are ignored when reading in VSFS
@dir3/abc
This is an error, since dir3 was not created using a directory record.
This should terminate with an appropriate error message to stderr, and
error code as per section3.4.
@dir1/note1
Another error,,,
Exit code as per 3.4 since note1 already exists in dir1
Page 4 of 6
RMIT Classification: Trusted
You run it within mc in one of three ways:
1. Type “cd abc,notes/VSFS://” on the command line within mc, to explicitly execute this extfs handler.
2. You press alt-C to get a cd prompt, and enter “cd abc,notes/VSFS://” into it.
3. You associate the .notes extension with the file system. See f1-Help, then contents, then ext. If you choose this
option, then you can just press ENTER when cursored on the file,,
In all cases, you should see one of the panels open up on the notes file system. You can then use F3…F8 to view, edit, copy,
move, mkdir, and rm/rmdir entries. Whenever you do any of these, mc will run “VSFS list” to refresh the file list on the
panel.
3.4 Error / Exit Handling
If the program works, it must output an exit code of 0. If it errors for any reason, it must print a one-line error
message to stderr, and then terminate with a corresponding error/exit code. Wherever possible, use one of the
standard Linux exit codes. If your error does not match one of these, then use a non-standard value. In either
case, document all possible error codes.
3.5 Submission levels.
This is a rough measure and assumes that all the non-programming parts get full marks.
PA level: Performa all the above activity in sections 3.1–3.4. “mc” compliance is not required.
CR Level: PA level + add the “VSFS “defrag” FS” command, which build a new FS, removed deleted entries and sorts
the entries into file tree sequence (like ls -lR).
DI level CR level + automatically create all intermediate directories as needed. (In PA/CR intermediate these must
already exist) and error if not. In DI level, they are automatically created.
HD level DI level +
1. Use the titan program “base64” or similar functionality within your language to encode a binary file
into usable text content, then convert copyin and copyout to encode and decode the files on input to,
or output from the file system. So now the FS can also store binary files, and it is still editable with
your text editor. Be sure to maintain the leading space in the FS file. favorite
2. Make it mc compliant. Make any and all changes necessary to ensure that mc will use your code
Document what you needed to do.
HD+ level Top level. If the notes file ends in .gz, then use gzip/gunzip to compress the entire FS. One way to do this
in C/C++ is to use system, or popen() the programs “gzip”/”hunzip” and read/write from its stdin/stdout
pipes using popen(). In other languages, there are similar methods to pipe command output.
BONUS Marks (This can be a challenge – only attempt if you have time and interest) Include full documentation.
Alternative 1
Download some classical books from https://gutenberg.org/ The book files are pure text.
Converting them to notes can be difficult – be careful about the time spent.
Create a program/script to convert them to notes format, with chapter and possibly section
headings as files. Use your judgement for section titles.
Alternative 2
A variation of the notes file format of your choice of similar complexity to alternative 1, but prior
consent is required.
4. Language Agnostic
For the VSFS code, you may use any language that is installed on titan / saturn / jupiter. They include C / C++,
Java, PHP, Perl, Ruby, JavaScript, bash, csh, awk, and more. As long as you can run it, it is acceptable.
Page 5 of 6
RMIT Classification: Trusted
Note that all script files need
1. To have the executable bit set (chmod uog+z file)
2. Have the path to the script program in the first line as a comment (#!/bin/sh is the most common )
Most languages allow you to read/build the entire FS in memory using things like associative arrays, so even
rebuildin the FS is possible.
5. Report and Submission
In addition to the program solution, you are required to write a DOCX/PDF report describing the following.
1. A syntax diagram
a. for the command line as you implemented it.
b. for the notes file format
2. A full “man” page for your program instandard man page format. It would be in section 1.
3. The rationale for using the language that you have used for the implementation.
4. What you would change in order to
a. build a table at the top to each note, and fseek() there to quickly get to the file.
b. use fixed length records, and calculate the fseek() instead of using a table.
5. Another application of this file format, or a small variation of it.
a. One example is the book format suggested in the bonus marks part.
b. Another suggestion is a Rubric format where all the parts of the Canvas rubric are files within the FS.
c. Your turn. Describe a third format / application.
6. Submission
1. Submit a ZIP file containing a complete set of source and test files needed to build your solution, and
2. A separate Report in DOCX/PDF format as per previous section
Students are REQUIRED to make 2 submissions of the ZIP and DOCX files, in week 13,14, with the last being the final
submission. Only the final submission will be used for marking, but the others are needed to demonstrate progress.
NB. Also note the submission policy at the top of this document.
6.1 Assessment declaration:
When you submit work electronically, you agree to the assessment declaration:
https://www.rmit.edu.au/students/student-essentials/assessment-and-exams/assessment/assessment-declaration
7. Academic integrity and plagiarism (standard warning)
It is your responsibility to ensure that all files you submit are your own work. We will check your submission against other submissions using automated
software to check for plagiarism. You must agree with the RMIT Assessment declaration available here:
Academic integrity is about honest presentation of your academic work. It means acknowledging the work of others while developing your own insights,
knowledge and ideas. You should take extreme care that you have:
• Acknowledged words, data, diagrams, models, frameworks and/or ideas of others you have quoted (i.e. directly copied), summarized,
paraphrased, discussed or mentioned in your assessment through the appropriate referencing methods,
• Provided a reference list of the publication details so your reader can locate the source if necessary. This includes material taken from Internet
sites.
If you do not acknowledge the sources of your material, you may be accused of plagiarism because you have passed off the work and ideas of another person
without appropriate referencing, as if they were your own.
RMIT University treats plagiarism as a very serious offence constituting misconduct. Plagiarism covers a variety of inappropriate behaviors, including:
Page 6 of 6
RMIT Classification: Trusted
• Failure to properly document a source
• Copyright material from the internet or databases
• Collusion between students
For further information on our policies and procedures, please refer to https://www.rmit.edu.au/students/student-essentials/rights-andresponsibilities/academic-integrity
8. Rough Marking Guidelines
A rough marking guide is described below. A more detail marking rubric will be attached to the assignment spec, and it will
be the final guide.
Report,docx (5 marks)
As per report section.
Test Strategy (5 marks)
You must devise a set of test strategies appropriate to your language, to ‘convince’ the markers that your test strategy is
complete would discover and document all bugs and error conditions.
Programming Style (4 marks)
You must follow good programming style - avoid use of “magic numbers”, name your constants, variables and functions
meaningfully, etc. There must be plenty of internal comments describing why is done piece is done that way.
PA level Implementation (4 marks)
CR level Implementation (3 marks)
DI level Implementation (3 marks)
HD level Implementation (3 marks)
HD+ level Implementation (3 marks)
BONUS Marks – Only awarded if fully implemented. (2 marks)
========
(max 30 marks)
For each of the criteria, there are 4 possible marks:
• Excellent: the solution you have provided is correct as per assignment requirements.
• Good: the solution you have provided is good but there are one or two minor issues with your implementation. Your
marker will detail the problems in the provided implementation.
• Fair: you gave it a go but it's a long way from the required implementation.
• No marks: no implementation provided.
Note that the published rubric for this assignment will apply, even if there are small differences between that,
and the marking described herein.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
urba6006代写、java/c++编程语...
2024-12-26
代做program、代写python编程语...
2024-12-26
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
热点标签
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: 9951568
© 2021
www.rj363.com
软件定制开发网!