From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 4 21:23:23 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 381239F; Thu, 4 Sep 2014 21:23:23 +0000 (UTC) Received: from mon-colo.panasas.com (mon-colo.panasas.com [209.166.131.137]) by mx1.freebsd.org (Postfix) with ESMTP id D1E6C18B2; Thu, 4 Sep 2014 21:23:22 +0000 (UTC) Received: from seabiscuit.panasas.com ([172.17.132.204]) by mon-colo.panasas.com with Microsoft SMTPSVC(7.0.6001.18000); Thu, 4 Sep 2014 17:23:20 -0400 Received: from SEABISCUIT.int.panasas.com ([172.17.132.204]) by seabiscuit ([172.17.132.204]) with mapi id 14.03.0181.006; Thu, 4 Sep 2014 14:23:20 -0700 From: "Sinha, Prokash" To: John Baldwin Subject: Re: PXE boot Thread-Topic: PXE boot Thread-Index: AQHPx7q2tjxfRdxxqUWbg0sIKzb+LpvwCpsAgAF8gAD//6TLgIAAAKKAgACLjID//8T9AIAAAF0A Date: Thu, 4 Sep 2014 21:23:19 +0000 Message-ID: References: <2303890.kxxKhV23z4@ralph.baldwin.cx> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.17.133.204] Content-Type: text/plain; charset="iso-8859-2" Content-ID: <2630458C4A10414690BA3729DB6F27C2@panasas.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 04 Sep 2014 21:23:20.0804 (UTC) FILETIME=[739F8240:01CFC886] Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 21:23:23 -0000 On 9/4/14 2:22 PM, "Sinha, Prokash" wrote: >Yeah, something going on that I don't understand. I defined that macro, >and for quick verify - >make -v=20 >Warning: Object directory not changed from original >/.automount/nfs.paneast.panasas.com/root/home/psinha/psinha-bug-pa/src/fre >e >bsd-c/sys/boot/i386/pxeldr >cc -O2 -fno-strict-aliasing -pipe -ffreestanding >-mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 >-mno-sse3 -m32 -march=3Di386 -DALWAYS_SERIAL -c pxeldr.S >cc -O2 -fno-strict-aliasing -pipe -ffreestanding >-mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 >-mno-sse3 -m32 -march=3Di386 -DALWAYS_SERIAL -nostdlib -m elf_i386_fbsd = -N >-e start -Ttext 0x7c00 -Wl,-S,--oformat,binary -o pxeldr pxeldr.o >make: don't know how to make pxeboot.8. Stop > >=3D=3D> The variable is defined and the correct flag is included in the cc= ... > > >But I still don't get the messages from pxe_enable or pxe_init... > >Need to sit back and look further... > >John, much appreciated for the help... > >If anything else you can think of, please drop couple lines for me to >investigate... >-prokash > >On 9/4/14 10:53 AM, "John Baldwin" wrote: > >>On Thursday, September 04, 2014 04:33:46 PM Sinha, Prokash wrote: >>> On 9/4/14 9:31 AM, "Sinha, Prokash" wrote: >>> >Thanks once again... >>> > >>> >This is the part - that you spelled out is why I had a trace in the >>> >pxe_enable(...) routine. As well as at pxe_init( ...) routine, just to >>>be >>> >sure >>> >the pxe.c routines are working like ( as you said ) devsw invocation. >>>But >>> >did not see the trace messages, could be serial console is not acting >>>( >>> >though I doubt it). >>> > >>> >Now gave me a base, off of what I could debug ... >> >>Hmm, the console should be working (cons_probe() is called before >>pxe_enable()). However, if you are using 'console=3Dcomconsole' in >>loader.conf=20 >>to set a serial console, you won't see early messages because loader.conf >>is=20 >>processed after main() calls interact() at the bottom of the function. >>If you=20 >>want to see early loader messages on serial, you will need to build >>pxeboot=20 >>with BOOT_PXELDR_ALWAYS_SERIAL defined as a make variable (so on the >>command=20 >>line, or in /etc/make.conf or /etc/src.conf). That will force a serial >>console for early loader messages. >> >>> > >>> >-prokash >>> > >>> >On 9/4/14 7:57 AM, "John Baldwin" wrote: >>> >>On Wednesday, September 03, 2014 11:16:05 PM Sinha, Prokash wrote: >>> >>> Thanks much, John ! >>> >>>=20 >>> >>> When it starts executing ? How ?. Who starts executing these. From >>>the >>> >>> Makefile it's org is 0x7c00. So I would assume that it would be >>>loaded >>> >>> >>> >>>at >>> >>> >>> >>> that absolute real-mode address !. I don't understand this part. >>>But, >>> >>> >>> >>>if I >>> >>> >>> >>> put traces, I see pxe_open, and pxe_close are being called, but >>>after >>> >>> >>> >>>all >>> >>> >>> >>> these pxe_calls are done, the loader's main is invoked at Rebooting >>>=A9 >>> >>> >>> >>>time. >>> >>> >>> >>> We are using a net boot server, and I see mountd- authenticated =A9 >>> >>> >>> >>>message >>> >>> >>> >>> storm on the boot server side. >>> >>>=20 >>> >>> Wondering what could cause such a message storm, while pxe_open() >>>-> >>> >>> >>> >>>net >>> >>> >>> >>> if_open( ) executes. >>> >> >>> >>The PXE BIOS uses TFTP to fetch the pxeboot binary (and it will do >>>its >>> >>own >>> >>DHCP, etc. as part of doing that). It writes the binary it downloads >>> >>starting >>> >>at address 0x7c00. Once the download is complete, it jumps to 0x7c00 >>> >>similar >>> >>to how booting from a disk loads the first sector at address 0x7c00 >>>and >>> >>then >>> >>jumps to it. >>> >> >>> >>The PXE calls in libi386 should not be invoked until the loader >>>main() >>> >>routine >>> >> >>> >>runs: >>> >> /* >>> >> =20 >>> >> * Special handling for PXE and CD booting. >>> >> */ >>> >> =20 >>> >> if (kargs->bootinfo =3D=3D 0) { >>> >>=09 >>> >> /* >>> >>=09 >>> >> * We only want the PXE disk to try to init itself in the below >>> >> * walk through devsw if we actually booted off of PXE. >>> >> */ >>> >>=09 >>> >> if (kargs->bootflags & KARGS_FLAGS_PXE) >>> >>=09 >>> >> pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL); >>> >>=09 >>> >> else if (kargs->bootflags & KARGS_FLAGS_CD) >>> >>=09 >>> >> bc_add(initial_bootdev); >>> >> =20 >>> >> } >>> >> >>> >>That enables the PXE devsw driver so that it will do something later >>>when >>> >> >>> >>main() calls all the devsw init routines: >>> >> /* >>> >> =20 >>> >> * March through the device switch probing for things. >>> >> */ >>> >> =20 >>> >> for (i =3D 0; devsw[i] !=3D NULL; i++) >>> >>=09 >>> >> if (devsw[i]->dv_init !=3D NULL) >>> >>=09 >>> >> (devsw[i]->dv_init)(); >>> >> =20 >>> >> printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, >>> >> >>> >>bios_extmem / 1024); >> >>--=20 >>John Baldwin >