Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92059165

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As