From owner-freebsd-hackers@freebsd.org Thu Apr 18 00:53:58 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0953157E683 for ; Thu, 18 Apr 2019 00:53:57 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1357B6C2AC for ; Thu, 18 Apr 2019 00:53:57 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-oi1-x230.google.com with SMTP id i21so271837oib.11 for ; Wed, 17 Apr 2019 17:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FdqX8mo/HemeNbQM5qfLcsbupef1DM0BxaCV43e3z8w=; b=Yey1FK7bSdiv21nCtLinIB05tb4f0dxp9dmXaqfQavHRMOD05SWTn7XZn3VS98diz4 eFdxymIf1mgnBocKGWnDw+MhQ/7XFV7UAKrSI5xwCdA9t907kRggCJNnZX2/laCeARE1 yVvt5dmDGWxJ0dIocngi/cqExtffnMbXxDNfhWk6EMQxq/YuZw8//EXDj88CcWrL5ZpP M+CUFgNEA3rUDrJ8AulxLgoHSe/li0SRKsWHKewywDyDiKE4i/A0cEDZrKbmzeLH6pG/ lkw2WHaHlGoB6AwYsCFVLQeG7voq6DXrMWzNgXv4NB4rTpKnjNSrmFQ/MqXD36bGrNJH OgvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=FdqX8mo/HemeNbQM5qfLcsbupef1DM0BxaCV43e3z8w=; b=daUlOagHoBIZS6Kh/tdbEe927tUARrgCCmGzQ3jDspeS4e3ksrunE07tpFptz05kxF FC5bD0iDhAXwpaqd+SYNXhN5sUBJ8Q40JUx7oZpbGecjI5zVVQAX/IOTdWppDl8AObv+ MGtnAkJ2sF47JEgFNA1EWJcvVD7xMoxxj4m98JglWBEunSEiKCPQoQOR8pL53RIZt8Nx IQn0gOLpd6pCIAUImWQNYgbovaYzvw9jgbN51WE+WRcNgdzCjkzJG1S/byvqfWxevcWc W+BSAbvMkkAiCbNXXrmjI6rvZMzTECaayDM0VQkG7KZx5jBPisDacORIVzIrOuGoTZuF cKdg== X-Gm-Message-State: APjAAAU/LouSjD+uT+VgZ4+477m5lRiArxMsVV0P91fRufUNuB/XGOuI EZBKokHkD1MTM30BKTRgaBKBmYkESeQN3m9mDvqNrMzS X-Google-Smtp-Source: APXvYqwlg2JxKSTfL3b8yZAoUhUr5Ufg2w4gfdhCwoIPxhnn0gL8jFXLbDiIYGMFRvwruWniNEiIu8Iwn8oGidGnSbI= X-Received: by 2002:aca:aa57:: with SMTP id t84mr258350oie.149.1555548835784; Wed, 17 Apr 2019 17:53:55 -0700 (PDT) MIME-Version: 1.0 From: Lee D Date: Wed, 17 Apr 2019 20:52:50 -0400 Message-ID: Subject: What code loads kernel modules at boot? To: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1357B6C2AC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Yey1FK7b; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of embaudarm@gmail.com designates 2607:f8b0:4864:20::230 as permitted sender) smtp.mailfrom=embaudarm@gmail.com X-Spamd-Result: default: False [-5.84 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[0.3.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.88)[ip: (-9.06), ipnet: 2607:f8b0::/32(-3.05), asn: 15169(-2.23), country: US(-0.06)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2019 00:53:58 -0000 A couple of years ago I wrote a FreeBSD bootloader for Zynq (Arm32). It's been working well, but now I need to add the ability to load kernel modules at boot. This is for 11.0.1 (updating to 12 soon, hopefully). Can anyone point me to the code that actually loads a kernel module for arm? I got lost reading the source in /src/sys/boot/common, and can't quite figure out what routine is actually called. I assume I need to parse the sections out of the .ko file and place them carefully in memory, like I do with the kernel image. Also, if you're feeling loquacious, where do I put the darn thing and how do I tell the kernel how to find it (part of the MODINFO stuff I assume)? This is all in the context of loading custom real time clock and I2C drivers so they are available at boot time. Thanks, Lee