|
Writing an operating
system will give you a better understanding of how operating systems function
internally, which can be very advantageous when programming for someone else's
operating system (i.e Windows). Creating an operating system offers a unique situation
in which you have complete control of the target machine, without any limitations,
but this also means you must create the most basic mundane components to do simple
operations
This tutorial and all code contained within it are Copyright
© 2002, Matthew Blagden, and may not be republished without permission
from the author.
Your Tools
The MASM syntax is far from beautiful, but because MASM comes
with visual studio and assembles files into formats that work with the VC++
linker, MASM will be the target compiler for the assembly part of this project.
However, the linker that comes with VC++ will not create 16-bit tiny model flat
binaries (.com files basically) which are the format that the boot sector must
be written in. To create the boot sector, a 16-bit linker is required, and may
be obtained here. Obviously, you can write your boot sector (and the whole operating
system) in any format you wish, but for those of you who will be copy-and-pasting
your way through the assembly sections of the tutorial, you had best get MASM.
To compile the boot sector, use must use the tiny model, OMF
format output, and the 16-bit linker. To compile any of the other sections (32-bit),
use the COFF format output, and the linker that comes with VC++ can take care
of the linking for you.
Read
More. . .
|