Page 1 of 2

Kernel with Intel C Compiler

Posted: Sun Feb 05, 2006 3:04 pm
by Tolga
Hi. I saw Intel C compiler. Can we use this for writing os kernel? Is it useful for this work?

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 12:32 am
by yayyak
Theoretically, a C compiler is a C compiler, and it should all conform to the same standard. That said, there are major differences between compilers, and some turn out better than others.

I would assume Intel has a fairly good grasp of the x86 architecture (as they invented it :P), but I haven't used this compiler personally. Maybe somebody else has an idea.

Most help/sample code given in these forums, the osfaq and other sites will feature GCC inline assembly, and NASM or AS format assembler, so that may influence your decision somewhat. Though NASM syntax is fairly close to Intel syntax.

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 1:48 am
by Solar
Hmmm...

Google: ICC compiler, first hit, led me to this page where it reads:
Compatibility: Utilize source and object compatibility with GCC version 3.2, 3.3 or 3.4, and other widely used utilities in the Linux development tool chain. Intel C++ Compiler also conforms to the C++ ABI standard.
I would say, "clear to land". ;)

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 3:12 am
by Pype.Clicker
Traditionnally, Intel compiler is reputed for its "better" integration of MMX/SSE features by the mean of "builtin" functions. Intel may have decided to change their policy recently, but - afaik - their compiler is not available for free, and the charges will keep any hobbyist out of the game ...

Be prepared to delve into their manuals to know how linker-scripts equivalents and all those subtle things we need for OS deving can be expressed. Imho, you should probably *not* expect ICC to take OS code and compile it ... I doubt their GCC support will extend to the support of AT&T inline assembly, for instance ...

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 3:22 am
by Solar
...but it should be safe to assume that they can generate ELF object files, which could be readily linked with Assembler-generated object files either using the Intel linker or GNU 'ld' or whatever you use.

The price tag is an issue though...

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 4:33 am
by Rob
Actually it seems to be free if you use it for non-commercial development onder linux:

http://www.intel.com/cd/software/products/asmo-na/eng/compilers/clin/219771.htm

I haven't read the actual license agreement, so perhaps it's illegal to use it to develop an OS.

Unfortunately it seems they have no such "treatment" for their Windows users. As if there is no Windows Open Source stuff....

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 4:39 am
by Candy
Rob wrote: Actually it seems to be free if you use it for non-commercial development onder linux:

<snip>

