Date: Thu, 04 Sep 2014 10:57:56 -0400 From: John Baldwin <jhb@freebsd.org> To: "Sinha, Prokash" <psinha@panasas.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: PXE boot Message-ID: <8193889.CqHK0JhjBu@ralph.baldwin.cx> In-Reply-To: <D02CE8DA.17D2%psinha@panasas.com> References: <D02C8BE1.179F%psinha@panasas.com> <1641492.zXWdUoX4Sh@ralph.baldwin.cx> <D02CE8DA.17D2%psinha@panasas.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 th= e > Makefile it's org is 0x7c00. So I would assume that it would be loade= d 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 =C5= =A0 time. >=20 > We are using a net boot server, and I see mountd- authenticated =C5=A0= 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=20 DHCP, etc. as part of doing that). It writes the binary it downloads s= tarting=20 at address 0x7c00. Once the download is complete, it jumps to 0x7c00 s= imilar=20 to how booting from a disk loads the first sector at address 0x7c00 and= then=20 jumps to it. The PXE calls in libi386 should not be invoked until the loader main() = routine=20 runs: /* * Special handling for PXE and CD booting. */ if (kargs->bootinfo =3D=3D 0) { =09/* =09 * We only want the PXE disk to try to init itself in the below =09 * walk through devsw if we actually booted off of PXE. =09 */ =09if (kargs->bootflags & KARGS_FLAGS_PXE) =09 pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL); =09else if (kargs->bootflags & KARGS_FLAGS_CD) =09 bc_add(initial_bootdev); } That enables the PXE devsw driver so that it will do something later wh= en=20 main() calls all the devsw init routines: /* * March through the device switch probing for things. */ for (i =3D 0; devsw[i] !=3D NULL; i++) =09if (devsw[i]->dv_init !=3D NULL) =09 (devsw[i]->dv_init)(); printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024,=20= bios_extmem / 1024); --=20 John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8193889.CqHK0JhjBu>