This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ld: cannot perform PE operations on non PE output file 'bootsect'.


Hi all,

I have a problem compiling the bootsect.S file above using the Makefile. Basically the project create a boot sector on floppy that print "Hello World" at compuer boot.
On Linux it works fine but in cygwin I go the following link problem:


*ld: cannot perform PE operations on non PE output file 'bootsect'.

*In the cygwin mail archive I saw question like this without response please can someone suggest me what is wrong in my Makefile and what I have to change?
To build the project do the following steps:


1. download the two file in a directory <dir>
2. in cygwin move to this directory
3. type make

In linux the final file bootsect should have a size of 512 bytes. Using the command

make disk

you can copy it on a floppy making it bootable.

PS
I am not subscribed to this mail list so, please, put my address in cc
Thanks in advance for your help.
AS=as
LD=ld

all: bootsect

bootsect: bootsect.o
	@echo "[LD] $@"
	@$(LD) -Ttext 0x0 -s --oformat binary -o $@ $<

bootsect.o: bootsect.S
	@echo "[AS] $@"
	@$(AS) -o $@ $<

disk: image
	@echo "[DISK]"
	@dd if=image of=/dev/fd0 bs=512

image: bootsect
	@echo "[KERNEL IMAGE]"
	@cat bootsect > image

clean:
	@echo [CLEAN]
	@rm -rf *.o image bootsect
.code16
.text

.global _start

_start:
    movb $0xE, %ah              # Function 0x0E of Interrupt 0x10
    movb $'H', %al              # write 'H'
    int  $0x10
    movb $'e', %al              # write 'e'
    int  $0x10
    movb $'l', %al              # write 'l'
    int  $0x10
    movb $'l', %al              # write 'l'
    int  $0x10
    movb $'o', %al              # write 'o'
    int  $0x10
    movb $' ', %al              # write ' '
    int  $0x10
    movb $'W', %al              # write 'W'
    int  $0x10
    movb $'o', %al              # write 'o'
    int  $0x10
    movb $'r', %al              # write 'r'
    int  $0x10
    movb $'l', %al              # write 'l'
    int  $0x10
    movb $'d', %al              # write 'd'
    int  $0x10
    movb $'!', %al              # write '!'
    int  $0x10
    movb $'!', %al              # write '!'
    int  $0x10
    movb $'!', %al              # write '!'
    int  $0x10
    ret

.org 510# Last 2 bytes of the boot sector.

boot_flag:		.word 0xAA55	# Flag indicating a boot disk

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]