Coding an OS from scratch is a very fun thing to do and gives a lot of insights on what is inside the computer and how it interacts with its hardware.
If you already know how to use GCC and have setup a cross compiler already and only want to set it up in Visual Studio, scroll down.
Setting up GCC and all you need for raw kernel development
The most used compiler named GCC is a wonderful thing and everyone should learn how to use it. If you are a person who feels comfortable with Windows but still wants that Unix power on his hands, like me, installs MinGW with its command line goodness. You need to install MinGW and a GCC cross compiler. What this does is, compile your code for the ELF architecture, which we need for our OS. Download a prebuilt one for Windows right here. Now make sure the directory in which the executables are in are in the PATH variable.
For Debugging I use Bochs but you can use any emulator you want.
Setting up Visual Studio
Create a New Project –> Visual C++ –> Makefile Project
Go to Properties –> Configuration Properties –> NMake
Now there are 2 command line settings we have to set up, compiling and cleaning. In my Makefile I have a label which directly creates my OS ISO file and one that cleans everything.
Now in Debugging you can setup your emulator.
Hit F5 to see that shiny emulator.
I have not tinkered with a GDB implementation yet but I think it may be possible with VisualGDB.
IntelliSense only “half-works”, GCC stuff like __attribute__ definitions and some inline assembly will show up errors but will not break compilation. Aside from that, all the C IDE goodness you need is there for you.