Received: from list by monty-python.gnu.org with archive (Exim 4.34) id 1BRnuL-0005OP-7W for mharc-grub-devel@gnu.org; Sun, 23 May 2004 04:00:33 -0400 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BRlVN-0008QO-EA for grub-devel@gnu.org; Sun, 23 May 2004 01:26:37 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BRlUk-0008G3-2M for grub-devel@gnu.org; Sun, 23 May 2004 01:26:31 -0400 Received: from [212.250.162.6] (helo=dircache04-winn.maildmz.private.ntl.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BRlUh-0008DW-9a for grub-devel@gnu.org; Sun, 23 May 2004 01:25:57 -0400 Received: from bfg.reinhouse.freeserve.co.uk ([217.137.179.35]) by dircache03-winn.maildmz.private.ntl.com with SMTP id <20040522124746.HBJV10774.dircache03-winn.maildmz.private.ntl.com@bfg.reinhouse.freeserve.co.uk> for ; Sat, 22 May 2004 13:47:46 +0100 Received: from tim by bfg.reinhouse.freeserve.co.uk with local (Exim 4.32) id 1BRVty-0000hk-MP for grub-devel@gnu.org; Sat, 22 May 2004 13:46:58 +0100 From: Timothy Baldwin To: grub-devel@gnu.org Date: Sat, 22 May 2004 13:46:32 +0100 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-03=_ou0rAIYga/9iRJN"; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200405221346.32847.timothy.baldwin1@tesco.net> Sender: Timothy Baldwin Subject: RISC OS/ARM port X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 08:00:28 -0000 --Boundary-03=_ou0rAIYga/9iRJN Content-Type: multipart/mixed; boundary="Boundary-01=_ou0rAyM/4WeLPYH" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_ou0rAyM/4WeLPYH Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I am working on a port to (ex-Acorn) RISC OS, which currently gets as far a= s=20 rescue mode. RISC OS is supplied in ROM or flash with many systems, including desktop=20 systems made by Acorn and it's sucessors, various set-top boxes, and the Bu= sh=20 Internet TV. I have used upper case thoughout for RISC OS as riscos is a=20 different operating system. Things to do: Discs and partitions. RISC OS native filesystem access. Network support (using BSD sockets). Colour and graphic console support. An interface for writing to files. A file copy command, to use when upgrading grub. Serial port support. Security (disabling keyboard drivers during boot) Access to RISC OS commands. A memory defragmenter. And some OS loaders of course. How should console errors be handled? Currently they are fatal, and won't=20 happen unless the console is redirected (assuming USB drivers don't=20 complain). Currently in the design of GRUB 2 there is an incorrect asumption that fili= ng=20 systems are either based on disks or networks. I propose to rectify this=20 whilst keeping code size down by: Creating a struct grub_fs_device_driver, which contains a pointer to either= =20 struct grub_disk_dev or struct grub_net_dev, and maintain a single linked=20 list of disk drivers, net drivers, and standalone filing systems. Convert struct grub_device from pointers to a unoin to simplify the code by= =20 removing memory allocations. =2D-=20 Member AFFS, WYLUG, SWP (UK), ANL, RESPECT, Leeds SA, Leeds Anti-war coalit= ion No to software patents! No to DRM/EUCD - hands off our computers! --Boundary-01=_ou0rAyM/4WeLPYH Content-Type: text/x-diff; charset="us-ascii"; name="patch1.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="patch1.diff" =2D-- grub2.orig/configure.ac 2004-05-21 12:14:37.000000000 +0100 +++ grub2.patch1/configure.ac 2004-05-19 00:26:16.000000000 +0100 @@ -23,12 +23,14 @@ case "$host_cpu" in i[[3456]]86) host_cpu=3Di386 ;; powerpc) ;; + arm) ;; *) AC_MSG_ERROR([unsupported CPU type]) ;; esac =20 case "$host_cpu"-"$host_vendor" in i386-*) host_vendor=3Dpc ;; powerpc-*) host_vendor=3Dieee1275 ;; + arm-*) host_vendor=3DRISC_OS ;; *) AC_MSG_ERROR([unsupported machine type]) ;; esac =20 diff -urN grub2.orig/conf/arm-RISC_OS.mk grub2.patch1/conf/arm-RISC_OS.mk =2D-- grub2.orig/conf/arm-RISC_OS.mk 1970-01-01 01:00:00.000000000 +0100 +++ grub2.patch1/conf/arm-RISC_OS.mk 2004-05-21 12:00:01.000000000 +0100 @@ -0,0 +1,696 @@ +# -*- makefile -*- + +COMMON_ASFLAGS =3D -nostdinc -fno-builtin +COMMON_CFLAGS =3D -fno-builtin + +# Images. +pkgdata_IMAGES =3D grub_RISC_OS.img + + +# For grub_RISC_OS.img. +grub_RISC_OS_img_SOURCES =3D kern/arm/aif_header.S kern/main.c kern/device= =2Ec \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/i386/dl.c kern/arm/RISC_OS/startup.S kern/arm/setjmp.S\ + kern/env.c kern/arm/RISC_OS/init.c disk/i386/pc/partition.c\ + term/arm/RISC_OS/console.c term/arm/RISC_OS/console-asm.S\ + symlist.c +CLEANFILES +=3D grub_RISC_OS.img grub_RISC_OS.exec grub_RISC_OS_img-kern_a= rm_aif_header.o grub_RISC_OS_img-kern_main.o grub_RISC_OS_img-kern_device.o= grub_RISC_OS_img-kern_disk.o grub_RISC_OS_img-kern_dl.o grub_RISC_OS_img-k= ern_file.o grub_RISC_OS_img-kern_fs.o grub_RISC_OS_img-kern_err.o grub_RISC= _OS_img-kern_misc.o grub_RISC_OS_img-kern_mm.o grub_RISC_OS_img-kern_loader= =2Eo grub_RISC_OS_img-kern_rescue.o grub_RISC_OS_img-kern_term.o grub_RISC_= OS_img-kern_i386_dl.o grub_RISC_OS_img-kern_arm_RISC_OS_startup.o grub_RISC= _OS_img-kern_arm_setjmp.o grub_RISC_OS_img-kern_env.o grub_RISC_OS_img-kern= _arm_RISC_OS_init.o grub_RISC_OS_img-disk_i386_pc_partition.o grub_RISC_OS_= img-term_arm_RISC_OS_console.o grub_RISC_OS_img-term_arm_RISC_OS_console_as= m.o grub_RISC_OS_img-symlist.o +MOSTLYCLEANFILES +=3D grub_RISC_OS_img-kern_arm_aif_header.d grub_RISC_OS_= img-kern_main.d grub_RISC_OS_img-kern_device.d grub_RISC_OS_img-kern_disk.d= grub_RISC_OS_img-kern_dl.d grub_RISC_OS_img-kern_file.d grub_RISC_OS_img-k= ern_fs.d grub_RISC_OS_img-kern_err.d grub_RISC_OS_img-kern_misc.d grub_RISC= _OS_img-kern_mm.d grub_RISC_OS_img-kern_loader.d grub_RISC_OS_img-kern_resc= ue.d grub_RISC_OS_img-kern_term.d grub_RISC_OS_img-kern_i386_dl.d grub_RISC= _OS_img-kern_arm_RISC_OS_startup.d grub_RISC_OS_img-kern_arm_setjmp.d grub_= RISC_OS_img-kern_env.d grub_RISC_OS_img-kern_arm_RISC_OS_init.d grub_RISC_O= S_img-disk_i386_pc_partition.d grub_RISC_OS_img-term_arm_RISC_OS_console.d = grub_RISC_OS_img-term_arm_RISC_OS_console_asm.d grub_RISC_OS_img-symlist.d + +grub_RISC_OS.img: grub_RISC_OS.exec + $(OBJCOPY) -O binary -R .note -R .comment $< $@ + +grub_RISC_OS.exec: grub_RISC_OS_img-kern_arm_aif_header.o grub_RISC_OS_img= =2Dkern_main.o grub_RISC_OS_img-kern_device.o grub_RISC_OS_img-kern_disk.o = grub_RISC_OS_img-kern_dl.o grub_RISC_OS_img-kern_file.o grub_RISC_OS_img-ke= rn_fs.o grub_RISC_OS_img-kern_err.o grub_RISC_OS_img-kern_misc.o grub_RISC_= OS_img-kern_mm.o grub_RISC_OS_img-kern_loader.o grub_RISC_OS_img-kern_rescu= e.o grub_RISC_OS_img-kern_term.o grub_RISC_OS_img-kern_i386_dl.o grub_RISC_= OS_img-kern_arm_RISC_OS_startup.o grub_RISC_OS_img-kern_arm_setjmp.o grub_R= ISC_OS_img-kern_env.o grub_RISC_OS_img-kern_arm_RISC_OS_init.o grub_RISC_OS= _img-disk_i386_pc_partition.o grub_RISC_OS_img-term_arm_RISC_OS_console.o g= rub_RISC_OS_img-term_arm_RISC_OS_console_asm.o grub_RISC_OS_img-symlist.o + $(CC) -o $@ $^ $(LDFLAGS) $(grub_RISC_OS_img_LDFLAGS) + +grub_RISC_OS_img-kern_arm_aif_header.o: kern/arm/aif_header.S + $(CC) -Ikern/arm -I$(srcdir)/kern/arm $(CPPFLAGS) -DASM_FILE=3D1 $(ASFLAG= S) $(grub_RISC_OS_img_ASFLAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_arm_aif_header.d: kern/arm/aif_header.S + set -e; $(CC) -Ikern/arm -I$(srcdir)/kern/arm $(CPPFLAGS) -DASM_FILE= =3D1 $(ASFLAGS) $(grub_RISC_OS_img_ASFLAGS) -M $< | sed 's,aif_header\.o= [ :]*,grub_RISC_OS_img-kern_arm_aif_header.o $@ : ,g' > $@; [ -s $@ ] ||= rm -f $@ + +-include grub_RISC_OS_img-kern_arm_aif_header.d + +grub_RISC_OS_img-kern_main.o: kern/main.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_main.d: kern/main.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,main\.o[ :]*,grub_RISC_OS_img-kern_main= =2Eo $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_main.d + +grub_RISC_OS_img-kern_device.o: kern/device.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_device.d: kern/device.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,device\.o[ :]*,grub_RISC_OS_img-kern_de= vice.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_device.d + +grub_RISC_OS_img-kern_disk.o: kern/disk.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_disk.d: kern/disk.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,disk\.o[ :]*,grub_RISC_OS_img-kern_disk= =2Eo $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_disk.d + +grub_RISC_OS_img-kern_dl.o: kern/dl.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_dl.d: kern/dl.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,dl\.o[ :]*,grub_RISC_OS_img-kern_dl.o $= @ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_dl.d + +grub_RISC_OS_img-kern_file.o: kern/file.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_file.d: kern/file.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,file\.o[ :]*,grub_RISC_OS_img-kern_file= =2Eo $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_file.d + +grub_RISC_OS_img-kern_fs.o: kern/fs.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_fs.d: kern/fs.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,fs\.o[ :]*,grub_RISC_OS_img-kern_fs.o $= @ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_fs.d + +grub_RISC_OS_img-kern_err.o: kern/err.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_err.d: kern/err.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,err\.o[ :]*,grub_RISC_OS_img-kern_err.o= $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_err.d + +grub_RISC_OS_img-kern_misc.o: kern/misc.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_misc.d: kern/misc.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,misc\.o[ :]*,grub_RISC_OS_img-kern_misc= =2Eo $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_misc.d + +grub_RISC_OS_img-kern_mm.o: kern/mm.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_mm.d: kern/mm.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,mm\.o[ :]*,grub_RISC_OS_img-kern_mm.o $= @ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_mm.d + +grub_RISC_OS_img-kern_loader.o: kern/loader.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_loader.d: kern/loader.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,loader\.o[ :]*,grub_RISC_OS_img-kern_lo= ader.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_loader.d + +grub_RISC_OS_img-kern_rescue.o: kern/rescue.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_rescue.d: kern/rescue.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,rescue\.o[ :]*,grub_RISC_OS_img-kern_re= scue.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_rescue.d + +grub_RISC_OS_img-kern_term.o: kern/term.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_term.d: kern/term.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,term\.o[ :]*,grub_RISC_OS_img-kern_term= =2Eo $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_term.d + +grub_RISC_OS_img-kern_i386_dl.o: kern/i386/dl.c + $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(grub_RIS= C_OS_img_CFLAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_i386_dl.d: kern/i386/dl.c + set -e; $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS)= $(grub_RISC_OS_img_CFLAGS) -M $< | sed 's,dl\.o[ :]*,grub_RISC_OS_img-k= ern_i386_dl.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_i386_dl.d + +grub_RISC_OS_img-kern_arm_RISC_OS_startup.o: kern/arm/RISC_OS/startup.S + $(CC) -Ikern/arm/RISC_OS -I$(srcdir)/kern/arm/RISC_OS $(CPPFLAGS) -DASM_F= ILE=3D1 $(ASFLAGS) $(grub_RISC_OS_img_ASFLAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_arm_RISC_OS_startup.d: kern/arm/RISC_OS/startup.S + set -e; $(CC) -Ikern/arm/RISC_OS -I$(srcdir)/kern/arm/RISC_OS $(CPPFLA= GS) -DASM_FILE=3D1 $(ASFLAGS) $(grub_RISC_OS_img_ASFLAGS) -M $< | sed 's= ,startup\.o[ :]*,grub_RISC_OS_img-kern_arm_RISC_OS_startup.o $@ : ,g' > $@;= [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_arm_RISC_OS_startup.d + +grub_RISC_OS_img-kern_arm_setjmp.o: kern/arm/setjmp.S + $(CC) -Ikern/arm -I$(srcdir)/kern/arm $(CPPFLAGS) -DASM_FILE=3D1 $(ASFLAG= S) $(grub_RISC_OS_img_ASFLAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_arm_setjmp.d: kern/arm/setjmp.S + set -e; $(CC) -Ikern/arm -I$(srcdir)/kern/arm $(CPPFLAGS) -DASM_FILE= =3D1 $(ASFLAGS) $(grub_RISC_OS_img_ASFLAGS) -M $< | sed 's,setjmp\.o[ :]= *,grub_RISC_OS_img-kern_arm_setjmp.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_arm_setjmp.d + +grub_RISC_OS_img-kern_env.o: kern/env.c + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_C= =46LAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_env.d: kern/env.c + set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grub_RI= SC_OS_img_CFLAGS) -M $< | sed 's,env\.o[ :]*,grub_RISC_OS_img-kern_env.o= $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-kern_env.d + +grub_RISC_OS_img-kern_arm_RISC_OS_init.o: kern/arm/RISC_OS/init.c + $(CC) -Ikern/arm/RISC_OS -I$(srcdir)/kern/arm/RISC_OS $(CPPFLAGS) $(CFLA= GS) $(grub_RISC_OS_img_CFLAGS) -c -o $@ $< + +grub_RISC_OS_img-kern_arm_RISC_OS_init.d: kern/arm/RISC_OS/init.c + set -e; $(CC) -Ikern/arm/RISC_OS -I$(srcdir)/kern/arm/RISC_OS $(CPPFLA= GS) $(CFLAGS) $(grub_RISC_OS_img_CFLAGS) -M $< | sed 's,init\.o[ :]*,gr= ub_RISC_OS_img-kern_arm_RISC_OS_init.o $@ : ,g' > $@; [ -s $@ ] || rm -f= $@ + +-include grub_RISC_OS_img-kern_arm_RISC_OS_init.d + +grub_RISC_OS_img-disk_i386_pc_partition.o: disk/i386/pc/partition.c + $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS) $(CFLAGS) $(gr= ub_RISC_OS_img_CFLAGS) -c -o $@ $< + +grub_RISC_OS_img-disk_i386_pc_partition.d: disk/i386/pc/partition.c + set -e; $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS) $(C= =46LAGS) $(grub_RISC_OS_img_CFLAGS) -M $< | sed 's,partition\.o[ :]*,gru= b_RISC_OS_img-disk_i386_pc_partition.o $@ : ,g' > $@; [ -s $@ ] || rm -f= $@ + +-include grub_RISC_OS_img-disk_i386_pc_partition.d + +grub_RISC_OS_img-term_arm_RISC_OS_console.o: term/arm/RISC_OS/console.c + $(CC) -Iterm/arm/RISC_OS -I$(srcdir)/term/arm/RISC_OS $(CPPFLAGS) $(CFLA= GS) $(grub_RISC_OS_img_CFLAGS) -c -o $@ $< + +grub_RISC_OS_img-term_arm_RISC_OS_console.d: term/arm/RISC_OS/console.c + set -e; $(CC) -Iterm/arm/RISC_OS -I$(srcdir)/term/arm/RISC_OS $(CPPFLA= GS) $(CFLAGS) $(grub_RISC_OS_img_CFLAGS) -M $< | sed 's,console\.o[ :]*= ,grub_RISC_OS_img-term_arm_RISC_OS_console.o $@ : ,g' > $@; [ -s $@ ] ||= rm -f $@ + +-include grub_RISC_OS_img-term_arm_RISC_OS_console.d + +grub_RISC_OS_img-term_arm_RISC_OS_console_asm.o: term/arm/RISC_OS/console-= asm.S + $(CC) -Iterm/arm/RISC_OS -I$(srcdir)/term/arm/RISC_OS $(CPPFLAGS) -DASM_F= ILE=3D1 $(ASFLAGS) $(grub_RISC_OS_img_ASFLAGS) -c -o $@ $< + +grub_RISC_OS_img-term_arm_RISC_OS_console_asm.d: term/arm/RISC_OS/console-= asm.S + set -e; $(CC) -Iterm/arm/RISC_OS -I$(srcdir)/term/arm/RISC_OS $(CPPFLA= GS) -DASM_FILE=3D1 $(ASFLAGS) $(grub_RISC_OS_img_ASFLAGS) -M $< | sed 's= ,console\-asm\.o[ :]*,grub_RISC_OS_img-term_arm_RISC_OS_console_asm.o $@ : = ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-term_arm_RISC_OS_console_asm.d + +grub_RISC_OS_img-symlist.o: symlist.c + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_img_CFLAGS)= -c -o $@ $< + +grub_RISC_OS_img-symlist.d: symlist.c + set -e; $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(grub_RISC_OS_= img_CFLAGS) -M $< | sed 's,symlist\.o[ :]*,grub_RISC_OS_img-symlist.o $@= : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include grub_RISC_OS_img-symlist.d + +grub_RISC_OS_img_HEADERS =3D boot.h device.h disk.h dl.h elf.h err.h \ + file.h fs.h kernel.h loader.h misc.h mm.h net.h rescue.h symbol.h \ + term.h types.h arg.h env.h +grub_RISC_OS_img_CFLAGS =3D $(COMMON_CFLAGS) +grub_RISC_OS_img_ASFLAGS =3D $(COMMON_ASFLAGS) +grub_RISC_OS_img_LDFLAGS =3D `$(CC) -print-libgcc-file-name` $(srcdir)/ke= rn/arm/aif_header.lds -nostdlib -Wl,-N,-Ttext,8000 + +MOSTLYCLEANFILES +=3D symlist.c grub_RISC_OS_syms.lst +DEFSYMFILES +=3D grub_RISC_OS_syms.lst + +symlist.c: $(addprefix include/grub/,$(grub_RISC_OS_img_HEADERS)) gensymli= st.sh + sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ + +grub_RISC_OS_syms.lst: $(addprefix include/grub/,$(grub_RISC_OS_img_HEADER= S)) genkernsyms.sh + sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ + +# Utilities. +#bin_UTILITIES =3D grub-mkimage +#sbin_UTILITIES =3D grub-setup grub-emu +noinst_UTILITIES =3D genmoddep + +# For grub-mkimage. +grub_mkimage_SOURCES =3D util/i386/pc/grub-mkimage.c util/misc.c \ + util/resolve.c +grub_mkimage_LDFLAGS =3D -llzo + +# For grub-setup. +grub_setup_SOURCES =3D util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ + util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \ + kern/err.c kern/misc.c disk/i386/pc/partition.c fs/fat.c fs/ext2.c \ + kern/file.c kern/fs.c kern/env.c + +# For grub +grub_emu_SOURCES =3D kern/main.c kern/device.c \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/loader.c kern/rescue.c kern/term.c \ + disk/i386/pc/partition.c kern/env.c commands/ls.c \ + commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c \ + util/i386/pc/biosdisk.c fs/fat.c fs/ext2.c \ + normal/cmdline.c normal/command.c normal/main.c normal/menu.c normal/arg.= c \ + util/console.c util/grub-emu.c util/misc.c util/i386/pc/getroot.c +grub_emu_LDFLAGS =3D -lncurses + +# For genmoddep. +genmoddep_SOURCES =3D util/genmoddep.c +CLEANFILES +=3D genmoddep genmoddep-util_genmoddep.o +MOSTLYCLEANFILES +=3D genmoddep-util_genmoddep.d + +genmoddep: genmoddep-util_genmoddep.o + $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS) + +genmoddep-util_genmoddep.o: util/genmoddep.c + $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DG= RUB_UTIL=3D1 $(genmoddep_CFLAGS) -c -o $@ $< + +genmoddep-util_genmoddep.d: util/genmoddep.c + set -e; $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_= CFLAGS) -DGRUB_UTIL=3D1 $(genmoddep_CFLAGS) -M $< | sed 's,genmoddep\.o[= :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include genmoddep-util_genmoddep.d + + +# Modules. +pkgdata_MODULES =3D fat.mod ext2.mod normal.mod hello.mod \ + font.mod ls.mod boot.mod cmp.mod cat.mod terminal.mod + +# For fat.mod. +fat_mod_SOURCES =3D fs/fat.c +CLEANFILES +=3D fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o def= =2Dfat.lst und-fat.lst +MOSTLYCLEANFILES +=3D fat_mod-fs_fat.d +DEFSYMFILES +=3D def-fat.lst +UNDSYMFILES +=3D und-fat.lst + +fat.mod: pre-fat.o mod-fat.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-fat.o: fat_mod-fs_fat.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-fat.o: mod-fat.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $< + +mod-fat.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1) + +def-fat.lst: pre-fat.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fat/' > $@ + +und-fat.lst: pre-fat.o + echo 'fat' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +fat_mod-fs_fat.o: fs/fat.c + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $= @ $< + +fat_mod-fs_fat.d: fs/fat.c + set -e; $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLA= GS) -M $< | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@; [ -s $= @ ] || rm -f $@ + +-include fat_mod-fs_fat.d + +fat_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For ext2.mod. +ext2_mod_SOURCES =3D fs/ext2.c +CLEANFILES +=3D ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2= =2Eo def-ext2.lst und-ext2.lst +MOSTLYCLEANFILES +=3D ext2_mod-fs_ext2.d +DEFSYMFILES +=3D def-ext2.lst +UNDSYMFILES +=3D und-ext2.lst + +ext2.mod: pre-ext2.o mod-ext2.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-ext2.o: ext2_mod-fs_ext2.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-ext2.o: mod-ext2.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $< + +mod-ext2.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1) + +def-ext2.lst: pre-ext2.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ext2/' > $@ + +und-ext2.lst: pre-ext2.o + echo 'ext2' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +ext2_mod-fs_ext2.o: fs/ext2.c + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o = $@ $< + +ext2_mod-fs_ext2.d: fs/ext2.c + set -e; $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFL= AGS) -M $< | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@; [ = =2Ds $@ ] || rm -f $@ + +-include ext2_mod-fs_ext2.d + +ext2_mod_CFLAGS =3D $(COMMON_CFLAGS) + + +# For normal.mod. +normal_mod_SOURCES =3D normal/cmdline.c normal/command.c normal/main.c \ + normal/menu.c normal/arg.c=20 +CLEANFILES +=3D normal.mod mod-normal.o mod-normal.c pre-normal.o normal_m= od-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_main.o no= rmal_mod-normal_menu.o normal_mod-normal_arg.o def-normal.lst und-normal.lst +MOSTLYCLEANFILES +=3D normal_mod-normal_cmdline.d normal_mod-normal_comman= d.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_arg= =2Ed +DEFSYMFILES +=3D def-normal.lst +UNDSYMFILES +=3D und-normal.lst + +normal.mod: pre-normal.o mod-normal.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-normal.o: normal_mod-normal_cmdline.o normal_mod-normal_command.o norm= al_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_arg.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-normal.o: mod-normal.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +mod-normal.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) + +def-normal.lst: pre-normal.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ + +und-normal.lst: pre-normal.o + echo 'normal' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +normal_mod-normal_cmdline.o: normal/cmdline.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLA= GS) -c -o $@ $< + +normal_mod-normal_cmdline.d: normal/cmdline.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(norm= al_mod_CFLAGS) -M $< | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.= o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_cmdline.d + +normal_mod-normal_command.o: normal/command.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLA= GS) -c -o $@ $< + +normal_mod-normal_command.d: normal/command.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(norm= al_mod_CFLAGS) -M $< | sed 's,command\.o[ :]*,normal_mod-normal_command.= o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_command.d + +normal_mod-normal_main.o: normal/main.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLA= GS) -c -o $@ $< + +normal_mod-normal_main.d: normal/main.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(norm= al_mod_CFLAGS) -M $< | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ := ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_main.d + +normal_mod-normal_menu.o: normal/menu.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLA= GS) -c -o $@ $< + +normal_mod-normal_menu.d: normal/menu.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(norm= al_mod_CFLAGS) -M $< | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ := ,g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_menu.d + +normal_mod-normal_arg.o: normal/arg.c + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLA= GS) -c -o $@ $< + +normal_mod-normal_arg.d: normal/arg.c + set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(norm= al_mod_CFLAGS) -M $< | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,= g' > $@; [ -s $@ ] || rm -f $@ + +-include normal_mod-normal_arg.d + +normal_mod_CFLAGS =3D $(COMMON_CFLAGS) +normal_mod_ASFLAGS =3D $(COMMON_ASFLAGS) + +# For hello.mod. +hello_mod_SOURCES =3D hello/hello.c +CLEANFILES +=3D hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-he= llo_hello.o def-hello.lst und-hello.lst +MOSTLYCLEANFILES +=3D hello_mod-hello_hello.d +DEFSYMFILES +=3D def-hello.lst +UNDSYMFILES +=3D und-hello.lst + +hello.mod: pre-hello.o mod-hello.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-hello.o: hello_mod-hello_hello.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-hello.o: mod-hello.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $< + +mod-hello.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1) + +def-hello.lst: pre-hello.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hello/' > $@ + +und-hello.lst: pre-hello.o + echo 'hello' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +hello_mod-hello_hello.o: hello/hello.c + $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS)= -c -o $@ $< + +hello_mod-hello_hello.d: hello/hello.c + set -e; $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_= mod_CFLAGS) -M $< | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g= ' > $@; [ -s $@ ] || rm -f $@ + +-include hello_mod-hello_hello.d + +hello_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For boot.mod. +boot_mod_SOURCES =3D commands/boot.c +CLEANFILES +=3D boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-command= s_boot.o def-boot.lst und-boot.lst +MOSTLYCLEANFILES +=3D boot_mod-commands_boot.d +DEFSYMFILES +=3D def-boot.lst +UNDSYMFILES +=3D und-boot.lst + +boot.mod: pre-boot.o mod-boot.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-boot.o: boot_mod-commands_boot.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-boot.o: mod-boot.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $< + +mod-boot.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1) + +def-boot.lst: pre-boot.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 boot/' > $@ + +und-boot.lst: pre-boot.o + echo 'boot' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +boot_mod-commands_boot.o: commands/boot.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CF= LAGS) -c -o $@ $< + +boot_mod-commands_boot.d: commands/boot.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(= boot_mod_CFLAGS) -M $< | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@= : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include boot_mod-commands_boot.d + +boot_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For terminal.mod. +terminal_mod_SOURCES =3D commands/terminal.c +CLEANFILES +=3D terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o = terminal_mod-commands_terminal.o def-terminal.lst und-terminal.lst +MOSTLYCLEANFILES +=3D terminal_mod-commands_terminal.d +DEFSYMFILES +=3D def-terminal.lst +UNDSYMFILES +=3D und-terminal.lst + +terminal.mod: pre-terminal.o mod-terminal.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-terminal.o: terminal_mod-commands_terminal.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-terminal.o: mod-terminal.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $< + +mod-terminal.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1) + +def-terminal.lst: pre-terminal.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminal/' > $@ + +und-terminal.lst: pre-terminal.o + echo 'terminal' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +terminal_mod-commands_terminal.o: commands/terminal.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mo= d_CFLAGS) -c -o $@ $< + +terminal_mod-commands_terminal.d: commands/terminal.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(= terminal_mod_CFLAGS) -M $< | sed 's,terminal\.o[ :]*,terminal_mod-comman= ds_terminal.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ + +-include terminal_mod-commands_terminal.d + +terminal_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For ls.mod. +ls_mod_SOURCES =3D commands/ls.c +CLEANFILES +=3D ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o def= =2Dls.lst und-ls.lst +MOSTLYCLEANFILES +=3D ls_mod-commands_ls.d +DEFSYMFILES +=3D def-ls.lst +UNDSYMFILES +=3D und-ls.lst + +ls.mod: pre-ls.o mod-ls.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-ls.o: ls_mod-commands_ls.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-ls.o: mod-ls.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $< + +mod-ls.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1) + +def-ls.lst: pre-ls.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ls/' > $@ + +und-ls.lst: pre-ls.o + echo 'ls' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +ls_mod-commands_ls.o: commands/ls.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLA= GS) -c -o $@ $< + +ls_mod-commands_ls.d: commands/ls.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(= ls_mod_CFLAGS) -M $< | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' >= $@; [ -s $@ ] || rm -f $@ + +-include ls_mod-commands_ls.d + +ls_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For cmp.mod. +cmp_mod_SOURCES =3D commands/cmp.c +CLEANFILES +=3D cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp= =2Eo def-cmp.lst und-cmp.lst +MOSTLYCLEANFILES +=3D cmp_mod-commands_cmp.d +DEFSYMFILES +=3D def-cmp.lst +UNDSYMFILES +=3D und-cmp.lst + +cmp.mod: pre-cmp.o mod-cmp.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-cmp.o: cmp_mod-commands_cmp.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-cmp.o: mod-cmp.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $< + +mod-cmp.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1) + +def-cmp.lst: pre-cmp.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cmp/' > $@ + +und-cmp.lst: pre-cmp.o + echo 'cmp' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +cmp_mod-commands_cmp.o: commands/cmp.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFL= AGS) -c -o $@ $< + +cmp_mod-commands_cmp.d: commands/cmp.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(= cmp_mod_CFLAGS) -M $< | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,= g' > $@; [ -s $@ ] || rm -f $@ + +-include cmp_mod-commands_cmp.d + +cmp_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For cat.mod. +cat_mod_SOURCES =3D commands/cat.c +CLEANFILES +=3D cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat= =2Eo def-cat.lst und-cat.lst +MOSTLYCLEANFILES +=3D cat_mod-commands_cat.d +DEFSYMFILES +=3D def-cat.lst +UNDSYMFILES +=3D und-cat.lst + +cat.mod: pre-cat.o mod-cat.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-cat.o: cat_mod-commands_cat.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-cat.o: mod-cat.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $< + +mod-cat.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1) + +def-cat.lst: pre-cat.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cat/' > $@ + +und-cat.lst: pre-cat.o + echo 'cat' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +cat_mod-commands_cat.o: commands/cat.c + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFL= AGS) -c -o $@ $< + +cat_mod-commands_cat.d: commands/cat.c + set -e; $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(= cat_mod_CFLAGS) -M $< | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,= g' > $@; [ -s $@ ] || rm -f $@ + +-include cat_mod-commands_cat.d + +cat_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For font.mod. +font_mod_SOURCES =3D font/manager.c +CLEANFILES +=3D font.mod mod-font.o mod-font.c pre-font.o font_mod-font_ma= nager.o def-font.lst und-font.lst +MOSTLYCLEANFILES +=3D font_mod-font_manager.d +DEFSYMFILES +=3D def-font.lst +UNDSYMFILES +=3D und-font.lst + +font.mod: pre-font.o mod-font.o + -rm -f $@ + $(LD) -r -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .= comment $@ + +pre-font.o: font_mod-font_manager.o + -rm -f $@ + $(LD) -r -o $@ $^ + +mod-font.o: mod-font.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< + +mod-font.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) + +def-font.lst: pre-font.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@ + +und-font.lst: pre-font.o + echo 'font' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +font_mod-font_manager.o: font/manager.c + $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c= -o $@ $< + +font_mod-font_manager.d: font/manager.c + set -e; $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod= _CFLAGS) -M $< | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g'= > $@; [ -s $@ ] || rm -f $@ + +-include font_mod-font_manager.d + +font_mod_CFLAGS =3D $(COMMON_CFLAGS) + +CLEANFILES +=3D moddep.lst +pkgdata_DATA +=3D moddep.lst +moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep + cat $(DEFSYMFILES) /dev/null | ./genmoddep $(UNDSYMFILES) > $@ \ + || (rm -f $@; exit 1) diff -urN grub2.orig/conf/arm-RISC_OS.rmk grub2.patch1/conf/arm-RISC_OS.rmk =2D-- grub2.orig/conf/arm-RISC_OS.rmk 1970-01-01 01:00:00.000000000 +0100 +++ grub2.patch1/conf/arm-RISC_OS.rmk 2004-05-21 11:59:58.000000000 +0100 @@ -0,0 +1,110 @@ +# -*- makefile -*- + +COMMON_ASFLAGS =3D -nostdinc -fno-builtin +COMMON_CFLAGS =3D -fno-builtin + +# Images. +pkgdata_IMAGES =3D grub_RISC_OS.img + + +# For grub_RISC_OS.img. +grub_RISC_OS_img_SOURCES =3D kern/arm/aif_header.S kern/main.c kern/device= =2Ec \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/i386/dl.c kern/arm/RISC_OS/startup.S kern/arm/setjmp.S\ + kern/env.c kern/arm/RISC_OS/init.c disk/i386/pc/partition.c\ + term/arm/RISC_OS/console.c term/arm/RISC_OS/console-asm.S\ + symlist.c +grub_RISC_OS_img_HEADERS =3D boot.h device.h disk.h dl.h elf.h err.h \ + file.h fs.h kernel.h loader.h misc.h mm.h net.h rescue.h symbol.h \ + term.h types.h arg.h env.h +grub_RISC_OS_img_CFLAGS =3D $(COMMON_CFLAGS) +grub_RISC_OS_img_ASFLAGS =3D $(COMMON_ASFLAGS) +grub_RISC_OS_img_LDFLAGS =3D `$(CC) -print-libgcc-file-name` $(srcdir)/ke= rn/arm/aif_header.lds -nostdlib -Wl,-N,-Ttext,8000 + +MOSTLYCLEANFILES +=3D symlist.c grub_RISC_OS_syms.lst +DEFSYMFILES +=3D grub_RISC_OS_syms.lst + +symlist.c: $(addprefix include/grub/,$(grub_RISC_OS_img_HEADERS)) gensymli= st.sh + sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@ + +grub_RISC_OS_syms.lst: $(addprefix include/grub/,$(grub_RISC_OS_img_HEADER= S)) genkernsyms.sh + sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@ + +# Utilities. +#bin_UTILITIES =3D grub-mkimage +#sbin_UTILITIES =3D grub-setup grub-emu +noinst_UTILITIES =3D genmoddep + +# For grub-mkimage. +grub_mkimage_SOURCES =3D util/i386/pc/grub-mkimage.c util/misc.c \ + util/resolve.c +grub_mkimage_LDFLAGS =3D -llzo + +# For grub-setup. +grub_setup_SOURCES =3D util/i386/pc/grub-setup.c util/i386/pc/biosdisk.c \ + util/misc.c util/i386/pc/getroot.c kern/device.c kern/disk.c \ + kern/err.c kern/misc.c disk/i386/pc/partition.c fs/fat.c fs/ext2.c \ + kern/file.c kern/fs.c kern/env.c + +# For grub +grub_emu_SOURCES =3D kern/main.c kern/device.c \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/loader.c kern/rescue.c kern/term.c \ + disk/i386/pc/partition.c kern/env.c commands/ls.c \ + commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c \ + util/i386/pc/biosdisk.c fs/fat.c fs/ext2.c \ + normal/cmdline.c normal/command.c normal/main.c normal/menu.c normal/arg.= c \ + util/console.c util/grub-emu.c util/misc.c util/i386/pc/getroot.c +grub_emu_LDFLAGS =3D -lncurses + +# For genmoddep. +genmoddep_SOURCES =3D util/genmoddep.c + +# Modules. +pkgdata_MODULES =3D fat.mod ext2.mod normal.mod hello.mod \ + font.mod ls.mod boot.mod cmp.mod cat.mod terminal.mod + +# For fat.mod. +fat_mod_SOURCES =3D fs/fat.c +fat_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For ext2.mod. +ext2_mod_SOURCES =3D fs/ext2.c +ext2_mod_CFLAGS =3D $(COMMON_CFLAGS) + + +# For normal.mod. +normal_mod_SOURCES =3D normal/cmdline.c normal/command.c normal/main.c \ + normal/menu.c normal/arg.c=20 +normal_mod_CFLAGS =3D $(COMMON_CFLAGS) +normal_mod_ASFLAGS =3D $(COMMON_ASFLAGS) + +# For hello.mod. +hello_mod_SOURCES =3D hello/hello.c +hello_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For boot.mod. +boot_mod_SOURCES =3D commands/boot.c +boot_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For terminal.mod. +terminal_mod_SOURCES =3D commands/terminal.c +terminal_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For ls.mod. +ls_mod_SOURCES =3D commands/ls.c +ls_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For cmp.mod. +cmp_mod_SOURCES =3D commands/cmp.c +cmp_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For cat.mod. +cat_mod_SOURCES =3D commands/cat.c +cat_mod_CFLAGS =3D $(COMMON_CFLAGS) + +# For font.mod. +font_mod_SOURCES =3D font/manager.c +font_mod_CFLAGS =3D $(COMMON_CFLAGS) + diff -urN grub2.orig/include/grub/arm/RISC_OS/console.h grub2.patch1/includ= e/grub/arm/RISC_OS/console.h =2D-- grub2.orig/include/grub/arm/RISC_OS/console.h 1970-01-01 01:00:00.000= 000000 +0100 +++ grub2.patch1/include/grub/arm/RISC_OS/console.h 2004-05-20 19:56:35.000= 000000 +0100 @@ -0,0 +1,57 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002 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. + */ + +#ifndef GRUB_CONSOLE_MACHINE_HEADER +#define GRUB_CONSOLE_MACHINE_HEADER 1 + +/* Define scan codes. */ +#define GRUB_CONSOLE_KEY_LEFT 0x4B00 +#define GRUB_CONSOLE_KEY_RIGHT 0x4D00 +#define GRUB_CONSOLE_KEY_UP 0x4800 +#define GRUB_CONSOLE_KEY_DOWN 0x5000 +#define GRUB_CONSOLE_KEY_IC 0x5200 +#define GRUB_CONSOLE_KEY_DC 0x5300 +#define GRUB_CONSOLE_KEY_BACKSPACE 0x0008 +#define GRUB_CONSOLE_KEY_HOME 0x4700 +#define GRUB_CONSOLE_KEY_END 0x4F00 +#define GRUB_CONSOLE_KEY_NPAGE 0x4900 +#define GRUB_CONSOLE_KEY_PPAGE 0x5100 + +#ifndef ASM_FILE + +#include +#include +#include + +/* These are global to share code between C and asm. */ +void grub_console_real_putchar (int c); +int EXPORT_FUNC(grub_console_checkkey) (void); +int EXPORT_FUNC(grub_console_getkey) (void); +grub_uint16_t grub_console_getxy (void); +void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y); +void grub_console_cls (void); +void grub_console_setcursor (int on); +void grub_console_setcolourstate (grub_term_color_state state); + +/* Initialize the console system. */ +void grub_console_init (void); + +#endif + +#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */ diff -urN grub2.orig/include/grub/arm/RISC_OS/partition.h grub2.patch1/incl= ude/grub/arm/RISC_OS/partition.h =2D-- grub2.orig/include/grub/arm/RISC_OS/partition.h 1970-01-01 01:00:00.0= 00000000 +0100 +++ grub2.patch1/include/grub/arm/RISC_OS/partition.h 2004-04-04 14:46:01.0= 00000000 +0100 @@ -0,0 +1,242 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002 Free Software Foundation, Inc. + * + * GRUB 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 GRUB; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GRUB_PARTITION_HEADER +#define GRUB_PARTITION_HEADER 1 + +#include +#include +#include + +/* The signature. */ +#define GRUB_PARTITION_SIGNATURE 0xaa55 + +/* This is not a flag actually, but used as if it were a flag. */ +#define GRUB_PARTITION_TYPE_HIDDEN_FLAG 0x10 + +/* DOS partition types. */ +#define GRUB_PARTITION_TYPE_NONE 0 +#define GRUB_PARTITION_TYPE_FAT12 1 +#define GRUB_PARTITION_TYPE_FAT16_LT32M 4 +#define GRUB_PARTITION_TYPE_EXTENDED 5 +#define GRUB_PARTITION_TYPE_FAT16_GT32M 6 +#define GRUB_PARTITION_TYPE_FAT32 0xb +#define GRUB_PARTITION_TYPE_FAT32_LBA 0xc +#define GRUB_PARTITION_TYPE_FAT16_LBA 0xe +#define GRUB_PARTITION_TYPE_WIN95_EXTENDED 0xf +#define GRUB_PARTITION_TYPE_EZD 0x55 +#define GRUB_PARTITION_TYPE_MINIX 0x80 +#define GRUB_PARTITION_TYPE_LINUX_MINIX 0x81 +#define GRUB_PARTITION_TYPE_EXT2FS 0x83 +#define GRUB_PARTITION_TYPE_LINUX_EXTENDED 0x85 +#define GRUB_PARTITION_TYPE_VSTAFS 0x9e +#define GRUB_PARTITION_TYPE_FREEBSD 0xa5 +#define GRUB_PARTITION_TYPE_OPENBSD 0xa6 +#define GRUB_PARTITION_TYPE_NETBSD 0xa9 +#define GRUB_PARTITION_TYPE_LINUX_RAID 0xfd + +/* Constants for BSD disk label. */ +#define GRUB_PARTITION_BSD_LABEL_SECTOR 1 +#define GRUB_PARTITION_BSD_LABEL_MAGIC 0x82564557 +#define GRUB_PARTITION_BSD_MAX_ENTRIES 8 + +/* BSD partition types. */ +#define GRUB_PARTITION_BSD_TYPE_UNUSED 0 +#define GRUB_PARTITION_BSD_TYPE_SWAP 1 +#define GRUB_PARTITION_BSD_TYPE_V6 2 +#define GRUB_PARTITION_BSD_TYPE_V7 3 +#define GRUB_PARTITION_BSD_TYPE_SYSV 4 +#define GRUB_PARTITION_BSD_TYPE_V71K 5 +#define GRUB_PARTITION_BSD_TYPE_V8 6 +#define GRUB_PARTITION_BSD_TYPE_BSDFFS 7 +#define GRUB_PARTITION_BSD_TYPE_MSDOS 8 +#define GRUB_PARTITION_BSD_TYPE_BSDLFS 9 +#define GRUB_PARTITION_BSD_TYPE_OTHER 10 +#define GRUB_PARTITION_BSD_TYPE_HPFS 11 +#define GRUB_PARTITION_BSD_TYPE_ISO9660 12 +#define GRUB_PARTITION_BSD_TYPE_BOOT 13 + +/* FreeBSD-specific types. */ +#define GRUB_PARTITION_FREEBSD_TYPE_VINUM 14 +#define GRUB_PARTITION_FREEBSD_TYPE_RAID 15 +#define GRUB_PARTITION_FREEBSD_TYPE_JFS2 21 + +/* NetBSD-specific types. */ +#define GRUB_PARTITION_NETBSD_TYPE_ADOS 14 +#define GRUB_PARTITION_NETBSD_TYPE_HFS 15 +#define GRUB_PARTITION_NETBSD_TYPE_FILECORE 16 +#define GRUB_PARTITION_NETBSD_TYPE_EXT2FS 17 +#define GRUB_PARTITION_NETBSD_TYPE_NTFS 18 +#define GRUB_PARTITION_NETBSD_TYPE_RAID 19 +#define GRUB_PARTITION_NETBSD_TYPE_CCD 20 +#define GRUB_PARTITION_NETBSD_TYPE_JFS2 21 +#define GRUB_PARTITION_NETBSD_TYPE_APPLEUFS 22 + +/* OpenBSD-specific types. */ +#define GRUB_PARTITION_OPENBSD_TYPE_ADOS 14 +#define GRUB_PARTITION_OPENBSD_TYPE_HFS 15 +#define GRUB_PARTITION_OPENBSD_TYPE_FILECORE 16 +#define GRUB_PARTITION_OPENBSD_TYPE_EXT2FS 17 +#define GRUB_PARTITION_OPENBSD_TYPE_NTFS 18 +#define GRUB_PARTITION_OPENBSD_TYPE_RAID 19 + +/* The BSD partition entry. */ +struct grub_partition_bsd_entry +{ + grub_uint32_t size; + grub_uint32_t offset; + grub_uint32_t fragment_size; + grub_uint8_t fs_type; + grub_uint8_t fs_fragments; + grub_uint16_t fs_cylinders; +} __attribute__ ((packed)); + +/* The BSD disk label. Only define members useful for GRUB. */ +struct grub_partition_disk_label +{ + grub_uint32_t magic; + grub_uint8_t padding[128]; + grub_uint32_t magic2; + grub_uint16_t checksum; + grub_uint16_t num_partitions; + grub_uint32_t boot_size; + grub_uint32_t superblock_size; + struct grub_partition_bsd_entry entries[GRUB_PARTITION_BSD_MAX_ENTRIES]; +} __attribute__ ((packed)); + +/* The partition entry. */ +struct grub_partition_entry +{ + /* If active, 0x80, otherwise, 0x00. */ + grub_uint8_t flag; + + /* The head of the start. */ + grub_uint8_t start_head; + + /* (S | ((C >> 2) & 0xC0)) where S is the sector of the start and C + is the cylinder of the start. Note that S is counted from one. */ + grub_uint8_t start_sector; + + /* (C & 0xFF) where C is the cylinder of the start. */ + grub_uint8_t start_cylinder; + + /* The partition type. */ + grub_uint8_t type; + + /* The end versions of start_head, start_sector and start_cylinder, + respectively. */ + grub_uint8_t end_head; + grub_uint8_t end_sector; + grub_uint8_t end_cylinder; + + /* The start sector. Note that this is counted from zero. */ + grub_uint32_t start; + + /* The length in sector units. */ + grub_uint32_t length; +} __attribute__ ((packed)); + +/* The structure of MBR. */ +struct grub_partition_mbr +{ + /* The code area (actually, including BPB). */ + grub_uint8_t code[446]; + + /* Four partition entries. */ + struct grub_partition_entry entries[4]; + + /* The signature 0xaa55. */ + grub_uint16_t signature; +} __attribute__ ((packed)); + +/* Partition description. */ +struct grub_partition +{ + /* The start sector. */ + unsigned long start; + + /* The length in sector units. */ + unsigned long len; + + /* The offset of the partition table. */ + unsigned long offset; + + /* The offset of the extended partition. */ + unsigned long ext_offset; + + /* The index of this partition in the partition table. */ + int index; + =20 + /* The DOS partition number. */ + int dos_part; + + /* The BSD partition number (a =3D=3D 0). */ + int bsd_part; + + /* The DOS partition type. */ + int dos_type; + + /* The BSD partition type. */ + int bsd_type; +}; +typedef struct grub_partition *grub_partition_t; + +struct grub_disk; + +grub_partition_t EXPORT_FUNC(grub_partition_probe) (struct grub_disk *disk, + const char *str); +grub_err_t EXPORT_FUNC(grub_partition_iterate) (struct grub_disk *disk, + int (*hook) (const grub_partition_t partition)); +char *EXPORT_FUNC(grub_partition_get_name) (const grub_partition_t partiti= on); + +static inline unsigned long +grub_partition_get_start (const grub_partition_t p) +{ + return p->start; +} + +static inline unsigned long +grub_partition_get_len (const grub_partition_t p) +{ + return p->len; +} + +static inline int +grub_partition_is_empty (int type) +{ + return (type =3D=3D GRUB_PARTITION_TYPE_NONE); +} + +static inline int +grub_partition_is_extended (int type) +{ + return (type =3D=3D GRUB_PARTITION_TYPE_EXTENDED + || type =3D=3D GRUB_PARTITION_TYPE_WIN95_EXTENDED + || type =3D=3D GRUB_PARTITION_TYPE_LINUX_EXTENDED); +} + +static inline int +grub_partition_is_bsd (int type) +{ + return (type =3D=3D GRUB_PARTITION_TYPE_FREEBSD + || type =3D=3D GRUB_PARTITION_TYPE_OPENBSD + || type =3D=3D GRUB_PARTITION_TYPE_NETBSD); +} + +#endif /* ! GRUB_PARTITION_HEADER */ diff -urN grub2.orig/include/grub/arm/RISC_OS/time.h grub2.patch1/include/g= rub/arm/RISC_OS/time.h =2D-- grub2.orig/include/grub/arm/RISC_OS/time.h 1970-01-01 01:00:00.000000= 000 +0100 +++ grub2.patch1/include/grub/arm/RISC_OS/time.h 2004-05-19 10:55:26.000000= 000 +0100 @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003 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. + */ + +#ifndef KERNEL_TIME_HEADER +#define KERNEL_TIME_HEADER 1 + +#ifdef GRUB_UTIL +# include +# define GRUB_TICKS_PER_SECOND CLOCKS_PER_SEC +#else +# define GRUB_TICKS_PER_SECOND 100 +#endif + +/* Return the real time in ticks. */ +grub_uint32_t grub_get_rtc (void); + +#endif /* ! KERNEL_TIME_HEADER */ diff -urN grub2.orig/include/grub/arm/setjmp.h grub2.patch1/include/grub/ar= m/setjmp.h =2D-- grub2.orig/include/grub/arm/setjmp.h 1970-01-01 01:00:00.000000000 +0= 100 +++ grub2.patch1/include/grub/arm/setjmp.h 2004-05-19 00:39:16.000000000 +0= 100 @@ -0,0 +1,25 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003 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. + */ + +#ifndef GRUB_SETJMP_CPU_HEADER +#define GRUB_SETJMP_CPU_HEADER 1 + +typedef unsigned long grub_jmp_buf[11]; + +#endif /* ! GRUB_SETJMP_CPU_HEADER */ diff -urN grub2.orig/include/grub/arm/types.h grub2.patch1/include/grub/arm= /types.h =2D-- grub2.orig/include/grub/arm/types.h 1970-01-01 01:00:00.000000000 +01= 00 +++ grub2.patch1/include/grub/arm/types.h 2004-05-19 00:41:04.000000000 +01= 00 @@ -0,0 +1,32 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002 Free Software Foundation, Inc. + * + * GRUB 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 GRUB; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GRUB_TYPES_CPU_HEADER +#define GRUB_TYPES_CPU_HEADER 1 + +/* The size of void *. */ +#define GRUB_HOST_SIZEOF_VOID_P 4 + +/* The size of long. */ +#define GRUB_HOST_SIZEOF_LONG 4 + +/* ARM is little-endian. (Or big-endian!! - but we don't support that yet)= */ +#undef GRUB_HOST_WORDS_BIGENDIAN + +#endif /* ! GRUB_TYPES_CPU_HEADER */ diff -urN grub2.orig/include/grub/symbol.h grub2.patch1/include/grub/symbol= =2Eh =2D-- grub2.orig/include/grub/symbol.h 2004-05-21 12:14:37.000000000 +0100 +++ grub2.patch1/include/grub/symbol.h 2004-05-18 22:48:26.000000000 +0100 @@ -29,8 +29,8 @@ # define EXT_C(sym) sym #endif =20 =2D#define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), @function ; EXT_C(= x): =2D#define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), @object ; EXT_C(x): +#define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x= ): +#define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x): =20 /* Mark an exported symbol. */ #define EXPORT_FUNC(x) x diff -urN grub2.orig/kern/arm/aif_header.lds grub2.patch1/kern/arm/aif_head= er.lds =2D-- grub2.orig/kern/arm/aif_header.lds 1970-01-01 01:00:00.000000000 +0100 +++ grub2.patch1/kern/arm/aif_header.lds 2004-05-21 11:55:49.000000000 +0100 @@ -0,0 +1,23 @@ +/* aif_header.lds - Calculate values for AIF header */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004 Timothy Baldwin. + * + * 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. + */ + +grub_aif_text_size =3D __data_start - 0x8000; +grub_aif_data_size =3D _edata - __data_start; +grub_aif_bss_size =3D _end - _edata; diff -urN grub2.orig/kern/arm/aif_header.S grub2.patch1/kern/arm/aif_header= =2ES =2D-- grub2.orig/kern/arm/aif_header.S 1970-01-01 01:00:00.000000000 +0100 +++ grub2.patch1/kern/arm/aif_header.S 2004-05-21 11:55:54.000000000 +0100 @@ -0,0 +1,68 @@ +/* aif_header.S - AIF header */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004 Timothy Baldwin. + * + * 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 + * aword with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + + .global _start +_start: nop + nop + bl zeroinit + bl grub_arm_startup +lock: b lock @ "Program exit instruction" (never reached) + .word grub_aif_text_size + .word grub_aif_data_size + .word 0 @ Debug data size +zisize: .word grub_aif_bss_size + .word 0 @ No Debug data + .word _start + .word 0 @ Workspace for self-moving image (not used) + .word 32 @ Yes, we work in 32bit PC modes. + .word __data_start + .word 0, 0 @ Unused + nop @ Initialise debugger (NOT!!) +=09 +zeroinit: + ldr r0, =3D__bss_start + ldr r4, zisize +=09 + @ Move appended modules out of the way + add r1, r0, r4 + ldr r2, EXT_C(grub_total_module_size) +1: ldr r3, [r0, r2] + str r3, [r1, r2] + subs r2, r2, #4 + bcs 1b +=09 + @ Zero BSS area + mov r1, #0=09 +1: str r1, [r0], #4=09 + subs r4, r4, #4 + bcs 1b + mov pc, lr + + .ltorg + .org _start + 128 +=09 + @ Size of appended modules +VARIABLE(grub_total_module_size) + .word 0=09 +VARIABLE(grub_end_addr) + .word _end diff -urN grub2.orig/kern/arm/RISC_OS/init.c grub2.patch1/kern/arm/RISC_OS/= init.c =2D-- grub2.orig/kern/arm/RISC_OS/init.c 1970-01-01 01:00:00.000000000 +0100 +++ grub2.patch1/kern/arm/RISC_OS/init.c 2004-05-21 11:38:09.000000000 +0100 @@ -0,0 +1,40 @@ +/* init.c - RISC OS Initialisation */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004 Timothy Baldwin. + * + * 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 +#include +#include +#include + +extern grub_addr_t grub_RISC_OS_memory_limit; + +void +grub_machine_init () +{ + //grub_RISC_OS_message("Hello World!\n\r"); + grub_console_init (); + grub_mm_init_region ((void *) grub_end_addr + grub_total_module_size, + grub_RISC_OS_memory_limit - (grub_end_addr + + grub_total_module_size)); + grub_env_set ("prefix", "(native)ADFS::0/$"); + grub_printf ("Hello World!\n"); + //grub_stop(); +} diff -urN grub2.orig/kern/arm/RISC_OS/startup.S grub2.patch1/kern/arm/RISC_= OS/startup.S =2D-- grub2.orig/kern/arm/RISC_OS/startup.S 1970-01-01 01:00:00.000000000 += 0100 +++ grub2.patch1/kern/arm/RISC_OS/startup.S 2004-05-21 11:59:14.000000000 += 0100 @@ -0,0 +1,119 @@ +/* startup.S - RISC OS Initialisation*/ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004 Timothy Baldwin. + * + * 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 + +#define OS_ChangeEnvironment 0x40 +#define OS_GenerateError 0x2B +#define OS_Exit 0x11 +#define OS_CLI 0x05 +#define OS_ReadMonotonicTime 0x42 + + + .data +handlers: + .word 0 +VARIABLE(grub_RISC_OS_memory_limit) + .word 0, 0, 0 + .word 6, error_handler, 0, error_buffer + .word 11, grub_stop, 0, 0 + .word 13, exception_registers, 0, 0 + .word 14 +VARIABLE(grub_RISC_OS_application_space) + .word 0, 0, 0 + .word 16, upcall_handler, 0, 0 +=09 + .text +swap_handlers: + mov r5, lr + ldr r4, =3Dhandlers +1: ldmia r4, {r0-r3} + swi OS_ChangeEnvironment + stmia r4!, {r0-r3} + teq r0, #16 + bne 1b + mov pc, r5 +=09 +error_handler: + @ TODO: do longjmp + mov r6, r0 + bl swap_handlers + add r0, r6, #4 + swi OS_GenerateError +=09 +upcall_handler: + subs r0, r0, #256 + moveq pc, lr + @beq upcall_newapp + teq r0, #1 + add r0, r0, #256 + @beq upcall_movemem + movne pc, lr +upcall_movemem: + movs r1, r1 + movpl r0, #0 + mov pc, lr +=09 +upcall_newapp: + @stmfd sp!, {r0-r5, lr} + @bl swap_handlers + @ldmfd sp!, {r0-r5, pc} +=09 + .globl grub_arm_startup +grub_arm_startup: + ldr sp, =3Dstack_end + bl swap_handlers + mov fp, #0 + bl grub_main +FUNCTION(grub_stop) + @ TODO: at_exit + ldr sp, =3Dstack_end + bl swap_handlers + mov r0, #0 + swi OS_Exit +=09 +FUNCTION(grub_RISC_OS_chain) + mov r6, r0 + ldr sp, =3Dstack_end + bl swap_handlers + mov r0, r5 + mov r1, #0 + swi OS_CLI + swi OS_Exit +=09 +FUNCTION(grub_get_rtc) + swi OS_ReadMonotonicTime + mov pc, lr +=09 + + .bss +stack_limit: + .space 0x4000 +stack_end: +exception_registers: + .space 17 * 4 +error_buffer: + .space 260 +=09 +VARIABLE(grub_os_area_addr) +VARIABLE(grub_os_area_size) +colourstate: + .space 4 diff -urN grub2.orig/kern/arm/setjmp.S grub2.patch1/kern/arm/setjmp.S =2D-- grub2.orig/kern/arm/setjmp.S 1970-01-01 01:00:00.000000000 +0100 +++ grub2.patch1/kern/arm/setjmp.S 2004-05-21 11:55:46.000000000 +0100 @@ -0,0 +1,31 @@ +/* aif_header.S - setjmp and longjmp */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004 Timothy Baldwin. + * + * 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 + * aword with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +=20 +FUNCTION(grub_setjmp) + stmia r0, {r4-r14} + mov pc, lr +=09 +FUNCTION(grub_longjmp) + ldmia r0, {r4-r14} + mov r0, r1 + mov pc, lr diff -urN grub2.orig/term/arm/RISC_OS/console-asm.S grub2.patch1/term/arm/R= ISC_OS/console-asm.S =2D-- grub2.orig/term/arm/RISC_OS/console-asm.S 1970-01-01 01:00:00.0000000= 00 +0100 +++ grub2.patch1/term/arm/RISC_OS/console-asm.S 2004-05-21 11:59:12.0000000= 00 +0100 @@ -0,0 +1,92 @@ +/* startup.S - RISC OS Console*/ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004 Timothy Baldwin. + * + * 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 + +#define OS_Write0 0x02 +#define OS_WriteC 0x00 +#define OS_WriteI 0x100 +#define OS_WriteN 0x46 +#define OS_Byte 0x06 +#define OS_ReadC 0x04 + +FUNCTION(grub_RISC_OS_message) + swi OS_Write0 + mov pc, lr +=09 +FUNCTION(grub_console_gotoxy) + swi OS_WriteI + 31 + swi OS_WriteC + mov r0, r1 +FUNCTION(grub_console_real_putchar) + swi OS_WriteC + mov pc, lr +=09 +FUNCTION(grub_console_getxy) + mov r0, #165 + swi OS_Byte + orr r0, r2, r1, lsl #8 + mov pc, lr + +FUNCTION(grub_console_setcursor) + swi OS_WriteI + 23 + swi OS_WriteI + 1 + swi OS_WriteC +pnulls: adr r0, nulls + mov r1, #8 + swi OS_WriteN + mov pc, lr +=09 +FUNCTION(grub_console_setcolourstate) + ldr r2, =3Dcolourstate + and r0, r0, #2 + ldrb r1, [r2] + teq r0, r1 + moveq pc, lr + strb r0, [r2] + swi OS_WriteI + 23 @ Swap text foreground/background colours + swi OS_WriteI + 17 + swi OS_WriteI + 5 + b pnulls +=09 +=09 +FUNCTION(grub_console_cls) + swi OS_WriteI + 12 + mov pc, lr +=09 +FUNCTION(grub_console_getkey) + swi OS_ReadC + mov pc, lr + +FUNCTION(grub_console_checkkey) + mov r0, #129 @ Read key with time limit + mov r1, #0 @ Timeout low byte + mov r2, #0 @ Timeout high byte ( < 0x80 ) + swi OS_Byte + movs r2, r2 @ r2 =3D 0 if key read + moveq r0, r1 @ r1 =3D key if read + mvnne r0, #0 + mov pc, lr + + .bss +colourstate: + .space 4 +=09 \ No newline at end of file diff -urN grub2.orig/term/arm/RISC_OS/console.c grub2.patch1/term/arm/RISC_= OS/console.c =2D-- grub2.orig/term/arm/RISC_OS/console.c 1970-01-01 01:00:00.000000000 += 0100 +++ grub2.patch1/term/arm/RISC_OS/console.c 2004-05-20 19:38:23.000000000 += 0100 @@ -0,0 +1,97 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003 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 +#include + + +static void +grub_console_putchar (grub_uint32_t c) +{ + if (c > 0x7f) + { + /* Map some unicode characters to the VGA font, if possible. */ + switch (c) + { + case 0x2190: /* left arrow */ + c =3D 0x1b; + break; + case 0x2191: /* up arrow */ + c =3D 0x18; + break; + case 0x2192: /* right arrow */ + c =3D 0x1a; + break; + case 0x2193: /* down arrow */ + c =3D 0x19; + break; + case 0x2501: /* horizontal line */ + c =3D 0xc4; + break; + case 0x2503: /* vertical line */ + c =3D 0xb3; + break; + case 0x250F: /* upper-left corner */ + c =3D 0xda; + break; + case 0x2513: /* upper-right corner */ + c =3D 0xbf; + break; + case 0x2517: /* lower-left corner */ + c =3D 0xc0; + break; + case 0x251B: /* lower-right corner */ + c =3D 0xd9; + break; + + default: + c =3D '?'; + break; + } + } + + grub_console_real_putchar (c); +} + + +static struct grub_term grub_console_term =3D + { + .name =3D "console", + .init =3D 0, + .fini =3D 0, + .putchar =3D grub_console_putchar, + .checkkey =3D grub_console_checkkey, + .getkey =3D grub_console_getkey, + .getxy =3D grub_console_getxy, + .gotoxy =3D grub_console_gotoxy, + .cls =3D grub_console_cls, + .setcolorstate =3D grub_console_setcolourstate, + .setcolor =3D 0, + .setcursor =3D grub_console_setcursor, + .flags =3D 0, + .next =3D 0 + }; + +void +grub_console_init (void) +{ + grub_term_register (&grub_console_term); + grub_term_set_current (&grub_console_term); +} --Boundary-01=_ou0rAyM/4WeLPYH-- --Boundary-03=_ou0rAIYga/9iRJN Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBAr0uojXSPyZ9/z+QRAvDnAKCvdq1PhNBT5lto0kfRZwQ2RJk3UwCeNX72 irhWb3pNjI6f6SM5tqZynbU= =Ql2M -----END PGP SIGNATURE----- --Boundary-03=_ou0rAIYga/9iRJN--