Page 1 of 1

How to compile ?!

Posted: Sun May 03, 2009 2:59 am
by vduck
Hello, I'm a newbie. I have some questions about OS dev.
1. Now, I'm using Visual C++ 2008. How to compile a kernel by VC2008.
2. How to test my kernel after compiling.
3. VC2008 is the best IDE and compiler to make a OS, isn't it ?

Finally, I am not a English and my E. skill isn't good so I hope you check my post :D

Re: How to compile ?!

Posted: Sun May 03, 2009 3:45 am
by Creature
vduck wrote:1. Now, I'm using Visual C++ 2008. How to compile a kernel by VC2008.
Check the wiki/search the forums before asking this question (it seriously has been asked in at least 5 topics). Since the Visual C++ compiler only supports a few formats (including PE and COFF I believe) you will have no access to ELF, which is generally considered the best documented. With Visual C++, you will also require some special set-ups, I believe these are on the wiki too.
vduck wrote:2. How to test my kernel after compiling.
You basically create a 'binary' file (sort of like an executable), put it on some sort of removable device (such as a floppy) and let your bootloader (or if you can't/don't want to create your own, you can use GRUB) load it. Then you can 'run the floppy' by using an emulator (like Bochs, VMWare, VirtualPC, VirtualBox, ...) or by just rebooting your computer with the floppy inserted (but this can be 'dangerous').
vduck wrote:3. VC2008 is the best IDE and compiler to make a OS, isn't it ?
Not really. The IDE is just a matter of preference. The compiler is generally not the best compiler because GCC supports many more executable formats. Even though the VC++ compiler and GCC both have their advantages and disadvantages, using a GCC cross-compiler is generally considered the best, I believe.

Re: How to compile ?!

Posted: Sun May 03, 2009 10:00 am
by Troy Martin
Creature wrote:
vduck wrote:3. VC2008 is the best IDE and compiler to make a OS, isn't it ?
Not really. The IDE is just a matter of preference. The compiler is generally not the best compiler because GCC supports many more executable formats. Even though the VC++ compiler and GCC both have their advantages and disadvantages, using a GCC cross-compiler is generally considered the best, I believe.
Unless there's a way to get the VC++ compiler to do C and not C++ so you can skip all the constructor/destructor crap, and you really like intel syntax assembly :D

Re: How to compile ?!

Posted: Sun May 03, 2009 10:25 am
by JamesM
vduck wrote:Hello, I'm a newbie. I have some questions about OS dev.
1. Now, I'm using Visual C++ 2008. How to compile a kernel by VC2008.
2. How to test my kernel after compiling.
3. VC2008 is the best IDE and compiler to make a OS, isn't it ?

Finally, I am not a English and my E. skill isn't good so I hope you check my post :D
Read the Required Reading.