Mike, you must write the final tutorial for the web site. Changing the design of the tutorial.
Download the base files on the attachment.
First, create the subdirs:
Next, you need create a Makefile C/C++ project on the vcproj subdir.
Then, on the main dir, copy the *.bat files and the dobuild.sh file from the base files.
On the src dir, put the Makefile, the Makerules and the kernel.ld from the src dir from base files.
On each code subdir, put a Makefile with the next code:
Code: Select all
LIBNAME=The name of the current dir
include $(ROOT)/Makerules
# This not work yet
export-lib-dir:
@shell export CURLIBDIR=`pwd`
$(ROOT) is set on domake.bat
For this you need to set the CYGPATH variable to the path of cygwin.
You need to change the compilers in Makerules file
You can use the i586-elf-gcc, for this, see wiki.osdev.org/GCC_Cross-Compiler
You need to put these files on the $(CYGPATH)/usr/cross/
Then add the name of the code dirs on the main Makefile:
Code: Select all
DIRS = Name of the code dirs with the makefile above.
Back to VS 2008 or VC Express.
Go to properties of the project, in Debugging, type the command line of the emulator.
On the NMake, type:
Build command line: cd $(SolutionDir) <NewLine> build.bat
Rebuild command line: cd $(SolutionDir) <NewLine> rebuild.bat
Clean command line: cd $(SolutionDir) <NewLine> clean.bat
Output: The final executable.
Common language runtime: No support
Preprocessor definition: X86;__ELF__;_DEBUG and anymore that you want, splited by ;.
Include search path: $(SolutionDir)\src\include\
If you change the preprocessor definitions, go to the makerules and edit the DEFINES to some like this:
Code: Select all
DEFINES=-DX86 -DDEBUG -DMULTIBOOT_KERNEL -DWhat you want
The DEFINESASM is only for asm code.
With these Makefiles, you can use:
- C code with .c extension.
- C++ code with .cpp extension.
- NASM code with .asm extension.
- GNU ASM code with .S extension.
And press Ok.
On the main makefile:
Edit to change the cp command to copy to the correct dir.