I tried one of the examples from
http://www.osdev.org/osfaq2/index.php/AsmExample
.code16
.text
mov $0x07C0, %ax
mov %ax, %ds
mov $msg, %si
1: lodsb
or %al,%al # zero=end of str
jz 2f # get out
mov $0x0E, %ah
int $0x10
jmp 1b
2:
jmp 2b
msg: .asciz "Welcome to Macintosh\n"
.org 510
.word 0xAA55
ld --oformat binary --Ttext 0x7C00 -o temp.bin temp.o
it shows me the following error while linking it using the above ld command:(
ld: cannot perform PE operations on non PE output file
Beginner's Questions
- nitinjavakid
- Member
- Posts: 65
- Joined: Sat Oct 21, 2006 11:28 am
- Location: Exams over!
- Contact:
Hello,
I have had this problem before with the version of LD distributed with DJGPP (I use a WinXP development machine), when I was creating my kernel.
LD did not like trying to link flat binaries (which I suppose, makes sense ). I fixed it by assembling in to A.OUT and then letting the linker create the flat binaries - maybe that will help.
Just one thing - I have never had to manually link my boot sector. I guess it must be because you are using different tool chain?
Adam
I have had this problem before with the version of LD distributed with DJGPP (I use a WinXP development machine), when I was creating my kernel.
LD did not like trying to link flat binaries (which I suppose, makes sense ). I fixed it by assembling in to A.OUT and then letting the linker create the flat binaries - maybe that will help.
Just one thing - I have never had to manually link my boot sector. I guess it must be because you are using different tool chain?
Adam
- nitinjavakid
- Member
- Posts: 65
- Joined: Sat Oct 21, 2006 11:28 am
- Location: Exams over!
- Contact: