From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 16 20:08:30 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A678F106564A for ; Thu, 16 Jun 2011 20:08:30 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 36F588FC18 for ; Thu, 16 Jun 2011 20:08:30 +0000 (UTC) Received: by fxm11 with SMTP id 11so1971537fxm.13 for ; Thu, 16 Jun 2011 13:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=SuQBkPr5Mf053ilQsgPCQLNuCrTV1NCwHSRzdFsOTAw=; b=SYLVafDu8L9d/O2Ae/YPmHscKoEU/rvKz8VPtCktXLcL6RIStxFi6qDlNqxce5LZJE nxY8R7WK8GsNnfNlHCXDtqKHMXvSZvrAjYMtzlFjEi5K1G6hI5KVVTjVQwddrqM1+egj /Yfi8e60BMX9FQe8gKkjfXFb9alOaB9EAMDrQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Q6snhWMtewCdadtjz1ZVfpOg9hzA4BYN/5qgs9Uh4IJBzyj2tjKT0/Dtbj7mFutEWq GhLp5D+ZToAROfx4UeeMiqj6KmFNpc5qxow95ZZjXdWjvmSbeh21wA0RRS4EYe9mIjoX 3us35JlqaYkwycEAP5UaFnfQc4q/j0E1BbQRs= Received: by 10.223.37.153 with SMTP id x25mr1581820fad.117.1308254909255; Thu, 16 Jun 2011 13:08:29 -0700 (PDT) Received: from localhost (lan-78-157-92-5.vln.skynet.lt [78.157.92.5]) by mx.google.com with ESMTPS id g8sm990894fai.44.2011.06.16.13.08.27 (version=SSLv3 cipher=OTHER); Thu, 16 Jun 2011 13:08:28 -0700 (PDT) Date: Thu, 16 Jun 2011 23:06:16 +0300 From: Gleb Kurtsou To: Russell Cattelan Message-ID: <20110616200616.GA67011@tops> References: <4DFA4C47.8060503@digitalelves.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4DFA4C47.8060503@digitalelves.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org Subject: Re: kexec or similar for FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 20:08:30 -0000 On (16/06/2011 13:32), Russell Cattelan wrote: > I have been contacted about possibly implementing a fast reboot > mechanism for FreeBSD similar to kexec on Linux. > > I have just started looking into how this accomplished so I figured > a note to freebsd hackers would also be a good place to ask > for comments. > > Has anybody looked at doing something like kexec? I was working on similar project some time ago. First of all you have to leave hardware in known good state for a new kernel. Reseting devices can be generally accomplished by unloading corresponding kernel modules (even if they are compiled in kernel). The biggest problem for me was timers and programmable interrupt controller. I didn't make it work properly, but my goals where much wider than replacing with another FreeBSD kernel. Aim was to restore initial BIOS state as much as possible. > Is it the right thing to do for FreeBSD. I'm concerned that the way > FreeBSD handles early kernel modules (loaded via the boot loader) > vs linux which does everything via initrd is going to be a problem. I find loader code easy work with. You could write dummy filesystem implementation for libstand. So that customized loader will load both kernel and modules yet while running FreeBSD. Your "reboot" procedure wouldn't even use any BIOS io interrupts. Linux boot is a real mess imho. > > Thanks for any help on this. > > -Russell Cattelan