Re: Loading modules from /boot/loader.conf

Michael Tuexen <[email protected]>
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]>
> On 25. Jun 2018, at 19:17, Michael Tuexen <[email protected]> wrote:
> 
> Dear all,
> 
> 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
> 
> tcp_rack_load="YES"
> 
> in /boot/loader.conf
> 
> However, this doesn't work and results in:
> 
> FreeBSD/powerpc Open Firmware loader, Revision 0.1
> (Tue Jun 12 01:08:20 UTC 2010 [email protected])
> Memory: 1048576KB
> Booted from: /pic@f4000000/ata-@d/disk@0
> 
> Loading /boot/default/loader.conf
> /boot/kernel/kernel data=0x706ac+0xed588 syms=[0x4+0xa3100+0x4+0x10bc45]
> /boot/entropy size=0x1000
> /boot/kernel/tcp_rack.ko text=0x2433c data=0x1d0+0x220 syms=[0x4+0x15a0+0x4+0x17bd]
> loading required module 'kernel'
> module 'kernel' exists but with wrong version
> 
> Hit [Enter] to boot immediately, or any other key for command prompt.
> ...
> 
> I have no problems when running
> 
> kldload tcp_rack
> 
> after the system completely booted. Then the modules loads without any problems.
> 
> 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 = 1, .md_type = 3, .md_data = NULL, .md_cval = 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=revision&revision=268055

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.

Best regards
Michael
> 
> Best regards
> Michael
> 
> 
> 
> 
> 
> _______________________________________________
> [email protected] mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
> To unsubscribe, send any mail to "[email protected]"

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.