need help compiling source
need help compiling source
I need some help compiling my sources. I have four files that I need to link together and run. My code is set up like this:
Bootsector - > Second stage loader - > third stage - > c kernel.
I have tried compiling but it won't work. Can somebody give me a example on how to compile more than just two files. Any help would be appreciated.
By the way, I using the DJGPP port of gcc tools for Windows.
Bootsector - > Second stage loader - > third stage - > c kernel.
I have tried compiling but it won't work. Can somebody give me a example on how to compile more than just two files. Any help would be appreciated.
By the way, I using the DJGPP port of gcc tools for Windows.
Re:need help compiling source
Well:
gcc -c somefile.c -o somefile.o
nasm -f coff someasm.asm -o someasm.o
Look in my install.sh for LD and objectcopy commands. There are ports for object copy.
gcc -c somefile.c -o somefile.o
nasm -f coff someasm.asm -o someasm.o
Look in my install.sh for LD and objectcopy commands. There are ports for object copy.
Re:need help compiling source
Tom, your install.h doesn't help me. I have a bootsector that loads my second stage loader. How would I compile them together? The second-stage loader loads into pmode and jumps to 0x1000. I then have another file load my c kernel.
I compiled my source but when I run it in bochs I get this error:
This is how I am compiling my code:
I have a feeling that I'm not compiling my code right. Can anybody help me.
I compiled my source but when I run it in bochs I get this error:
Code: Select all
00000237336i[BIOS ] FATAL: Not a bootable disk
00000237635p[BIOS ] >>PANIC<< BIOS panic at rombios.c, line 1550
Code: Select all
nasm -f aout -o mboot.o mboot.o
nasm -f aout -o mloader.o mloader.o
ld -Ttext=0x1000 --oformat binary -o boot.bin mboot.o mloader.o
gcc -ffreestanding -c kernel.c -o kernel.o
nasm -f aout load.asm -o load.o
ld -Ttext=0x1000 --oformat binary -o kernel32.bin kernel.o load.o
makeboot test.img boot.bin kernel32.bin
Re:need help compiling source
Hi,
Why do you want to link them together??
And why the heck do you have a third stage loader?? You could've put it all in the Second Stage Loader!
Cya.
Why do you want to link them together??
And why the heck do you have a third stage loader?? You could've put it all in the Second Stage Loader!
Cya.
Re:need help compiling source
Code: Select all
Why do you want to link them together??
Code: Select all
And why the heck do you have a third stage loader?? You could've put it all in the Second Stage Loader!
Re:need help compiling source
Here's what I did:
Bootloader, sets pmode, gdt, loads 2nd stage loader with C kernel.
2nd loader:
new bigger GDT with more power
externel functions
Kernel linked with 2nd loader:
Your stuff.
Bootloader, sets pmode, gdt, loads 2nd stage loader with C kernel.
2nd loader:
new bigger GDT with more power
externel functions
Kernel linked with 2nd loader:
Your stuff.
Re:need help compiling source
But a seperat 2nd stage loader and a 3rd linked with kernel gives you more flexibility, but causes more bugs and probs.
Re:need help compiling source
I've already figured that out Tom ;D
If your not too busy, can you help me with objcopy?
If your not too busy, can you help me with objcopy?
Re:need help compiling source
Yea...how come the command line info in install.sh doesn't help? ( need to open it up with Wordpad...not notepad)
Re:need help compiling source
Opening up your install.sh file in wordpad is no problem. What I don't understand is the different command-line options you are using.
I've tried to look at the gnu manuals and its like trying to pull gum out of your hair.
So your help would be appreciated.
I've tried to look at the gnu manuals and its like trying to pull gum out of your hair.
So your help would be appreciated.
Re:need help compiling source
Sorry about that Tom. I figured out my problem. I'm at school right now, so I won't be able to test it till later.
If I still have problems, I send you a reply for help.
If I still have problems, I send you a reply for help.
Re:need help compiling source
I don't even know the options i'm typing in!
At least it just works for me...
At least it just works for me...