Produce a simple command processor

Assignment Help Computer Engineering
Reference no: EM131304530

Systems Programming Assignment

Task 1

Now that the OS has a keyboard driver, it is possible to produce a simple command processor. You should expand the Run() method in command.c to produce a simple command processor that implements the following commands:

cls- Clear the screen.

exit- Shutdown the operating system (for now it should just output a message stating that the operating system is shutting down and then return from the Run() method).

prompt- Change the prompt output by the command processor. It should take one argument - the

new prompt. For example:

Prompt Hello>

should set the set the prompt to be 'Hello>' (the default prompt should be 'Command>'

Use the function KeyboardGetCharacter() in keyboard.c to retrieve the key code for a character (keyboard.h contains a list of the key codes). The routine KeyboardConvertKeyToASCII() will also be useful to you. You will need to write routines to read a string from the keyboard and then act on that string. When writing the routine to read a string from the keyboard, do not forget about handling backspace correctly.

Task 2

Exercise 1. Add a command 'readdisk' to your command processor that displays the contents of sector 0 of the disk to the screen. You should display the contents of each byte in the sector as hexadecimal value. Because the contents of the first bytes might scroll off the screen, you may need to implement some sort of paging mechanism, i.e. display 16 or 32 bytes at a time and then wait for the user to press a key before displaying the next 16 or 32 bytes and so on,

Use the function FloppyDriveReadSector to read the contents of the specified sector.

Exercise 2. Extend your solution to exercise 1 to enable you to specify which sector to read, e.g. implement 'readdisk n' where n is a sector number.

Exercise 3. Add some command-line options to your solution to exercise 2 to control how the data is displayed. For example, you might implement '/c' to display as characters, '/d' to display as decimal values, etc.

Task 3

So far, we have been adding all our code to our kernel, but we are getting to the point where we need to start to separate out the kernel from other parts of the operating system. This means that we need to be able to load other components from the disk, as well as being able to load user applications.

Now we need code to read and navigate the file system. There are two parts to this task:

a) Implement routines to open, read and close files using the FAT 12 file system.

b) Implement some basic utilities to navigate around a disk formatted using the FAT 12 file system.

Part A

A commercial operating system will usually support multiple file systems and multiple devices. However, for UODos, you only need to support the boot device that is formatted using the FAT12 file system (i.e. the. Img file you have been using so far).Of course, in a real operating system, you would also need to implement routines to write to the disk. However, since we are only interested in loading files at this stage, we will ignore the functionality needed to write to the disk.

Full details of the functions you need to write are provided in Appendix 1.

Part B

When you have implemented Part A, you need to implement the following utility commands that will use the functions from Part A and demonstrate that your implementation of Part A works. These should all be implemented as part of the command processor you have been working on Task 1 and 2.

READ filename

This function should read a text file from disk and display the contents of the file on the screen. You must be able to specify a normal DOS-style file path for the filename, including sub-directories, e.g.

READ \subdir\testdoc.txt

would display the contents of testdoc.txt that resides in the sub-directory subdir.

CD dir

Change to a particular directory on the disk image and make it the current directory for future disk operations. The CD command should accept any valid path, including . and ..

PWD

Display the current directory (as navigated to using CD). If the current directory is the root directory, then PWD should just display '\'.

DIR

Display the names of all of the files and directories in the current directory.

Testing

With your submission, you should submit a document in .doc, .docx or .pdf format that details the testing that you have done on your solutions to Parts A and B. You should clearly state your rationale behind the approach you have taken to your testing. In particular, if part of your submission is not completely functional, you should detail the problems you have encountered and the progress you have made towards solving them.

In order to test your submission, you will need to write test files to the disk image. A batch file (copytestfiles.bat) has been provided to you that will mount and unmount the disk image. You can edit this file to copy test files to the disk image.

Attachment:- Assignment.rar

Reference no: EM131304530

Questions Cloud

