From nobody Wed Jul 3 20:09:20 2024 X-Original-To: freebsd-drivers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WDrVG6l2fz5Q8sN for ; Wed, 03 Jul 2024 20:09:58 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDrVG4WMJz4g4k; Wed, 3 Jul 2024 20:09:58 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2c1a4192d55so3647388a91.2; Wed, 03 Jul 2024 13:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720037397; x=1720642197; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VHYCdkEXlHJpeVHYm0FqSskEGZFgW6yvXCe21Ci1lug=; b=Cxf73GF7bnOr+tzmxe+E1ETeyalWqnIQc/d4hWkiIAas//hL9zGegvc11s485h3FvH nFo+hQRv+7+AYHzvMpC4RumWnkC+pNaZr64DkxpMn5+ywydwZFD70KNsvW6/oQndHErh 6ybVlj4Ot7FcBfQOeP4sjcGS+mJ5sSWx+KQpeTxKuC+/Ao+tBs5TksBxjWhB5mgFzsYk aWmOOo6pC9rwubNpcfARHILkekq8MpaFfqhVM/nSO9d3FwTytaq8T7fiw7QcZvOSz2AD KgVPBOutJJnfHx4Q5oWiYVfrBQ3vjQSERnE1BKXEvX5tOKsrG8ZgPrmE/Li7QvFKnf9u ID4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720037397; x=1720642197; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VHYCdkEXlHJpeVHYm0FqSskEGZFgW6yvXCe21Ci1lug=; b=SJHrBQPM16oIe+oiyg3GaUOx5Gc2EiwYZQpndChAGBa98m9AG7CuSK4togwPVC4nOy xlMK7rGeDazfg/22SR/QVS6mSsdjhDpI45erKo5pVSTswLErlsNDpkDR0xRGHOtEBVs5 6w0rd+a4WpqFqFXxVNhPrhKS+fsu/PQbam/UbpUkUVZlO2J5ebhpsEhVoT3/ZfPM+55o r08XetFn22vCl1Jrltc2NDWcFvrqdSqo5Sh9oA1yNoDZWpJtsQbtg9VgND5Bh5LPib6k SgkbBszt/gY9jq2FCv+vXap5/JYqqIFbMh+Q5H+tPhilNXodSNLAY63UXjnr6mPMBaIc +zEw== X-Forwarded-Encrypted: i=1; AJvYcCWmy4kb/CTNYwDbNm0Belu+Ju9hWlv2k/5VJjPvGq8UJZsqLT+f2qo77vYPdwTynqUFNOAowxX8R1l/XajpspWqtXIZmDlz6dcpR1A= X-Gm-Message-State: AOJu0Yxhps3udr1Wq0hVsJiUyR66XdPQsn7RaAyaA0EJaz2CZSC54GW/ dNzGsk+DEKWakfsbUTjhb8f+CBbHxEPd8uos7KUKZwKp1otIR25g5OX427ptt9jB0b3HWFWaSav bv7cjhETrCuJkbpqQWSZHUHe0EiRuTZ++ X-Google-Smtp-Source: AGHT+IHQAuXkOmRDomMtwfHomc1o0YG6KcGSR0m2ATMRB1VTDfBx2s7yx+8yO+Of6+xkpSjrepuYHqx++yBTIE9+hLQ= X-Received: by 2002:a17:90a:1c08:b0:2c5:10a6:e989 with SMTP id 98e67ed59e1d1-2c93d75a3d5mr8367369a91.35.1720037396890; Wed, 03 Jul 2024 13:09:56 -0700 (PDT) List-Id: Writing device drivers for FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-drivers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-drivers@FreeBSD.org MIME-Version: 1.0 References: <171996207708.31.7910752540216367279@startmail.com> <86ed8aalkh.fsf@peasant.bootbsd.com> <172003689512.28.10920198816573547978@startmail.com> In-Reply-To: <172003689512.28.10920198816573547978@startmail.com> From: Mario Marietto Date: Wed, 3 Jul 2024 22:09:20 +0200 Message-ID: Subject: Re: Project Proposal: An Standard Driver Virtual Machine To: Nimbly2329 Cc: Dmitry Salychev , freebsd-drivers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000000ad26c061c5d6af5" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WDrVG4WMJz4g4k --0000000000000ad26c061c5d6af5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ---> it does allow to use loadable kernel drivers between different version of the FreeBSD kernel Can someone elaborate more on this ? Because it happened yesterday that I tried to load the vmm.ko module present in my FreeBSD 14.0-RELEASE system to FreeBSD 14.1-RELEASE system but it hasn't been accepted. The same happened with the ZFS module. On Wed, Jul 3, 2024 at 10:01=E2=80=AFPM Nimbly2329 wrote: > > Nimbly2329 writes:> Motivation:>> In is n= ot a obscure fact that driver development is the hardest part in both maint= aining and creating an operating system, and > > that FreeBSD struggles to keep the pace with Linux and Windows. And is = the the number one cause that there is no way of > > developing novel and viable operating systems. > > > > Plan: > > > > (1) We and maybe with the cooperation of another public source kernel/O= S projects develop a Standard Driver Virtual > > Machine, (2) and then we manage to get it implemented in at least Linux= , so that Linus et al. promote that all new drivers > > shall be written against the Standard Driver Virtual Machine. (3) Final= ly profit in little to no effort in porting drivers from Linux. > > I wish we had more Spare Time Investment proposals instead of project > ones :) > > Regards, > Dmitry > > -- https://wiki.freebsd.org/DmitrySalychev > > > I have reading some resources regarding FreeBSD drivers, looks like > FreeBSD has a superior system to Linux's Dynamic Kernel Module System > (dmks), for loading drivers, as by the architecture book ( > https://download.freebsd.org/doc/en/books/arch-handbook/arch-handbook_en.= pdf, > or in other of the sources at freebsd.org I don't remember exactly) it > does allow to use loadable kernel drivers between different version of t= he > FreeBSD kernel, giving both backwards and forward compatibility by design= , > through an stable Binary Application Interface. > > > Therefore if where for only being able to write a loadable kernel drivers= , > that would be enough, but it also has to work with static linked drivers. > > > Does is possible to statically link an otherwise loadable kernel driver > final binary? > > There is a way to implement an device detection from userspace?, so that > device drivers can be loaded as needed. > > > If boat of those are possible, then there is an even simpler plan, and > that is to make Linux implement the FreeBSD's Driver ABI, and my proposal > also is simpler. > > > Regards, > > Nimbly2329 > > > By the way where is the documentation of the FreeBSD's driver ABI? > --=20 Mario. --0000000000000ad26c061c5d6af5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
---> it=20 does allow to use loadable kernel drivers=C2=A0 between different version o= f=20 the FreeBSD kernel

