My code don't work(agin)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Atom
Posts: 10
Joined: Sun Apr 25, 2010 8:50 am
Location: Aracaju,Brazil

My code don't work(agin)

Post by Atom »

Ok i try to compile my code and he gives that error:
build.bat

Code: Select all

@echo off
echo Agora montando, compilando, e juntando seu kernel:
C:\djgpp\bin\nasm -f elf -o start.o start.s
rem Lembre-se neste ponto aqui: Nós vamos adicionar comandos 'gcc' para compilar as fontes em C


C:\djgpp\bin\gcc -Wall -O -nostdlib  -nostdinc -fno-builtin -fno-exceptions -I./include -c -o main.o main.c
C:\djgpp\bin\gcc -Wall -O -nostdlib  -nostdinc -fno-builtin -fno-exceptions -I./include -c -o monitor.o monitor.c
C:\djgpp\bin\gcc -Wall -O -nostdlib  -nostdinc  -fno-builtin -fno-exceptions -I./include -c -o common.o common.c

rem Este junta todos seus arquivos. Lembre-se de como você adiciona arquivos *.o, você precisa
rem adicionar após start.o. Se você não adicionar eles de qualquer modo, eles não estarão em seu kernel!
C:\djgpp\bin\ld -T link.ld -o kernel.elf start.o main.o monitor.o common.o 
echo Limpando arquivos objetos...
del *o
echo Feito!
pause
erro

Code: Select all

start.o file not recognized: File format not recognized
I'm using gcc
Can somebody help me?
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: My code don't work(agin)

Post by pcmattman »

Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: My code don't work(agin)

Post by Gigasoft »

Or use the correct output format with nasm. DJGPP uses coff, so you should have -f coff.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: My code don't work(agin)

Post by Solar »

Use English-language comments and output. (I assume your code looks similar to your build script.) When the time comes to ask for help, it makes things much more readable for the international audience you get in forums like this one.
Every good solution is obvious once you've found it.
Atom
Posts: 10
Joined: Sun Apr 25, 2010 8:50 am
Location: Aracaju,Brazil

Re: My code don't work(agin)

Post by Atom »

Solar wrote:Use English-language comments and output. (I assume your code looks similar to your build script.) When the time comes to ask for help, it makes things much more readable for the international audience you get in forums like this one.
Oh,sorry #-o
And gus thanks for the help!
Post Reply