167f0 is FreeBSD kernel a multiboot kernel ? - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Development > FreeBSD Development

FreeBSD Development Kernel development, writing drivers, coding, and questions regarding FreeBSD internals.

Reply
 
Thread Tools Display Modes
  #1  
Old July 17th, 2009, 03:51
wsw1wsw2 wsw1wsw2 is offline
Junior Member
 
Join Date: Dec 2008
Posts: 11
Thanks: 4
Thanked 1 Time in 1 Post
Default is FreeBSD kernel a multiboot kernel ?

Hi,
Grub can boot FreeBSD by :
Code:
kernel /boot/<some kernel>
boot
Does this mean FreeBSD kernel is a multiboot kernel?
I search the source tree and can not find any thing about multiboot. I think the grub maybe know something about the boot stages of FreeBSD. Am i right?

Thanks.
Reply With Quote
  #2  
Old July 17th, 2009, 10:57
SirDice's Avatar
SirDice SirDice is online now
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,699
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

The kernel has nothing to do with multiboot. That's the bootloader's job, which in your case is grub.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old July 17th, 2009, 15:35
Beastie Beastie is offline
Senior Member
 
Join Date: Mar 2009
Location: /dev/earth0
Posts: 1,701
Thanks: 0
Thanked 301 Times in 245 Posts
Default

The multiboot code is not in the kernel.
By default, it's in boot0 (stored in the MBR if you chose it during the setup) and you can find it in src/sys/boot/i386/boot0/boot0.s (N.B. it's written in assembler).

The boot process is very simple, which is why grub or any other boot manager can easily do it.
Basically it just finds the first block (i.e. the boot loader) in a particular partition using the MBR's partition table and executes it. In FreeBSD this block is boot1.
__________________
May the source be with you!
Reply With Quote
The Following User Says Thank You to Beastie For This Useful Post:
wsw1wsw2 (July 21st, 2009)
  #4  
Old October 1st, 2009, 16:26
john_doe john_doe is offline
Banned
 
Join Date: Aug 2009
Posts: 78
Thanks: 1
Thanked 22 Times in 18 Posts
Default

I would like to know this, too. Does FreeBSD kernel conform to multiboot spec so it can be loaded by grub directly?
http://onlamp.com/bsd/2007/03/01/inside-multiboot.html

Last edited by john_doe; October 1st, 2009 at 16:32.
Reply With Quote
  #5  
Old October 1st, 2009, 16:37
dennylin93 dennylin93 is offline
Member
 
Join Date: Dec 2008
Posts: 784
Thanks: 34
Thanked 103 Times in 71 Posts
Default

I've been dual booting for a while with Grub (FreeBSD + Windows).

Here's my configuration file:
Code:
default 0
timeout 5

title Windows XP SP2
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1

title FreeBSD 7.2-RELEASE-p3
rootnoverify (hd0,0)
chainloader +1
Reply With Quote
  #6  
Old October 1st, 2009, 17:37
john_doe john_doe is offline
Banned
 
Join Date: Aug 2009
Posts: 78
Thanks: 1
Thanked 22 Times in 18 Posts
Default

I'm not asking about chainloading. For example, netbsd's boot(8) has a multiboot command. But looks like it can't boot freebsd's kernel.
Reply With Quote
  #7  
Old October 1st, 2009, 19:04
Oxyd's Avatar
Oxyd Oxyd is offline
Member
 
Join Date: Nov 2008
Location: Czech Republic
Posts: 167
Thanks: 5
Thanked 15 Times in 13 Posts
Default

You can use mbchk to check if a binary is multiboot-compliant (installed with GRUB):
Code:
/boot > mbchk loader
loader: No Multiboot header.
/boot > mbchk kernel
kernel: No Multiboot header.
So I think this is enough to conclude that neither FreeBSD kernel, nor loader are multiboot compliant.

Oh, and for those wondering what this "multiboot" thing is and what the hell it has to do with the kernel itself: it's a specification that requires bootable binaries to have a special header, in order to allow arbitrary kernels to be loaded by arbitrary bootloaders.
Reply With Quote
  #8  
