OK - my boot sector get loaded 0x7C00.
Question 1:
CS:0x200 is the end of the running boot loader. Right? If not, what is it?
Question 2:
How do I access memory just after the boot loader. I have been trying to do the equivelent of the following pseudo code:
BX = CS:0x200 + [offset]
where offset is a 16 bit number I have defined, but I'm still trying to come up to speed on ASM and the syntax is getting me.
Can anyone help me out?
Thanks
_mark()
segments and NASM help again
Re:segments and NASM help again
One last question if I may, then things should be working...
MOV BX, [koff]
MOV AX, [kseg]
; JMP AX:BX
JMP 0800:0000
HLT
How can I jump to the kernel at [kseg]:[koff]. I have
tried numerous things, but I cannot seem to land on the right way to do it?
Thanks
_mark()
MOV BX, [koff]
MOV AX, [kseg]
; JMP AX:BX
JMP 0800:0000
HLT
How can I jump to the kernel at [kseg]:[koff]. I have
tried numerous things, but I cannot seem to land on the right way to do it?
Thanks
_mark()
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:segments and NASM help again
check the instruction set in the documentations coming with NASM.
What you probably want is something like
farptr:
dd k_offset
dw k_segment
jmp [farptr]
What you probably want is something like
farptr:
dd k_offset
dw k_segment
jmp [farptr]
Re:segments and NASM help again
Great, that is the syntax I was looking for. Now just one question about your example. Why is it you have the offset 4 bytes and the segment second. I would have expect to see both 16 bit values with the segment first:
farptr:
DD kseg
DD koff
My code is a boot loader running in real-mode.
Thanks
_mark
farptr:
DD kseg
DD koff
My code is a boot loader running in real-mode.
Thanks
_mark
Re:segments and NASM help again
by trial and error, it seems like the offset does come first. Anyone know the reason for that, it seems backwards to me.
BTW:
From the manual I found that:
JMP FAR WORD [kernel]
was not required, but made it more clear to me that it was 16 bit.
Mark
BTW:
From the manual I found that:
JMP FAR WORD [kernel]
was not required, but made it more clear to me that it was 16 bit.
Mark