How can i put my kernel to 1000h:000 ?!

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.
Post Reply
KiBOrG

How can i put my kernel to 1000h:000 ?!

Post by KiBOrG »

I have bootloader a it loaded some soctors from diskette
a then jump to 1000h:0000 and i dont know how i can put my kernet there.

Please Help me,

when you know some url with os turorials
please send me it.

Thank

KiBOrG
Kershplat

Re:How can i put my kernel to 1000h:000 ?!

Post by Kershplat »

Why not just tell the BIOS, instead of loading it wherever you told it to, to load it to 0x1000:0 ?

If you're looking to relocate data loaded with the BIOS, look into the stosb instruction. Although really, the address you're using isn't above the 1 meg mark, so you don't need to, just tell the BIOS to put it there; it can, and you don't have to move it.

es:bx, I think it is for the BIOS.
slash

Re:How can i put my kernel to 1000h:000 ?!

Post by slash »

To put your kernel at 1000h:000 you should compile it and relocate its "text" segment to 10000h(segment*10 + offset).For example linking the kernel using GNU "ld" you should use the following command :

ld -Ttext 0x00010000
DennisCGc

Re:How can i put my kernel to 1000h:000 ?!

Post by DennisCGc »

To put your kernel at 1000h:000 you should compile it and relocate its "text" segment to 10000h(segment*10 + offset).For example linking the kernel using GNU "ld" you should use the following command :

ld -Ttext 0x00010000
That doesn't put the kernel to 0x1000:0000, now does it ? If I'll do that, but the bootloader does load it to 0x2000:0000 it will be put to 0x2000:0000.
To put it to 0x1000:0000 you should set es to 0x1000 and bx to 0 before the actually loading.
And if you're using C/C++/any high level programming language/ you should link it to 0x10000.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:How can i put my kernel to 1000h:000 ?!

Post by Candy »

[joke, don't try]
dd if=kernel.sys of=/dev/mem seek=65536
[/joke, don't try]
slash

Re:How can i put my kernel to 1000h:000 ?!

Post by slash »

And if you're using C/C++/any high level programming language/ you should link it to 0x10000
Thats what I meant.I didn't say the kernel will be put there I only meant that when the bootloader puts the kernel at 1000:000 and execute it,the kernel will look for code at 0x1000.
B.E

Re:How can i put my kernel to 1000h:000 ?!

Post by B.E »

KiBOrG wrote: I have bootloader a it loaded some soctors from diskette
a then jump to 1000h:0000 and i dont know how i can put my kernel there.
I think you blindly copied the loading sectors (if not the whole bootloader) code from somewhere and said you have a bootloader. I suggest you write your own or even just study the code.

By the way to put the kernal at 1000h:000 do what DennisCGc said:
To put it to 0x1000:0000 you should set es to 0x1000 and bx to 0 before the actually loading.
Post Reply