Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Dec 2022 11:18:45 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        hiroo.ono+freebsd@gmail.com
Cc:        Mark Millard <marklmi@yahoo.com>, freebsd-arm@freebsd.org
Subject:   Re: Succeeded to boot on Lenovo Yoga C630
Message-ID:  <CANCZdfpKnxeRp3RtPGrq%2BsCMqXjq0AnYWuN2orHt1qt57KRh0Q@mail.gmail.com>
In-Reply-To: <CANtk6Si4Eg3vd4j3wvgCt%2BoodpNK7ikei-XikEmXPMdQUane3w@mail.gmail.com>
References:  <CANtk6SgUoqC_Jgdtu=CZnFvnLzqP445MQqfwhV5%2BBgX_%2BVFUZA@mail.gmail.com> <B55013C7-B04C-48E4-BC0F-C106DA08348F@yahoo.com> <CANtk6Shwaea09TiTZq3UZwzCoXjm8TqkA930QQwS_i3_Awd5bg@mail.gmail.com> <CANCZdfqpTW3AVHPfHPWOEpEW2QPTE6aADGNzhH=pQT4btA1%2BvQ@mail.gmail.com> <CANtk6Si4Eg3vd4j3wvgCt%2BoodpNK7ikei-XikEmXPMdQUane3w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000f39fbc05ef5511ed
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Dec 7, 2022 at 4:21 PM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=E7=94=
=9F) <hiroo.ono+freebsd@gmail.com>
wrote:

> 2022=E5=B9=B412=E6=9C=887=E6=97=A5(=E6=B0=B4) 1:18 Warner Losh <imp@bsdim=
p.com>:
> >
> >
> >
> > On Tue, Dec 6, 2022 at 7:59 AM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=
=E7=94=9F) <
> hiroo.ono+freebsd@gmail.com> wrote:
>
> >> OK, I (and the subject) was wrong. The loader boots, and show
> >> following log at last:
> >>
> >> Loading kernel...
> >> /boot/kernel/kernel text=3D0x2a8 text=3D0x8bcbf0 text=3D0x1f97ac
> >> data=3D0x1a6ac0 data=3D0x0+0x381000 syms=3D[0x8+0x11f6a0+0x8+0x1439ea]
> >> Loading configured modules...
> >> can't find '/boot/entropy'
> >> can't find '/etc/hostid'
> >> No valid device tree blob found!
> >> WARNING! Trying to fire up the kernel, but no device tree blob found!
> >> EFI framebuffer information
> >> addr, size        0x80400000, 0x7e9000
> >> dimensions     1920 x 1080
> >> stride             1920
> >> masks            0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
> >>
> >> and it stops here. No "<<BOOT>>" line is displayed.
> >> So, it seems that the kernel is loaded but could not be started.
> >
> >
> > There are several causes of this.
> >
> > Most likely is that the console is setup to go somewhere else. Though i=
f
> you are on the video display and getting that framebuffer output, it won'=
t
> not go there w/o some setting to override (say to force serial).
>
> In the loader, when comconsole->c_init() is called for the second
> time, the function does not return. (I commented out comconsole to
> make the loader work, but it is rather brutal and is not a proper
> solution).
> But the function parse_uefi_con_out() in stand/efi/loader/main.c
> always returns RB_SERIAL, so the loader tries to use the serial
> console.
>

I wonder why that is. Is this -current or -stable? I have a rather large
backlog of MFC-able loader changes. If it is with stable, then it makes
sense: I fixed a bug where parse_uefi_con_out would return serial if
'8be4df61-93ca-11d2-aa0d-00e098032b8c-ConOut' was unset. Is it set?  Now we
return Video console if we fine evidence there's a video console.

Now, why it fails the second time, I don't know.


> If a similar thing happens with the kernel, it may be stopping at
> serial console initialization.
>

The kernel doesn't use the EFI routines to initialize the serial console.
But if the kernel is being told the wrong console, then it could also be
booting just fine or almost fine and hitting some bug later.


> > Next most likely is that FreeBSD doesn't cope well with having both FDT
> and ACPI information available. But since not DTB is being passed in (per
> that message) that's not likely at play here.
>
> I managed to load the dtb file and the boot process stopped at the
> same point. The problem is not here?
>

Yea, I don't think so.

Warner


> > Finally, the loader passes a large number of tables, etc to the kernel.
> It's quite possible that, for reasons still unknown, that data is wrong o=
r
> if standard conforming not expected by the kernel. this leads to a crash
> before we've setup the console in the kernel which looks a lot like a han=
g.
> >
> > Warner
> >
> >
> >>
> >> > . . .
> >> >
> >> > Such also happens for stable/13, releng/13.* based installations
> >> > as well --and likely others too.
> >> >
> >> > ACPI booting does not use Device Tree information but the messages
> >> > are output anyway about the lack. Only if you know that the context
> >> > is a Device Tree style of boot are the messages actually reporting
> >> > a problem.
> >> >
> >> >
> >> > =3D=3D=3D
> >> > Mark Millard
> >> > marklmi at yahoo.com
> >> >
> >>
>

--000000000000f39fbc05ef5511ed
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 7, 2022 at 4:21 PM Hiroo =
Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono%=
2Bfreebsd@gmail.com">hiroo.ono+freebsd@gmail.com</a>&gt; wrote:<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft:1px solid rgb(204,204,204);padding-left:1ex">2022=E5=B9=B412=E6=9C=887=
=E6=97=A5(=E6=B0=B4) 1:18 Warner Losh &lt;<a href=3D"mailto:imp@bsdimp.com"=
 target=3D"_blank">imp@bsdimp.com</a>&gt;:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Dec 6, 2022 at 7:59 AM Hiroo Ono (=E5=B0=8F=E9=87=8E=E5=AF=9B=
=E7=94=9F) &lt;<a href=3D"mailto:hiroo.ono%2Bfreebsd@gmail.com" target=3D"_=
blank">hiroo.ono+freebsd@gmail.com</a>&gt; wrote:<br>
<br>
&gt;&gt; OK, I (and the subject) was wrong. The loader boots, and show<br>
&gt;&gt; following log at last:<br>
&gt;&gt;<br>
&gt;&gt; Loading kernel...<br>
&gt;&gt; /boot/kernel/kernel text=3D0x2a8 text=3D0x8bcbf0 text=3D0x1f97ac<b=
r>
&gt;&gt; data=3D0x1a6ac0 data=3D0x0+0x381000 syms=3D[0x8+0x11f6a0+0x8+0x143=
9ea]<br>
&gt;&gt; Loading configured modules...<br>
&gt;&gt; can&#39;t find &#39;/boot/entropy&#39;<br>
&gt;&gt; can&#39;t find &#39;/etc/hostid&#39;<br>
&gt;&gt; No valid device tree blob found!<br>
&gt;&gt; WARNING! Trying to fire up the kernel, but no device tree blob fou=
nd!<br>
&gt;&gt; EFI framebuffer information<br>
&gt;&gt; addr, size=C2=A0 =C2=A0 =C2=A0 =C2=A0 0x80400000, 0x7e9000<br>
&gt;&gt; dimensions=C2=A0 =C2=A0 =C2=A01920 x 1080<br>
&gt;&gt; stride=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01920<br>
&gt;&gt; masks=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0x00ff0000, 0x0000f=
f00, 0x000000ff, 0xff000000<br>
&gt;&gt;<br>
&gt;&gt; and it stops here. No &quot;&lt;&lt;BOOT&gt;&gt;&quot; line is dis=
played.<br>
&gt;&gt; So, it seems that the kernel is loaded but could not be started.<b=
r>
&gt;<br>
&gt;<br>
&gt; There are several causes of this.<br>
&gt;<br>
&gt; Most likely is that the console is setup to go somewhere else. Though =
if you are on the video display and getting that framebuffer output, it won=
&#39;t not go there w/o some setting to override (say to force serial).<br>
<br>
In the loader, when comconsole-&gt;c_init() is called for the second<br>
time, the function does not return. (I commented out comconsole to<br>
make the loader work, but it is rather brutal and is not a proper<br>
solution).<br>
But the function parse_uefi_con_out() in stand/efi/loader/main.c<br>
always returns RB_SERIAL, so the loader tries to use the serial<br>
console.<br></blockquote><div><br></div><div>I wonder why that is. Is this =
-current or -stable? I have a rather large backlog of MFC-able loader chang=
es. If it is with stable, then it makes sense: I fixed a bug where parse_ue=
fi_con_out would return serial if &#39;8be4df61-93ca-11d2-aa0d-00e098032b8c=
-ConOut&#39; was unset. Is it set?=C2=A0 Now we return Video console if we =
fine evidence there&#39;s a video console.</div><div><br></div><div>Now, wh=
y it fails the second time, I don&#39;t know.</div><div>=C2=A0</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
If a similar thing happens with the kernel, it may be stopping at<br>
serial console initialization.<br></blockquote><div><br></div><div>The kern=
el doesn&#39;t use the EFI routines to initialize the serial console. But i=
f the kernel is being told the wrong console, then it could also be booting=
 just fine or almost fine and hitting some bug later.</div><div>=C2=A0</div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; Next most likely is that FreeBSD doesn&#39;t cope well with having bot=
h FDT and ACPI information available. But since not DTB is being passed in =
(per that message) that&#39;s not likely at play here.<br>
<br>
I managed to load the dtb file and the boot process stopped at the<br>
same point. The problem is not here?<br></blockquote><div><br></div><div>Ye=
a, I don&#39;t think so.</div><div><br></div><div>Warner</div><div>=C2=A0</=
div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex">
&gt; Finally, the loader passes a large number of tables, etc to the kernel=
. It&#39;s quite possible that, for reasons still unknown, that data is wro=
ng or if standard conforming not expected by the kernel. this leads to a cr=
ash before we&#39;ve setup the console in the kernel which looks a lot like=
 a hang.<br>
&gt;<br>
&gt; Warner<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt; . . .<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Such also happens for stable/13, releng/13.* based installati=
ons<br>
&gt;&gt; &gt; as well --and likely others too.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ACPI booting does not use Device Tree information but the mes=
sages<br>
&gt;&gt; &gt; are output anyway about the lack. Only if you know that the c=
ontext<br>
&gt;&gt; &gt; is a Device Tree style of boot are the messages actually repo=
rting<br>
&gt;&gt; &gt; a problem.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; =3D=3D=3D<br>
&gt;&gt; &gt; Mark Millard<br>
&gt;&gt; &gt; marklmi at <a href=3D"http://yahoo.com" rel=3D"noreferrer" ta=
rget=3D"_blank">yahoo.com</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
</blockquote></div></div>

--000000000000f39fbc05ef5511ed--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpKnxeRp3RtPGrq%2BsCMqXjq0AnYWuN2orHt1qt57KRh0Q>