Page 1 of 1

Beginner's Questions

Posted: Wed Oct 25, 2006 12:25 pm
by nitinjavakid
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

Posted: Thu Oct 26, 2006 1:46 am
by AJ
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 :oops: ). 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

Posted: Fri Oct 27, 2006 10:57 pm
by nitinjavakid
As you can see I am a begineer in this field and would like to make a small program which would print hello world while booting. Also, I would like it to be written in GAS(GNU assembler). Can you please explain me the exact procedure from compiling to making bootable binaries please...