logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

You will build a stage 1 boot loader and a stage 2 operating system (OS).

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Introduction

You will build a stage 1 boot loader and a stage 2 operating system (OS). This initial boot loader has already been written; You simply need to download it, compile it, and install it. It will boot from a (virtual) floppy and put the computer into protected mode. It then will load the seconds stage OS. The second stage OS will clear the screen, draw a border around the screen, and the print a message in the middle of the screen.  The message will be "OS 0000".

Tools that you will need

You will need to use the following tools to complete your assignment, and all of them are provided as part of the course virtual machine:  You will need to download and install VirtualBox.  However, for the rest, you do not need to download, install, or set them up.  Their descriptions below are just to familiarize you with their function.

Bximage. This utility will build a virtual floppy disk (a file called a.img) for you.

dosfstools.  Specifically, the mkdosfs program will format a virtual floppy.

 

The dd copy utility. You will use this utility to copy your stage 1 boot loader to the virtual floppy.

 

The mtools suite of utilities, specifically mcopy. You will use this utility to copy your stage 2 OS to the virtual floppy.

 

The Qemu x86 emulator. Your will use this emulator to run, and test your operating system.

 

GDB, the Gnu Debugger.  You will use this tool to debug your operating system.

 

The nasm assembler. You will use this assembler to generate the stage 1 boot loader, and to generate the object file for the part of your OS written in assembly.

 

gcc, the Gnu C compiler. You will use the cross compiler to generate object code for the main driver of your stage 2 operating system.

 

objcopy, the object code translator. You will use objcopy to strip out all symbolic information from the stage 2 OS code.

 

Debian, a distribution of Linux.   You can use another distribution if you wish.  You will, however be on your own in getting things to work.

 

VirtualBox, a free but commercial grade emulator.  You need VirtualBox only if you are not booting Debian Linux natively.  VirtualBox will allow you to run Debian Linux under Windows (XP, Vista, or 7), Mac OS X, or another distribution of Linux without having to install Linux on your hard drive is a separate partition.  At the end of the class, if you do not want to keep Linux, you can simple delete the virtual machine and uninstall VirtualBox.

Creating Your OS

 

In order to create your operating system you need to download the boot loader at boot1.asm. This boot loader will load into memory at boot time, put the computer into 32 bit protected mode, and then load your stage 2 OS. We will talk more about the boot loader in class.

 

Next you will need to write a simple main driver in C. Your main will print a border around the screen followed by a message in the middle of the screen.  To get its work done, the main  will call two functions written in assembly, called k_print() and print_border(), to get its work done. The functions have the following prototypes:

 

void k_clearscr();

void k_print(char *string, int string_length, int row, int col);

void print_border(int start_row, int start_col, int end_row, int end_col);

 

The k_print() function must be written in assembly to get credit for this assignment. You can write the k_clearscr() and print_border() functions in C/C++, but they must call k_print() to get their work done. Note that you will need to understand how parameters are passed from C to an assembly language function. 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

846 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

984 Answers

Hire Me
expert
Husnain SaeedComputer science

850 Answers

Hire Me
expert
Atharva PatilComputer science

640 Answers

Hire Me