Can someone elaborate more on t= his ? Because it happened yesterday that I tried to load the vmm.ko module = present in my FreeBSD 14.0-RELEASE system to FreeBSD 14.1-RELEASE system bu= t it hasn't been accepted. The same happened with the ZFS module.
<= /div>

On Wed, Jul 3, 2024 at 10:01=E2=80=AFPM Nimbly2329 <hjlftdygaqf@use.startmail.com> wro= te:
=
Nimbly2329 <hjlftdygaqf@use.startma= il.com> writes: > = Motivation: > > = In is not a obscure fact that driver development is the hardest part in bot= h maintaining and creating an ope= rating system, and > that FreeBSD struggles to keep the pace with Linux and Windows. And is= the the number one cause that there is no way of > developing novel and viable operating systems. > > Plan: > > (1) We and maybe with the cooperation of another public source kernel/= OS projects develop a Standard Driver Virtual > Machine, (2) and then we manage to get it implemented in at least Linu= x, so that Linus et al. promote that all new drivers > shall be written against the Standard Driver Virtual Machine. (3) Fina= lly profit in little to no effort in porting drivers from Linux. I wish we had more Spare Time Investment proposals instead of project ones :) Regards, Dmitry --=20 https= ://wiki.freebsd.org/DmitrySalychev

I have reading some resources regarding FreeBSD drivers, looks like=20 FreeBSD has a superior system to Linux's Dynamic Kernel Module System= =20 (dmks), for loading drivers, as by the architecture book (https://download.freebsd.org/doc= /en/books/arch-handbook/arch-handbook_en.pdf, or in other of the sources at freebsd.org I don't remember exactly) it=20 does allow to use loadable kernel drivers=C2=A0 between different version o= f=20 the FreeBSD kernel, giving both backwards and forward compatibility by=20 design, through an stable Binary Application Interface.

Therefore if where for only being able to write a loadable kernel drivers, that=20 would be enough, but it also has to work with static linked drivers.


Does is possible to statically link an= otherwise loadable kernel driver final binary?

There = is a way to implement an device detection from userspace?, so that device d= rivers can be loaded as needed.


= If boat of those are possible, then there is an even simpler plan, and=20 that is to make Linux implement the FreeBSD's Driver ABI, and my=20 proposal also is simpler.


Regard= s,

Nimbly2329


By the way where is the documentation of the FreeBSD's driver ABI?



--
Mario.
--0000000000000ad26c061c5d6af5--