From: marco_g Date: Sun, 11 Jul 2004 13:44:23 +0000 (+0000) Subject: 2004-07-11 Marco Gerards X-Git-Tag: 1.98~2210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=020616c2b2e0a11476c2d1cbfc344c8789b31686;p=thirdparty%2Fgrub.git 2004-07-11 Marco Gerards * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img. (pxeboot_img_SOURCES): New variable. (pxeboot_img_ASFLAGS): Likewise. (pxeboot_img_LDFLAGS): Likewise. * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy . --- diff --git a/ChangeLog b/ChangeLog index 9b321798c..081386a80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-07-11 Marco Gerards + + * conf/i386-pc.rmk (pkgdata_IMAGE): Add pxeboot.img. + (pxeboot_img_SOURCES): New variable. + (pxeboot_img_ASFLAGS): Likewise. + (pxeboot_img_LDFLAGS): Likewise. + * boot/i386/pc/pxeboot.S: New file. Based on pxeloader.S from + GRUB Legacy and boot.S. Adopted for GRUB 2 by lode leroy + . + 2004-06-27 Tomas Ebenlendr * kern/rescue.c (grub_enter_rescue_mode): Don't continue when diff --git a/boot/i386/pc/pxeboot.S b/boot/i386/pc/pxeboot.S new file mode 100644 index 000000000..2a255fbd1 --- /dev/null +++ b/boot/i386/pc/pxeboot.S @@ -0,0 +1,43 @@ +/* -*-Asm-*- */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2004 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + +/* +* defines for the code go here +*/ + + .file "pxeboot.S" + + .text + + /* Tell GAS to generate 16-bit instructions so that this code works + in real mode. */ + .code16 + +.globl _start; _start: + /* + * _start is loaded at 0x7c00 and is jumped to with CS:IP 0:0x7c00 + */ + ljmp $0, $0x8200 + + . = 0x8000 - 0x7C00 -1 + .byte 0 diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index e099b426c..03d88b841 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -4,7 +4,7 @@ COMMON_ASFLAGS = -nostdinc -fno-builtin COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 # Images. -pkgdata_IMAGES = boot.img diskboot.img kernel.img +pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S @@ -28,6 +28,28 @@ boot_img-boot_i386_pc_boot.d: boot/i386/pc/boot.S boot_img_ASFLAGS = $(COMMON_ASFLAGS) boot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 +# For pxeboot.img +pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S +CLEANFILES += pxeboot.img pxeboot.exec pxeboot_img-boot_i386_pc_pxeboot.o +MOSTLYCLEANFILES += pxeboot_img-boot_i386_pc_pxeboot.d + +pxeboot.img: pxeboot.exec + $(OBJCOPY) -O binary -R .note -R .comment $< $@ + +pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o + $(CC) -o $@ $^ $(LDFLAGS) $(pxeboot_img_LDFLAGS) + +pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S + $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(pxeboot_img_ASFLAGS) -c -o $@ $< + +pxeboot_img-boot_i386_pc_pxeboot.d: boot/i386/pc/pxeboot.S + set -e; $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(pxeboot_img_ASFLAGS) -M $< | sed 's,pxeboot\.o[ :]*,pxeboot_img-boot_i386_pc_pxeboot.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include pxeboot_img-boot_i386_pc_pxeboot.d + +pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) +pxeboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000 + # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 71f11dd9a..d8a32e9be 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -4,13 +4,18 @@ COMMON_ASFLAGS = -nostdinc -fno-builtin COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 # Images. -pkgdata_IMAGES = boot.img diskboot.img kernel.img +pkgdata_IMAGES = boot.img diskboot.img kernel.img pxeboot.img # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S boot_img_ASFLAGS = $(COMMON_ASFLAGS) boot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00 +# For pxeboot.img +pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S +pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) +pxeboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000 + # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)