boot manager patch

Dick Wesseling ftu at fi.uu.nl
Fri May 18 20:18:30 UTC 2007


The PC ROM BIOS sets register si to the selected partition table
entry when invoking a bootstrap. The bootstrap can then use si to
retrieve its partition parameter.
This functionality used to work in the FreeBSD boot manager, but
it is broken in the current version of boot/i386/boot0/boot0.S


*** boot0.S.old	Fri May 18 20:42:32 2007
--- boot0.S	Fri May 18 21:04:47 2007
***************
*** 317,328 ****
  		movb $0x2,%ah			# Read sector
  		callw intx13			#  from disk
  		jc main.10			# If error
  		cmpw $MAGIC,0x1fe(%bx)		# Bootable?
  		jne main.10			# No
! 		movw $crlf,%si			# Leave some
! 		callw puts			#  space
  		jmp *%bx			# Invoke bootstrap
  
  /*
   * Display routines
   */
--- 317,329 ----
  		movb $0x2,%ah			# Read sector
  		callw intx13			#  from disk
  		jc main.10			# If error
  		cmpw $MAGIC,0x1fe(%bx)		# Bootable?
  		jne main.10			# No
! 		pushw %si                       # Leave some
! 		callw putn			#  space
! 		popw %si                        # Pointer to selected partition
  		jmp *%bx			# Invoke bootstrap
  
  /*
   * Display routines
   */


More information about the freebsd-bugs mailing list