From owner-freebsd-questions@FreeBSD.ORG Mon Jun 15 13:50:55 2015 Return-Path: Delivered-To: freebsd-questions@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35ACF7DE for ; Mon, 15 Jun 2015 13:50:55 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 0DB7BA8A for ; Mon, 15 Jun 2015 13:50:54 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from lowell-desk.lan (router.lan [172.30.250.2]) by be-well.ilk.org (Postfix) with ESMTP id A543533C48; Mon, 15 Jun 2015 09:50:42 -0400 (EDT) Received: by lowell-desk.lan (Postfix, from userid 1147) id 6004139813; Mon, 15 Jun 2015 09:50:40 -0400 (EDT) From: Lowell Gilbert To: Jason Unovitch Cc: freebsd-questions@freebsd.org Subject: Re: reload kernel without reboot? References: <20150614182418.56857acc.freebsd@edvax.de> Reply-To: freebsd-questions@freebsd.org Date: Mon, 15 Jun 2015 09:50:40 -0400 In-Reply-To: (Jason Unovitch's message of "Sun, 14 Jun 2015 15:48:19 -0400") Message-ID: <44wpz56pxr.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 13:50:55 -0000 Jason Unovitch writes: > On Jun 14, 2015 12:30 PM, "Polytropon" wrote: >> >> On Sun, 14 Jun 2015 13:24:59 +0430, takCoder wrote: >> > my question is: Is there a way to reload freebsd kernel in which i don't >> > need to restart to apply the changes? >> >> Probably not, because the kernel is the first thing the >> OS boot mechanism will load, and this is required at the >> earliest stage of OS booting for the kernel to work as >> intended. What you would need is to change the kernel >> binary content (after source change and compile run) >> both on disk and in memory, with all its location references >> and dependency resolutions so the result parts will work >> consistently again. I'd say that's a very hard task, nearly >> impossible. >> >> However, if you are able to move the things you want to >> "dynamically load and unload" into kernel modules - there >> might be a solution for you. Kernel modules can be dealt >> with easily using kldload and kldunload. However, the >> kernel itself cannot be unloaded and reloaded with those >> tools. > > That is worth a read. I'm sure if it were easy it would have been > implemented by now. A standard kernel comes with many hundreds of kernel modules. We don't know what you're working on specifically, but the building and loading and unloading of modules is not tricky.