is it possible to do a far like this:
Code: Select all
initseg:
.word 0x0050
initoff:
.word 0x0000
ljmp initseg, initoff # does not work
ljmp $0x0050, $0x0000 # works
Code: Select all
initseg:
.word 0x0050
initoff:
.word 0x0000
ljmp initseg, initoff # does not work
ljmp $0x0050, $0x0000 # works
Code: Select all
BOOTDEV = 0x01ff
BOOTSEG = 0x07c0
INITSEG = 0x0050
.section .rodata
msg:
.asciz "booting..."
msgend:
msglen:
.word (msgend - msg)
errmsg:
.asciz "disk error!"
errmsgend:
errmsglen:
.word (errmsgend - errmsg)
.section .text
.globl Start
Start:
.code16
ReloadCsIp:
movw $BOOTSEG, %ax
movw %ax, %ds # Set Data Segment
movw %ax, %es # Set Extra Segment
movw %ax, %fs # Set Data2 Segment
movw %ax, %gs # Set Data3 Segment
movw %ax, %ss # Set Stack Segment
ljmp $BOOTSEG, $SaveDev
SaveDev:
movb %dl, BOOTDEV # Save Boot Device to Memory
.
.
.
.
...