I was trying to compile a simple kernel like in the mega-tokyo os faq.
int main() {
}
I run:
gcc -c main.c
then I try to link,
ld --oformat binary -Ttext 1x100000 -o kernel.bin main.o
However I get the error - ld: PE operations on non PE file.
What is wrong? How do I fix this? When gcc -c is run does it format the .o file for pei386 automatically? If so, is there an argument I can pass to gcc at compile time?
ld: PE operations on non PE file
Re:ld: PE operations on non PE file
This is normal behaviour for Cygwin. Link to PE format (don't specify --oformat binary) then use objcopy to copy from PE to binary.
Re:ld: PE operations on non PE file
search the forum, ive written quite a few posts on this topic
-- Stu --