bugGNU GRUB - Bugs: bug #10728, [PATCH] FreeBSD Boot Patch


You are not allowed to post comments on this tracker with your current authentication level.

bug #10728: [PATCH] FreeBSD Boot Patch

Submitter:  clock <clock>
Submitted:  Tue 19 Oct 2004 01:08:10 PM UTC
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Action Request
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  clock
Open/Closed:  Closed Release:  None
Release:  0.95 Reproducibility:  None
Planned Release:  None

Sat 15 Dec 2007 11:15:03 AM UTC, comment #4: 

We've moved to GRUB 2 as our development branch.  *BSD booting is not supported there, so I'm closing this bug.

If someone wants to work on *BSD boot support for GRUB 2, please contact us at <grub-devel@gnu.org> announcing your intent to avoid duplication of effort.

Robert Millan <robertmh>
Group administrator
Mon 24 Apr 2006 06:18:15 PM UTC, comment #3: 

Here's my current patch.  Usage:

  kernel /boot/kernel/kernel
  loadenv /boot/device.hints

Note: kernel MUST be compiled with acpi builtin ("device acpi" in config file).  Theoricaly, you should be able to load it as a module (/boot/kernel/acpi.ko), but this requires FreeBSD.hint.acpi.0.* variables to contain correct data.

I've added code to fetch hint.acpi values from BIOS memory space (stage2/biosacpi.c), but for some reason it gets the wrong stuff.  Correct variables are sort of like:

  hint.acpi.0.rsdt=<address in hex>

It still needs a lot of cleanup.  In particular, the function and variable names (added in the former patch) are very cryptic and difficult to figure out what they do (grub_fstenv, grub_nxtenv and that lot of two-letter variables).  The code to parse device.hints (grub_loadenv), which I added, is quite dirty as well.

Robert Millan <robertmh>
Group administrator
Mon 24 Apr 2006 03:54:58 PM UTC, comment #2: 

Ok, I got it to work with 5.x.  The core loading semantics are the same, but 5.x also wants us to:

 1- Set variables from /boot/device.hints in the environment
 2- Load acpi.ko
 3- Set some acpi hints that are NOT in device.hints and should be determined dynamicaly by digging into BIOS space.

I have updated the patch to get #1 working (not submitting yet, needs some cleanup).  #2 is trivial (module /boot/kernel/acpi.ko).

As for #3, shouldn't be too hard since the code is in FreeBSD CVS (src/sys/boot/i386/libi386/biosacpi.c), but it depends on some headers and I'm not sure how should it be integrated in GRUB exactly.  Do we copy the (relevant parts of) these headers into the GRUB tree?

Robert Millan <robertmh>
Group administrator
Sun 23 Apr 2006 06:00:14 PM UTC, comment #1: 

I just tested your patch with GRUB 0.97 and it seems to work fine for kernel 4.11.  Very good work!

Unfortunately with kernel 5.4 it just hangs.  Do you have any idea why could that be?

Robert Millan <robertmh>
Group administrator
Tue 19 Oct 2004 01:08:10 PM UTC, original submission:  

I create a patch which would allow grub to load FreeBSD modules directly.

A menuitem to boot FreeBSD may look like this:

title FreeBSD
kernel (hd0,0)/kernel
module (hd0,0)/msdos.ko

Note that (hd0,0) can be any partition that grub can understand ((nd) may work too)

initrd is modified to support FreeBSD. Now you can use the following sequence to boot FreeBSD in a ramdisk:

title FreeBSD in ramdisk
kernel (hd0,0)/kernel
initrd (hd0,0)/ramdisk.gz
set FreeBSD.vfs.root.mountfrom=ufs:/dev/md0c

The last line shows how to pass environment variables to the FreeBSD kernel.

Command "module" support --type option, they can be used to specify the type of module.They can be mfs_root (the ramdisk type !), splash_image, etc. please refer to FreeBSD docs for more information.

New command "lsmod", you can use it to list the current loaded modules.

The above patch is based on FreeBSD 4.9. 5.xx series has not been tested yet.

Have Fun !

clock <clock>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #9830:  kfreebsd.diff added by robertmh (30KiB - text/plain - new patch with (incomplete) support for 5.x)
file #1886:  grub-0.95-freebsd.diff added by clock (20KiB - text/plain - FreeBSD Boot Patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by robertmh (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-12-15 robertmh Open/ClosedOpen Closed
    2006-04-24 robertmh Attached File- Added kfreebsd.diff, #9830
    2004-10-19 clock Attached File- Added grub-0.95-freebsd.diff, #1779

    Back to the top

    Powered by Savane 3.11