Booting my kernel [Fixed]

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.
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: Booting my kernel

Post 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
Attachments
configargs.h
(353 Bytes) Downloaded 124 times
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: Booting my kernel

Post 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:)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Booting my kernel

Post by Combuster »

Have you set cygwin to unix line endings and binary format during installation?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: Booting my kernel

Post 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
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: Booting my kernel

Post 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?
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: Booting my kernel

Post by xDDunce »

put a "./" in front of each path. this makes it relative to the current directory (or atleast enforces it).
computafreak
Member
Member
Posts: 76
Joined: Sun Dec 14, 2008 1:53 pm

Re: Booting my kernel

Post 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
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Booting my kernel

Post by Troy Martin »

computafreak wrote:

Code: Select all

#!/bin/csh
Yucky, csh. <-- bash propaganda
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply