How to compile ?!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
vduck
Posts: 1
Joined: Sun May 03, 2009 2:49 am

How to compile ?!

Post 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
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: How to compile ?!

Post 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.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: How to compile ?!

Post 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
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: How to compile ?!

Post 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.
Locked