Unfortunately it seems they have no such "treatment" for their Windows users. As if there is no Windows Open Source stuff....
Well... if you're using windows, you've paid for it (or you're using it illegally). If you paid, you'll pay for icc, if you haven't paid you'd probably rip it off as well. Why bother?

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 4:58 am
by Rob
That may be true, but I bought Windows with my computer. And it isn't in the same price league as ICC either. It just find it strange that it is free for one OS but not another (if it is available on such a platform).

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 9:46 am
by JAAman
well, you can download an evaluation copy, but im not sure what that means exactly (usually there is a limitation to evaluation copies)

intel compiler is usually considered to be the best (as far as optimization) followed closely by the MS compiler (which is free)

it is also possible, that the linux download is command-line only, where the windows one includes an IDE, if you don't need the IDE, you may be able to find just the compiler for download somewhere (on the intel site, of course) but it may take some searching -- i know the MS command line compiler has always been free, but not always easy to find the download for it (of course now its easy to find, and includes the IDE)

Re:Kernel with Intel C Compiler

Posted: Mon Feb 06, 2006 3:10 pm
by kataklinger
There is a free verison for Linux. There is 30-days evaluation period for Windows version without limitations. It works almost perfectly with VS.NET 2003. It is almost 100% compatible with VC++, and no special tools need to use with it. So it is a good choice.

Re:Kernel with Intel C Compiler

Posted: Tue Feb 07, 2006 2:00 am
by Candy
JAAman wrote: ... followed closely by the MS compiler (which is free)
The MS compiler in its most MS loving form is free for non-commercial use. All others, including semi-professional work, you have to pay for. Also, when it does have a bug or such, you can't fix it. You can't port the compiler, so you can't make your own OS self-supporting. What good is an OS that can't even compile itself at some point in the future?

Re:Kernel with Intel C Compiler

Posted: Tue Feb 07, 2006 7:03 am
by JoeKayzA
Candy wrote: The MS compiler in its most MS loving form is free for non-commercial use. All others, including semi-professional work, you have to pay for. Also, when it does have a bug or such, you can't fix it. You can't port the compiler, so you can't make your own OS self-supporting. What good is an OS that can't even compile itself at some point in the future?
<sarcasm>
Well, you could ask MS to support your OS in the future because of the superiour features and the anticipated market share.... :P ;D
</sarcasm>

Re:Kernel with Intel C Compiler

Posted: Tue Feb 07, 2006 7:26 am
by bubach
I think Solar should make a VSPDCC ( Very Simple Public Domain C Compiler ) when he's done with pdclib. ;)

Re:Kernel with Intel C Compiler

Posted: Tue Feb 07, 2006 7:55 am
by Candy
bubach wrote: I think Solar should make a VSPDCC ( Very Simple Public Domain C Compiler ) when he's done with pdclib. ;)
I think he should take a well-deserved vacation after PDClib is done in v1.0.

Not sure whether you know, but I'm busy with a C compiler too... it's just not going very fast. Have a preliminary version which can compile hello-world (provided you don't use strings) at least. Was a school project together with somebody else who was pretty new to compiler stuff so he kind of messed up the frontend, so I have to rewrite that first, and I'd much rather rewrite it with my own tools which I also have to complete. In short, I'll be busy for some time :). I'll try to convert some of the code/designs/stuff like that for publication first so at least somebody else can do a part of it if he/she likes to. Got the lexer-generator nearly finished (working on that mainly now), got the parser-generator design on a minimum level, got an abstract assembler (parameterizable with the CPU type you have, up to a pretty extreme level - you could support 68030's, PIC's and P4's without recompiling) designed in my head, with language written out already (plus an example of some part of the 8086, so yes, I have modR/M encoding expressed in a non-intel-specific way including all exception cases) in EBNF (which my parser generator should parse, generating a regexp file, to parse with the lexer generator to make a lexer and a parser instantly). I'm considering how to make the C compiler design adjustable for C++ (full) and a new language I'm considering making for the purpose of interface programming, possibly (probably) very similar to an existing language (knowing me, probably c++). One thing I'm sort of stumped on is having a retargetable back-end, in the current design you'd have to make a new back-end for each cpu family and I'd like to optimize that away in genericity. Generally speaking, I'm trying to optimize the human away and I'm trying to get the overhead for porting anything to zero, as far as possible. At the moment, the OS core and the compiler backend need to be ported, plus you'd need to make a cpu design file. This is still some 40000-50000 lines of code (eventually) that need porting and I'd like to reduce that. No, portability wasn't a goal of my OS project but if it's well possible to achieve in a constant amount of more work, I'd rather have it clean enough for it. Anyway, I'm going to try to fix up the lexer generator and then I'm going to try to use it for a quick fix-up of the C compiler. Might be done by the weekend, don't put your crontabs on it.

Re:Kernel with Intel C Compiler

Posted: Tue Feb 07, 2006 8:15 am
by bubach
edit:
I think he should take a well-deserved vacation after PDClib is done in v1.0.
You'r absolutely right, he deserves it.
---

Thats some cool stuff. I've read some stuff abot making
a compiler, but i'm afraid it's to hard for me, not to mention the
amount of time it would take me..

Wishlist: I would like a simple C compiler that could, hopefully compile itself one day, maybe output fasm compatible assembly and allow fasm syntaxed inline.

That would be the perfect C compiler for me and one of the first things to be ported to BOS. :D

I'm determent to program it myself if nothing turns up by the time BOS is usable enought. I'm thinking of using BOS as the dev platform for any future OS projects.. ;)