From nobody Sun Mar 19 11:32:53 2023 X-Original-To: freebsd-current@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 4PfbMb4JC9z406lY for ; Sun, 19 Mar 2023 11:32:59 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PfbMb2Rthz441s for ; Sun, 19 Mar 2023 11:32:59 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id A44C7320029B; Sun, 19 Mar 2023 07:32:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 19 Mar 2023 07:32:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1679225576; x=1679311976; bh=ylTgP9q+Wdcr6/57jIc38kqCCH2TjbUePBe sLaHeIts=; b=P991I52wflf/z6Ok4j40Gj8Hkc70Wz3AurXp71B8opGB0xQMF8l oCPMWg5nCM/Xg5KuPl3F78CvySQ4uwxpWH2D3igwNdXwfbPk2fvJ1utBGW6+fWQq 0mtZFfH1pRyZdnOvv1FhQ837vQz9+nZG/mB2CK16faw+sIbgARzPTgVroBEirCE3 1jIskX29OqOA6Dw+0sHvr24bMPxBtomN+AWy3UHW+lX1eFi8pYxazp0LI+275wQk jkeqW4P8XPTnVdsirXQgmWKK5MO+ZOxwq/sOaJNHM90S6QopkgGO+41YR1YBQ+h1 iA/k7aXC0+66vgKWi/nWspPPysUTmd/KxjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1679225576; x= 1679311976; bh=ylTgP9q+Wdcr6/57jIc38kqCCH2TjbUePBesLaHeIts=; b=a xXdg7aEX0nkDmKdAuu7f0JsfORngi1x1cPQdXQdT7rnT3dGPgenTi47YTcVn9IIj pnhuYRPcSn3WCO5JVLDxk3WswQH00d5bolW4EW4adWtzAOpjmUgQedHgiNDv9A7e kN4wgpiMatDKfdtjF6HL6iUy7ROOoqgtqUx2junxntjc5o4orf+D4O1QXfYLhfFx FcLstn+9np2HxxT3c8PDJR6s3GC01NOc1qWWONirGU0B6rgeoICT0CQSLZY6wh/1 8pHlXcwji5BydeVQTVblM3uHUhLv/uCsRolqTYVZmINVkc/PLbZlcj8EEDKJf97Q VheE4V2x65GVTxzMyKzPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdefiedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpegjuhhrihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeen ucggtffrrghtthgvrhhnpedtveevuddtgfelvdeukeekudetgffhjeefvdevlefhteelue etffdtueeludevueenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhfrhgvvggsshgu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh ephihurhhisegrvghtvghrnhdrohhrgh X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Mar 2023 07:32:55 -0400 (EDT) Message-ID: Date: Sun, 19 Mar 2023 12:32:53 +0100 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Infinite loop with d_write_t To: =?UTF-8?Q?Goran_Meki=c4=87?= , freebsd-current@FreeBSD.org References: <20230319111404.a6ac2w44u4trtedy@tilda.center> Content-Language: en-US From: Yuri In-Reply-To: <20230319111404.a6ac2w44u4trtedy@tilda.center> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4PfbMb2Rthz441s X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Goran Mekić wrote: > Hello, > > I'm trying to assemble a minimal kernel module and user space program as > a skeleton, and no matter what I do I get infinite loop. The code for > kernel is https://github.com/mekanix/freebsd-project/blob/master/kernel/main.c. > The way to test: > # make > # sudo kldload ./hello.ko > # echo "something" >/dev/hello > Write done. > Write done. > ... > > What am I doing wrong and where does that infinite loop comes from? Why are you using copyin() and not uiomove() in d_write entry? There's an example that looks like you are trying to do: https://docs.freebsd.org/en/books/arch-handbook/driverbasics/#driverbasics-char