Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Jul 2018 16:18:30 +0200
From:      Michael Tuexen <tuexen@freebsd.org>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: Loading modules from /boot/loader.conf
Message-ID:  <6EDBDB53-9A50-4846-8EDF-4B074838C600@freebsd.org>
In-Reply-To: <365d2fef-a272-16b2-de09-6344e2abc242@selasky.org>
References:  <6DB7ABD4-8C04-46B3-8C07-FC591FC16F71@freebsd.org> <B7AA170D-9F78-4F67-92FF-2EF0CC2B91D6@freebsd.org> <365d2fef-a272-16b2-de09-6344e2abc242@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> On 10. Jul 2018, at 16:06, Hans Petter Selasky <hps@selasky.org> =
wrote:
>=20
> On 07/10/18 13:23, Michael Tuexen wrote:
>>> On 25. Jun 2018, at 19:17, Michael Tuexen <tuexen@FreeBSD.org> =
wrote:
>>>=20
>>> Dear all,
>>>=20
>>> I'm running FreeBSD head of today on a G4 MacMini. I'm trying to
>>> load a kernel module using /boot/loader.conf by having the line
>>>=20
>>> tcp_rack_load=3D"YES"
>>>=20
>>> in /boot/loader.conf
>>>=20
>>> However, this doesn't work and results in:
>>>=20
>>> FreeBSD/powerpc Open Firmware loader, Revision 0.1
>>> (Tue Jun 12 01:08:20 UTC 2010 root@releng3.nyi.freebsd.org)
>>> Memory: 1048576KB
>>> Booted from: /pic@f4000000/ata-@d/disk@0
>>>=20
>>> Loading /boot/default/loader.conf
>>> /boot/kernel/kernel data=3D0x706ac+0xed588 =
syms=3D[0x4+0xa3100+0x4+0x10bc45]
>>> /boot/entropy size=3D0x1000
>>> /boot/kernel/tcp_rack.ko text=3D0x2433c data=3D0x1d0+0x220 =
syms=3D[0x4+0x15a0+0x4+0x17bd]
>>> loading required module 'kernel'
>>> module 'kernel' exists but with wrong version
>>>=20
>>> Hit [Enter] to boot immediately, or any other key for command =
prompt.
>>> ...
>>>=20
>>> I have no problems when running
>>>=20
>>> kldload tcp_rack
>>>=20
>>> after the system completely booted. Then the modules loads without =
any problems.
>>>=20
>>> Any idea what am I doing wrong?
>> The problem seem to be in the metadata information stored in =
/boot/kernel/kernel.
>> Concentrating on the version info for the kernel.
>> The .symtab entry contains
>> entry: 11727
>> 	st_name: _mod_metadata_kernel_version
>> 	st_value: 0xdcafd4
>> 	st_size: 16
>> 	st_info: STT_OBJECT STB_LOCAL
>> 	st_shndx: 22
>> which seems to be correct. However, looking at the version info, one =
finds:
>> readelf -x .data.rel.local /boot/kernel/kernel provides
>>   0x00dcafc8 3454f8e9 00000000 00000000 00000001 4T..............
>>   0x00dcafd8 00000003 00000000 00000000 02000000 ................
>> which corresponds to
>> {.md_version =3D 1, .md_type =3D 3, .md_data =3D NULL, .md_cval =3D =
NULL}
>> First of all, this information is NOT stored in the .data section as =
it is in
>> the case of power64, amd64, arm64, but in the .data.rel.local =
section.
>> Furthermore,md_data and md_cval are NULL, which should not be the =
case.
>> In addition, the set_modmetadata_set should contain pointers to the =
module
>> metadata, but it contains only NULL pointers, as can be checked with
>> readelf -x set_modmetadata_set /boot/kernel/kernel
>> Does anyone knows what is going wrong and why?
>> Is it possible that
>> https://svnweb.freebsd.org/base?view=3Drevision&revision=3D268055
>> is related to this issue? It only handles the 64-bit version.
>> However, simply applying this also to __powerpc__ and recompiling
>> the kernel didn't solve the issue.
>=20
> Hi,
>=20
> There is this thread with some more information:
> https://lists.freebsd.org/pipermail/svn-src-all/2014-June/087354.html
Thanks for the pointer!
It seems that the problem discussed there affects the =
compilation/linking
process and I can still reproduce the issue with the gcc version we have
in tree.

Do you think this problem is related to the problem the the module
information is not included correctly? Do you know anyone who has
experience in this area?

Best regards
Michael
>=20
> --HPS
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6EDBDB53-9A50-4846-8EDF-4B074838C600>