Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,431 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,902 people online right now. Registration is fast and FREE... Join Now!




Cross compiler

 
Reply to this topicStart new topic

Cross compiler, gcc compiling

techn9kotine
11 Jan, 2008 - 01:32 PM
Post #1

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 4

Hello all. I am trying to get a working cross compiler for OS Development. I'm using XP. At first I tried DJGPP, but found problems that weren't accually there when compiling. Then I tried Cygwin, compiling was fine but when i used LD to link my start.o and other system files, it tells me , "cannot use PE operations on non-PE formats", refering to my start file assembaled in NASM. i tried outputing in A.OUT and Elf, both get the same message. Any clues as to what I'm doing wrong? THanks in advance.

_Techn9kotine
User is offlineProfile CardPM
+Quote Post

Tom9729
RE: Cross Compiler
11 Jan, 2008 - 01:39 PM
Post #2

Debian guru
Group Icon

Joined: 30 Dec, 2007
Posts: 1,463



Thanked: 10 times
Dream Kudos: 325
My Contributions
GCC has two (that I know of) native ports on Windows.
MinGW
Windows Services For Unix

You may have better luck with one of those?

This post has been edited by Tom9729: 11 Jan, 2008 - 01:40 PM
User is offlineProfile CardPM
+Quote Post

techn9kotine
RE: Cross Compiler
11 Jan, 2008 - 01:43 PM
Post #3

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 4

thanks a lot man, ill give those a try. i didnt try Min before, because i was under the impression that it was just a smaller cygwin, i havent heard of the second one. ill give then a try though. thank you.
User is offlineProfile CardPM
+Quote Post

MorphiusFaydal
RE: Cross Compiler
12 Jan, 2008 - 02:41 PM
Post #4

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,113



Thanked: 9 times
Expert In: Hardware, Networking

My Contributions
MinGW is a literal port of GCC/make to Windows, it's not semi-emulated like Cygwin is.
User is offlineProfile CardPM
+Quote Post

techn9kotine
RE: Cross Compiler
13 Jan, 2008 - 06:16 PM
Post #5

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 4

ok. used MinGW. If i output start.asm as elf with nasm, ld says no PE operations on non PE format. if i output it as aout, Format not recognized. exactly the same as before.
User is offlineProfile CardPM
+Quote Post

MorphiusFaydal
RE: Cross Compiler
13 Jan, 2008 - 06:37 PM
Post #6

D.I.C Lover
Group Icon

Joined: 12 May, 2005
Posts: 1,113



Thanked: 9 times
Expert In: Hardware, Networking

My Contributions
What commands are you using? And where?
User is offlineProfile CardPM
+Quote Post

techn9kotine
RE: Cross Compiler
13 Jan, 2008 - 06:49 PM
Post #7

New D.I.C Head
*

Joined: 11 Jan, 2008
Posts: 4

QUOTE(MorphiusFaydal @ 13 Jan, 2008 - 07:37 PM) *

What commands are you using? And where?


CODE

ld -T C:\src\link.ld -o C:\done\kernel.bin C:\done\start.o C:\done\main.o C:\done\ idt.o C:\done\gdt.o C:\done\irq.o C:\done\scrn.o C:\done\timer.o C:\done\isrs.o C:\done\kb.o


start.o seems to be the only problem. elf has that PE error and aout has the format error.
User is offlineProfile CardPM
+Quote Post

hazardoxide
RE: Cross Compiler
14 Jan, 2008 - 08:27 AM
Post #8

New D.I.C Head
*

Joined: 7 Dec, 2007
Posts: 9


My Contributions
QUOTE(techn9kotine @ 13 Jan, 2008 - 07:49 PM) *

QUOTE(MorphiusFaydal @ 13 Jan, 2008 - 07:37 PM) *

What commands are you using? And where?


CODE

ld -T C:\src\link.ld -o C:\done\kernel.bin C:\done\start.o C:\done\main.o C:\done\ idt.o C:\done\gdt.o C:\done\irq.o C:\done\scrn.o C:\done\timer.o C:\done\isrs.o C:\done\kb.o


start.o seems to be the only problem. elf has that PE error and aout has the format error.


User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 04:59AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month