OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 12:06 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Visual Studio 2008
PostPosted: Tue Apr 28, 2009 6:43 pm 
Offline
Member
Member

Joined: Mon Aug 18, 2008 6:17 am
Posts: 76
Hi,

Well I have a big problem...
I really want to take advantage of this IDE... why? because the the Microsoft MASM instructions are very similar to that one that is present on Intel's manuals... and we can compile C/C++ and ASM code just clicking on build solution... Yes, we need to make some adjustment, switching off some features like informations for debug on the fly... But that's OK... Even with some limitations, even so, I still believe that is more attractive working with Visual Studio rater than with GCC+NASM...

Is there any suggestion? for example controlling stack overflows? Does anybody tell me the exactly advantage of working with GCC+NASM (because the majority of tuts on the net use this tools); Or is there any IDE that we can use with GCC+NASM that cannot be targeted to a specific OS?


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Tue Apr 28, 2009 6:54 pm 
Offline
Member
Member
User avatar

Joined: Sat Feb 28, 2009 11:43 am
Posts: 80
InsightSoft wrote:
Hi,

Well I have a big problem...
I really want to take advantage of this IDE... why? because the the Microsoft MASM instructions are very similar to that one that is present on Intel's manuals... and we can compile C/C++ and ASM code just clicking on build solution... Yes, we need to make some adjustment, switching off some features like informations for debug on the fly... But that's OK... Even with some limitations, even so, I still believe that is more attractive working with Visual Studio rater than with GCC+NASM...

Is there any suggestion? for example controlling stack overflows? Does anybody tell me the exactly advantage of working with GCC+NASM (because the majority of tuts on the net use this tools); Or is there any IDE that we can use with GCC+NASM that cannot be targeted to a specific OS?

GCC is better in some areas than the Microsoft C compilers in Visual Studio. Firstly, the Microsoft compilers (and thus VS08) is more targeted at Windows; GCC can target any platform (I can develop on the GNU Hurd if I want to ^_^). Second, then we have the open-sourced GCC and closed Microsoft C. Third, GCC is a little smarter. Finally, GCC supports more languages.

NASM is in every way similar to the VS08 Intel-style assembly. The only difference is NASM supports more formats.

IDE? How about Code::Blocks (closest thing found)? You would need to program in gas (but this is fixed by .intel_syntax noprefix at the top of the Assembler file, though).

_________________
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Tue Apr 28, 2009 7:53 pm 
Offline
Member
Member

Joined: Sun Jan 14, 2007 9:15 pm
Posts: 2566
Location: Sydney, Australia (I come from a land down under!)
The biggest advantage to GCC is that it's extremely easy to use for many different architectures. It's also quite standards compliant and, because many people use it (especially here on OSDev.org) you can get support with your problems extremely quickly.

On the other hand, neon (iirc) has a bunch of tutorials about making an OS using Visual C++.

If all you want is the IDE, it's also possible to create a "Makefile Project" and have that run your project's Makefiles when you click "Build".

_________________
Pedigree | GitHub | Twitter | LinkedIn


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Tue Apr 28, 2009 8:31 pm 
Offline
Member
Member
User avatar

Joined: Sun Feb 18, 2007 7:28 pm
Posts: 1564
Quote:
Is there any suggestion?

The only suggestion that I usually give out is to use the best tools for your project and that you have the most experience with. If you feel more comfortable with MSVC, use it. If you do not, try something else.

Decide what tool chain is best for your project and try it. :)

_________________
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Wed Apr 29, 2009 12:35 am 
Offline
Member
Member

Joined: Thu Apr 10, 2008 1:47 am
Posts: 104
InsightSoft wrote:
But that's OK... Even with some limitations, even so, I still believe that is more attractive working with Visual Studio rater than with GCC+NASM...


So keep your prefered IDE. I try many solutions to develop my OS on windows and for me the two best are
- Eclipse CDT(5.x) + cygwin(gcc cross compiled) + nasm
- Visual Studio and eventualy nasm in a VS makefile project for boot and loader

The two solution give you intellisense and fast acces to your function, definition, class, etc, ... and other good feature
When your os grow up, it's very important.

I worked long time with Eclipse CDT but now i'm on Visual C++ 2008 that is more confortable.

_________________
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Wed Apr 29, 2009 5:19 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2008 2:34 pm
Posts: 548
Location: Belgium
Don't want to burst anyone's bubble here, but isn't using MASM to develop your own OS illegal? Doesn't the license explicitly say that you can only create Windows software with it? Correct me if I wrong, but if I remember correctly, it's not allowed.

Besides that, if you like the IDE so much but don't want to use the compiler/assembler, that's fine. Visual Studio has build rules for these kind of things. I build my entire OS by just clicking the 'build' button, build & run builds my entire OS and runs Bochs with the new version. When I add a new ASM/C/C++ source file, it automatically gets assigned to YASM/GCC. The only thing I haven't managed to do inside visual studio is use the GCC linker instead of the VC++ one, I just use a separate batch for that and let it execute post-build.

_________________
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Wed Apr 29, 2009 6:30 am 
Offline
Member
Member

