Page 2 of 2

Re: Booting my kernel

Posted: Sat Jan 10, 2009 2:25 pm
by computafreak
I've tried to build the cross-compiler, but I've got four compilation errors when I run 'make all-gcc'. They are as follows:
configargs.h: lines 2 and 3: missing terminating " character
configargs.h: line 4: parse error before 'static'
gcc.c: line 6281: thread_model undeclared
The commands I used are the same as the ones used in the GCC Cross-Compiler. I've attached configargs.h to my message, and I'll link to gcc.c if that would help

Re: Booting my kernel

Posted: Sat Jan 10, 2009 7:35 pm
by xDDunce
i advise DJGPP. just because i have had the exact same experience as you, and DJGPP is a hell of alot easier than building a cross compiler. (although the download has become a bit confusing whenit starts getting late...:lol:)

Re: Booting my kernel

Posted: Sun Jan 11, 2009 3:28 am
by Combuster
Have you set cygwin to unix line endings and binary format during installation?

Re: Booting my kernel

Posted: Sun Jan 11, 2009 6:43 am
by xDDunce
how do you do that? i neevr knew you had to do that in order to compile it. no wonder i've been going wrong :O

Re: Booting my kernel

Posted: Sun Jan 11, 2009 7:24 am
by computafreak
Thanks; my cross-compiler's working now. But now, my source files won't even compile. My new build script is below

Code: Select all

#!/bin/csh
nasm -f elf -o Boot.o Assembly/Boot.s
nasm -f elf -o Interrupts.o Assembly/Interrupts.s
nasm -f elf -o DescriptorTables.o Kernel/DTables.s
i586-elf-g++ -c Kernel/Boot.cpp -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o Main.o
i586-elf-g++ -c Kernel/Common.cpp -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o Common.o
i586-elf-g++ -c Kernel/Console.cpp -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o Console.o
i586-elf-g++ -c Kernel/DTables.cpp -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o CDescriptorTables.o
i586-elf-g++ -c Kernel/ISR.cpp -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o ISR.o
i586-elf-g++ -c Kernel/Timer.cpp -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o Timer.o
i586-elf-ld -T Link.ld -o Output/kernel Boot.o Interrupts.o DescriptorTables.o Main.o Common.o Console.o CDescriptorTables.o ISR.o Timer.o
rm *.o
I've add the location of the cross-compiler's location to my path variable, but the files don't get found. I've changed to the correct directory, but get several errors:
asm: fatal: unable to open input file
No such file or directory

The strange thing is, I can actually see the files in Windows Explorer. The paths are correct, and if I run the nasm and g++ commands in the usual Cygwin shell, they work correctly. This approach doesn't work with the linker, though. What's going wrong?

Re: Booting my kernel

Posted: Sun Jan 11, 2009 7:35 am
by xDDunce
put a "./" in front of each path. this makes it relative to the current directory (or atleast enforces it).

Re: Booting my kernel

Posted: Sun Jan 11, 2009 7:41 am
by computafreak
I've just done that. Nothing has changed apart from the files which aren't found, but still exist, now have a ./ in front. Incidentally, Cygwin can definitely 'see' the files on its own

Edit: After a little poking around, I've found the problem. I was coding the script file in Notepad, a Windows application. This means that it's saving the script with a \r\n delimiting the lines. Cygwin was expecting a different delimiter. I changed the installation to Windows/Text mode in the install program, and everything started working! Thanks to anyone who posted in the thread

Re: Booting my kernel

Posted: Sun Jan 11, 2009 2:41 pm
by Troy Martin
computafreak wrote:

Code: Select all

#!/bin/csh
Yucky, csh. <-- bash propaganda