Old October 2nd, 2009, 01:47
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

This may be a naive comment, but the effort seems like too little too late. EFI will probably replace the BIOS soon, and I suspect that will render all this BIOS hackery obsolete. Either way, FreeBSD's chain loading process is elegant (more so than linux) and simply works. I can only see this being useful for someone writing a new OS and wanting to avoid the black art of writing a boot loader.
Reply With Quote
  #9  
Old October 3rd, 2009, 18:24
fonz's Avatar
fonz fonz is online now
Moderator
 
Join Date: Nov 2008
Location: Apeldoorn, the Netherlands
Posts: 1,449
Thanks: 369
Thanked 232 Times in 206 Posts
Default

Quote:
Originally Posted by Oxyd View Post
Oh, and for those wondering what this "multiboot" thing is and what the hell it has to do with the kernel itself: it's a specification
Actually, it's a proposal if I'm not mistaken.

Alphons
__________________
Ken sent me.
Reply With Quote
  #10  
Old October 3rd, 2009, 18:42
Oxyd's Avatar
Oxyd Oxyd is offline
Member
 
Join Date: Nov 2008
Location: Czech Republic
Posts: 167
Thanks: 5
Thanked 15 Times in 13 Posts
Default

Quote:
Originally Posted by fonz View Post
Actually, it's a proposal if I'm not mistaken.

Alphons
Mistaken you are not:
Quote:
This file documents Multiboot Specification, the proposal for the boot sequence standard
Reply With Quote
  #11  
Old October 3rd, 2009, 19:20
fonz's Avatar
fonz fonz is online now
Moderator
 
Join Date: Nov 2008
Location: Apeldoorn, the Netherlands
Posts: 1,449
Thanks: 369
Thanked 232 Times in 206 Posts
Default

So, do you happen to know which OSes/kernels currently comply to this proposed standard?

Alphons
__________________
Ken sent me.
Reply With Quote
  #12  
Old October 3rd, 2009, 22:32
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Member
 
Join Date: Nov 2008
Location: Eindhoven, Netherlands
Posts: 794
Thanks: 19
Thanked 123 Times in 93 Posts
Default

I think the Hurd and NetBSD are pretty much the only one ... Surely two of the most popular operating systems out there.

As far as I've understood is, the multiboot specs have pretty much failed to gain a wide acceptance.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #13  
Old April 23rd, 2010, 19:42
cpghost cpghost is offline
Junior Member
 
Join Date: Nov 2008
Posts: 3
Thanks: 5
Thanked 0 Times in 0 Posts
Default Multiboot

Quote:
Originally Posted by Carpetsmoker View Post
I think the Hurd and NetBSD are pretty much the only one ... Surely two of the most popular operating systems out there.

As far as I've understood is, the multiboot specs have pretty much failed to gain a wide acceptance.
Some microkernels are multiboot compliant too, e.g. L4Ka:: Pistachio:

http://l4ka.org/projects/pistachio/

And, frankly, it would be nice if FreeBSD were multiboot compliant like NetBSD.
__________________
Cordula's Web.
Reply With Quote
  #14  
Old April 23rd, 2010, 22:44
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

What does multiboot provide that EFI doesn't?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
7.1 amd 64 on HP DV8000Z... Error: "/boot/kernel/kernel text=0x78eea0 dgologanov Installing & Upgrading 0 April 26th, 2009 04:18
freeBSD 4.10 Kernel srcs jarod Installing & Upgrading 4 April 25th, 2009 11:03
Building kernel modules without kernel source code holycow General 5 April 2nd, 2009 09:18
Is the cciss kernel module available in the installation kernel & other general Q's osx-addict Installing & Upgrading 2 March 2nd, 2009 18:14
Fail to compile kernel in Freebsd 7.0 R ohcarol Installing & Upgrading 4 February 19th, 2009 17:45


All times are GMT +1. The time now is 13:31.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0