Just setting up a new project and decided I would put in the Babystep bios printing code. The code so far (practically just the babystep tutorial):
Code: Select all
global boot_first
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Code ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section .text
boot_first:
xor ax, ax
mov ax, 0x07C0
mov ds, ax
mov si, msg ; This is the line that causes the error to occur
call bios_print
jmp hang
bios_print:
lodsb
or al,al
jz bios_print_done
mov ah, 0x0E
int 0x10
jmp bios_print
bios_print_done:
ret
hang:
hlt;
jmp hang;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Data ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section .data
msg db "Welcome to Coria", 13, 10, 0 ; But I think this is the problem
Code: Select all
ld -T "../depend/Kernel_Linker.ld" -m elf_i386 -o "../bin/kernel.bin" boot.o
boot.o: In function `boot_first':
boot/boot.asm:(.text+0x8): relocation truncated to fit: R_386_16 against `.data'
Any help or pointers appreciated.
Phoenix Stew.