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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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