Hi all, thanks for all of your replies ;D (and sorry about me beeing so darn slow about things). :'(
I've tried some of the compilers out there combined with
John Fine's jLoc since my only interest has been in producing binary flat output.
LCC
Seems nice, I had some problems though. Adding _asm("mov %eax, 0xF") to the .c source gave me an internal compiler error. Could be my syntax is wrong or something, didn't find much in the docs or on the net about it though. Know what I'm doing wrong? ???
Codewarrior command line tools (mwcc)
This compiler produces object files in some crazy COFF format I think. It adds multiply .text sections, one for each function it seems. I think this is why jLoc and ld produces errorous function call code. I'm not sure about this, any help would be highly appretiated! :-*
Code: Select all
mwcc -c -r -w on -RTTI off -nodefaultlibs -Cpp_exceptions off -codegen -opt full main.c -o main.o
void putChar();
int main() {
putChar();
for(;;) { }
return 0;
}
void putChar() {
__asm {
mov eax, 0x0b8000
mov [eax], 'A'
mov [eax + 1], 0x0F
}
produces this object file
-EDIT- I'm not sure I'm allowed to publish results from the compiler so I'll clean it up a bit. -EDIT-
Code: Select all
coff-go32
It adds one .text for each function, one for main and one for putchar in this case. Each function gets the offset of zero (relative to it's section).
00000000 <_main>:
0: e8 00 00 00 00 call 5 <_main+0x5>
- some other code -
Disassembly of section .text:
00000000 <_putChar>:
0: code
5: code
8: code
c: return
The .obj-file is supposed to be in some format compatible with Microsofts compiler. Maybe that's why it looks strage ;D
after linking it with jLoc, using the control file
the calls are made to wrong positions in the code.
Sometimes the call is even "out of bounds" so to speak.
BCC32
This is a very nice compiler which is free (not Debian-free).
Chris Giese earlier stated that you can't make a binary kernel with it. But I suppose that's only true if you're
trying to link it with ilink32 and not jLoc, right?
This far the only toubble I've had using bcc is the syntax of the _asm statement.
tasm transforms the code into (after complaining about argument needing type override)
a dword move? with an offset of one? Can anyone more familiar with the TASM syntax explain that to me? ???
Microsoft .NET
I didn't have the courage to download and install the entire .NET SDK. (It contains the command line version of the Visual .Net compiler and is available for download on MSDN).
Might do it later, should be interesting to see if one can use it as well. It's supposed to be quite a high quality compiler, or so I've heard.
Two other
cool compilers are the Intel and Codplay ones. Demos and free non-commercial(Intel linux) versions can be downloaded from their sites.
Please correct any blunders I've made in this post.
Since I'm more or less a total newbe when it comes to Os programming, there's probably quite a few of them in here :-[
There seems to be alot of problems