Bootloader Help
Re:Bootloader Help
Do I need to do a far jump to start my second stage or are you talking about when I transfer control?
Re:Bootloader Help
You are using [ORG 0x0000] which to me implys that you are far jumping so that CS=0x800 (or wherever you put the next stage), unless you have physically loaded the next stage at 0000:0000 which would be very very bad (Override the Interrupt Vector Table and the BIOS)
If you are merely tacking a second bootsector onto the end of the first sector and saying that they are part of the same "program" then your ORG is the problem.
If you are merely tacking a second bootsector onto the end of the first sector and saying that they are part of the same "program" then your ORG is the problem.
Re:Bootloader Help
Yea I far jumped to 0000:800
I added what you said and I'm still getting bad output :[
I added what you said and I'm still getting bad output :[
Re:Bootloader Help
If your far jump is jmp 0000:8000 then the ORG should be [ORG 0x8000], ORG is the offset from the start of the CS segment (and implicitly the DS segment as well), since CS=0 you want to tell the assembler that your are at offset 0x8000 from 0.
Re:Bootloader Help
Holy wow, that fixed it. I was putting 0x0000 for the segment :[
Thanks alot AR!
Thanks alot AR!
Re:Bootloader Help
Isn't it like this:0000:8000 then the ORG should be [ORG 0x8000]
0x8000:0x0000 then the ORG should be [ORG 0x8000]
0x0000:0x8000 then the ORG should be [ORG 0x800]
?
And using something like [ORG 0x10000] in realmode, does that really work? I doubt it..
Re:Bootloader Help
No. In realmode 0x8000:0x0000 should be [ORG 0x0], because it's at offset 0. Now in protected mode it should be like [ORG 0x80000] because 0x8000*0x10+0x0=0x80000bubach wrote:Isn't it like this:0000:8000 then the ORG should be [ORG 0x8000]
0x8000:0x0000 then the ORG should be [ORG 0x8000]
0x0000:0x8000 then the ORG should be [ORG 0x800]
?
Just try to distinguish the difference of realmode and protected mode. (also with offsets)
Now you can see why the second is also wrong.
Re:Bootloader Help
Generic:
location <segment>:<offset> -> ORG is offset.
So, for 0x800:0x0 -> ORG 0x0
0x0:0x8000 -> ORG 0x8000
0x400:0x4000 -> ORG 0x4000
0x3FF:0x4010 -> ORG 0x4010
All the same address btw.
location <segment>:<offset> -> ORG is offset.
So, for 0x800:0x0 -> ORG 0x0
0x0:0x8000 -> ORG 0x8000
0x400:0x4000 -> ORG 0x4000
0x3FF:0x4010 -> ORG 0x4010
All the same address btw.