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.
use16
org 0x10000
jmp start
; 16-bit includes
....
; boot code here
start:
jmp pword 0x08:start_32
use32
start_32:
;code continues here
...
When ever I try to assemble it, FASM throws a "value out of range" error for "jmp start". I know the position of my start label has nothing to do with it, as "jmp $" also returns a "value out of range" error.
I remember solving this problem before, but after reading over my old source file and the source of various other OS's I really have no idea what to do. Maybe the problem is I'm tired and need some sleep.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Fill free space with zeroes ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
times 510- ($-0) db 0
;;;;;;;;;;;;;;;;;;;;;;;;;;
;; End of the sector ID ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
dw 0xaa55
But that give a differant error
or is you org ?????
in the right place ?.
I'm sure it's 0x10000. When I start in realmode, I am starting from 0, and accessing memory as [pointer - 0x10000], but when I enter real mode, memory locations are correct.
I think I may be able to fix it by 'jumping' to '[start - 0x10000]' instead of just 'start'. I'll try it later when I'm home.
MessiahAndrw wrote:
I think I may be able to fix it by 'jumping' to '[start - 0x10000]' instead of just 'start'. I'll try it later when I'm home.
jumping to "start - 0x10000" would definitely increase your chances, but beware that "jmp [start - 0x10000]" would just mean "pick a value at memory address (start - 0x10000) and then jump there".