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-ob0.topicbox.com (tb-ob0.topicbox.com [64.147.108.117]) by inbox.vuxu.org (Postfix) with ESMTP id 114FC2841A for ; Sun, 4 Aug 2024 15:41:16 +0200 (CEST) Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob0.topicbox.com (Postfix) with ESMTP id DD3313ECC4 for ; Sun, 4 Aug 2024 09:41:15 -0400 (EDT) (envelope-from bounce.mM798e4b1249a2536aa222a53b.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id DAF981E3C61A; Sun, 4 Aug 2024 09:41:15 -0400 (EDT) ARC-Authentication-Results: i=3; topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=185.172.199.225; dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=f0m4mEbA 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=sender21-op-o11.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:cc:subject:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding :list-help:list-id:list-post:list-subscribe:reply-to :list-unsubscribe; s=sysmsg-1; t=1722778875; bh=zoN/e9ukNJezsKMu 4K8q5KFRuNz/ihuQwpsSB5AJt3o=; b=Hn6HrkQknbt/QM/nmXVZCdcv4zzI3wzv QmLgosS4MqXJaseCC01JnK3XkghoNZaFlT9FN3mf+PnyyPWHpfv2WnkDg446itfD B6fDXl1UQoLVPkk/2Dn2xV2XzdT8AkOvW+/r1wAiCDi+vcw1YyYSBRtc+nPqUpRb 14IfxKTjSDY= ARC-Seal: i=3; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1722778875; b=DFsORJGldaPNCB/dfu4Vpmvj+kOnht3+ZX0y6CCz9bwKDI+6WG LW5aLIX0NeLIdE2PaG5yHt7O7gt/E6SDRPs6mFIpsKnQSQEb9RAXx2NTNFAav7SO 1GOE0SVfo3OEouFrUFRTz/nDdTZxVKQs+8ZUoZnjKVYdpI22d1a7KHBSE= Authentication-Results: topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=185.172.199.225; dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=f0m4mEbA 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=sender21-op-o11.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-mx1.topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=185.172.199.225; bimi=skipped (DMARC did not pass); dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=f0m4mEbA 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=185.172.199.225 (sender21-op-o11.zoho.eu); spf=pass smtp.mailfrom=edou@rdklein.fr smtp.helo=sender21-op-o11.zoho.eu; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=sender21-op-o11.zoho.eu policy.ptr=sender21-op-o11.zoho.eu; x-return-mx=pass header.domain=rdklein.fr policy.is_org=yes (MX Records found: mx2.zoho.eu,mx3.zoho.eu,mx.zoho.eu); x-return-mx=pass smtp.domain=rdklein.fr policy.is_org=yes (MX Records found: mx2.zoho.eu,mx3.zoho.eu,mx.zoho.eu); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=15 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=references :from:to:cc:subject:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; t=1722778875; x=1722865275; bh=jyC2bupw2uzWmwpeB+AaTgVtj9f8UaUS 7DEEVkV+UB0=; b=M/oQbeyHT8Ym0xOJYjZ+2O8W8LNl/lgt3WtDyjGIfoI+hHIL nk4cps4Hl3ov+jL2T91+PwlJKR+LJiCk2lZL6rYPwwdSh//pM7vxNgX6yDOs3UEo v0xayywSILyo8qJyzJmjUwxQmjJleNWnQVsUClJ+uOcqgLWfs+rfvt8n2YM= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id AD59B1E3C1BE for <9fans@9fans.net>; Sun, 4 Aug 2024 09:41:00 -0400 (EDT) (envelope-from edou@rdklein.fr) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 31605E89849; Sun, 4 Aug 2024 09:41:00 -0400 ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=arcseal; t= 1722778860; b=JBaj72c4EE/QxsJmGysSPJZ9mZgCPtMUZBfP5PdWrtoq3Ehq5O 7EYbMEIJbsAiPzW+fT03hT9TQ3nITgx1SIEimd0tYG9lLTNEJ9nggbVkLY7vNZNT i2xM5SpEkFjEQg6Uv/XCC+4OcOKdM67bs1EVcJVbjPFf3Xqav5/HBngJwfMFlZHi zEkZ5naCjfbfRF64OEY1zYZNyi7BIP2AO7HFVXbz/zJ4CaYxpc+hbRCki3U/JoNN JhnUlqIITPwd3U+zLIsyKhbWpmnkFFKODhOkJztu58qcdKto0I9+lzRVuZMNMW2D rLZKgwd9gEWNmzfzR15UceC9y8PDUkKFvlRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=references:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=arcseal; t=1722778860; bh=Jt0nETjNh2pQfdBWUSJ/Cb5+h9p9Cb+u0wg w8ws7ZK4=; b=rqFYXl8KB5nNbgpIZBdOMdQufGtzIC4FvUD6RQMODWDpyuoK7pD 9NQitMuiR2nG1V9bGRMzPThYN7l2+6QZUZzJ/ku4Xt9lIkmQnWBzlFvdL6ik6jvE L0+EPrECgoWDYtXjF8NgGIQSsgsDC7Jr3LbzVn/juXZjn/C1h6bS2j/Pvho3hg/o Aq54ij+T38JavpBa03J39SqILFAtJToknGizjDLP0tTL1JdEe81B4MwVFdAjxME1 +/VcOAjsMnFoaVqQVx3THoPTveu5rtjWX7pAiR1F3pyUdhNmi2H91/Xjjn6FZro8 mxdHz3lqaGlbKgpkRUiwdrOkwgklIVhWxQQ== ARC-Authentication-Results: i=2; tb-mx1.topicbox.com; arc=pass (as.1.zohomail.eu=pass, ams.1.zohomail.eu=pass) smtp.remote-ip=185.172.199.225; bimi=skipped (DMARC did not pass); dkim=pass (2048-bit rsa key sha256) header.d=rdklein.fr header.i=edou@rdklein.fr header.b=f0m4mEbA 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=185.172.199.225 (sender21-op-o11.zoho.eu); spf=pass smtp.mailfrom=edou@rdklein.fr smtp.helo=sender21-op-o11.zoho.eu; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=sender21-op-o11.zoho.eu policy.ptr=sender21-op-o11.zoho.eu; x-return-mx=pass header.domain=rdklein.fr policy.is_org=yes (MX Records found: mx2.zoho.eu,mx3.zoho.eu,mx.zoho.eu); x-return-mx=pass smtp.domain=rdklein.fr policy.is_org=yes (MX Records found: mx2.zoho.eu,mx3.zoho.eu,mx.zoho.eu); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=15 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeeftddrkeeggdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecuogetfedtuddqtdduucdlud ehmdenucfjughrpehffgfhvfevufffjgfkgggtgfesthhqredttderjeenucfhrhhomhep gfguohhurghrugcumfhlvghinhcuoegvughouhesrhgukhhlvghinhdrfhhrqeenucggtf frrghtthgvrhhnpeeitdejtdetgedtheejkedugeekudduffelheegffekudfgueeileev ueeuteejhfenucffohhmrghinhepthhophhitggsohigrdgtohhmnecukfhppedukeehrd dujedvrdduleelrddvvdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehi nhgvthepudekhedrudejvddrudelledrvddvhedphhgvlhhopehsvghnuggvrhdvuddqoh hpqdhouddurdiiohhhohdrvghupdhmrghilhhfrhhomhepoegvughouhesrhgukhhlvghi nhdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeolehfrghnsheslehfrg hnshdrnhgvtheq X-ME-VSScore: 15 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-mx1.topicbox.com; identity=mailfrom; envelope-from="edou@rdklein.fr"; helo=sender21-op-o11.zoho.eu; client-ip=185.172.199.225 Received: from sender21-op-o11.zoho.eu (sender21-op-o11.zoho.eu [185.172.199.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sun, 4 Aug 2024 09:40:59 -0400 (EDT) (envelope-from edou@rdklein.fr) ARC-Seal: i=1; a=rsa-sha256; t=1722778854; cv=none; d=zohomail.eu; s=zohoarc; b=C69Ntcpn8SHKwbiQL+bg4+DBxJlIaM9n1+FWhMMlY3rYbTJ8WztgylJj95gVPxHPOBd5GJdBt/oSMjOggbuI+Pzy/usOLZ251MDBi3njiIK6CiFPNmOC0qeqHiH9RZpdAvFvb/GSNXGtde+SCaxivyAOLITdNVjKqUvwhL2Hig0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1722778854; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=Jt0nETjNh2pQfdBWUSJ/Cb5+h9p9Cb+u0wgw8ws7ZK4=; b=IvIhfa0TeekIC8lgQ+BH1ixpguoEqEbB9bR5mgI+DMYH0H7FsZDfIJOWzXJQebESQpiZeUwuQK1rSjQhG/Fis/ktZKa74io21O4+ZEOzvqqh3ieACTfJIyQGi4+6W04zqwIiharvBUIBrZ1FTjMYUGhoa4PLspAaOYgzraR3wMw= 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 1722778853336253.904121850686; Sun, 4 Aug 2024 15:40:53 +0200 (CEST) References: <87bk2p3k86.fsf@rdklein.fr> <87zfptpu4a.fsf@rdklein.fr> User-agent: mu4e 1.10.2; emacs 28.2 From: Edouard Klein To: Edouard Klein Cc: 9fans <9fans@9fans.net> Subject: Re: [9fans] Inferno: starting a process in a stopped state Date: Sun, 04 Aug 2024 15:37:22 +0200 In-reply-to: <87zfptpu4a.fsf@rdklein.fr> Message-ID: <87bk28pfsa.fsf@rdklein.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 33467ffc-5267-11ef-8ce8-cb1b795d22e4 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UNDI5N2Y0NTFiMThkNTk5YS1NNzk4ZTRiMTI0OWEyNTM2YWEyMjJh?= =?UTF-8?B?NTNiPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M798e4b1249a2536aa222a53b:1:AfgZpj4X9RLW5q__cAsa4PFArnVjSap0uf-gPU7SR88 For the sake of people stumbling on this post a long time from now: I solved my immediate problem by running: echo stop <>/prog/33/dbgctl The <> redirection opens the file for reading and writing, not just for writing, and solves the "permission denied" issue. However, Inferno's sh(1) man pages mentions A file descriptor may be redirected to an already open descriptor = by writing >[fd0=3Dfd1] or <[fd0=3Dfd1]. Fd1 is a previously opened f= ile de=E2=80=90 scriptor and fd0 becomes a new copy (in the sense of sys-dup(2)) of = it. But I see no hint on how to actually open a file and get a file descriptor. It seems that there is a way to call limbo from sh, so maybe the open system call can be called from sh, but I haven't discovered the syntax yet. Anyway, if anybody knows, I'll be glad to know too, in the meantime, my current hurdle is cleared so off I go. Cheers, Edouard. Edouard Klein writes: > 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 Permal= ink ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T4297f451b18d599a-M798e4= b1249a2536aa222a53b Delivery options: https://9fans.topicbox.com/groups/9fans/subscription