Help to get my bootloader to load my kernel??
Re:Help to get my bootloader to load my kernel??
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
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??
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
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??
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
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??
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
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
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Help to get my bootloader to load my kernel??
I wouldn't use GAS either...the syntax is so complicated...
Rather use Nasm
Rather use Nasm
Re:Help to get my bootloader to load my kernel??
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)
.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??
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.
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??
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)
Code: Select all
movl $0xF, %eax
Code: Select all
mov eax, 0Fh
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??
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??
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
....................................
....................................
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
....................................