Method of compiling boot0
David O'Brien
obrien at freebsd.org
Sun Apr 25 13:02:50 PDT 2004
On Fri, Apr 23, 2004 at 03:18:59PM -0600, Ryan Sommers wrote:
> I was browsing over the boot0 makefiles and source when I was playing with
> some boot sector code of mine and I was wondering why the designers chose
> to use objcopy to output a binary file instead of just using the --oformat
> option when it's run over the linker.
I converted most i386 boot things to use the linker options. I was
unable to us them on boot2.bin. Rather using them to produce boot2.bin
produced a different file than what is in CVS right now. I didn't have
time to track down why, but if you'd like to analyis this I'd appreciate
it.
Index: i386/boot2/Makefile
===================================================================
RCS file: /home/ncvs/src/sys/boot/i386/boot2/Makefile,v
retrieving revision 1.55
diff -u -r1.55 Makefile
--- i386/boot2/Makefile 17 Feb 2004 07:13:03 -0000 1.55
+++ i386/boot2/Makefile 25 Apr 2004 19:53:01 -0000
@@ -53,7 +53,7 @@
boot1.out: boot1.o
${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
-CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
+CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.o \
boot2.s boot2.s.tmp boot2.h sio.o
boot2: boot2.ld
@@ -68,11 +68,8 @@
boot2.ldr:
dd if=/dev/zero of=${.TARGET} bs=276 count=1
-boot2.bin: boot2.out
- objcopy -S -O binary boot2.out ${.TARGET}
-
-boot2.out: ${BTXCRT} boot2.o sio.o
- ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
+boot2.bin: ${BTXCRT} boot2.o sio.o
+ ${LD} ${LDFLAGS} -Ttext ${ORG2} -S --oformat binary -o ${.TARGET} ${.ALLSRC}
boot2.o: boot2.s
--
-- David (obrien at FreeBSD.org)
More information about the freebsd-hackers
mailing list