From nobody Thu Mar 03 21:10:31 2022 X-Original-To: freebsd-hackers@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 A3CE819F57CE for ; Thu, 3 Mar 2022 21:10:35 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: from puchar.net (puchar.net [194.1.144.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4K8kCt6DTRz3jkY for ; Thu, 3 Mar 2022 21:10:34 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: Received: from 127.0.0.1 (localhost [127.0.0.1]) by puchar.net (8.15.2/8.16.1) with ESMTPS id 223LAWUY014334 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Mar 2022 22:10:33 +0100 (CET) (envelope-from wojtek@puchar.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=puchar.net; s=default; t=1646341833; bh=wJAvZhdNHwgvf7FYGVfx3GmXETVWuSHtgjim6A7btQI=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=mxpo1Dj99zICRLPkLfmaY1lyZQKTPwthQhVoUoC+7FJ3fTJpP3wys7AqlYZhpljFV IRncCNLNS0Vv1WrZzKvlP+KVK/nAB+xN2XGBO7UCG3R/GdmPi8ETKr13F2D2PShYtp N9shdjESu+xs8BJciDeSybqM1tnKJM5KbXl2TMyc= Received: from wojtek.intra (localhost [127.0.0.1]) by wojtek.intra (8.16.1/8.16.1) with ESMTP id 223LAWlC027064; Thu, 3 Mar 2022 22:10:32 +0100 (CET) (envelope-from wojtek@puchar.net) Received: from localhost (wojtek@localhost) by wojtek.intra (8.16.1/8.16.1/Submit) with ESMTP id 223LAVDd027061; Thu, 3 Mar 2022 22:10:31 +0100 (CET) (envelope-from wojtek@puchar.net) X-Authentication-Warning: wojtek.intra: wojtek owned process doing -bs Date: Thu, 3 Mar 2022 22:10:31 +0100 (CET) From: Wojciech Puchar To: Eugene Grosbein cc: John-Mark Gurney , freebsd-hackers@freebsd.org Subject: Re: problem with USB-CD drive In-Reply-To: Message-ID: <8f255987-db8b-b1ee-3732-b587c35c9d40@puchar.net> References: <197d435-6c4b-a60-4e6f-ea4ee515b8f4@puchar.net> <20220302014925.GA88842@funkthat.com> <2de67fd5-40d9-55fc-18ea-671aa096bab5@puchar.net> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4K8kCt6DTRz3jkY X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=puchar.net header.s=default header.b=mxpo1Dj9; dmarc=none; spf=pass (mx1.freebsd.org: domain of wojtek@puchar.net designates 194.1.144.90 as permitted sender) smtp.mailfrom=wojtek@puchar.net X-Spamd-Result: default: False [-3.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[puchar.net:s=default]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[puchar.net]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[puchar.net:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-hackers]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:43476, ipnet:194.1.144.0/24, country:PL]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N >> The question is how to debug it on host side - what exactly is wrong. > > Use sysctl kern.cam.dflags to enable CAM-level debugging. That's what i will do next week with access to the device. It is not really a problem - end users use windows, unix users don't need to mount this image at all in fact. User level program to control this devices (using vendor specific SCSI commands) works fine on unix (FreeBSD and linux) windows and mac OS without problems. For sure that's wrong response to some of few CD-specific SCSI commands i implemented. or maybe some missing. More importantly - when i was implementing this it worked properly under FreeBSD in some point WITHOUT most SCSI command implemented (READ was implemented and few others). Actually i implemented this reading SCSI specs but often - just doing camcontrol on real CD drive to see what to respond :) And not implementing more than needed - all microcontroller side code, including all USB/SCSI handling, firmware update code with decryption AND CD image (decompressed on the fly) fits in PIC32MX bootloader space - 12kB ;)