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. You need Microsoft Visual C version 7 (i.e. Visual Studio.NET 2002) in order 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 by running the build.cmd command file 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 build.cmd command file compiles and links all the code and builds a boot floppy image in img/sanos.flp. See here for booting and installing this image.
The build.cmd script first builds the sanos specific win32 based tools:
These tools are placed in the tools directory. Next the all the sanos executable files are compiled, linked, and placed in the bin directory. The following targets 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.
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:
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.