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.
I tried to change my bootlader setting to load my code in 0000h segment with offset (real mode) 500h (5000h normal mem ), and my code got org 5000h and it worked in real mode now, but when i loaded gdt and turned in pmode i can't jump in my code to change cs.
Probably the most commonly used are GRUB/GRUB2. There are pages about bootloaders on the wiki and searching for GRUB will lead you to the downloads / manual.
czlowieczek wrote:I tried to change my bootlader setting to load my code in 0000h segment with offset (real mode) 500h (5000h normal mem ), and my code got org 5000h and it worked in real mode now, but when i loaded gdt and turned in pmode i can't jump in my code to change cs.
In real mode, 0000h:0500h is 500h linear, not 5000h. Was that a typo, or is your addressing off?
Those who understand Unix are doomed to copy it, poorly.
But in real mode segment part [i_mean_this]:[not_this] is shl 4 500h shl 4 = 5000h, but doesn't matter It wasn't working with org 5000h , I am trying to install grub on floppy, but I don't know will it work
If you are using flat protected mode, with all the segments based at zero, then before switching to protected mode the cs:ip at the entry point to your code should (in theory) be 0:0x80000 and the org (in theory) should be 0x80000 - so that offset addresses before and after switching to protected mode were the same. Except that ip can't be loaded with 0x80000, because it is a sixteen bit register.
The obvious solution to your problem is to switch to protected mode before leaving the boot loader. Then the eip register will be available for any jumps you want to make. You can set up a temporary GDT for the purpose.
I wrote new bootloader with protected mode enabling, but i have error in nasm 'mov bp, ??' :FCFD My error is at eip 0x7D6A, I think that the last error in my code
The whole point of this whole thing is that you learn how to debug. Not throw away code and rewrite something until it just happens to work.
In other words, I'm getting the idea you haven't quite learned how to program yet and you're trying something way above your league.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]