Go to the previous, next section.
We developed our system using the Linux operating system; a free Unix- like operating system for PCs. The main reason we chose Linux was that it already has many of the tools we needed to build our system. For example, a 32-bit C compiler (GCC), 16 and 32 bit assemblers, linkers and so on.
Although Linux contains many of the tools we needed (including gcc, gas, ld, as86 and ld86) we had to produce a number of small utility programs to be used in the process of building the system. Descriptions of these tools make up the following table.
mld [-v] [-v] [-o dest-file] source-file
It also performs a number of consistency checks; for example the object file may not contain any unresolved external references. Common data symbols (global bss objects) are resolved as they are loaded from the a.out file.
Each -v
argument increases the verbosity of the program.
mstrip [-v] [-v] object-file {-s symbol-to-keep} [-o dest-file]
_kernel
and _foo_module
(where foo is
the name of the module). This is necessary since modules can be
statically linked into the kernel. If two separate modules defined a
symbol with a particular name there would be trouble.
Each -v
argument increases the verbosity of the program, the
file called object-file is the a.out object to strip all symbols
but those specified by the -s
switches. If a dest-file is
specified the stripped object is written to this file, otherwise the
source is overwritten.
mdump module-file
bbin source-file dest-file
ld86
) source-file, and copies the 512
bytes of code in the file to dest-file. Only a code segment may be
present in source-file and this code segment must be exactly 512 bytes
in length. This is used to create images of boot blocks.
bbin16 source-file dest-file
bbin
except that a multiple of 512 bytes of code is
copied from source-file to dest-file. Only a code segment may be
present in source-file. This is used to create a binary image of the
16 bit startup code.
bsc bootsect-image bootsect-header
bootsect_code
. A file of this type stored
in the file `src/fs/bootsect.h' defines the standard system
boot sector. Only 480 bytes of code are produced because the rest of the boot
block is initialised by the mkfs
portion of the file system.
btoa array-name <source-file >dest-file
array-name_length
containing the length
of the array. This program is used to include files of 16 bit code
into the 32 bit code emitted by the compiler.
e2b source-file dest-file
makeimage bootsect-image start16-image kernel-image device-name >image-file
device-name is the name of the system's boot device, for example `fd0:' or `hda1'.
sbb boot-file
sysdisk start16-image kernel-image device-name system-file
Since the system is fairly large we have split the source code into easily manageable sections, each section being stored in a separate directory. Each module is considered a section, the kernel is also split into sections. Each directory is given a `Makefile' whose default target is to build the contents of that directory (i.e. to create a module file or part of the kernel). The top-level `Makefile' can be used to recurse through the source hierarchy compiling each section in turn. This allows the whole system to be built by simply typing `make' in the root of the source tree.
The top-level `Makefile' also contains a number of phony targets, each of which performs some useful operation. These targets include the following:
To use these targets the following environment variables must be set to suitable values:
VMM_ROOT
VMM_ROOT_SIZE
VMM_ROOT
.
VMM_BOOT
VMM_ROOT
variable.
VMM_CFLAGS
LD_DOES_QMAGIC
ld
program can
produce QMAGIC format executables.
Go to the previous, next section.