Why did he consider this term to be more appropriate : Explain why, in your opinion, Jefferson chose to change "property" into "the pursuit of happiness"? Why did he consider this term to be more appropriate for the American Declaration of Independence? ?Think about this from multiple perspectives.
Write a paper on impact of oil industry innovation on canada : Write a research paper about impact of oil industry innovation on canada economy. The paper should be 10 pages (tittle page and references not included), double space.
Generate the statistical process control chart : MAE 400 - Fall 2016 - Generate the statistical process control (SPC) chart for the daily averages of the data set for the 25-day period under study showing each daily average point, the mean of the distribution (X-bar), the Upper Control Limit (UC..
What is the expected real interest rate on the treasury bill : What is the yield to maturity on a Treasury bill that matures one year from now, has a price of $1,010, and has a face value of $1,000? If the consumer price index is expected to decline during the year from 250 to 245, what is the expected real i..
Produce a simple command processor : Now that the OS has a keyboard driver, it is possible to produce a simple command processor. You should expand the Run() method in command.c to produce a simple command processor that implements the following commands: cls- Clear the screen
What particular ideologies played a role : How did the culture in which the work was created influence the work? (What particular ideologies played a role in its creation and where do you see this influence reflected in the work you chose?) Make sure to point to specific examples of the in..
Show the impact on the market for u.s. treasury bonds : Use one graph to show the impact of this change in tax rates on the market for municipal bonds and another graph to show the impact on the market for U.S. Treasury bonds.
The traditional lm curve and replacing it with the mp curve : John Hicks, in his original macroeconomic model,- Why would Paul Romer in 2000 suggest dropping the traditional LM curve and replacing it with the MP curve?
What has helped you grow the most as an adult educator : How has your work changed during the time in which you have been involved? How do you see the field of working with adults in the early childhood field changing in the future-such as trends that may impact it?

Reviews

len1304530

12/7/2016 7:42:05 AM

You might find the following hints useful while working on this assessment-The keyboard driver you were previously given does not completely handle UK keyboards correctly. In particular, the backslash key does not work correctly. When entering path names in your command processor, press the hash key to enter a backslash. Remember that sub-directories on the FAT file system are implemented as files of directory entries, 16 entries in each sector. The first two entries in each sub-directory are the special entries. These contain references to the current directory and the parent directory respectively. Path-names are case-insensitive. You were provided with assembler code that read a FAT 12 formatted disk. That code only read the root directory, not sub-directories, but rereading this code will be useful to you in doing this assessment.

Write a Review

Computer Engineering Questions & Answers

  What is the polymorphic assingment

Why do C++'s capabilites of (polymorphism, encapsulation, inheritance) make programming difficult?what is the polymorphic assingment.

  Prepare a general set of instructions

Prepare a general set of instructions that will allow us to change any displayed value (from 0 to 9) to any desired value (from 0 to 9) in the least number of steps.

  Create a web page tags.aspx for viewing tags

Create a web page Tags.aspx for viewing tags. Use a GridView control to provide access to the list of tags in the database. Put checkboxes beside each tag.

  A palindrome consists of a word or deblanked

A palindrome consists of a word or deblanked, unpunctuated phrase that is spelled exactly the similar when the letters are reversed. Write a recursive function that returns a value of 1 if its string argument is a palindrome.

  Explain java programming with commented code

Java Programming with Commented Code, A marketing research company has hired you to develop a program. Analytics Nation, Inc. has gathered information from about five different products. They would like to follow up with 1% of these households.

  Create a class called class to represent a class of students

Create a class called Class to represent a class of students. The class should store the name of the class (Biology, History, etc), the name of the instructor, the number of students, the average GPA of the students in the class, and finally the s..

  Create a storyboard diagram depicting layout of your website

Create a storyboard diagram depicting the layout of your Website. Create a narrative that describes the site to your prospective client.

  Determine one protocol which works at the osi layer 2

suppose you are Dave Baker, the Senior System Administrator from Minnesota Consulting Group (MCG). The company with which MCG has an ongoing contract wishes to have some basic TCP/IP concepts explained to senior decision-makers.

  Describe the ip address

a MAC address and an IP address the same thing.

  Question1 what are the methods of defense and provide

question1. what are the methods of defense and provide examples? how do you deal with the damage?2. explain fundamental

  Compare and contrast the software development process

question 1 take a position on the idea that software development is either a creation process or a manufacturing

  Researching intrusion detection systems

Utilize the Internet in order to research the intrusion detection systems. Explain the network which could benefit from your solution.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd