Bug 96430 - boot2 is unable to load kernel directly
Summary: boot2 is unable to load kernel directly
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: i386 (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: ru
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-27 20:30 UTC by Yuichiro Goto
Modified: 2006-11-27 15:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuichiro Goto 2006-04-27 20:30:12 UTC
Loading a kernel directly using boot2 causes the invalid-opcode fault like the
following:

int=00000006  err=00000000  efl=00010002  eip=c0445a90
eax=c0445a90  ebx=0007cd0f  ecx=c0b5e1a7  edx=a030001e
esi=c0b5e1a7  edi=c0445a90  ebp=00000002  esp=0009eb84
cs=0008  ds=0010  es=0010    fs=0010  gs=0010  ss=0010
cs:eip=ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff
       ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff
ss:esp=69 95 00 00 00 00 00 80-1e 00 30 a0 00 00 00 00
       00 00 00 00 00 00 00 00-60 dd 00 00 36 42 00 00
BTX halted

I tried to load a kernel directly that is a slightly modified
version of GENERIC.  The following 2 lines are added to
GENERIC:

makeoptions     CONF_CFLAGS=-DROOTDEVNAME=\"ufs:/dev/ad0s2a\"
makeoptions     NO_MODULES=yes

Fix: 

load() in src/sys/boot/i386/boot2/boot2.c tries to copy kernel segments at a
phisical address on memory whose most significant 2 bits are set.  This is
because of changes between rev 1.70 and 1.71 of
src/sys/boot/i386/boot2/boot2.c.
How-To-Repeat: Directly load a kernel using boot2.
Comment 1 Bruce Evans 2006-04-28 20:49:19 UTC
On Thu, 27 Apr 2006, Yuichiro Goto wrote:

>> Description:
> Loading a kernel directly using boot2 causes the invalid-opcode fault like the
> following:
>
> int=00000006  err=00000000  efl=00010002  eip=c0445a90
> eax=c0445a90  ebx=0007cd0f  ecx=c0b5e1a7  edx=a030001e
> esi=c0b5e1a7  edi=c0445a90  ebp=00000002  esp=0009eb84
> cs=0008  ds=0010  es=0010    fs=0010  gs=0010  ss=0010
> cs:eip=ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff
>       ff ff ff ff ff ff ff ff-ff ff ff ff ff ff ff ff
> ss:esp=69 95 00 00 00 00 00 80-1e 00 30 a0 00 00 00 00
>       00 00 00 00 00 00 00 00-60 dd 00 00 36 42 00 00
> BTX halted
>
> I tried to load a kernel directly that is a slightly modified
> version of GENERIC.  ...

>> How-To-Repeat:
> Directly load a kernel using boot2.
>> Fix:
> load() in src/sys/boot/i386/boot2/boot2.c tries to copy kernel segments at a
> phisical address on memory whose most significant 2 bits are set.  This is
> because of changes between rev 1.70 and 1.71 of
> src/sys/boot/i386/boot2/boot2.c.

I reported this to the author of the bug a few months ago.

I use an old 2-stage-only boot loader that is missing this bug, but
still the GENERIC kernel doesn't load - the load hangs with no message.
Loading of smaller kernels (size ~= 3MB) with boot2 still works with
both my old boot loader and the FreeBSD-6.0 boot2 with rev.1.71 backed
out.

Bruce
Comment 2 ru freebsd_committer 2006-10-26 13:17:14 UTC
Responsible Changed
From-To: freebsd-i386->jhb

John, could you please look into fixing this properly? 
Backing out rev. 1.71 changes fixes this issue for me; 
see my email with more details.
Comment 3 dfilter service freebsd_committer 2006-10-26 20:16:15 UTC
ru          2006-10-26 19:15:54 UTC

  FreeBSD src repository

  Modified files:
    sys/boot/i386/boot2  boot2.c 
  Log:
  Back out rev. 1.71 as it breaks directly loading (i386) kernels.
  
  OK'ed by:       jhb
  PR:             i386/96430, i386/104709
  MFC after:      3 days
  
  Revision  Changes    Path
  1.80      +3 -3      src/sys/boot/i386/boot2/boot2.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 ru freebsd_committer 2006-10-30 15:31:32 UTC
State Changed
From-To: open->patched

Fixed differently in 7.0-CURRENT. 


Comment 5 ru freebsd_committer 2006-10-30 15:31:32 UTC
Responsible Changed
From-To: jhb->ru
Comment 6 ru freebsd_committer 2006-11-27 14:49:56 UTC
State Changed
From-To: patched->closed

Fixed in RELENG_6.
Comment 7 dfilter service freebsd_committer 2006-11-27 14:50:47 UTC
ru          2006-11-27 14:49:38 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_6)
    sys/boot/i386/boot2  boot2.c 
  Log:
  MFC: 1.80: Restore support for directly loaded kernels.
       1.81: Restore support for -c and -d.
  
  PR:             i386/96430, i386/104709
  
  Revision  Changes    Path
  1.72.2.5  +7 -5      src/sys/boot/i386/boot2/boot2.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"