This patch for FreeBSD 2.0 makes FreeBSD kernel images
minimally compatible with the proposed multi-OS boot standard.
The produced kernel images still load fine from the normal
FreeBSD boot loader as well.

By "minimally compatible" I mean the kernel loads and runs,
but it doesn't do any interpretation of the passed command line;
thus, there's currently no way to specify the 'boothowto' and
'bootdev' options when loading the kernel from a MultiBoot
boot loader.  All that needs to be added is a little code to
parse the command line string passed in the multiboot_info struct.
For the 'bootdev' option, it would be nice for consistency
if the kernel supported the 'root=/dev/???' syntax used by Linux,
at least as one way of specifying the 'bootdev' parameter.

			Bryan

diff -crN osys/i386/i386/locore.s sys/i386/i386/locore.s
*** osys/i386/i386/locore.s	Fri Nov 18 05:27:34 1994
--- sys/i386/i386/locore.s	Sat Apr  1 17:21:37 1995
***************
*** 164,176 ****
   */
  NON_GPROF_ENTRY(btext)
  	movw	$0x1234,0x472			/* warm boot */
! 	jmp	1f
  	/*
  	 * XXX now that we load at 1MB is this still really used?
  	 */
  	.org	0x500				/* space for BIOS variables */
  
! 1:
  	/* Set up a real frame, some day we will be doing returns */
  	pushl	%ebp
  	movl	%esp, %ebp
--- 164,199 ----
   */
  NON_GPROF_ENTRY(btext)
  	movw	$0x1234,0x472			/* warm boot */
! 	jmp	old_entry
  	/*
  	 * XXX now that we load at 1MB is this still really used?
  	 */
  	.org	0x500				/* space for BIOS variables */
  
! 	/* MultiBoot header - see multiboot.h.  */
! 	.align	2
! boot_header:
! 	.long	0x1BADB002		/* magic */
! 	.long	0x00010000		/* flags: AOUT_KLUDGE */
! 	.long	boot_header-KERNBASE	/* header_addr */
! 	.long	_btext-KERNBASE		/* load_addr */
! 	.long	_edata-KERNBASE		/* load_end_addr */
! 	.long	_end-KERNBASE		/* bss_end_addr */
! 	.long	boot_entry-KERNBASE	/* entry */
! 
! boot_entry:
! 	/* Get ourselves a stack.  */
! 	movl	$tmpstk-KERNBASE,%esp
! 	pushl	%ebp
! 	movl	%esp, %ebp
! 
! 	/* Don't trust what the boot loader gives for eflags. */
! 	pushl	$PSL_MBO
! 	popfl
! 
! 	jmp	bootinfo_done
! 
! old_entry:
  	/* Set up a real frame, some day we will be doing returns */
  	pushl	%ebp
  	movl	%esp, %ebp
***************
*** 301,306 ****
--- 324,331 ----
  	movl	%eax,_boothowto-KERNBASE
  	movl	12(%ebp),%eax
  	movl	%eax,_bootdev-KERNBASE
+ 
+ bootinfo_done:
  
  #if NAPM > 0
  	/*