Joined: Fri Jul 11, 2008 5:15 am
Posts: 342
Location: Hungary
Creature wrote:
Don't want to burst anyone's bubble here, but isn't using MASM to develop your own OS illegal? Doesn't the license explicitly say that you can only create Windows software with it? Correct me if I wrong, but if I remember correctly, it's not allowed.


Using MASM (which comes with VS) is not illegal. Using MASM32 for osdev'ing (which does not come with VS and you have to download it from a 3rd party site) is illegal.


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Wed Apr 29, 2009 6:44 am 
Offline
Member
Member
User avatar

Joined: Sun Feb 18, 2007 7:28 pm
Posts: 1564
In addition to ru2aqare, you can also always configure MSVC to use another assembler instead of MASM.

_________________
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Wed Apr 29, 2009 7:13 am 
Offline
Member
Member

Joined: Thu Apr 10, 2008 1:47 am
Posts: 104
Creature wrote:
Besides that, if you like the IDE so much but don't want to use the compiler/assembler, that's fine. Visual Studio has build rules for these kind of things.

Yes makefile project and/or tools menu
I personnaly use a makefile projet with nasm for boot&loader and C++ project for kernel and libs, in my solution.

Creature wrote:
I build my entire OS by just clicking the 'build' button, build & run builds my entire OS and runs Bochs with the new version

Visual Studio[F5, F7], Eclipse [F11, CTRL-F11], and other I[ntegrated]DE can do that.

Creature wrote:
The only thing I haven't managed to do inside visual studio is use the GCC linker instead of the VC++ one, I just use a separate batch for that and let it execute post-build.

VC++ link PE format executable file, either use PE format (neon wrote tuto about it) or use makefile to compile/link.

Many solution, many different way , many different people with many differrent experience .. and so on...
Real question is "how i feel my devellopment tools ?"
I you feel good use it and stop asking you question ;o)

_________________
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Thu Apr 30, 2009 7:14 am 
Offline
Member
Member

Joined: Mon Aug 18, 2008 6:17 am
Posts: 76
Thanks guys...

It has been more difficult to choose the correct tools than understanding what is need to do to make up and running an operating system... actualy I have the same piece of intelligence running in C and NASM and the same on Visual C++ and MASM... i am trying to solve a little problem in this last one...

My big problem is that with growing of the code, I become a lost man...

In C+NASM seems to me that is more easy to control the implementation;
With visual studio, with so much help it become easy to get lost, mainly on implementations C++/MASM..., etc

Why I still trying Visual Studio: For a long time I use that IDE; I start learning programming the absolte low-level with MASM (lot of manuals, ect)
When I realize that NASM, GAS can be the next choice, I was getting upset with some diferences with opcodes with standards (Intel books that I have eaten) (for ex: OUT DX, AL)...

I dont sleep for 4 days... I am working 24h per day trying to learn as quick as possible, reading books and books and books... (This weekend, after the grand premio of MotoGP I will sleep one week straight)

Now, what I am looking for, is steal some experience from you Guys... and be sure that I will take the correct line, correct steps...

That's why, I thanks all of you...


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Thu Apr 30, 2009 12:55 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2008 2:34 pm
Posts: 548
Location: Belgium
ru2aqare wrote:
Creature wrote:
Don't want to burst anyone's bubble here, but isn't using MASM to develop your own OS illegal? Doesn't the license explicitly say that you can only create Windows software with it? Correct me if I wrong, but if I remember correctly, it's not allowed.


Using MASM (which comes with VS) is not illegal. Using MASM32 for osdev'ing (which does not come with VS and you have to download it from a 3rd party site) is illegal.


Yes, sorry, my mistake, the names just look so much alike :P.

_________________
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Thu Apr 30, 2009 12:57 pm 
Offline
Member
Member

Joined: Fri Jul 11, 2008 5:15 am
Posts: 342
Location: Hungary
Creature wrote:
Yes, sorry, my mistake, the names just look so much alike :P.

No fret, a few years ago I also thought that MASM32 was official...


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Thu Apr 30, 2009 1:49 pm 
Offline
Member
Member

Joined: Mon Aug 18, 2008 6:17 am
Posts: 76
...one of the advantages of NASM is the variety of output formats (like truly binary (free of headers, etc) (And I like that)


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Thu Apr 30, 2009 4:11 pm 
Offline
Member
Member

Joined: Fri Jul 11, 2008 5:15 am
Posts: 342
Location: Hungary
InsightSoft wrote:
...one of the advantages of NASM is the variety of output formats (like truly binary (free of headers, etc) (And I like that)


Not to start a flame war or anything, but creating the final output - linking the object files together - is not the assembler's job.

One of the advantages of MASM is the strong type checking for structure types. For example, you can use the "assume <register>, ptr <structurename>" construct and the assembler checks that you only access members of that structure via that register. It's a kind of strong typing. I missed this functionality in NASM.


Top
 Profile  
 
 Post subject: Re: Visual Studio 2008
PostPosted: Thu Apr 30, 2009 5:36 pm 
Offline
Member
Member

Joined: Mon Aug 18, 2008 6:17 am
Posts: 76
yes... you are right... Actually, when I reefer to NASM I really meaning the full environment
(compiler+linker)...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 133 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group