Page 1 of 1
Help to get my bootloader to load my kernel??
Posted: Mon Oct 07, 2002 12:36 am
by TheVillageIdiot
[attachment deleted by admin]
Re:Help to get my bootloader to load my kernel??
Posted: Mon Oct 07, 2002 3:28 am
by TheVillageIdiot
Hail again,
OK i know its only been 2 hours, but it feels like bloody ages. hehehe.
I've made some changes:
In the file MakeKernel.bat the line that reads:
ld -Ttext 0xFF800000 --oformat binary -o kernel.bin kernel.o kernel_c.o
Has been changed to:
ld -Ttext 0x00001000 --oformat binary -o kernel.bin kernel.o kernel_c.o
That's to tell my compiler where to expect the kernel to be. Since i was asking my bootloader to load it at 0x1000 then i must tell my kernel compiler the same.
:P
Anyways, i'm gonna keep at it. Talk to yous later i suppose.
:)
Regards,
----------------------
TheVillageIdiot
Re:Help to get my bootloader to load my kernel??
Posted: Mon Oct 07, 2002 6:45 am
by Tom
Well, try testing the code without Bochs.
Re:Help to get my bootloader to load my kernel??
Posted: Mon Oct 07, 2002 9:32 am
by TheVillageIdiot
Hey,
Thanks for your post Tom.
I tried it, and it still ain't working. There's got to be some little thing wrong that i just can't see.
Oh well.....Into the breach dear friends.....
----------------------
TheVillageIdiot
Re:Help to get my bootloader to load my kernel??
Posted: Mon Oct 07, 2002 11:56 am
by TheVillageIdiot
Hey again,
Hmmm......still no luck.
Anyways its 2am so i'm going to bed. I'll sleep on it and see how i go tommorrow.
Regards,
----------------------
TheVillageIdiot
Re:Help to get my bootloader to load my kernel??
Posted: Wed Oct 09, 2002 6:01 pm
by .bdjames
1) You are not compiling your kernel
2) You are not linking to your kernel
NASM -o stub.o -f coff kernel.asm
GCC -O2 -fomit-frame-pointer -c -o kernel.o kernel_c.c
ld --oformat=binary --entry=start --Ttext=0x1000 --output kernel.bin stub.o kernel.o
I suggest using gas and makefiles for your kernel:
.code32
.global start
start: jmp _c_main
Re:Help to get my bootloader to load my kernel??
Posted: Thu Oct 10, 2002 2:15 am
by Pype.Clicker
using gas ?? gasp!
Re:Help to get my bootloader to load my kernel??
Posted: Thu Oct 10, 2002 2:18 am
by Whatever5k
I wouldn't use GAS either...the syntax is so complicated...
Rather use Nasm
Re:Help to get my bootloader to load my kernel??
Posted: Thu Oct 10, 2002 3:05 am
by grey wolf
i can use the more familiar syntax if you add this line to the top of your .S files:
.intel_suntax no_prefix
then no more % before the register name, and no more source before destination. nice, clean Intel Syntax.
(BTW, GAS's syntax is called AT&T syntax)
Re:Help to get my bootloader to load my kernel??
Posted: Thu Oct 10, 2002 11:06 am
by .bdjames
I did not like gcc/gas until I read about extended inline
assembly. It is so much better than any other combination.
Yes AT&T is ugly and gas is buggy, but I like keeping it
simple:one assembler, one compiler, one linker.
Re:Help to get my bootloader to load my kernel??
Posted: Fri Oct 11, 2002 10:26 am
by dronkit
it makes more sense to me to write:
to load 0xFh in eax than
and why is gas buggy?
I think this is all a matter of personal taste. Like using masm or tasm or a86 or whatever.
(but if you use gas you can use gdb easier)
Re:Help to get my bootloader to load my kernel??
Posted: Fri Oct 11, 2002 2:55 pm
by .bdjames
Try using unreal mode in gas
Re:Help to get my bootloader to load my kernel??
Posted: Fri Oct 11, 2002 2:57 pm
by dronkit
that's because gas was not intended to be used to write 16 bits applications...
Re:Help to get my bootloader to load my kernel??
Posted: Sun Nov 17, 2002 2:43 pm
by svempa
When you are setting up your stack.
....................................
cli
mov ax,0x9000
mov ss,ax
mov sp,0xFFFF
;<--- sti is missing right? So that you can print the message through int 10h
mov si, BootMsg
call PrintStr
....................................
Re:Help to get my bootloader to load my kernel??
Posted: Sun Nov 17, 2002 3:21 pm
by Tom
why did you bring up such a old message?