sanos home

Building sanos from source


To build sanos from source you first need to download sanos-src-x.x.x.zip from the download page and unzip it into a directory (e.g. c:\sanos).

The source code for sanos is compiled under Windows. I use Microsoft Visual C version 7 (i.e. Visual Studio.NET 2002) to compile the source code. The boot sector is assembled using NASM. A copy of the NASM assembler is distributed with the source release of sanos (in the tools directory).

You can build sanos from a command line using the Makefile in the root directory of the sanos distribution. If your Visual Studio is not placed in its default location you need to have your path setup for Visual Studio. This is most easily done by running vsvars32.bat. This file is usually located in C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin.

The Makefile compiles and links all the code and builds a boot floppy image in img/sanos.flp. See here for booting and installing this image.

 

Building sanos using NMAKE

 

The root directory of the sanos source distribution contains a Makefile, that can be used to build sanos. After running vsvars32.bat you can build sanos by running:

c:\sanos> nmake sanos

This will build all the files in the bin directory. You can then build different install medias from these files:

 

Building sanos using other versions of Visual Studio

 

You can use the following versions of Visual Studio for building sanos:

You can also use the Express (i.e. "free") versions of Visual Studio.

 

Building sanos from the Visual Studio IDE

 

You can also build sanos from within the Visual Studio IDE. Go to to the build directory and double click sanos.sln. After Visual Studio has started right click the image project and select 'Set as Startup Project'.

Right click the sanos solution in the project pane and select 'Build Solution'. This will compile and link all the code and create a floppy image sanos.flp) in the img subdirectory.

 

The build process

 

The Makefile first builds the sanos specific win32 based tools:

These tools are placed in the tools directory. Next, all the sanos executable files are compiled, linked, and placed in the bin directory. The following components are built:

The only expected build warning is in osldr:

LINK : warning LNK4096: /BASE value '0x10000' is invalid for Windows 95 and Windows 98; image may not run

The last step in the build process is to make a floppy disk boot image using the mkdfs tool. The control file bootdisk.lst in the build directory is used to create the image. This image (sanos.flp) is placed in the img directory.