From owner-freebsd-sparc64@FreeBSD.ORG Tue Oct 25 17:31:23 2005 Return-Path: X-Original-To: freebsd-sparc64@freebsd.org Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC9A516A41F for ; Tue, 25 Oct 2005 17:31:23 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from mv.twc.weather.com (mv.twc.weather.com [65.212.71.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F8CB43D6B for ; Tue, 25 Oct 2005 17:31:23 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from [10.50.41.234] (Not Verified[10.50.41.234]) by mv.twc.weather.com with NetIQ MailMarshal (v6, 0, 3, 8) id ; Tue, 25 Oct 2005 13:48:06 -0400 From: John Baldwin To: freebsd-sparc64@freebsd.org Date: Tue, 25 Oct 2005 13:32:58 -0400 User-Agent: KMail/1.8.2 References: <435DEAF6.8020503@itbs.cz> In-Reply-To: <435DEAF6.8020503@itbs.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510251332.59038.jhb@freebsd.org> Cc: Subject: Re: SPARC iso9660 boot loader loading alternative OS? X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2005 17:31:24 -0000 On Tuesday 25 October 2005 04:21 am, Jakub Jermar wrote: > Hi, > > I am looking for a suitable bootloader for my school > operating system kernel. I came across to FreeBSD and tried > to produce a bootable CD. > > I downloaded 5.4-RELEASE-sparc64-bootonly.iso, replaced > FreeBSD kernel with my own and produced iso9660 image like this: > > mkisofs -f -G root/boot/boot1 -B ... -r -o image.iso root/ > > When I try to boot it, I get a message like this: > >> FreeBSD/sparc64 boot block > > Boot path: /sbus@3,0/SUNW,fas@3,8800000/sd@6,0:f > Boot loader: /boot/loader > Not ufs > mount: can't read superblock > panic: mount > Program terminated > ok > > I guess the ISO image is missing something. Can you help me > and say what am I doing wrong? The cdboot doesn't actually load the /boot/loader from the CD, it loads /boot/loader out of a UFS image on the CD and the loader loads the kernel. You can look in src/release/sparc64 to find the script that creates the sparc64 ISO images. Alternatively, here's some csh shell script code that I use to build release ISOs: #!/bin/csh # # Script to build an ISO image # check for required variables if ( ! $?DISC_NUMBER ) then echo "Disc Number not specified" exit 1 endif if ( ! $?WORK_DIR ) then echo "Release work directory not set" exit 1 endif if ( ! $?RELEASE ) then echo "Release Name not set" exit 1 endif if ( ! $?CD_DIR ) then echo "Destination directory not set" exit 1 endif # set variables if ( ! $?ARCH ) set ARCH=`uname -m` setenv APPLICATION "FreeBSD ${RELEASE}" setenv CD_BOOT_FLAGS "" set VOLUME_ID="${APPLICATION} Disc ${DISC_NUMBER}" set DISC=disc${DISC_NUMBER} if ( ! $?ISO_SUFFIX ) then set ISO_SUFFIX="" endif if ( $?ISO_ARCH_NAME ) then set ISO=${CD_DIR}/${RELEASE}-${DISC}-${ARCH}${ISO_SUFFIX}.iso else set ISO=${CD_DIR}/${RELEASE}-${DISC}${ISO_SUFFIX}.iso endif if ( ! $?PUBLISHER ) then setenv PUBLISHER "John Baldwin / http://www.FreeBSD.org/~jhb" endif if ( ! $?PREPARER ) then setenv PREPARER "John Baldwin / jhb@FreeBSD.org" endif # setup boot options if ( $ARCH == i386 ) then setenv CD_BOOT_FLAGS "-b boot/cdboot -no-emul-boot" else if ( $ARCH == sparc64 ) then set BOOTFS=/tmp/bootfs_image.$$ set MNT=/tmp/bootfs_mount.$$ dd if=/dev/zero of=${BOOTFS} bs=512 count=1024 set MD=`mdconfig -a -t vnode -f ${BOOTFS}` disklabel -Brw ${MD} auto newfs /dev/${MD}c mkdir -p ${MNT} mount /dev/${MD}c ${MNT} mkdir ${MNT}/boot cp ${WORK_DIR}/R/cdrom/${DISC}/boot/loader ${MNT}/boot umount ${MNT} rmdir ${MNT} mdconfig -d -u ${MD:s/md//} setenv CD_BOOT_FLAGS "-B ,,,,${BOOTFS}" endif echo "---> Generating ISO" `basename ${ISO}` mkdir -p ${CD_DIR} mkisofs -J -p "${PREPARER}" -P "${PUBLISHER}" -r -A "${APPLICATION}" \ ${CD_BOOT_FLAGS} -V "${VOLUME_ID}" -o ${ISO} ${WORK_DIR}/R/cdrom/${DISC} $* if ( $ARCH == alpha ) then setcdboot ${ISO} boot/cdboot else if ( $ARCH == sparc64 ) then rm -f ${BOOTFS} endif -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org