Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2015 09:50:40 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Jason Unovitch <jason.unovitch@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: reload kernel without reboot?
Message-ID:  <44wpz56pxr.fsf@lowell-desk.lan>
In-Reply-To: <CABW2x9p3Kq_-bhArq_UMf0G%2B3=d4z=XiQqX-kFVrpWHgqfVHeQ@mail.gmail.com> (Jason Unovitch's message of "Sun, 14 Jun 2015 15:48:19 -0400")
References:  <CAPkyVLwy_cW9fuY4CLgGtXKcLb7qeLNk9VdiHQA3OYy-rbq6ew@mail.gmail.com> <20150614182418.56857acc.freebsd@edvax.de> <CABW2x9p3Kq_-bhArq_UMf0G%2B3=d4z=XiQqX-kFVrpWHgqfVHeQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Jason Unovitch <jason.unovitch@gmail.com> writes:

> On Jun 14, 2015 12:30 PM, "Polytropon" <freebsd@edvax.de> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44wpz56pxr.fsf>