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
How can i put my kernel to 1000h:000 ?!
Re:How can i put my kernel to 1000h:000 ?!
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.
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.
Re:How can i put my kernel to 1000h:000 ?!
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
ld -Ttext 0x00010000
Re:How can i put my kernel to 1000h:000 ?!
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 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
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.
Re:How can i put my kernel to 1000h:000 ?!
[joke, don't try]
dd if=kernel.sys of=/dev/mem seek=65536
[/joke, don't try]
dd if=kernel.sys of=/dev/mem seek=65536
[/joke, don't try]
Re:How can i put my kernel to 1000h:000 ?!
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.And if you're using C/C++/any high level programming language/ you should link it to 0x10000
Re:How can i put my kernel to 1000h:000 ?!
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.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.
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.