16bit program
Posted: Sun May 09, 2010 10:26 pm
first,i am sorry i know only a littleenglish.
souce code:
boot.s
***************************************************************************************
loadfile.s
Makefile
error:
as -o boot.o boot.s
as -o loadfile.o loadfile.s
ld -s -o boot boot.o loadfile.o --oformat=binary -Ttext 0x0
boot.o: In function `go':
(.text+0x11): relocation truncated to fit: R_386_PC16 against `_loadDisk'
make: *** [boot] Error 1
souce code:
boot.s
Code: Select all
.code16
4
5 .global _start
6
7 .text
8
9 _start:
10 jmp $0x7c0 ,$go
11
12 go:
13 movw %cs , %ax
14 movw %ax , %ds
15 movw %ax , %es
16
17 movw %ax , %ss
18
19 movw $0x8000 ,%sp
20
21 call _loadDisk
22 .org 1024*1024 #error more than 1M
loadfile.s
Code: Select all
.code16
.global _loadDisk
.text
_loadDisk:
nop
ret
Code: Select all
all:boot
2
3 boot:boot.s loadfile.s
4 as -o boot.o boot.s
5 as -o loadfile.o loadfile.s
6 ld -s -o boot boot.o loadfile.o --oformat=binary -Ttext 0x0
as -o boot.o boot.s
as -o loadfile.o loadfile.s
ld -s -o boot boot.o loadfile.o --oformat=binary -Ttext 0x0
boot.o: In function `go':
(.text+0x11): relocation truncated to fit: R_386_PC16 against `_loadDisk'
make: *** [boot] Error 1