MessiahAndrw wrote:
What are you asking? Which development environment to use?
Cygwin is straight forward, but you need half a day to set up the cross compilers. All tutorials you ever need can be found on the wiki.
However, you have Visual Studio (by far the nicest C++ IDE, but you can also use the VS IDE with Cygwin) and that has everything you need, but not many people here use the PE executable format, so if you find a good tutorial that can help you out it will do.
Yeah sorry, I tend to make really vague posts when I'm confused
Basically I'm a little lost in choosing a compiler, and indeed, I want to know what's the best development environment.
Thanks for your reaction! I did a bit of searching, and combining visual studio and cygwin doesn't seam ideal (or perhaps you meant using VS as an editor and cygwin to compile the lot? That would probably work).
h0bby1 wrote:
I'm currently trying to write an article about these issues, it's not finished yet, but you can already find some information about how to make C program that will work with several compilers, and how to interface safely between C and assembly, or between two C program compiled on different configurations.
viewtopic.php?f=8&t=27147 this thread is about that actually.
Agner frog articles are also well made about this topic.
But you can perfectly use visual studio to build an OS, i know a bit about PE and ELF format.
Typically the base assembly code will be assembled as flat binary object and loaded at a fixed location, then you need to be able to load exe file from it to be able to interface with C program compiled into a specific executable format. Or you can maybe link C program as flat binary and load them at specific location if you don't want to program a PE or ELF loader in assembler. But you'll still have to make a PE or ELF loader if you want to be able to use exe files produced by visual or gcc easily.
you can use mingw in visual studio as well, but i think under windows, both cygwin and mingw will produce PE format executable anyway, and they will potentially require mingw dll at runtime to function. So i'm not sure it's a very good solution.
Devcpp also use gcc under windows, it can worth a try if you want to use gcc compatible building environment, or you can define custom build rule that use mingw in visual.
And yes you'll most likely need to become familiar with visual studio compiling/linking options if you use the visual studio C compiler .
Phew, that sucks. I was under the impression that GCC can compile to a flat assembly format... Well, thank you too, I'm curious about your tutorial (edit: wait, you meant the one on the wiki? Found it
)!
So, as far I understand, I basically got the choice of compiling in VS and get a PE-executable, or compile in GCC and get an ELF-executable?