Date: Thu, 24 Jan 2013 11:45:00 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-virtualization@freebsd.org Cc: Tom Hanrahan <hanrahat@microsoft.com>, Nick Meier <Nick.Meier@microsoft.com>, "Abhishek Gupta \(LIS\)" <abgupta@microsoft.com>, Peter Grehan <grehan@netapp.com> Subject: Re: Getting enlightened drivers to load only when Hyper-V (or Azure) is detected Message-ID: <201301241145.00836.jhb@freebsd.org> In-Reply-To: <e667db14921a4fe294e9cf2c72b45e2a@BY2PR03MB058.namprd03.prod.outlook.com> References: <e667db14921a4fe294e9cf2c72b45e2a@BY2PR03MB058.namprd03.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, January 24, 2013 9:50:54 am Larry Melia (Insight Global) wrote: > We're preparing our Hyper-V, enlightened drivers to be included in the CURRENT build, but need some help with the loader configuration. The drivers should only load or remain resident when Hyper-V is present. On Linux, the installer program was modified to detect the presence of Hyper-V/Azure, and only then are the Hyper-V drivers installed (starting with the VM Bus driver). What's the best way to do this on FreeBSD? Any help would be greatly appreciated! > Thanks in advance! > Larry Melia > Enlightened driver team for FreeBSD on Hyper-V Currently the approach we seem to be taking with these sorts of things is either to use a custom kernel config (such as XENHVM), or to include drivers by default (such as with virtio now being in the default x86 kernels). We do have a mechanism in place for auto-loading drivers post-boot (devd), but you need to have your root filesystem in place, and I suspect you want to use an enlightened driver for your root filesystem. :) Currently we don't really autoload any drivers at the boot loader stage. We did do that for ACPI for a while but have since moved to just including ACPI by default. The place to do this would be in the /boot/loader code. You can see an example of triggering this in sys/boot/i386/libi386/biosacpi.c. The way this was achieved for ACPI was to have code that was run during /boot/loader's startup set the 'acpi_load' variable if ACPI was detected. The loader will auto-load any module 'foo' if the 'foo_load' variable is set before it boots the kernel. If you want to go the dynamic route (vs having a HYPERV kernel config, or just including the relevant drivers in GENERIC), then that is what you will need to do. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301241145.00836.jhb>