From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 3 21:04:52 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 359CDA5F for ; Wed, 3 Sep 2014 21:04:52 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4951543 for ; Wed, 3 Sep 2014 21:04:52 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F1971B95E; Wed, 3 Sep 2014 17:04:50 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Subject: Re: PXE boot Date: Wed, 03 Sep 2014 17:03:44 -0400 Message-ID: <1641492.zXWdUoX4Sh@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 03 Sep 2014 17:04:51 -0400 (EDT) Cc: "Sinha, Prokash" 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: Wed, 03 Sep 2014 21:04:52 -0000 On Wednesday, September 03, 2014 04:12:01 PM Sinha, Prokash wrote: > Hi All, >=20 > I'm trying to understand the invocation of the routines pxe_init(); > pxe_open() etc. in pxe.c >=20 > By the structure, it looks like a driver with devsw_pxedisk =3D { ent= ry points > =E2=80=A6} >=20 > Once this pxeldr is brought down from the net boot server, how does i= t get > invoked ( or rather who calls these routines ) ??? The loader ( strap= ped > with it don't seem to call). >=20 > I assume that the the boot code in the NVRAM ( or wherever ) of the N= IC that > supports calls these pxe_* () functions ??? pxeboot is pxeldr + /boot/loader. The firmware (BIOS or EFI) downloads= the=20 pxeboot binary to a known fixed address and starts executing it. When = it=20 starts executing, pxeldr finds the /boot/loader binary "behind" it and=20= arranges for it to run. It passes a flag telling it that it was booted= via=20 PXE. The loader then uses the routines in pxe.c to talk to firmware on= the=20 NIC. The firmware provides both TFTP and UDP interfaces. The loader u= ses=20 those to provide either a TFTP "filesystem" or to mount an NFS filesyst= em over=20 UDP. --=20 John Baldwin