From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: from tb-ob20.topicbox.com (tb-ob20.topicbox.com [173.228.157.66]) by inbox.vuxu.org (Postfix) with ESMTP id A69FE2632E for ; Sat, 3 Aug 2024 16:19:23 +0200 (CEST) Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob20.topicbox.com (Postfix) with ESMTP id 5BAF224EB5 for ; Sat, 3 Aug 2024 10:19:21 -0400 (EDT) (envelope-from bounce.mM67ba8d91ab92ee064844712b.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id 39ABB1EDA8C1; Sat, 3 Aug 2024 10:19:21 -0400 (EDT) ARC-Authentication-Results: i=3; topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=136.143.169.18; dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=duHLum1Q header.a=rsa-sha256 header.s=zoho x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr smtp.helo=sender-op-o18.zoho.eu; x-internal-arc=fail (as.2.topicbox.com=pass, ams.2.topicbox.com=fail (message has been altered), as.1.zohomail.eu=pass, ams.1.zohomail.eu=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=references:from:to:subject:date:in-reply-to :message-id:mime-version:content-type:list-help:list-id :list-post:list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1722694761; bh=JXT/XcBziL4jqO/3 IG4WOsTUh3wrrR6RptCC0hs1JbI=; b=Mu+fnUYmUKVLqayZlmfqAVZLno9/90YU q/ReVHKhpxt56gjELc6LvDdpCjxgLmdRlyHl/KvqxIqs0Dgq2/1roluxiW++kI9y FEQFVvboCZPSbRm9wDhB3aCz49OWl74uuLjaRXiGAlZKsxylGiE1YZlpAlg2EY1T 6e6ZRvri3mw= ARC-Seal: i=3; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1722694761; b=IK7e8zs6AhIwJeBl38FI9aocJhsIaOgRU7pZX2xRz/1MFkXtnu IcnOwplXpo7aPP/SRUAISTU5vbSG/CmpZpsnwfVuiAsVrkikGzmsT9F56OeLKFGB oRuwkaGp0F7uE03Y0HR02qEp5+IBPcmQNMaCZmp76BuRMQsS9RZ210gxs= Authentication-Results: topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=136.143.169.18; dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=duHLum1Q header.a=rsa-sha256 header.s=zoho x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr smtp.helo=sender-op-o18.zoho.eu; x-internal-arc=fail (as.2.topicbox.com=pass, ams.2.topicbox.com=fail (message has been altered), as.1.zohomail.eu=pass, ams.1.zohomail.eu=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx0.topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=136.143.169.18; bimi=skipped (DMARC did not pass); dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=duHLum1Q header.a=rsa-sha256 header.s=zoho x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=rdklein.fr; iprev=pass smtp.remote-ip=136.143.169.18 (sender-op-o18.zoho.eu); spf=pass smtp.mailfrom=edou@rdklein.fr smtp.helo=sender-op-o18.zoho.eu; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=sender-op-o18.zoho.eu policy.ptr=sender-op-o18.zoho.eu; x-return-mx=pass header.domain=rdklein.fr policy.is_org=yes (MX Records found: mx.zoho.eu,mx3.zoho.eu,mx2.zoho.eu); x-return-mx=pass smtp.domain=rdklein.fr policy.is_org=yes (MX Records found: mx.zoho.eu,mx3.zoho.eu,mx2.zoho.eu); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=references :from:to:subject:date:in-reply-to:message-id:mime-version :content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; t=1722694760; x=1722781160; bh=tta7uwDhCv9J10bdli4mVkXtqUQkyqXf kUU9CNR39Uo=; b=ULlUwmb1XpWa1fK8RLw+1q5iclJJvkOL8O0kZoiD46zYgkRv IBidYG2FG0F+HQvhwmTwYo1WNRYYr2vI7mX6YGJ6C7AnITKt2ONCJ/b/wWc2+Pbj T5pRBZl/uKyu4ad5H4RhMYSU6HML4C/uu2Hu06cuOfiCAB3HBPvQ5qWqf44= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 8AB9D2161445 for <9fans@9fans.net>; Sat, 3 Aug 2024 10:19:08 -0400 (EDT) (envelope-from edou@rdklein.fr) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 1A1C29DA282; Sat, 3 Aug 2024 10:19:08 -0400 ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=arcseal; t= 1722694748; b=C91JKSySUtCTcXFncIDGULNgJJ/uHTiOeok3mdetVryDYNTMdw to6wYS5wAa7mZbIy0U3+uJQlq/Ot/oMzJz5QudvxvR8gMJ+Gh7behOsqMu7ZRa38 BQCEHV2A+nW+EBjSegJtQYbUM+hGJcw3NdVx23lGpvzNG4AdZlWwnY7+M72RO5wu oxJOQMoa2MxtjKdJadQUqtGMqntC67S30QctEsd8kRFzbm3Mi75zKtWAtLT80oql SjUKgGkDVh8Yx1LLOZIuPRKO9YXSqwmdS9H7eVKzcll6bJEpP6T34sydwHvCPEuy EhTevlXqZvMXuzYAfihkITnI/wWXZUbgCO9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=references:from:to:subject:date:in-reply-to :message-id:mime-version:content-type; s=arcseal; t=1722694748; bh=NxaCyJwEfHyyPeGng1hG9aSa11HTbQfTSMeOv1QCWus=; b=OhC6vP7pJlC0 zY8ryvu+qGFBtEgTaFRiiKxXzDB/RiZoKfYeZNBKA4CsP/77jzRnpXejWZwuwzfo jphpRMk5Oh/YpVAKN4i5HsGPcNxoUnc3GqJoTK0Lbe4Wu1Kzb2WLzkCoyhkYumU/ XMvO4xxxc9eFpvmfQbnh0Q/R3SFybSlsaZNRpaJTTzP1XcSPyg33DJwhPdJbXVX6 0ZUm6jMO1OCMnfifvwjiezi939ZHFP272qhN5z+VR7z6SrkGHj2cGLGy4KdUsLAU YUzoFZdFXf7zoNrR3Cj/She84cpqMarYCcInhVaxezVpNGaLiDs7cscmm4AezB8h XQZPiN/lNA== ARC-Authentication-Results: i=2; tb-mx0.topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=136.143.169.18; bimi=skipped (DMARC did not pass); dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=duHLum1Q header.a=rsa-sha256 header.s=zoho x-bits=2048; dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=rdklein.fr; iprev=pass smtp.remote-ip=136.143.169.18 (sender-op-o18.zoho.eu); spf=pass smtp.mailfrom=edou@rdklein.fr smtp.helo=sender-op-o18.zoho.eu; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=sender-op-o18.zoho.eu policy.ptr=sender-op-o18.zoho.eu; x-return-mx=pass header.domain=rdklein.fr policy.is_org=yes (MX Records found: mx.zoho.eu,mx3.zoho.eu,mx2.zoho.eu); x-return-mx=pass smtp.domain=rdklein.fr policy.is_org=yes (MX Records found: mx.zoho.eu,mx3.zoho.eu,mx2.zoho.eu); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeeftddrkedvgdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvuf ffjgfkgggtsehttdertddtredtnecuhfhrohhmpefgughouhgrrhguucfmlhgvihhnuceo vgguohhusehrughklhgvihhnrdhfrheqnecuggftrfgrthhtvghrnhepjeefveffkeekie eiiedtjedtueetuddugfekleehffevkeevjeejjefgtdeluefgnecuffhomhgrihhnpeht ohhpihgtsghogidrtghomhenucfkphepudefiedrudegfedrudeiledrudeknecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudefiedrudegfedrudeiledr udekpdhhvghlohepshgvnhguvghrqdhophdqohdukedriihohhhordgvuhdpmhgrihhlfh hrohhmpeeovgguohhusehrughklhgvihhnrdhfrheqpdhnsggprhgtphhtthhopedupdhr tghpthhtohepoeelfhgrnhhsseelfhgrnhhsrdhnvghtqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (rdklein.fr: Sender is authorized to use 'edou@rdklein.fr' in 'mfrom' identity (mechanism 'include:zoho.eu' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="edou@rdklein.fr"; helo=sender-op-o18.zoho.eu; client-ip=136.143.169.18 Received: from sender-op-o18.zoho.eu (sender-op-o18.zoho.eu [136.143.169.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sat, 3 Aug 2024 10:19:06 -0400 (EDT) (envelope-from edou@rdklein.fr) ARC-Seal: i=1; a=rsa-sha256; t=1722694744; cv=none; d=zohomail.eu; s=zohoarc; b=XFKafsHhFXGiCM+8lcVIy8ZTb4/6RdJM/r6RZZWR2MX1gA2+cH7YvcF8PHfi+/fXStIQWVbGSVZ3Hyif5bpbYqgkjVJAFi9D15pWgZs60+JgFisYz3prGCcwaWoyTXDLmjeCX+W0iex7p3S+hYLHonVIwLQkQOhXGHxXSMC5J20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1722694744; h=Content-Type:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=NxaCyJwEfHyyPeGng1hG9aSa11HTbQfTSMeOv1QCWus=; b=UkvQdycZIwQHuDcryFnoI4QvqafdE8TvWnd/qAPBrH7eAY6dAMl7MSRekaOMkOV/scmaDGoTY+somFQ4hMVWnfyAV0jADyFCihGdByWNO3NrLI/kP5lGpM8rDtMo9ckCRqq6e63D0BJbjSp//yLMczRZOJpKkiU8kezTnzAz6cI= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr; dmarc=pass header.from= Received: by mx.zoho.eu with SMTPS id 172269474300848.919083934350056; Sat, 3 Aug 2024 16:19:03 +0200 (CEST) References: <87bk2p3k86.fsf@rdklein.fr> User-agent: mu4e 1.10.2; emacs 28.2 From: Edouard Klein To: 9fans <9fans@9fans.net> Subject: Re: [9fans] Inferno: starting a process in a stopped state Date: Sat, 03 Aug 2024 16:03:18 +0200 In-reply-to: Message-ID: <87zfptpu4a.fsf@rdklein.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-ZohoMailClient: External Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 5b76840a-51a3-11ef-8c68-5c10048c7b06 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UNDI5N2Y0NTFiMThkNTk5YS1NNjdiYThkOTFhYjkyZWUwNjQ4NDQ3?= =?UTF-8?B?MTJiPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M67ba8d91ab92ee064844712b:1:JhUHcti4nHri94J5FiBFchycw6MvozXH2gjEHzOpUyQ Thanks Ron :) In DIS assembly, this is written as jmp $0, which can be changed to jmp $1 when I want to disable the loop and spare myself from decreasing all PC offsets in the code. Now, I have another problem: /prog/N/dbgctl can't be written to :/ Here is how to reproduce: Save the file below as hello.s asm hello.s # Assemble it hello& # Run it bind '#p' /prog # Mount /prog ps # Get the pid, assume e.g. 33 echo stop > /prog/33/dbgctl This yields sh: cannot open /prog/33/dbgctl: permission denied instead of stopping the program. But I can still kill it with echo kill > /prog/33/ctl sh: 33 "Command":killed I have no idea what's wrong. The dbgctl has mode --rw-r--r-- so I should be able to write to it. devprog.c has this snippet case Qdbgctl: if(SECURE || p->group->flags&Pprivatemem || omode !=3D ORDW= R) error(Eperm); Which seems to indicate that the simple > redirection may fail because it would only by an open in write mode. Is there a way, with Inferno's sh, to open a file in RW and get a file descriptor (kinda like bash's exec N<> fname) ? Is the problem stemming from something else ? Any ideas, no matter how far fetched or off the cuff, would be welcome as I'm banging my head against the wall, and the wall is starting to suffer. Thanks in advance, Cheers, Edouard ------------hello.s-------------- #0 jmp $1 load 0(mp),$0,12(mp) # Loads "$Sys" into @mp+12, loading the li= nk descriptors at $0 # ???: why 12 in @mp+12 # ???: where is $0 ? frame $1,44(fp) # Stores in @fp+44 (44 bytes after the cur= rent frame pointer) # a pointer to a new stack frame to local-= call to function of type $1 # ???: Why +44 ? movp 4(mp),32(44(fp)) # 32 after said new frame, store a pointer= to @mp+4, the string to print # ???: Why 32 ? lea 40(fp),16(44(fp)) # Stores the address of @fp+40 in 16 a= fter said new frame # ???: Why 40 ? Maybe because type $2 is 4= 0 bytes long # ???: Why 16 ? mcall 44(fp),$0,12(mp) # Call, in module @mp+12 ($Sys), the first= function in linkage record array $0, in frame @fp+44 ret # Return entry 0, 2 # Entrypoint is at the beginning of the in= struction stream (offset 0) # The function type of this entry poin= t is $2 (offset 2) desc $0,16,"f0" # Type $0 is 16 bytes =3D=3D 4 words long= , all pointers desc $1,40,"0080" # Type $1 is 40 bytes =3D=3D 10 words long= , the ninth is a pointer desc $2,48,"00c0" # Type $2 is 48 bytes =3D=3D 12 words long= , the ninth and tenth are pointers var @mp,16 # Define the module pointer, of length= 16 string @mp+0,"$Sys" # The name of the module to load string @mp+4,"hello world and more\n" # The string to print module Command # The module name link 2,0,0x4244b354,"init" # The doc is wrong, its desc, pointer= , ... not pointer, desc... # it is the list of exported symbols for t= he module. ldts @ldt,1 # This look like the imported symbols from= $Sys word @ldt+0,1 ext @ldt+4,0xac849033,"print" source "/tmp/quatorze/hello.b" ron minnich writes: > I put a > 1:jump 1 > At the start, when I need to do this and have no other way. >=20 > On Mon, Jul 22, 2024 at 01:28 Edouard Klein wrote: >=20 > Hi ! >=20 > I'm writing dis assembly, and I would like to debug my program right > from the entrypoint. >=20 > I intend to use the /prog filesystem for that, thanks to which one can > stop a program by echoing "stop" to dbgctl file. >=20 > However, what I need to do is stop the program at the very start. >=20 > I have multiple ideas, such as introducing a sleep or a read that would > let me enough time to stop the program, but they have the bad property > of modifying the program. >=20 > I could create a loader program that would exec the target program and > stop the loader right before the exec, and I suspect (but I'm not sure) > that would let me stop the target program. >=20 > But these all sound very rube goldbergy to me. >=20 > Is there a way to start a program in a stopped state that I have > overlooked ? >=20 > Thanks in advance, >=20 > Cheers, >=20 > Edouard. >=20 > 9fans / 9fans / see discussions + participants + delivery options Permali= nk ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T4297f451b18d599a-M67ba8= d91ab92ee064844712b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription