i have a little trouble with my asm loader.
I have this error code from linker:
Code: Select all
loader.o(.text+0x4):loader.o: relocation truncated to fit: 16 .text
loader.o(.text+0x11):loader.o: relocation truncated to fit: 16 .text
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
*(.rodata)
. = ALIGN(4096);
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
Code: Select all
[BITS 16]
[global start]
[extern _main]
start:
cli
lgdt [gdtr]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp 0x08:pmode32
gdtr:
dw gdt - gdtend - 1
dd gdt
gdt:
dd 0x00000000, 0x00000000
dd 0x0000FFFF, 0x00CF9A00
dd 0x0000FFFF, 0x00CF9200
dd 0x0000FFFF, 0x00CFFA00
dd 0x0000FFFF, 0x00CFF200
gdtend:
[BITS 32]
pmode32:
mov ax, 0x10
mov ds, ax
mov es, ax
mov ss, ax
xor ax, ax
mov fs, ax
mov gs, ax
mov esp, 0x200000
call _main
jmp $