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

  Analyze requirements for constructing a computer laboratory

Your team is tasked with analyzing and documenting requirements for constructing a standard computer forensics laboratory for a recently launched company -- XYZ, Inc.

  Find which statement is true and which statement is false

Two cells within a Karnaugh map are adjacent if only one variable is different between the coordinates of the two cells - Find which statement is true and which statement is false.

  How may a business use the internet

How may a business use the Internet. Provide three examples with web links demonstrating your answer.

  Describe website design basics characteristics of design

describe website design basics characteristics of design.

  Defined the derivative of the gaussian function

E27: Computer Vision Spring 2016 - HOMEWORK 3. The partial derivative of a Gaussian is separable. Let G→(x, y) be defined as the derivative of the Gaussian function with respect to x: G→(x, y) = (∂/∂x)G(x, y)

  Distributed file service

Use your own word to describe if five clients accessed the same file in a Distributed File Service how many copies of the file may exist on the network? Show list where the copies are.

  Demonstrate how this search would go

assume an algorithm that processes a data set of size 8 has a runtime of 72, and the same algorithm on a data set of size 20 has a runtime of 420. Using big-O notation, state runtime for this algorithm for the general case of a data set of size n.

  Define wlan

In WLAN data can be sent in one of the two different network modes. What are these modes?

  How the project management life cycle be efficient

How the Project Management Life Cycle be efficient.

  Define the edge connectivity of a tree is 1

The edge connectivity of an undirected graph is the minimum number k of edges that must be removed to disconnect the graph. For instance, the edge connectivity of a tree is 1, and the edge connectivity of a cyclic chain of vertices is 2.

  Find terms of elimination of redundant data

Thinking in terms of elimination of redundant data hopefully eliminating data corruption from operator input, would it not make sense to normalize and let new Duo-Core, Quad-Core processors take-up the slack and even decrease query times.

  Three different organizations'' e-business models

How do these organizations' business models affect way they market themselves? How does the target market learn about or find this site (e.g., search engines, referral sites, click-and-mortar advertising).

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