From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 10 00:48:44 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EEBA106566B for ; Sun, 10 Apr 2011 00:48:44 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id D93568FC14 for ; Sun, 10 Apr 2011 00:48:43 +0000 (UTC) Received: by iyj12 with SMTP id 12so5533913iyj.13 for ; Sat, 09 Apr 2011 17:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:x-openpgp-key-id:x-openpgp-key-fingerprint :x-openpgp-key-url; bh=TD7wHWUV/nSxRSUWevhHVgXYBIEgVC1AhP4FL59lGZg=; b=jt8gnv73YHw6tA+xY7VKFjli6afsASJse6uNhhYvkGysj9wSkBKqh/FLSzNmG+mk7v Fxo21MSelgdpO4rHZFGZ444xnZl60EoW/30rX3rK4bKzKc3seziVWLNDcPOYISXdbKcu 4hx9YbL3D2icSybkIpv/bUIjtxODxnXfJWuno= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-openpgp-key-id :x-openpgp-key-fingerprint:x-openpgp-key-url; b=VfjbywYDMsxbRcz5EZ3N/BF2yPwOHduOLWQsscY9iY6fW01gx2MztkOAiIxeLZPry8 BNeZHTeSjVZEUq+TKXaoldhC3zsi0xJbX+LKbe+DVIplEH4LlC6Ek9KpULsGLYlJq2Ff 9DN7djMpikDBPQofNChoKgyfLm0DwWpwqnjps= Received: by 10.42.135.71 with SMTP id o7mr5724496ict.85.1302396523212; Sat, 09 Apr 2011 17:48:43 -0700 (PDT) Received: from DataIX.net (adsl-99-190-87-163.dsl.klmzmi.sbcglobal.net [99.190.87.163]) by mx.google.com with ESMTPS id g16sm3019348ibb.37.2011.04.09.17.48.41 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Apr 2011 17:48:41 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.4/8.14.4) with ESMTP id p3A0mca6040023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Apr 2011 20:48:39 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.4/8.14.4/Submit) id p3A0mbXw040022; Sat, 9 Apr 2011 20:48:37 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Sat, 9 Apr 2011 20:48:37 -0400 From: "J. Hellenthal" To: dieterbsd@engineer.com Message-ID: <20110410004837.GB95165@DataIX.net> References: <8CDC4EC0DEBF3BD-18FC-3276@web-mmc-m02.sysops.aol.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bCsyhTFzCvuiizWE" Content-Disposition: inline In-Reply-To: <8CDC4EC0DEBF3BD-18FC-3276@web-mmc-m02.sysops.aol.com> X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E X-OpenPGP-Key-URL: http://bit.ly/0x89D8547E Cc: freebsd-hackers@freebsd.org Subject: Re: ifconfig output: ipv4 netmask format X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 00:48:44 -0000 --bCsyhTFzCvuiizWE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 09, 2011 at 12:41:05PM -0400, dieterbsd@engineer.com wrote: >Paul Schenkeveld writes: >>Although non-contiguous netmasks are not legal anymore in IPv4, our >>ifconfig still allows to do something like: >> >> # ifconfig em0 inet 10.0.5.2 netmask 255.0.255.0 >> # ifconfig em0 >> em0: flags=3D8843 metric 0 >mtu 1500 >options=3D219bAGIC> >> ether xx:xx:xx:xx:xx:xx >> inet 10.0.5.2 netmask 0xff00ff00 broadcast 10.255.5.255 >> media: Ethernet autoselect (1000baseT ) >> status: active > >If this is no longer legal, should ifconfig issue a warning? > >J. Hellenthal writes: > >>This is the year 2011 right ? when are we going to support new users >>rather than supporting old outdated washed up "scripts" ? > >Change for the sake of change is not progress. Perhaps when you get >more experience you will understand the "joy" of spending massive >amounts of time attempting to deal with gratuitious changes. Perhaps making blind assumptions and shouting from an advertisement domain about experience of others might cause some assumptions to be made, but I won't go there with my thoughts of that. Bold moves that aid the user deciphering what they see correctly spurs further community involvement rather than driving them away. Given this is a small change and one that would only play a small role in a similar light, there are much greater issues that surround this and all of them play a part in the final result, not just the "bigger" ones. I know where to find those. Anyway... Thanks for broadening the Service Window with your ``experience'' --=20 J. Hellenthal --bCsyhTFzCvuiizWE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJNoP5kAAoJEJBXh4mJ2FR+8oAH/0RUuzJyaD4d/TLE0pqBZ0g4 mngox3XWpzsKjXGKbUVaHlhEopNBqGmTQoergD4saImi6eSOZD1aV4gXMxYPAmvN G1n0DCBSx7GDbJeM6AxZEylOv5QO3YdHmC4U9jXel9YL2Ri4KYtNu5NZlxTdIsHh PkmI14F83guC83tgDTgO0OeIRxzTUkYPk2mjJfJmV6oV8nse6fuAJqF4eSp4DKl+ aetcuTUcCPF4kiMFk7PrVctND7TAwooxObB4i+fpJlr/LdGae7lywLyhfhosH1zZ UJTMkLvH7ysSl2/RLmtier/1rOK4FYnSZv1tvj3tubvaHibykYHqRj9akVDsr8A= =8/Y1 -----END PGP SIGNATURE----- --bCsyhTFzCvuiizWE-- From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 10 01:23:16 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DF64106564A for ; Sun, 10 Apr 2011 01:23:16 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from imr-ma02.mx.aol.com (imr-ma02.mx.aol.com [64.12.206.40]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC858FC12 for ; Sun, 10 Apr 2011 01:23:15 +0000 (UTC) Received: from imo-da01.mx.aol.com (imo-da01.mx.aol.com [205.188.169.199]) by imr-ma02.mx.aol.com (8.14.1/8.14.1) with ESMTP id p3A1NFVw010153 for ; Sat, 9 Apr 2011 21:23:15 -0400 Received: from dieterbsd@engineer.com by imo-da01.mx.aol.com (mail_out_v42.9.) id n.1038.487a208 (55914) for ; Sat, 9 Apr 2011 21:23:10 -0400 (EDT) Received: from smtprly-mc03.mx.aol.com (smtprly-mc03.mx.aol.com [64.12.95.99]) by cia-md07.mx.aol.com (v129.9) with ESMTP id MAILCIAMD071-d3da4da1067c63; Sat, 09 Apr 2011 21:23:10 -0400 Received: from web-mmc-m02 (web-mmc-m02.sim.aol.com [64.12.224.135]) by smtprly-mc03.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYMC034-d3da4da1067c63; Sat, 09 Apr 2011 21:23:08 -0400 To: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Date: Sat, 09 Apr 2011 21:23:08 -0400 X-MB-Message-Source: WebUI X-AOL-IP: 67.206.162.65 X-MB-Message-Type: User MIME-Version: 1.0 From: dieterbsd@engineer.com Content-Type: text/plain; charset="us-ascii"; format=flowed X-Mailer: Mail.com Webmail 33490-STANDARD Received: from 67.206.162.65 by web-mmc-m02.sysops.aol.com (64.12.224.135) with HTTP (WebMailUI); Sat, 09 Apr 2011 21:23:08 -0400 Message-Id: <8CDC534FC00AE72-18FC-4107@web-mmc-m02.sysops.aol.com> X-Spam-Flag: NO X-AOL-SENDER: dieterbsd@engineer.com Subject: Re: *printf(9) and PRINTF_BUFR_SIZE X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 01:23:16 -0000 >> While working on other problems with *printf(9), log(9), etc. >> I stumbled upon: >> >> options PRINTF_BUFR_SIZE=3D128 # Prevent printf output being=20 interspersed. >> >> Question 1: Am I correct in thinking that PRINTF_BUFR_SIZE is=20 supposed >> to prevent this: >> >> ada2: 300.000MB/s transfuhub2: 3 ports with 3 removable, self=20 powered >> ers (SATA 2.x, UDMA6, PIO 8192bytes) >> ada2: Command Queueing enabled >> >> Question 2: Why is vprintf() the only function that does this=20 buffering? >> As far as I can tell, the various functions that call kvprintf()=20 directly >> without going through vprintf() do not get buffered. I'm thinking=20 that >> kvprintf() would be a better place for the buffering. Or would this=20 break >> something? >=20 http://docs.freebsd.org/cgi/mid.cgi?AANLkTinPhcc8Z_BdvoEQUv-ZXlHAYOTQJwlUQ= DVO\ 8iJ9 Thanks, Alex! That was a useful thread, I now know more about the problem and how to fix it. I gather the answer to Q1 is yes. Given that the word "transfers" is broken, I still think this example is most likely due to my changes that use unbuffered kvprintf() rather than buffered vprintf(). So question 2 remains. BTW, I see some threads where people think this is due to SMP. It happens on uniprocessor machines too. From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 10 05:02:24 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED6F1106564A; Sun, 10 Apr 2011 05:02:24 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 8DB878FC0C; Sun, 10 Apr 2011 05:02:23 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p3A4jnYO084127 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 9 Apr 2011 21:45:53 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4DA13620.7060407@freebsd.org> Date: Sat, 09 Apr 2011 21:46:24 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Chris Richardson References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-emulation@freebsd.org, freebsd-current@freebsd.org Subject: Re: Kernel Tracking Question.. regarding kernel and boot files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 05:02:25 -0000 On 4/9/11 2:51 PM, Chris Richardson wrote: > On Sat, Apr 9, 2011 at 10:34 PM, Chuck Swiger wrote: > >> Hi, Chris-- >> >> [ ...Reply-to: set to direct towards the most appropriate list... ] >> >> On Apr 9, 2011, at 8:31 AM, Chris Richardson wrote: >>> I am totally new to FreeBSD. I was involved within project which will >>> trace the kernel. I used ktrace but I could not get appropriate results >>> about the files being opened. I don't see any of the boot files boot0-1 >> or 2 >>> in the ktrace.out file. Where did they go? >> The bootstrap loader stages are what loads and runs the kernel. >> ktrace isn't available until afterwards, when the kernel is running. >> >>> Is ktrace the best "trace suite" for freebsd kernel? >> Kinda depends on what you are doing. Setting up good logging and making >> userland >> interfaces for getting to useful information (cf vmstat, ps, iostat, etc) >> is >> more likely to be useful over the longer run. >> >> > What about if I wanna see the interaction between boot process and kernel > loading. either you run it under an emulator that allows you to single step it. or you just add a lot of printf() to the boot loader. (some parts are required to fit in small code sizes to adding prints will cause overflow..) best to read the docs and then the sources. then it wil become apparent to you what you want to find out. > >>> What about going through source code .. Is it better to >>> use Combination of Ecllipse/Qemu and FreeBSD Source tree? >> Eclipse is an editor. If you like it in particular, free free to use it, >> otherwise pick something else you'd prefer to use for C code. >> >>> Does this method will provide us with someway to see how booting process >> invokes >>> the kernel to memory ? Any help will be appreciated. >> You're asking about the process here: >> >> >> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-blocks.html >> >> ...? Frankly, none of these are especially big, start by reviewing the >> source >> code for 'em. >> >> > Yeah. this file provides me with the stages in theoretical way. How about > implementing it using qemu to emulate livecd to see what is going on boot0. > Do you have an idea about that ? > > Good Luck, > > >> Regards, >> -- >> -Chuck >> >> >> > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 10 05:13:00 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52EE4106564A for ; Sun, 10 Apr 2011 05:13:00 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA328FC12 for ; Sun, 10 Apr 2011 05:13:00 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id p3A5CxSn076763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 9 Apr 2011 22:12:59 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id p3A5CxuD076762 for freebsd-hackers@freebsd.org; Sat, 9 Apr 2011 22:12:59 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA12048; Sat, 9 Apr 11 22:00:53 PDT Date: Sat, 09 Apr 2011 22:00:17 -0700 From: perryh@pluto.rain.com To: freebsd-hackers@freebsd.org Message-Id: <4da13961.ER0azkqEq4bIplqX%perryh@pluto.rain.com> References: In-Reply-To: User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: Kernel Tracking Question.. regarding kernel and boot files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 05:13:00 -0000 Chuck Swiger wrote: > > ... Is it better to use Combination of > > Ecllipse/Qemu and FreeBSD Source tree? > > Eclipse is an editor ... Eclipse is, or at least can be configured to be, much more than an editor. In my experience it is an integrated development environment incorporating various debugging displays and controls. The OP is presumably referring to a plugin that integrates Qemu into the Eclipse environment. From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 10 07:15:34 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008E31065670; Sun, 10 Apr 2011 07:15:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D13FB8FC16; Sun, 10 Apr 2011 07:15:32 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA03366; Sun, 10 Apr 2011 10:15:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Q8orp-000Npb-7Z; Sun, 10 Apr 2011 10:15:29 +0300 Message-ID: <4DA15910.4070600@FreeBSD.org> Date: Sun, 10 Apr 2011 10:15:28 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Chris Richardson References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, freebsd-emulation@FreeBSD.org, freebsd-current@FreeBSD.org Subject: Re: Kernel Tracking Question.. regarding kernel and boot files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 07:15:34 -0000 on 10/04/2011 00:51 Chris Richardson said the following: > Yeah. this file provides me with the stages in theoretical way. How about > implementing it using qemu to emulate livecd to see what is going on boot0. > Do you have an idea about that ? Yes, that's perfectly possible. You have to be familiar with assembly and know basic behavior of BIOS booting (supposing we talk about x86) and FreeBSD boot blocks, e.g. what is loaded at what address. Here's an example of something related: http://lists.freebsd.org/pipermail/freebsd-fs/2010-May/008580.html -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 10 07:49:49 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9809106564A; Sun, 10 Apr 2011 07:49:49 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB298FC1A; Sun, 10 Apr 2011 07:49:49 +0000 (UTC) Received: from sbhfislrext01.fnfis.com ([192.168.249.167]) by SCSFISLTC02 (8.14.3/8.14.3) with ESMTP id p3A7SnvB023344; Sun, 10 Apr 2011 02:28:49 -0500 Received: from SBHFISLTCGW04.FNFIS.COM (Not Verified[10.132.248.123]) by sbhfislrext01.fnfis.com with MailMarshal (v6, 5, 4, 7535) id ; Sun, 10 Apr 2011 02:29:00 -0500 Received: from SBHFISLTCGW04.FNFIS.COM ([10.132.248.123]) by SBHFISLTCGW04.FNFIS.COM with Microsoft SMTPSVC(6.0.3790.4675); Sun, 10 Apr 2011 02:28:49 -0500 Received: from [127.0.0.1] ([10.132.254.135]) by SBHFISLTCGW04.FNFIS.COM over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 10 Apr 2011 02:28:48 -0500 References: <4DA13620.7060407@freebsd.org> In-Reply-To: <4DA13620.7060407@freebsd.org> Mime-Version: 1.0 (iPad Mail 8G4) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPad Mail (8G4) From: Devin Teske Date: Sun, 10 Apr 2011 00:28:51 -0700 To: Julian Elischer X-OriginalArrivalTime: 10 Apr 2011 07:28:48.0742 (UTC) FILETIME=[EEE1F060:01CBF750] Cc: "freebsd-hackers@freebsd.org" , Chris Richardson , "freebsd-current@freebsd.org" , "freebsd-emulation@freebsd.org" Subject: Re: Kernel Tracking Question.. regarding kernel and boot files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2011 07:49:49 -0000 On Apr 9, 2011, at 9:46 PM, Julian Elischer wrote: > On 4/9/11 2:51 PM, Chris Richardson wrote: >> On Sat, Apr 9, 2011 at 10:34 PM, Chuck Swiger wrote: >>=20 >>> Hi, Chris-- >>>=20 >>> [ ...Reply-to: set to direct towards the most appropriate list... ] >>>=20 >>> On Apr 9, 2011, at 8:31 AM, Chris Richardson wrote: >>>> I am totally new to FreeBSD. I was involved within project which will >>>> trace the kernel. I used ktrace but I could not get appropriate results >>>> about the files being opened. I don't see any of the boot files boot0-1 >>> or 2 >>>> in the ktrace.out file. Where did they go? >>> The bootstrap loader stages are what loads and runs the kernel. >>> ktrace isn't available until afterwards, when the kernel is running. >>>=20 >>>> Is ktrace the best "trace suite" for freebsd kernel? >>> Kinda depends on what you are doing. Setting up good logging and making >>> userland >>> interfaces for getting to useful information (cf vmstat, ps, iostat, et= c) >>> is >>> more likely to be useful over the longer run. >>>=20 >>>=20 >> What about if I wanna see the interaction between boot process and kernel >> loading. >=20 > either you run it under an emulator that allows you to single step it. > or you just add a lot of printf() to the boot loader. > (some parts are required to fit in small code sizes to adding prints will= cause overflow..) > best to read the docs and then the sources. then it wil become apparent t= o you > what you want to find out. You also have the option of writing Forth modules for the boot-loader. Even= dropping to the "ok" prompt is enough to give you full access to the built= -in Forth interpreter. You can query the variables that are set in the "env= ironment" (which are different depending whether you've booted via pxeboot,= cdboot, or other method). You can even do some limited device poking and f= ile-io (both read and write). The benefit of the forth modules is that you can use it to produce the nece= ssary debug output whilst avoiding the overflow issue. That is to say, that= one technique I've used is to add code to the loader to export some string= or value of interest to a variable in the environment that I would then ad= d something like 'echo "debug =3D=3D $debug"' to loader.rc. Keeps the loade= r small and the human fluff off to the interpreter. >=20 >>=20 >>>> What about going through source code .. Is it better to >>>> use Combination of Ecllipse/Qemu and FreeBSD Source tree? >>> Eclipse is an editor. If you like it in particular, free free to use i= t, >>> otherwise pick something else you'd prefer to use for C code. I use a combination of vim (as my editor) and CVSweb (URL is in the handboo= k) for historical research as necessary. Just my "tuppence." --=20 Devin >>>=20 >>>> Does this method will provide us with someway to see how booting proce= ss >>> invokes >>>> the kernel to memory ? Any help will be appreciated. >>> You're asking about the process here: >>>=20 >>>=20 >>> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-blocks.h= tml >>>=20 >>> ...? Frankly, none of these are especially big, start by reviewing the >>> source >>> code for 'em. >>>=20 >>>=20 >> Yeah. this file provides me with the stages in theoretical way. How about >> implementing it using qemu to emulate livecd to see what is going on boo= t0. >> Do you have an idea about that ? >>=20 >> Good Luck, >>=20 >>=20 >>> Regards, >>> -- >>> -Chuck >>>=20 >>>=20 >>>=20 >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.or= g" >>=20 >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. _____________ From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 01:59:27 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20DEF1065679 for ; Mon, 11 Apr 2011 01:59:27 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from imr-ma01.mx.aol.com (imr-ma01.mx.aol.com [64.12.206.39]) by mx1.freebsd.org (Postfix) with ESMTP id D576B8FC15 for ; Mon, 11 Apr 2011 01:59:26 +0000 (UTC) Received: from imo-ma03.mx.aol.com (imo-ma03.mx.aol.com [64.12.78.138]) by imr-ma01.mx.aol.com (8.14.1/8.14.1) with ESMTP id p3B1xKER010455; Sun, 10 Apr 2011 21:59:20 -0400 Received: from dieterbsd@engineer.com by imo-ma03.mx.aol.com (mail_out_v42.9.) id n.e78.9e811b2 (44228); Sun, 10 Apr 2011 21:59:18 -0400 (EDT) Received: from smtprly-dc01.mx.aol.com (smtprly-dc01.mx.aol.com [205.188.170.1]) by cia-dd08.mx.aol.com (v129.9) with ESMTP id MAILCIADD086-d1c24da260711c5; Sun, 10 Apr 2011 21:59:16 -0400 Received: from web-mmc-m02 (web-mmc-m02.sim.aol.com [64.12.224.135]) by smtprly-dc01.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYDC013-d1c24da260711c5; Sun, 10 Apr 2011 21:59:13 -0400 To: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Content-Transfer-Encoding: quoted-printable Date: Sun, 10 Apr 2011 21:59:13 -0400 X-MB-Message-Source: WebUI X-AOL-IP: 67.206.163.145 X-MB-Message-Type: User MIME-Version: 1.0 From: dieterbsd@engineer.com Content-Type: text/plain; charset="us-ascii" X-Mailer: Mail.com Webmail 33490-STANDARD Received: from 67.206.163.145 by web-mmc-m02.sysops.aol.com (64.12.224.135) with HTTP (WebMailUI); Sun, 10 Apr 2011 21:59:13 -0400 Message-Id: <8CDC60330838A41-18FC-694F@web-mmc-m02.sysops.aol.com> X-Spam-Flag: NO X-AOL-SENDER: dieterbsd@engineer.com Cc: Subject: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 01:59:27 -0000 FreeBSD 8.2 amd64 uniprocessor kernel: siisch1: DISCONNECT requested kernel: siisch1: SIIS reset... kernel: siisch1: siis_sata_connect() calling DELAY(1000) last message repeated 59 times kernel: siisch1: SATA connect time=3D60ms status=3D00000123 kernel: siisch1: SIIS reset done: devices=3D00000001 kernel: siisch1: DISCONNECT requested kernel: siisch1: SIIS reset... kernel: siisch1: siis_sata_connect() calling DELAY(1000) last message repeated 58 times kernel: siisch1: SATA connect time=3D59ms status=3D00000123 ... kernel: siisch0: siis_wait_ready() calling DELAY(1000) last message repeated 1300 times kernel: siisch0: port is not ready (timeout 10000ms) status =3D 001f2000 Meanwhile, *everything* comes to a screeching halt. Device drivers are locked out, and thus incoming data is lost. Losing incoming data is unacceptable. Need an alternative to DELAY() that does not lock out other device drivers. There must be a way to reset one bit of hardware without locking down the entire machine. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 07:36:21 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0631065672; Mon, 11 Apr 2011 07:36:21 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 012788FC1F; Mon, 11 Apr 2011 07:36:20 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=6QwXiDozn7Gnsf2tGidwH+ndAwLlGixx7JAIKZICKmI= c=1 sm=1 a=IU0TiZmyZPMA:10 a=w6hOy3w7ACoA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=L6tdpFjRAAAA:8 a=-mmsfIQ70veC9lWLMqEA:9 a=kt4sO8lXSNaTAiA8-_IA:7 a=wPNLvfGTeEIA:10 a=RZHap4myAk8A:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 112377227; Mon, 11 Apr 2011 09:26:17 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Mon, 11 Apr 2011 09:25:16 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <8CDC60330838A41-18FC-694F@web-mmc-m02.sysops.aol.com> In-Reply-To: <8CDC60330838A41-18FC-694F@web-mmc-m02.sysops.aol.com> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104110925.16882.hselasky@c2i.net> Cc: freebsd-drivers@freebsd.org, dieterbsd@engineer.com Subject: Re: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 07:36:21 -0000 On Monday 11 April 2011 03:59:13 dieterbsd@engineer.com wrote: > FreeBSD 8.2 amd64 uniprocessor > > kernel: siisch1: DISCONNECT requested > kernel: siisch1: SIIS reset... > kernel: siisch1: siis_sata_connect() calling DELAY(1000) > last message repeated 59 times > kernel: siisch1: SATA connect time=60ms status=00000123 > kernel: siisch1: SIIS reset done: devices=00000001 > kernel: siisch1: DISCONNECT requested > kernel: siisch1: SIIS reset... > kernel: siisch1: siis_sata_connect() calling DELAY(1000) > last message repeated 58 times > kernel: siisch1: SATA connect time=59ms status=00000123 > ... > kernel: siisch0: siis_wait_ready() calling DELAY(1000) > last message repeated 1300 times > kernel: siisch0: port is not ready (timeout 10000ms) status = 001f2000 > > Meanwhile, *everything* comes to a screeching halt. Device > drivers are locked out, and thus incoming data is lost. > Losing incoming data is unacceptable. > > Need an alternative to DELAY() that does not lock out > other device drivers. There must be a way to reset one > bit of hardware without locking down the entire machine. Hi, An alternative to DELAY() is the simplest solution. You probably need to do some redesign in the SCSI layer to find a better solution. --HPS From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 08:52:19 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE781065673 for ; Mon, 11 Apr 2011 08:52:19 +0000 (UTC) (envelope-from boogie@lazybytes.org) Received: from mail.lazybytes.org (mail.lazybytes.org [195.54.209.3]) by mx1.freebsd.org (Postfix) with ESMTP id 487838FC17 for ; Mon, 11 Apr 2011 08:52:19 +0000 (UTC) Received: from [95.108.170.237] (dhcp170-237-red.yandex.net [95.108.170.237]) by mail.lazybytes.org (Postfix) with ESMTPSA id D75C4935; Mon, 11 Apr 2011 12:52:17 +0400 (MSD) Message-ID: <4DA2C166.1080804@lazybytes.org> Date: Mon, 11 Apr 2011 12:52:54 +0400 From: Sergey Vinogradov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Lanikai/3.1.9 MIME-Version: 1.0 To: Damien Fleuriot References: <4D9EFAC6.4020906@lazybytes.org> <4D9F2B8D.3040104@lazybytes.org> <20110409045453.GA91335@DataIX.net> <4DA04BEB.6010608@my.gd> In-Reply-To: <4DA04BEB.6010608@my.gd> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.lazybytes.org); Mon, 11 Apr 2011 12:52:17 +0400 (MSD) Cc: freebsd-hackers@freebsd.org Subject: Re: ifconfig output: ipv4 netmask format X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 08:52:19 -0000 On 09.04.2011 16:07, Damien Fleuriot wrote: > > > On 4/9/11 7:33 AM, Garrett Cooper wrote: >> >> Although I see the value of your and Sergey's argument, the problem is >> that it may cause unexpected breakage for other third parties that >> depend on a particular behavior in FreeBSD as Bjoern and others have >> suggested; I have a script at least that does properly parse out the >> hex output in order to set IPs properly with ipmitool, and I would be >> perturbed to have to hack around this further in my script. >> >> Thanks, >> -Garrett >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > If the proposed change was made an option via a knob as has been > suggested, that would leave your script unscathed. > > One might or might not like the option, and then choose to use it or > disregard it. > > Given that one can configure their interfaces by giving a CIDR notation > (like: ifconfig re0 inet 192.168.0.1/24) , it makes sense that one > should be able to output the CIDR notation as well. > > I for one see absolutely no valid reason why the change should be > rejected if it doesn't change ifconfig's default behaviour and doesn't > cause any regression ? > > A valid reason would be: nobody wants it. > But then, some people do seem to want it. > > I would like this option really, would prolly alias it while I'm at it. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" I was going to write the very same thing. I can sign under every word of your message :) -- wbr, Boo From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 13:44:28 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DABC106564A for ; Mon, 11 Apr 2011 13:44:28 +0000 (UTC) (envelope-from boogie@lazybytes.org) Received: from mail.lazybytes.org (mail.lazybytes.org [195.54.209.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47B568FC0C for ; Mon, 11 Apr 2011 13:44:28 +0000 (UTC) Received: from [95.108.170.237] (dhcp170-237-red.yandex.net [95.108.170.237]) by mail.lazybytes.org (Postfix) with ESMTPSA id 48712DFC for ; Mon, 11 Apr 2011 17:44:27 +0400 (MSD) Message-ID: <4DA305E2.9080206@lazybytes.org> Date: Mon, 11 Apr 2011 17:45:06 +0400 From: Sergey Vinogradov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Lanikai/3.1.9 MIME-Version: 1.0 To: FreeBSD Hackers References: <4D9EFAC6.4020906@lazybytes.org> In-Reply-To: <4D9EFAC6.4020906@lazybytes.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (mail.lazybytes.org); Mon, 11 Apr 2011 17:44:27 +0400 (MSD) Cc: Subject: Re: ifconfig output: ipv4 netmask format X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 13:44:28 -0000 On 08.04.2011 16:08, Sergey Vinogradov wrote: > Hi, hackers. > I have a question: why ipv4 netmask is displayed by ifconfig in hex > format? Isn't dot-decimal notation more human-readable? Will the > attached patch break something in the very bad way? > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" TWIMC: the patch adding the '-t' flag was sent to freebsd-current@ today. Should I duplicate it here? -- wbr, Boo From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 18:34:49 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B771065670; Mon, 11 Apr 2011 18:34:49 +0000 (UTC) (envelope-from eng.mufic@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 143B88FC15; Mon, 11 Apr 2011 18:34:48 +0000 (UTC) Received: by pvg11 with SMTP id 11so2800800pvg.13 for ; Mon, 11 Apr 2011 11:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=yj7OxTifM7Iso8t5iG69RTFyZz/hxRn/cFpLKqfGW4Y=; b=rxdosvUbXB1mt1trWP/ct/BEzvsXhWgsLNpBrsv/4myHxHxMWkWiOImot0F7MOIau7 vmqGUL9vpabGQ0np7zoupSIPA72JX3OAuXHZEUwnGp9zJpoWL3XgJum4tT6UHkUe0XuS 5nYAXeEQfdluGYtwgZDfT9E/PcFSJhIx1xKTo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=pYCVzm67ZKN10/4qjO8FqezmHQiiIZyPYh1WvJ7NHBeJND3mZ9RXSm0kuQgOhCgK6m Nc3f4rG4yg/LqWFuwAHIAMrcXVgoQsy9itFzRV6noD5rBiWkaBKhSCT9agiXxSFA++Kf mPKUpytWmsGv/jPiM7JIiPn8aZQ3sYNfGKDUQ= MIME-Version: 1.0 Received: by 10.142.150.32 with SMTP id x32mr5646118wfd.287.1302545300458; Mon, 11 Apr 2011 11:08:20 -0700 (PDT) Sender: eng.mufic@gmail.com Received: by 10.68.65.200 with HTTP; Mon, 11 Apr 2011 11:08:20 -0700 (PDT) In-Reply-To: References: <4DA13620.7060407@freebsd.org> Date: Mon, 11 Apr 2011 20:08:20 +0200 X-Google-Sender-Auth: MP6NfP0IpqboLpRddkefuhVOdGs Message-ID: From: Mohammed Farrag To: Devin Teske Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-hackers@freebsd.org" , Chris Richardson , "freebsd-current@freebsd.org" , "freebsd-emulation@freebsd.org" Subject: Re: Kernel Tracking Question.. regarding kernel and boot files X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 18:34:49 -0000 Hey All, Please check this. Check this to use Eclipse/Qemu for Kernel Debugging. http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html It was designed to debug linux kernel. Regards, Mohammed On Sun, Apr 10, 2011 at 9:28 AM, Devin Teske wrote: > On Apr 9, 2011, at 9:46 PM, Julian Elischer wrote: > > > On 4/9/11 2:51 PM, Chris Richardson wrote: > >> On Sat, Apr 9, 2011 at 10:34 PM, Chuck Swiger wrote: > >> > >>> Hi, Chris-- > >>> > >>> [ ...Reply-to: set to direct towards the most appropriate list... ] > >>> > >>> On Apr 9, 2011, at 8:31 AM, Chris Richardson wrote: > >>>> I am totally new to FreeBSD. I was involved within project which > will > >>>> trace the kernel. I used ktrace but I could not get appropriate > results > >>>> about the files being opened. I don't see any of the boot files > boot0-1 > >>> or 2 > >>>> in the ktrace.out file. Where did they go? > >>> The bootstrap loader stages are what loads and runs the kernel. > >>> ktrace isn't available until afterwards, when the kernel is running. > >>> > >>>> Is ktrace the best "trace suite" for freebsd kernel? > >>> Kinda depends on what you are doing. Setting up good logging and > making > >>> userland > >>> interfaces for getting to useful information (cf vmstat, ps, iostat, > etc) > >>> is > >>> more likely to be useful over the longer run. > >>> > >>> > >> What about if I wanna see the interaction between boot process and > kernel > >> loading. > > > > either you run it under an emulator that allows you to single step it. > > or you just add a lot of printf() to the boot loader. > > (some parts are required to fit in small code sizes to adding prints will > cause overflow..) > > best to read the docs and then the sources. then it wil become apparent > to you > > what you want to find out. > > You also have the option of writing Forth modules for the boot-loader. Even > dropping to the "ok" prompt is enough to give you full access to the > built-in Forth interpreter. You can query the variables that are set in the > "environment" (which are different depending whether you've booted via > pxeboot, cdboot, or other method). You can even do some limited device > poking and file-io (both read and write). > > The benefit of the forth modules is that you can use it to produce the > necessary debug output whilst avoiding the overflow issue. That is to say, > that one technique I've used is to add code to the loader to export some > string or value of interest to a variable in the environment that I would > then add something like 'echo "debug == $debug"' to loader.rc. Keeps the > loader small and the human fluff off to the interpreter. > > > > >> > >>>> What about going through source code .. Is it better to > >>>> use Combination of Ecllipse/Qemu and FreeBSD Source tree? > >>> Eclipse is an editor. If you like it in particular, free free to use > it, > >>> otherwise pick something else you'd prefer to use for C code. > > I use a combination of vim (as my editor) and CVSweb (URL is in the > handbook) for historical research as necessary. > > Just my "tuppence." > -- > Devin > > >>> > >>>> Does this method will provide us with someway to see how booting > process > >>> invokes > >>>> the kernel to memory ? Any help will be appreciated. > >>> You're asking about the process here: > >>> > >>> > >>> > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-blocks.html > >>> > >>> ...? Frankly, none of these are especially big, start by reviewing the > >>> source > >>> code for 'em. > >>> > >>> > >> Yeah. this file provides me with the stages in theoretical way. How > about > >> implementing it using qemu to emulate livecd to see what is going on > boot0. > >> Do you have an idea about that ? > >> > >> Good Luck, > >> > >> > >>> Regards, > >>> -- > >>> -Chuck > >>> > >>> > >>> > >> _______________________________________________ > >> freebsd-current@freebsd.org mailing list > >> http://lists.freebsd.org/mailman/listinfo/freebsd-current > >> To unsubscribe, send any mail to " > freebsd-current-unsubscribe@freebsd.org" > >> > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > _____________ > > The information contained in this message is proprietary and/or > confidential. If you are not the intended recipient, please: (i) delete the > message and all copies; (ii) do not disclose, distribute or use the message > in any manner; and (iii) notify the sender immediately. In addition, please > be aware that any message addressed to our domain is subject to archiving > and review by persons other than the intended recipient. Thank you. > _____________ > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- *Mohammed Farrag* *FreeBSD Contributor* From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 19:43:30 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11A3B106564A; Mon, 11 Apr 2011 19:43:30 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from imr-ma03.mx.aol.com (imr-ma03.mx.aol.com [64.12.206.41]) by mx1.freebsd.org (Postfix) with ESMTP id C731E8FC0A; Mon, 11 Apr 2011 19:43:29 +0000 (UTC) Received: from imo-ma01.mx.aol.com (imo-ma01.mx.aol.com [64.12.78.136]) by imr-ma03.mx.aol.com (8.14.1/8.14.1) with ESMTP id p3BJhFus002034; Mon, 11 Apr 2011 15:43:15 -0400 Received: from dieterbsd@engineer.com by imo-ma01.mx.aol.com (mail_out_v42.9.) id n.1048.4a7d781 (55739); Mon, 11 Apr 2011 15:43:13 -0400 (EDT) Received: from smtprly-md01.mx.aol.com (smtprly-md01.mx.aol.com [64.12.143.154]) by cia-md04.mx.aol.com (v129.9) with ESMTP id MAILCIAMD046-d4154da359c5ff; Mon, 11 Apr 2011 15:43:13 -0400 Received: from web-mmc-m04 (web-mmc-m04.sim.aol.com [64.12.224.137]) by smtprly-md01.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYMD013-d4154da359c5ff; Mon, 11 Apr 2011 15:43:01 -0400 To: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Content-Transfer-Encoding: quoted-printable Date: Mon, 11 Apr 2011 15:43:00 -0400 X-MB-Message-Source: WebUI X-AOL-IP: 67.206.164.34 X-MB-Message-Type: User MIME-Version: 1.0 From: dieterbsd@engineer.com Content-Type: text/plain; charset="us-ascii"; format=flowed X-Mailer: Mail.com Webmail 33490-STANDARD Received: from 67.206.164.34 by web-mmc-m04.sysops.aol.com (64.12.224.137) with HTTP (WebMailUI); Mon, 11 Apr 2011 15:43:00 -0400 Message-Id: <8CDC697CCCE3652-124C-1B2@web-mmc-m04.sysops.aol.com> X-Spam-Flag: NO X-AOL-SENDER: dieterbsd@engineer.com Cc: Subject: Re: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 19:43:30 -0000 >> FreeBSD 8.2 amd64 uniprocessor >> >> kernel: siisch1: DISCONNECT requested >> kernel: siisch1: SIIS reset... >> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >> last message repeated 59 times >> kernel: siisch1: SATA connect time=3D60ms status=3D00000123 >> kernel: siisch1: SIIS reset done: devices=3D00000001 >> kernel: siisch1: DISCONNECT requested >> kernel: siisch1: SIIS reset... >> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >> last message repeated 58 times >> kernel: siisch1: SATA connect time=3D59ms status=3D00000123 >> ... >> kernel: siisch0: siis_wait_ready() calling DELAY(1000) >> last message repeated 1300 times >> kernel: siisch0: port is not ready (timeout 10000ms) status =3D=20 001f2000 >> >> Meanwhile, *everything* comes to a screeching halt. Device >> drivers are locked out, and thus incoming data is lost. >> Losing incoming data is unacceptable. >> >> Need an alternative to DELAY() that does not lock out >> other device drivers. There must be a way to reset one >> bit of hardware without locking down the entire machine. Hans Petter Selasky writes: > An alternative to DELAY() is the simplest solution. You probably need > to do some redesign in the SCSI layer to find a better solution. I keep coming back to the idea that a device driver for one controller should not have to lock out *all* the hardware. RS-232 locks out Ethernet. Disk drivers lock out Ethernet. And so on. Why? Is there some fundamental reason that this *has* to be? I thought the conversion from spl() to mutex() was supposed to fix this? I'm making progress on my project converting printf(9) calls to log(9), and fixing some bugs along the way. Eventually I'll have patches to submit. But this is really a workaround, not a fix to the underlying problem. Redesigning the SCSI layer sounds like a job for someone who took a lot more CS classes than I did. /dev/brain returns ENOCLUE. :-( From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 11 23:27:38 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9566E106566B; Mon, 11 Apr 2011 23:27:38 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 345538FC1B; Mon, 11 Apr 2011 23:27:38 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3BNMetI069314 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 11 Apr 2011 17:22:43 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <8CDC697CCCE3652-124C-1B2@web-mmc-m04.sysops.aol.com> Date: Mon, 11 Apr 2011 17:22:34 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <2BD9089E-874C-41BB-80B1-25B0DDE489C4@bsdimp.com> References: <8CDC697CCCE3652-124C-1B2@web-mmc-m04.sysops.aol.com> To: dieterbsd@engineer.com X-Mailer: Apple Mail (2.1082) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 11 Apr 2011 17:22:44 -0600 (MDT) Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Apr 2011 23:27:38 -0000 I don't suppose that your driver could cause the hardware to interrupt = after a little time? That would be more resource friendly... = Otherwise, 1ms is long enough that a msleep or tsleep would likely work = quite nicely. Warner On Apr 11, 2011, at 1:43 PM, dieterbsd@engineer.com wrote: >>> FreeBSD 8.2 amd64 uniprocessor >>>=20 >>> kernel: siisch1: DISCONNECT requested >>> kernel: siisch1: SIIS reset... >>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>> last message repeated 59 times >>> kernel: siisch1: SATA connect time=3D60ms status=3D00000123 >>> kernel: siisch1: SIIS reset done: devices=3D00000001 >>> kernel: siisch1: DISCONNECT requested >>> kernel: siisch1: SIIS reset... >>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>> last message repeated 58 times >>> kernel: siisch1: SATA connect time=3D59ms status=3D00000123 >>> ... >>> kernel: siisch0: siis_wait_ready() calling DELAY(1000) >>> last message repeated 1300 times >>> kernel: siisch0: port is not ready (timeout 10000ms) status =3D=20 > 001f2000 >>>=20 >>> Meanwhile, *everything* comes to a screeching halt. Device >>> drivers are locked out, and thus incoming data is lost. >>> Losing incoming data is unacceptable. >>>=20 >>> Need an alternative to DELAY() that does not lock out >>> other device drivers. There must be a way to reset one >>> bit of hardware without locking down the entire machine. >=20 > Hans Petter Selasky writes: >> An alternative to DELAY() is the simplest solution. You probably need >> to do some redesign in the SCSI layer to find a better solution. >=20 > I keep coming back to the idea that a device driver for one > controller should not have to lock out *all* the hardware. > RS-232 locks out Ethernet. Disk drivers lock out Ethernet. > And so on. Why? Is there some fundamental reason that this > *has* to be? I thought the conversion from spl() to mutex() > was supposed to fix this? >=20 > I'm making progress on my project converting printf(9) calls > to log(9), and fixing some bugs along the way. Eventually I'll > have patches to submit. But this is really a workaround, not > a fix to the underlying problem. >=20 > Redesigning the SCSI layer sounds like a job for someone who took > a lot more CS classes than I did. /dev/brain returns ENOCLUE. :-( >=20 >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to = "freebsd-hackers-unsubscribe@freebsd.org" >=20 >=20 From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 12 07:12:17 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D25B8106564A for ; Tue, 12 Apr 2011 07:12:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 610B18FC08 for ; Tue, 12 Apr 2011 07:12:17 +0000 (UTC) Received: by fxm11 with SMTP id 11so5437393fxm.13 for ; Tue, 12 Apr 2011 00:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Fzs8wCjYXspkcDEIDr1SJfOQosoIfwmVdH0A5ScLhVQ=; b=IeTlJ0YT0D5mmXw+B6YRlnBHn+xAX1gcW4KkyMEVQQ1i6hCPv4QXYNOirY+AFboBdV N2vaU0xPv/Pj4r4ukpV4Tn4VXp6/JfpiiPIoUkdHlD8YAyAH4iWj9fWM7xSkOodSBmFT E5vN0HjgcoS+GOkLb5LXfXNW5izqPHUh4JR/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=x1mDZ0Lw3chiUL8OBTzCP14kVHqOQBOvcaU1rrvkX3shuuFCHWolGIHIlepDD7zDlD F3YDD74XbccchRrhAKyXrM05xUqt9WjXeUfhhu+MqoVIsJ5PyUSRiepSTp+OtRmE5N6t /EG72fZYQGmzmDATnscHfsbkMYC1Mxu8sEDng= Received: by 10.223.27.7 with SMTP id g7mr386469fac.62.1302591837364; Tue, 12 Apr 2011 00:03:57 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l2sm1885969fam.29.2011.04.12.00.03.55 (version=SSLv3 cipher=OTHER); Tue, 12 Apr 2011 00:03:56 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DA3F950.1070906@FreeBSD.org> Date: Tue, 12 Apr 2011 10:03:44 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Warner Losh References: <8CDC697CCCE3652-124C-1B2@web-mmc-m04.sysops.aol.com> <4DA3F70F.4010805@FreeBSD.org> In-Reply-To: <4DA3F70F.4010805@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, dieterbsd@engineer.com, Hans Petter Selasky Subject: Re: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 07:12:17 -0000 Alexander Motin wrote: > Warner Losh wrote: >> I don't suppose that your driver could cause the hardware to interrupt after a little time? That would be more resource friendly... Otherwise, 1ms is long enough that a msleep or tsleep would likely work quite nicely. > > It's not his driver, it's mine. Actually, unlike AHCI, this hardware > even has interrupt for ready transition (second, biggest of sleeps). But > it is not used in present situation. > >> On Apr 11, 2011, at 1:43 PM, dieterbsd@engineer.com wrote: >>>>> FreeBSD 8.2 amd64 uniprocessor >>>>> >>>>> kernel: siisch1: DISCONNECT requested >>>>> kernel: siisch1: SIIS reset... >>>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>>> last message repeated 59 times >>>>> kernel: siisch1: SATA connect time=60ms status=00000123 >>>>> kernel: siisch1: SIIS reset done: devices=00000001 >>>>> kernel: siisch1: DISCONNECT requested >>>>> kernel: siisch1: SIIS reset... >>>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>>> last message repeated 58 times >>>>> kernel: siisch1: SATA connect time=59ms status=00000123 >>>>> ... >>>>> kernel: siisch0: siis_wait_ready() calling DELAY(1000) >>>>> last message repeated 1300 times >>>>> kernel: siisch0: port is not ready (timeout 10000ms) status = >>> 001f2000 >>>>> Meanwhile, *everything* comes to a screeching halt. Device >>>>> drivers are locked out, and thus incoming data is lost. >>>>> Losing incoming data is unacceptable. >>>>> >>>>> Need an alternative to DELAY() that does not lock out >>>>> other device drivers. There must be a way to reset one >>>>> bit of hardware without locking down the entire machine. >>> Hans Petter Selasky writes: >>>> An alternative to DELAY() is the simplest solution. You probably need >>>> to do some redesign in the SCSI layer to find a better solution. >>> I keep coming back to the idea that a device driver for one >>> controller should not have to lock out *all* the hardware. >>> RS-232 locks out Ethernet. Disk drivers lock out Ethernet. >>> And so on. Why? Is there some fundamental reason that this >>> *has* to be? I thought the conversion from spl() to mutex() >>> was supposed to fix this? >>> >>> I'm making progress on my project converting printf(9) calls >>> to log(9), and fixing some bugs along the way. Eventually I'll >>> have patches to submit. But this is really a workaround, not >>> a fix to the underlying problem. >>> >>> Redesigning the SCSI layer sounds like a job for someone who took >>> a lot more CS classes than I did. /dev/brain returns ENOCLUE. :-( > > CAM is not completely innocent in this situation indeed. CAM defines > XPT_RESET_BUS request as synchronous. It is not queued, and called under > the SIM mutex lock. I don't think lock can be safely dropped in the > middle there. Thinking again, I was unfair to CAM: SCSI (SPI) just don't have this ready status to wait for, so waiting was always done asynchronously there. I'll try to emulate that. > Now I think that I could try to move readiness waiting out of the > siis_reset() to do it asynchronously. I'll think about it. -- Alexander Motin From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 12 07:21:34 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48219106566B for ; Tue, 12 Apr 2011 07:21:34 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id CC4578FC0C for ; Tue, 12 Apr 2011 07:21:33 +0000 (UTC) Received: by fxm11 with SMTP id 11so5441410fxm.13 for ; Tue, 12 Apr 2011 00:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=7kLmVDk36/ZPZ0rSoEB9fIza6fnxxlUJAtz+hUywQho=; b=gcZRoMeiLsIkxk0iMFPTvggy/PMqjsSmJLK5Ai4IBBn3U5uBVP/ZLnA3gpqd6QN13C Ot0EjZ8XKmT+xz2SNnSD8YMTEVsU9hm9i5aqoD/JEkFY3gx8Vb28mBAugt/0uHXi0rSt mxJlg1j6eBYfB56oI5a9n8zvXaHnKJmZfWkaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=Klh8KWtIzkyTh8urPrijjpGKaNGksECAXnF6IvTV8nyCkp9IZD5QX9H+9YEsy6fGCI 3BsiwCb8IAxPwC7Z54Uf/onDiRcpAFo4V+Ostq+7t52g8tW5eoq+Yo/VPx3ekw7SDm53 bJ5fXIdnqqsjAWjxBD0SaFI04UHNKsKuSWSsk= Received: by 10.223.6.198 with SMTP id a6mr869096faa.126.1302591260419; Mon, 11 Apr 2011 23:54:20 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n26sm1883597fam.37.2011.04.11.23.54.18 (version=SSLv3 cipher=OTHER); Mon, 11 Apr 2011 23:54:19 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DA3F70F.4010805@FreeBSD.org> Date: Tue, 12 Apr 2011 09:54:07 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Warner Losh References: <8CDC697CCCE3652-124C-1B2@web-mmc-m04.sysops.aol.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, dieterbsd@engineer.com, Hans Petter Selasky Subject: Re: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2011 07:21:34 -0000 Warner Losh wrote: > I don't suppose that your driver could cause the hardware to interrupt after a little time? That would be more resource friendly... Otherwise, 1ms is long enough that a msleep or tsleep would likely work quite nicely. It's not his driver, it's mine. Actually, unlike AHCI, this hardware even has interrupt for ready transition (second, biggest of sleeps). But it is not used in present situation. > On Apr 11, 2011, at 1:43 PM, dieterbsd@engineer.com wrote: >>>> FreeBSD 8.2 amd64 uniprocessor >>>> >>>> kernel: siisch1: DISCONNECT requested >>>> kernel: siisch1: SIIS reset... >>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>> last message repeated 59 times >>>> kernel: siisch1: SATA connect time=60ms status=00000123 >>>> kernel: siisch1: SIIS reset done: devices=00000001 >>>> kernel: siisch1: DISCONNECT requested >>>> kernel: siisch1: SIIS reset... >>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>> last message repeated 58 times >>>> kernel: siisch1: SATA connect time=59ms status=00000123 >>>> ... >>>> kernel: siisch0: siis_wait_ready() calling DELAY(1000) >>>> last message repeated 1300 times >>>> kernel: siisch0: port is not ready (timeout 10000ms) status = >> 001f2000 >>>> Meanwhile, *everything* comes to a screeching halt. Device >>>> drivers are locked out, and thus incoming data is lost. >>>> Losing incoming data is unacceptable. >>>> >>>> Need an alternative to DELAY() that does not lock out >>>> other device drivers. There must be a way to reset one >>>> bit of hardware without locking down the entire machine. >> Hans Petter Selasky writes: >>> An alternative to DELAY() is the simplest solution. You probably need >>> to do some redesign in the SCSI layer to find a better solution. >> I keep coming back to the idea that a device driver for one >> controller should not have to lock out *all* the hardware. >> RS-232 locks out Ethernet. Disk drivers lock out Ethernet. >> And so on. Why? Is there some fundamental reason that this >> *has* to be? I thought the conversion from spl() to mutex() >> was supposed to fix this? >> >> I'm making progress on my project converting printf(9) calls >> to log(9), and fixing some bugs along the way. Eventually I'll >> have patches to submit. But this is really a workaround, not >> a fix to the underlying problem. >> >> Redesigning the SCSI layer sounds like a job for someone who took >> a lot more CS classes than I did. /dev/brain returns ENOCLUE. :-( CAM is not completely innocent in this situation indeed. CAM defines XPT_RESET_BUS request as synchronous. It is not queued, and called under the SIM mutex lock. I don't think lock can be safely dropped in the middle there. Now I think that I could try to move readiness waiting out of the siis_reset() to do it asynchronously. I'll think about it. -- Alexander Motin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 06:48:48 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FADB106564A for ; Wed, 13 Apr 2011 06:48:48 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C1D028FC0A for ; Wed, 13 Apr 2011 06:48:47 +0000 (UTC) Received: by fxm11 with SMTP id 11so346176fxm.13 for ; Tue, 12 Apr 2011 23:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=tPdBS7y4GsEMemEKHXvOg1bWcxBXF9WwzCnGW1gDu1w=; b=ELcxI+0TbBfem4uVp8TdavaC1DHCzT9rOXAlZZdjRCk6DHo2gje9RNq060laCXlPM1 KzsOng5r1/gvtKRgLjgzvyb1JOcCM7IAf3rozQPyoxywS63gqRn7RtbxJIZvSI+u1Xz2 zqUGHQySuy6xdLRIb4rxX8yfVhXvDL7WyJYks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=XHO9AJddozswSW9i1SMdQoe2AZd9h5G70mE21zxvyWBxk0qUNb01oYuCO0oF62yaw7 H7d5TILKu7ncdZjC9i1ShgD9sDLvIbGChUYRt301N1794nRZxEZWbF8Hajn+Q6zFqGGC PO/Q4ANTqmSlM4uuNTpF7yULh5kasG974zMoM= Received: by 10.223.59.146 with SMTP id l18mr926737fah.58.1302677326628; Tue, 12 Apr 2011 23:48:46 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 21sm66294fav.17.2011.04.12.23.48.44 (version=SSLv3 cipher=OTHER); Tue, 12 Apr 2011 23:48:45 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DA5473E.8060208@FreeBSD.org> Date: Wed, 13 Apr 2011 09:48:30 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: dieterbsd@engineer.com References: <8CDC697CCCE3652-124C-1B2@web-mmc-m04.sysops.aol.com> <4DA3F70F.4010805@FreeBSD.org> In-Reply-To: <4DA3F70F.4010805@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Hans Petter Selasky Subject: Re: Need an alternative to DELAY() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 06:48:48 -0000 Alexander Motin wrote: > Warner Losh wrote: >> I don't suppose that your driver could cause the hardware to interrupt after a little time? That would be more resource friendly... Otherwise, 1ms is long enough that a msleep or tsleep would likely work quite nicely. > > It's not his driver, it's mine. Actually, unlike AHCI, this hardware > even has interrupt for ready transition (second, biggest of sleeps). But > it is not used in present situation. > >> On Apr 11, 2011, at 1:43 PM, dieterbsd@engineer.com wrote: >>>>> FreeBSD 8.2 amd64 uniprocessor >>>>> >>>>> kernel: siisch1: DISCONNECT requested >>>>> kernel: siisch1: SIIS reset... >>>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>>> last message repeated 59 times >>>>> kernel: siisch1: SATA connect time=60ms status=00000123 >>>>> kernel: siisch1: SIIS reset done: devices=00000001 >>>>> kernel: siisch1: DISCONNECT requested >>>>> kernel: siisch1: SIIS reset... >>>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>>> last message repeated 58 times >>>>> kernel: siisch1: SATA connect time=59ms status=00000123 >>>>> ... >>>>> kernel: siisch0: siis_wait_ready() calling DELAY(1000) >>>>> last message repeated 1300 times >>>>> kernel: siisch0: port is not ready (timeout 10000ms) status = >>> 001f2000 >>>>> Meanwhile, *everything* comes to a screeching halt. Device >>>>> drivers are locked out, and thus incoming data is lost. >>>>> Losing incoming data is unacceptable. >>>>> >>>>> Need an alternative to DELAY() that does not lock out >>>>> other device drivers. There must be a way to reset one >>>>> bit of hardware without locking down the entire machine. >>> Hans Petter Selasky writes: >>>> An alternative to DELAY() is the simplest solution. You probably need >>>> to do some redesign in the SCSI layer to find a better solution. >>> I keep coming back to the idea that a device driver for one >>> controller should not have to lock out *all* the hardware. >>> RS-232 locks out Ethernet. Disk drivers lock out Ethernet. >>> And so on. Why? Is there some fundamental reason that this >>> *has* to be? I thought the conversion from spl() to mutex() >>> was supposed to fix this? >>> >>> I'm making progress on my project converting printf(9) calls >>> to log(9), and fixing some bugs along the way. Eventually I'll >>> have patches to submit. But this is really a workaround, not >>> a fix to the underlying problem. >>> >>> Redesigning the SCSI layer sounds like a job for someone who took >>> a lot more CS classes than I did. /dev/brain returns ENOCLUE. :-( > > CAM is not completely innocent in this situation indeed. CAM defines > XPT_RESET_BUS request as synchronous. It is not queued, and called under > the SIM mutex lock. I don't think lock can be safely dropped in the > middle there. > > Now I think that I could try to move readiness waiting out of the > siis_reset() to do it asynchronously. I'll think about it. I've fixed this problem for ahci(4) in HEAD, there should be no sleeps longer then 100ms now (typical 1-2ms). With siis(4) the situation is different. There by default should be no sleeps longer then 100ms (typical 1-2ms). Longer sleep means that either controller is not responding, or it can't establish link to device it sees. I've reduced waiting timeout from 10s to 1s. It should improve situation a bit, but I would look for the original problem cause. Have you done something specific to trigger it? Are your drive/cables OK? -- Alexander Motin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 16:15:46 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73409106567E for ; Wed, 13 Apr 2011 16:15:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3418FC14 for ; Wed, 13 Apr 2011 16:15:45 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA20338 for ; Wed, 13 Apr 2011 19:15:44 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DA5CC2F.9010506@FreeBSD.org> Date: Wed, 13 Apr 2011 19:15:43 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: FreeBSD Hackers X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: couple more vim gems for C/FreeBSD hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 16:15:46 -0000 This is for your .vimrc. Picked from some google search results. " highlight too long lines autocmd BufWinEnter *.c let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1) autocmd BufWinLeave *.c call matchdelete(w:m2) " permanently highlight 80th column " set colorcolumn=80 " highlight trailing whitespace and tabs after spaces in leading whitespace highlight ExtraWhitespace ctermbg=red guibg=red autocmd BufWinEnter *.c match ExtraWhitespace /^\s* \|\s\+$/ autocmd InsertEnter *.c match ExtraWhitespace /^\s* \|\s\+\%#\@ Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95CD8106564A for ; Wed, 13 Apr 2011 19:31:12 +0000 (UTC) (envelope-from jstuart@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7158F8FC1A for ; Wed, 13 Apr 2011 19:31:12 +0000 (UTC) X-ASG-Debug-ID: 1302723072-522b077d0001-P5m3U7 Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id yIO90ARFetfMXSHQ for ; Wed, 13 Apr 2011 12:31:12 -0700 (PDT) X-Barracuda-Envelope-From: jstuart@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Wed, 13 Apr 2011 12:31:11 -0700 From: Jonathan Stuart X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: "freebsd-hackers@freebsd.org" Date: Wed, 13 Apr 2011 12:31:28 -0700 X-ASG-Orig-Subj: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Topic: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Index: Acv6EWKpwInwVp0TQ2mgk1XCadcb2g== Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: Aco9 AwYr Dryl El1V FILM FLLg F8z8 F9f6 GJ6t GRed H5U7 I3MJ I6Gc Jf8/ JtXh KnhX; 1; ZgByAGUAZQBiAHMAZAAtAGgAYQBjAGsAZQByAHMAQABmAHIAZQBlAGIAcwBkAC4AbwByAGcA; Sosha1_v1; 7; {50513DDB-235E-447E-A440-BC060A54CAF3}; agBzAHQAdQBhAHIAdABAAGEAZABhAHIAYQBuAGUAdAAuAGMAbwBtAA==; Wed, 13 Apr 2011 19:31:29 GMT; RwBlAHQAdABpAG4AZwAgAHYAbgBvAGQAZQAgACsAIABjAHIAZQBkAGUAbgB0AGkAYQBsAHMAIABvAGYAIABhACAAZgBpAGwAZQAgAGYAcgBvAG0AIABhACAAcwB0AHIAdQBjAHQAIABtAG8AdQBuAHQAIABhAG4AZAAgAFUARgBTACAAaQBuAG8AZABlACAAIwA= x-cr-puzzleid: {50513DDB-235E-447E-A440-BC060A54CAF3} acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1302723072 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Mailman-Approved-At: Wed, 13 Apr 2011 19:39:01 +0000 Subject: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 19:31:12 -0000 Hi, I'd like to pull the owner/group ownership from a file (the information I h= ave about the file is it's UFS inode # and it's struct mount *). I'm sure = there's got to be a function that would return a vnode and I could VTOI() t= o get this information from the inode.. but I'm having a brainfreeze. Thanks for any help you can provide. Kind Regards, Jon From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 20:47:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20197106564A for ; Wed, 13 Apr 2011 20:47:54 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 737658FC08 for ; Wed, 13 Apr 2011 20:47:54 +0000 (UTC) Received: by wwc33 with SMTP id 33so1133005wwc.31 for ; Wed, 13 Apr 2011 13:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hDgSStDbDM89lu1w1fFhrtQ/3TI65bVsb9OqWTBApvo=; b=NUFxNzxag/4ija9E64aBcCfZA3e+fz8+SjV3EzUYEJHQD2VjwG09zwxpDJ54IA98kX fNVS0jgH9pTRfA6+INOLiISLY55N4svY4Ap/oEQKsIhpr64te9ItgwfcWl/icLMtKV7h BQCZx7rXf8yZg4VErpTVHPfTmbD/AB6udfN54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=L4UDq0TywwVLLyiQiR2fJGyOHlrsakDL8hLKrzqRODfW8MZLI6lhPg/tX2pZ8tWNLB YBU9lCTxTmojZSnzJKbfqDKZujlXnVHQSR9xpUyRAW7H8D7FMIY3PqwEHF0F1v55VIJ6 PI/jczdFlNH1Onjz06+NWQY8K0HipqRK4oOWU= MIME-Version: 1.0 Received: by 10.216.142.35 with SMTP id h35mr5733936wej.31.1302727673579; Wed, 13 Apr 2011 13:47:53 -0700 (PDT) Received: by 10.216.123.15 with HTTP; Wed, 13 Apr 2011 13:47:53 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> Date: Wed, 13 Apr 2011 13:47:53 -0700 Message-ID: From: Matthew Fleming To: Jonathan Stuart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" Subject: Re: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 20:47:55 -0000 On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart wr= ote: > Hi, > > I'd like to pull the owner/group ownership from a file (the information I= have about the file is it's UFS inode # and it's struct mount *). =A0I'm s= ure there's got to be a function that would return a vnode and I could VTOI= () to get this information from the inode.. but I'm having a brainfreeze. > VFS_VGET(mp, ino, flags, &vp) is probably what you want. Cheers, matthew From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 21:34:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C93ED106564A for ; Wed, 13 Apr 2011 21:34:35 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 56CD28FC18 for ; Wed, 13 Apr 2011 21:34:35 +0000 (UTC) Received: by wwc33 with SMTP id 33so1175422wwc.31 for ; Wed, 13 Apr 2011 14:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oQW7Gh1i1VcmjZMgrNmklpZf+NBigAW9uu590sFEvqM=; b=Ojl9lW/TThQn2qtp3G00VzHdHEaF6palStAKunh3o6JS+S01uO4AHpRrYZzQm9sb/I N7WPSYLr4qiBr40+EQmmrcwzKpjqQc/840ojSF2kJCepMSusJwvcrIP70/Rth2jrWsxU CCioecea+DHoa2oi7g2TBMHRNriez3vkF6PnQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bf+QhHz855HhKjxiUOBtrkhf6kTq7fNy/DHlubLX1TzZDZ9hhiCR6lhudWKjKBghVx J8Hu2iTiK6+oWmcqmsoCifr8EKDh7TRC1YAqoMtvJzx6WbIy0lREAe3P43dMn+DGIcl0 NypCaEq1eJGE1Z4LPmEC0lhWnHVubr2LXRuN8= MIME-Version: 1.0 Received: by 10.216.136.91 with SMTP id v69mr5771688wei.16.1302730474287; Wed, 13 Apr 2011 14:34:34 -0700 (PDT) Received: by 10.216.123.15 with HTTP; Wed, 13 Apr 2011 14:34:34 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> Date: Wed, 13 Apr 2011 14:34:34 -0700 Message-ID: From: Matthew Fleming To: Jonathan Stuart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" Subject: Re: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 21:34:35 -0000 On Wed, Apr 13, 2011 at 2:18 PM, Jonathan Stuart wro= te: > Hi Matthew, > > Thanks, I'll give it a shot.. for some reason f_cred off the vnode is ret= urning all zeros for uid/gid, and > pulling the VTOI does the same thing (using getvnode()).. do these not ge= t initialized properly? f_cred is a field in struct file, not struct vnode, so I'm confused as to what you're referring to. Cheers, matthew > -----Original Message----- > From: Matthew Fleming [mailto:mdf356@gmail.com] > Sent: Wednesday, April 13, 2011 1:48 PM > To: Jonathan Stuart > Cc: freebsd-hackers@freebsd.org > Subject: Re: Getting vnode + credentials of a file from a struct mount an= d UFS inode # > > On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart = wrote: >> Hi, >> >> I'd like to pull the owner/group ownership from a file (the information = I have about the file is it's UFS inode # and it's struct mount *). =A0I'm = sure there's got to be a function that would return a vnode and I could VTO= I() to get this information from the inode.. but I'm having a brainfreeze. >> > > VFS_VGET(mp, ino, flags, &vp) is probably what you want. > > Cheers, > matthew > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 22:19:44 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4E61065672 for ; Wed, 13 Apr 2011 22:19:44 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id F41898FC1C for ; Wed, 13 Apr 2011 22:19:43 +0000 (UTC) Received: by wwc33 with SMTP id 33so1213148wwc.31 for ; Wed, 13 Apr 2011 15:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tx1vHSL2JVq21cOWdKex3IsDa841p8kkj0e8AM9B5Z4=; b=KEWL50LuZx8HJBvQ/KrG016Y+kEYnyUEpYeTkTyl+v/71rWFW1N0Q7CjEr2SUfNbj4 SGdOrsq7Dnrs9M1lCTc8dd/N54/+o6MfJPjNi9RfoJJRXr3ZlXfvxpOp2Bn6+SdktmND jG8PCcRjive4i7zA57iu4UF1QW/fg8h3JJEbQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Uv0vgVPQ4nf2yuAmnS3Kb0Heg35SfYB3+dRy14Exu7Sqg9+aShHS20pGmrWhZlSGmI w3U+ifC3VVdbr99DW93UxNeNhADWM/B3Af1m5OcTIAeANTi9w/stxhEov14MfyQuKLAL 5EVmrLZo07t2BRyDSFNuzFKJGwKspzpoDlz5w= MIME-Version: 1.0 Received: by 10.216.87.8 with SMTP id x8mr13815wee.46.1302733182847; Wed, 13 Apr 2011 15:19:42 -0700 (PDT) Received: by 10.216.123.15 with HTTP; Wed, 13 Apr 2011 15:19:42 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024E929FDC@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FDC@SJ-EXCH-1.adaranet.com> Date: Wed, 13 Apr 2011 15:19:42 -0700 Message-ID: From: Matthew Fleming To: Jonathan Stuart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" Subject: Re: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 22:19:44 -0000 On Wed, Apr 13, 2011 at 2:37 PM, Jonathan Stuart wro= te: > Yes, however getvnode() does initialize a struct file *.. but f_cred seem= s to not contain valid/correct entries. > In my last post I probably should have pointed out that I have the inode = stored from another operation. I haven't looked at this field before, but it looks that f_cred is set on falloc() to the cred of the thread creating the struct file (the thread that called open or socket or pipe or kqueue, etc.). Are you running this as root/wheel? Cheers, matthew > -----Original Message----- > From: Matthew Fleming [mailto:mdf356@gmail.com] > Sent: Wednesday, April 13, 2011 2:35 PM > To: Jonathan Stuart > Cc: freebsd-hackers@freebsd.org > Subject: Re: Getting vnode + credentials of a file from a struct mount an= d UFS inode # > > On Wed, Apr 13, 2011 at 2:18 PM, Jonathan Stuart w= rote: >> Hi Matthew, >> >> Thanks, I'll give it a shot.. for some reason f_cred off the vnode is re= turning all zeros for uid/gid, and >> pulling the VTOI does the same thing (using getvnode()).. do these not g= et initialized properly? > > f_cred is a field in struct file, not struct vnode, so I'm confused as > to what you're referring to. > > Cheers, > matthew > >> -----Original Message----- >> From: Matthew Fleming [mailto:mdf356@gmail.com] >> Sent: Wednesday, April 13, 2011 1:48 PM >> To: Jonathan Stuart >> Cc: freebsd-hackers@freebsd.org >> Subject: Re: Getting vnode + credentials of a file from a struct mount a= nd UFS inode # >> >> On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart = wrote: >>> Hi, >>> >>> I'd like to pull the owner/group ownership from a file (the information= I have about the file is it's UFS inode # and it's struct mount *). =A0I'm= sure there's got to be a function that would return a vnode and I could VT= OI() to get this information from the inode.. but I'm having a brainfreeze. >>> >> >> VFS_VGET(mp, ino, flags, &vp) is probably what you want. >> >> Cheers, >> matthew >> > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 22:33:32 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C1D51065742 for ; Wed, 13 Apr 2011 22:33:32 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1A85F8FC12 for ; Wed, 13 Apr 2011 22:33:31 +0000 (UTC) Received: by wyf23 with SMTP id 23so1078221wyf.13 for ; Wed, 13 Apr 2011 15:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CIJ+3rGVwXdh7BD/Nd+RI2OMNZXXnfJf1ZwdfNLhtKQ=; b=wEX5KjRzwqjE2hLXLdhhG6lwXvHORhbdKEHI1+f5Ulqt/1lWc1vkyfykWPGGQfSESh fIGSSz8d2jYXgQApppWzn0MXqF5vzIYetbBW0CYSjLaOgngayyXBM3iaVmcQ3wNHevNd Ovop8DMEbBGGemlEU8gHwOJyhst5m8FuZr0FM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=sPpERmkpL9r7w0WwpubYHrIruZTT9c/GUmYcUpKBrDp3ATkqBSXy+cAUdo/B25GqIq RxSZwRkW/0M98hI7KimVS41zl0guBF2dKjVdhyNSxHV981ijOMumRkeSOi5lrlHEpm0l /Ko+xCR11wrwjib78D55fGv9RY/BYv0Z/AoJ8= MIME-Version: 1.0 Received: by 10.216.64.139 with SMTP id c11mr5792280wed.46.1302734010990; Wed, 13 Apr 2011 15:33:30 -0700 (PDT) Received: by 10.216.123.15 with HTTP; Wed, 13 Apr 2011 15:33:30 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024E929FE5@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FDC@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FE5@SJ-EXCH-1.adaranet.com> Date: Wed, 13 Apr 2011 15:33:30 -0700 Message-ID: From: Matthew Fleming To: Jonathan Stuart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" Subject: Re: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 22:33:32 -0000 On Wed, Apr 13, 2011 at 3:25 PM, Jonathan Stuart wro= te: > Hi, > > Yes, I am.. that was my suspicion (e.g., that it was the parameters of th= e process which called open()/creat()/socket()/... originally). =A0What's t= he quickest way to get back to the v/inode's uid/gid? > Since you have a struct mount * and an inode, it should be something like: void test_uidgid(struct mount *mp, ino_t ino) { struct vnode *vp; struct inode *ip; int error; error =3D VFS_VGET(mp, ino, LK_SHARED, &vp); if (error !=3D 0) { printf("Got error %d\n", error); return; } ip =3D VTOI(vp); printf("For inode %x, uid is %d, gid is %d\n", ino, ip->i_uid, ip->i_gid); vput(vp); } > Also, calling VFS_VGET() seems to give me a lockmgr panic with unknown ty= pe 0x0. > What is odd is that the only way I can get a vnode for VFS_VGET is throug= h struct file, and then shouldn't I be able to use that? =A0I tried using t= he flipping that vnode->inode with VTOI() and it was also giving me zeros f= or i_uid, i_gid, etc., when it shouldn't have been. > VFS_VGET gives you the vnode pointer; you shouldn't need getvnode() or struct file or anything else. There are other ways to get a vnode *, but from an ino_t that's the easiest I know of. Cheers, matthew > -----Original Message----- > From: Matthew Fleming [mailto:mdf356@gmail.com] > Sent: Wednesday, April 13, 2011 3:20 PM > To: Jonathan Stuart > Cc: freebsd-hackers@freebsd.org > Subject: Re: Getting vnode + credentials of a file from a struct mount an= d UFS inode # > > On Wed, Apr 13, 2011 at 2:37 PM, Jonathan Stuart w= rote: >> Yes, however getvnode() does initialize a struct file *.. but f_cred see= ms to not contain valid/correct entries. >> In my last post I probably should have pointed out that I have the inode= stored from another operation. > > I haven't looked at this field before, but it looks that f_cred is set > on falloc() to the cred of the thread creating the struct file (the > thread that called open or socket or pipe or kqueue, etc.). =A0Are you > running this as root/wheel? > > Cheers, > matthew > >> -----Original Message----- >> From: Matthew Fleming [mailto:mdf356@gmail.com] >> Sent: Wednesday, April 13, 2011 2:35 PM >> To: Jonathan Stuart >> Cc: freebsd-hackers@freebsd.org >> Subject: Re: Getting vnode + credentials of a file from a struct mount a= nd UFS inode # >> >> On Wed, Apr 13, 2011 at 2:18 PM, Jonathan Stuart = wrote: >>> Hi Matthew, >>> >>> Thanks, I'll give it a shot.. for some reason f_cred off the vnode is r= eturning all zeros for uid/gid, and >>> pulling the VTOI does the same thing (using getvnode()).. do these not = get initialized properly? >> >> f_cred is a field in struct file, not struct vnode, so I'm confused as >> to what you're referring to. >> >> Cheers, >> matthew >> >>> -----Original Message----- >>> From: Matthew Fleming [mailto:mdf356@gmail.com] >>> Sent: Wednesday, April 13, 2011 1:48 PM >>> To: Jonathan Stuart >>> Cc: freebsd-hackers@freebsd.org >>> Subject: Re: Getting vnode + credentials of a file from a struct mount = and UFS inode # >>> >>> On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart wrote: >>>> Hi, >>>> >>>> I'd like to pull the owner/group ownership from a file (the informatio= n I have about the file is it's UFS inode # and it's struct mount *). =A0I'= m sure there's got to be a function that would return a vnode and I could V= TOI() to get this information from the inode.. but I'm having a brainfreeze= . >>>> >>> >>> VFS_VGET(mp, ino, flags, &vp) is probably what you want. >>> >>> Cheers, >>> matthew >>> >> > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 21:33:51 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C44D106564A for ; Wed, 13 Apr 2011 21:33:51 +0000 (UTC) (envelope-from jstuart@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9298FC0C for ; Wed, 13 Apr 2011 21:33:51 +0000 (UTC) X-ASG-Debug-ID: 1302729464-522b08790001-P5m3U7 Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id H4sIx6t2P8IGiyEr; Wed, 13 Apr 2011 14:17:44 -0700 (PDT) X-Barracuda-Envelope-From: jstuart@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Wed, 13 Apr 2011 14:17:44 -0700 From: Jonathan Stuart X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Matthew Fleming Date: Wed, 13 Apr 2011 14:18:03 -0700 X-ASG-Orig-Subj: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Topic: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Index: Acv6HBFnUn38yypBQAiS9lnN9vc15wAA/xsw Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1302729464 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Mailman-Approved-At: Wed, 13 Apr 2011 23:07:08 +0000 Cc: "freebsd-hackers@freebsd.org" Subject: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 21:33:51 -0000 Hi Matthew, Thanks, I'll give it a shot.. for some reason f_cred off the vnode is retur= ning all zeros for uid/gid, and pulling the VTOI does the same thing (using getvnode()).. do these not get = initialized properly? Ciao, Jonathan -----Original Message----- From: Matthew Fleming [mailto:mdf356@gmail.com] Sent: Wednesday, April 13, 2011 1:48 PM To: Jonathan Stuart Cc: freebsd-hackers@freebsd.org Subject: Re: Getting vnode + credentials of a file from a struct mount and = UFS inode # On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart wr= ote: > Hi, > > I'd like to pull the owner/group ownership from a file (the information I= have about the file is it's UFS inode # and it's struct mount *). I'm sur= e there's got to be a function that would return a vnode and I could VTOI()= to get this information from the inode.. but I'm having a brainfreeze. > VFS_VGET(mp, ino, flags, &vp) is probably what you want. Cheers, matthew From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 21:37:36 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A94D6106564A for ; Wed, 13 Apr 2011 21:37:36 +0000 (UTC) (envelope-from jstuart@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 888BF8FC12 for ; Wed, 13 Apr 2011 21:37:36 +0000 (UTC) X-ASG-Debug-ID: 1302730655-522b08af0001-P5m3U7 Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id bfW6k4jus5JEkIli; Wed, 13 Apr 2011 14:37:35 -0700 (PDT) X-Barracuda-Envelope-From: jstuart@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Wed, 13 Apr 2011 14:37:35 -0700 From: Jonathan Stuart X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Matthew Fleming Date: Wed, 13 Apr 2011 14:37:54 -0700 X-ASG-Orig-Subj: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Topic: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Index: Acv6IpZn2WoRJLb6QXSmaIzqbyZdzQAABssQ Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E929FDC@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1302730655 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Mailman-Approved-At: Wed, 13 Apr 2011 23:23:16 +0000 Cc: "freebsd-hackers@freebsd.org" Subject: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 21:37:36 -0000 Yes, however getvnode() does initialize a struct file *.. but f_cred seems = to not contain valid/correct entries. In my last post I probably should have pointed out that I have the inode st= ored from another operation. Jon -----Original Message----- From: Matthew Fleming [mailto:mdf356@gmail.com] Sent: Wednesday, April 13, 2011 2:35 PM To: Jonathan Stuart Cc: freebsd-hackers@freebsd.org Subject: Re: Getting vnode + credentials of a file from a struct mount and = UFS inode # On Wed, Apr 13, 2011 at 2:18 PM, Jonathan Stuart wro= te: > Hi Matthew, > > Thanks, I'll give it a shot.. for some reason f_cred off the vnode is ret= urning all zeros for uid/gid, and > pulling the VTOI does the same thing (using getvnode()).. do these not ge= t initialized properly? f_cred is a field in struct file, not struct vnode, so I'm confused as to what you're referring to. Cheers, matthew > -----Original Message----- > From: Matthew Fleming [mailto:mdf356@gmail.com] > Sent: Wednesday, April 13, 2011 1:48 PM > To: Jonathan Stuart > Cc: freebsd-hackers@freebsd.org > Subject: Re: Getting vnode + credentials of a file from a struct mount an= d UFS inode # > > On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart = wrote: >> Hi, >> >> I'd like to pull the owner/group ownership from a file (the information = I have about the file is it's UFS inode # and it's struct mount *). I'm su= re there's got to be a function that would return a vnode and I could VTOI(= ) to get this information from the inode.. but I'm having a brainfreeze. >> > > VFS_VGET(mp, ino, flags, &vp) is probably what you want. > > Cheers, > matthew > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 22:24:46 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5AA6106564A for ; Wed, 13 Apr 2011 22:24:46 +0000 (UTC) (envelope-from jstuart@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 91A0D8FC12 for ; Wed, 13 Apr 2011 22:24:46 +0000 (UTC) X-ASG-Debug-ID: 1302733486-522b09040001-P5m3U7 Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id ZelwxkiC4BuY68Uc; Wed, 13 Apr 2011 15:24:46 -0700 (PDT) X-Barracuda-Envelope-From: jstuart@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Wed, 13 Apr 2011 15:24:46 -0700 From: Jonathan Stuart X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Matthew Fleming Date: Wed, 13 Apr 2011 15:25:04 -0700 X-ASG-Orig-Subj: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Topic: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Index: Acv6KOTQP1whERqtRW+zvPxfZ2hA2wAACMFA Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E929FE5@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FDC@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1302733486 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Mailman-Approved-At: Wed, 13 Apr 2011 23:23:34 +0000 Cc: "freebsd-hackers@freebsd.org" Subject: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 22:24:46 -0000 Hi, Yes, I am.. that was my suspicion (e.g., that it was the parameters of the = process which called open()/creat()/socket()/... originally). What's the q= uickest way to get back to the v/inode's uid/gid? Also, calling VFS_VGET() seems to give me a lockmgr panic with unknown type= 0x0. What is odd is that the only way I can get a vnode for VFS_VGET is through = struct file, and then shouldn't I be able to use that? I tried using the f= lipping that vnode->inode with VTOI() and it was also giving me zeros for i= _uid, i_gid, etc., when it shouldn't have been. Kind Regards, Jon -----Original Message----- From: Matthew Fleming [mailto:mdf356@gmail.com] Sent: Wednesday, April 13, 2011 3:20 PM To: Jonathan Stuart Cc: freebsd-hackers@freebsd.org Subject: Re: Getting vnode + credentials of a file from a struct mount and = UFS inode # On Wed, Apr 13, 2011 at 2:37 PM, Jonathan Stuart wro= te: > Yes, however getvnode() does initialize a struct file *.. but f_cred seem= s to not contain valid/correct entries. > In my last post I probably should have pointed out that I have the inode = stored from another operation. I haven't looked at this field before, but it looks that f_cred is set on falloc() to the cred of the thread creating the struct file (the thread that called open or socket or pipe or kqueue, etc.). Are you running this as root/wheel? Cheers, matthew > -----Original Message----- > From: Matthew Fleming [mailto:mdf356@gmail.com] > Sent: Wednesday, April 13, 2011 2:35 PM > To: Jonathan Stuart > Cc: freebsd-hackers@freebsd.org > Subject: Re: Getting vnode + credentials of a file from a struct mount an= d UFS inode # > > On Wed, Apr 13, 2011 at 2:18 PM, Jonathan Stuart w= rote: >> Hi Matthew, >> >> Thanks, I'll give it a shot.. for some reason f_cred off the vnode is re= turning all zeros for uid/gid, and >> pulling the VTOI does the same thing (using getvnode()).. do these not g= et initialized properly? > > f_cred is a field in struct file, not struct vnode, so I'm confused as > to what you're referring to. > > Cheers, > matthew > >> -----Original Message----- >> From: Matthew Fleming [mailto:mdf356@gmail.com] >> Sent: Wednesday, April 13, 2011 1:48 PM >> To: Jonathan Stuart >> Cc: freebsd-hackers@freebsd.org >> Subject: Re: Getting vnode + credentials of a file from a struct mount a= nd UFS inode # >> >> On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart = wrote: >>> Hi, >>> >>> I'd like to pull the owner/group ownership from a file (the information= I have about the file is it's UFS inode # and it's struct mount *). I'm s= ure there's got to be a function that would return a vnode and I could VTOI= () to get this information from the inode.. but I'm having a brainfreeze. >>> >> >> VFS_VGET(mp, ino, flags, &vp) is probably what you want. >> >> Cheers, >> matthew >> > From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 14 01:02:01 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 745C9106566B for ; Thu, 14 Apr 2011 01:02:01 +0000 (UTC) (envelope-from jstuart@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 5121C8FC15 for ; Thu, 14 Apr 2011 01:02:01 +0000 (UTC) X-ASG-Debug-ID: 1302742920-522b0a070001-P5m3U7 Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id 3SEZVOPm8k7uj5mP; Wed, 13 Apr 2011 18:02:00 -0700 (PDT) X-Barracuda-Envelope-From: jstuart@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Wed, 13 Apr 2011 18:02:00 -0700 From: Jonathan Stuart X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Rick Macklem Date: Wed, 13 Apr 2011 18:02:18 -0700 X-ASG-Orig-Subj: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Topic: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Index: Acv6P1alROLV5lHuRaqvRHHNio9a3wAAD9oA Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E92A00D@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929FE5@SJ-EXCH-1.adaranet.com> <11353544.443834.1302742821487.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <11353544.443834.1302742821487.JavaMail.root@erie.cs.uoguelph.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1302742920 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Mailman-Approved-At: Thu, 14 Apr 2011 01:16:15 +0000 Cc: "freebsd-hackers@freebsd.org" , Fleming , Matthew Subject: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 01:02:01 -0000 VGhhbmtzIFJpY2ssIHdpbGwgdHJ5IQ0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJv bTogUmljayBNYWNrbGVtIFttYWlsdG86cm1hY2tsZW1AdW9ndWVscGguY2FdDQpTZW50OiBXZWRu ZXNkYXksIEFwcmlsIDEzLCAyMDExIDY6MDAgUE0NClRvOiBKb25hdGhhbiBTdHVhcnQNCkNjOiBm cmVlYnNkLWhhY2tlcnNAZnJlZWJzZC5vcmc7IE1hdHRoZXcgRmxlbWluZw0KU3ViamVjdDogUmU6 IEdldHRpbmcgdm5vZGUgKyBjcmVkZW50aWFscyBvZiBhIGZpbGUgZnJvbSBhIHN0cnVjdCBtb3Vu dCBhbmQgVUZTIGlub2RlICMNCg0KPiBIaSwNCj4NCj4gWWVzLCBJIGFtLi4gdGhhdCB3YXMgbXkg c3VzcGljaW9uIChlLmcuLCB0aGF0IGl0IHdhcyB0aGUgcGFyYW1ldGVycyBvZg0KPiB0aGUgcHJv Y2VzcyB3aGljaCBjYWxsZWQgb3BlbigpL2NyZWF0KCkvc29ja2V0KCkvLi4uIG9yaWdpbmFsbHkp Lg0KPiBXaGF0J3MgdGhlIHF1aWNrZXN0IHdheSB0byBnZXQgYmFjayB0byB0aGUgdi9pbm9kZSdz IHVpZC9naWQ/DQo+DQo+IEFsc28sIGNhbGxpbmcgVkZTX1ZHRVQoKSBzZWVtcyB0byBnaXZlIG1l IGEgbG9ja21nciBwYW5pYyB3aXRoIHVua25vd24NCj4gdHlwZSAweDAuDQoNClZGU19WR0VUKCkg cmV0dXJucyBhIHZub2RlIHB0ciwgaXQgZG9lc24ndCBuZWVkIHRoZSBhcmd1bWVudCBzZXQgdG8g b25lLg0KVGhlIGZsYWdzIGFyZ3VtZW50IChhc3N1bWluZyBhIHJlY2VudCBrZXJuZWwpIG5lZWRz IHRvIGJlIExLX0VYQ0xVU0lWRSBvcg0KTEtfU0hBUkVELCBub3QgMCAoSSBzdXNwZWN0IHRoYXQn cyB5b3VyIHBhbmljKS4NCg0KPiBXaGF0IGlzIG9kZCBpcyB0aGF0IHRoZSBvbmx5IHdheSBJIGNh biBnZXQgYSB2bm9kZSBmb3IgVkZTX1ZHRVQgaXMNCj4gdGhyb3VnaCBzdHJ1Y3QgZmlsZSwgYW5k IHRoZW4gc2hvdWxkbid0IEkgYmUgYWJsZSB0byB1c2UgdGhhdD8gSSB0cmllZA0KPiB1c2luZyB0 aGUgZmxpcHBpbmcgdGhhdCB2bm9kZS0+aW5vZGUgd2l0aCBWVE9JKCkgYW5kIGl0IHdhcyBhbHNv DQo+IGdpdmluZyBtZSB6ZXJvcyBmb3IgaV91aWQsIGlfZ2lkLCBldGMuLCB3aGVuIGl0IHNob3Vs ZG4ndCBoYXZlIGJlZW4uDQo+DQpBZnRlciBWRlNfVkdFVCByZXR1cm5zIGEgdnAsIEknZCBkbyBh IFZPUF9HRVRBVFRSKCkgYW5kIHRoZW4gdnB1dCgpIHRoZQ0KdnAgdG8gcmVsZWFzZSBpdC4gTG9v ayBmb3IgZXhhbXBsZXMgb2YgdGhlc2UgY2FsbHMgaW4gdGhlIGtlcm5lbCBzb3VyY2VzLg0KVGhl ICJzdHJ1Y3QgdmF0dHIiIGZpbGxlZCBpbiBieSBWT1BfR0VUQVRUUigpIGhhcyB2YV91aWQgYW5k IHZhX2dpZCBpbiBpdCwNCndoaWNoIGFyZSB0aGUgdWlkLGdpZCB0aGF0IG93bnMgdGhlIGZpbGUs IHdoaWNoIGlzIHdoYXQgSSB0aGluayB5b3UgYXJlDQp0cnlpbmcgdG8gZ2V0LiAoQ3JlZGVudGlh bHMgZ2VuZXJhbGx5IHJlZmVyIHRvIHRoZSBlZmZlY3RpdmUgdWlkICsgZ2lkcw0KZXRjIG9mIHRo ZSBwcm9jZXNzL3RocmVhZCB0cnlpbmcgdG8gZG8gdGhlIHN5c2NhbGwuKQ0KDQpyaWNrDQo= From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 14 01:29:33 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90345106566B for ; Thu, 14 Apr 2011 01:29:33 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4AC418FC18 for ; Thu, 14 Apr 2011 01:29:32 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEALxGpk2DaFvO/2dsb2JhbACETKJPiG+oV5FGgSmDTXgEjWk X-IronPort-AV: E=Sophos;i="4.64,208,1301889600"; d="scan'208";a="118228226" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 13 Apr 2011 21:00:22 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 85955B3F52; Wed, 13 Apr 2011 21:00:21 -0400 (EDT) Date: Wed, 13 Apr 2011 21:00:21 -0400 (EDT) From: Rick Macklem To: Jonathan Stuart Message-ID: <11353544.443834.1302742821487.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024E929FE5@SJ-EXCH-1.adaranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: freebsd-hackers@freebsd.org, Matthew Fleming Subject: Re: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 01:29:33 -0000 > Hi, > > Yes, I am.. that was my suspicion (e.g., that it was the parameters of > the process which called open()/creat()/socket()/... originally). > What's the quickest way to get back to the v/inode's uid/gid? > > Also, calling VFS_VGET() seems to give me a lockmgr panic with unknown > type 0x0. VFS_VGET() returns a vnode ptr, it doesn't need the argument set to one. The flags argument (assuming a recent kernel) needs to be LK_EXCLUSIVE or LK_SHARED, not 0 (I suspect that's your panic). > What is odd is that the only way I can get a vnode for VFS_VGET is > through struct file, and then shouldn't I be able to use that? I tried > using the flipping that vnode->inode with VTOI() and it was also > giving me zeros for i_uid, i_gid, etc., when it shouldn't have been. > After VFS_VGET returns a vp, I'd do a VOP_GETATTR() and then vput() the vp to release it. Look for examples of these calls in the kernel sources. The "struct vattr" filled in by VOP_GETATTR() has va_uid and va_gid in it, which are the uid,gid that owns the file, which is what I think you are trying to get. (Credentials generally refer to the effective uid + gids etc of the process/thread trying to do the syscall.) rick From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 14 18:15:23 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E91F1065676; Thu, 14 Apr 2011 18:15:23 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from imr-da03.mx.aol.com (imr-da03.mx.aol.com [205.188.105.145]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7298FC14; Thu, 14 Apr 2011 18:15:22 +0000 (UTC) Received: from imo-ma04.mx.aol.com (imo-ma04.mx.aol.com [64.12.78.139]) by imr-da03.mx.aol.com (8.14.1/8.14.1) with ESMTP id p3EIEtY4007964; Thu, 14 Apr 2011 14:14:55 -0400 Received: from dieterbsd@engineer.com by imo-ma04.mx.aol.com (mail_out_v42.9.) id n.fca.f31f65d (44669); Thu, 14 Apr 2011 14:14:51 -0400 (EDT) Received: from smtprly-dd01.mx.aol.com (smtprly-dd01.mx.aol.com [205.188.84.129]) by cia-mc01.mx.aol.com (v129.9) with ESMTP id MAILCIAMC018-d3e64da7399933d; Thu, 14 Apr 2011 14:14:51 -0400 Received: from web-mmc-m04 (web-mmc-m04.sim.aol.com [64.12.224.137]) by smtprly-dd01.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYDD012-d3e64da7399933d; Thu, 14 Apr 2011 14:14:49 -0400 To: mav@freebsd.org Content-Transfer-Encoding: quoted-printable Date: Thu, 14 Apr 2011 14:14:49 -0400 X-AOL-IP: 67.206.162.44 X-MB-Message-Source: WebUI Received: from 67.206.162.44 by web-mmc-m04.sysops.aol.com (64.12.224.137) with HTTP (WebMailUI); Thu, 14 Apr 2011 14:14:49 -0400 MIME-Version: 1.0 From: dieterbsd@engineer.com X-MB-Message-Type: User Content-Type: text/plain; charset="us-ascii"; format=flowed X-Mailer: Mail.com Webmail 33540-STANDARD Message-Id: <8CDC8E6FA136231-29B0-2128@web-mmc-m04.sysops.aol.com> X-Spam-Flag: NO X-AOL-SENDER: dieterbsd@engineer.com Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: (no subject) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2011 18:15:23 -0000 [ Email attempt #3 and counting... ] Alexander Motin wrote: >> Warner Losh wrote: >>> I don't suppose that your driver could cause the hardware to=20 interrupt after a little time? That would be more resource friendly...=20 Otherwise, 1ms is long enough that a msleep or tsleep would likely=20 work quite nicely. >> >> It's not his driver, it's mine. Actually, unlike AHCI, this hardware >> even has interrupt for ready transition (second, biggest of sleeps).=20 But >> it is not used in present situation. >> >>> On Apr 11, 2011, at 1:43 PM, dieterbsd@engineer.com wrote: >>>>>> FreeBSD 8.2 amd64 uniprocessor >>>>>> >>>>>> kernel: siisch1: DISCONNECT requested >>>>>> kernel: siisch1: SIIS reset... >>>>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>>>> last message repeated 59 times >>>>>> kernel: siisch1: SATA connect time=3D60ms status=3D00000123 >>>>>> kernel: siisch1: SIIS reset done: devices=3D00000001 >>>>>> kernel: siisch1: DISCONNECT requested >>>>>> kernel: siisch1: SIIS reset... >>>>>> kernel: siisch1: siis_sata_connect() calling DELAY(1000) >>>>>> last message repeated 58 times >>>>>> kernel: siisch1: SATA connect time=3D59ms status=3D00000123 >>>>>> ... >>>>>> kernel: siisch0: siis_wait_ready() calling DELAY(1000) >>>>>> last message repeated 1300 times >>>>>> kernel: siisch0: port is not ready (timeout 10000ms) status =3D >>>> 001f2000 >>>>>> Meanwhile, *everything* comes to a screeching halt. Device >>>>>> drivers are locked out, and thus incoming data is lost. >>>>>> Losing incoming data is unacceptable. >>>>>> >>>>>> Need an alternative to DELAY() that does not lock out >>>>>> other device drivers. There must be a way to reset one >>>>>> bit of hardware without locking down the entire machine. >>>> Hans Petter Selasky writes: >>>>> An alternative to DELAY() is the simplest solution. You probably=20 need >>>>> to do some redesign in the SCSI layer to find a better solution. >>>> I keep coming back to the idea that a device driver for one >>>> controller should not have to lock out *all* the hardware. >>>> RS-232 locks out Ethernet. Disk drivers lock out Ethernet. >>>> And so on. Why? Is there some fundamental reason that this >>>> *has* to be? I thought the conversion from spl() to mutex() >>>> was supposed to fix this? >>>> >>>> I'm making progress on my project converting printf(9) calls >>>> to log(9), and fixing some bugs along the way. Eventually I'll >>>> have patches to submit. But this is really a workaround, not >>>> a fix to the underlying problem. >>>> >>>> Redesigning the SCSI layer sounds like a job for someone who took >>>> a lot more CS classes than I did. /dev/brain returns ENOCLUE. :-( >> >> CAM is not completely innocent in this situation indeed. CAM defines >> XPT_RESET_BUS request as synchronous. It is not queued, and called=20 under >> the SIM mutex lock. I don't think lock can be safely dropped in the >> middle there. >> >> Now I think that I could try to move readiness waiting out of the >> siis_reset() to do it asynchronously. I'll think about it. > > I've fixed this problem for ahci(4) in HEAD, there should be no sleeps > longer then 100ms now (typical 1-2ms). > > With siis(4) the situation is different. There by default should be no > sleeps longer then 100ms (typical 1-2ms). Longer sleep means that=20 either > controller is not responding, or it can't establish link to device it > sees. I've reduced waiting timeout from 10s to 1s. It should improve > situation a bit, but I would look for the original problem cause. Have > you done something specific to trigger it? Are your drive/cables OK? Thank you for your prompt attention to this problem, it is very much appreciated. (losing data sucks) However, 100 ms is still way too long. (assuming ms =3D milliseconds) 1 millisecond is dangerous, if Ethernet is locked out for approx 4 milliseconds there is guaranteed data loss. I'd like to see something more like 100 microseconds worst case (for TCP). Closed source closed hardware black box generates data, has a very small output buffer, cannot be changed. In some cases it insists on using UDP rather than TCP so dropping even a single packet screws up the data. I have cranked the TCP and UDP receive buffer sizes way up, I'm reading the ports at rtprio into a large buffer locked into main memory, etc. etc. Most of the time it works. But if a device driver takes too long, incoming Ethernet packets do not get serviced in time, and I lose data. A device driver doing printf(9) to the RS-232 console is too slow. Changing printf to log(9) works around this. If a disk controller, port multiplier, or disk has a hiccup, I lose data. Siis(4) is the current problem, but IIRC I've had problems from ahci(4) and ata(4) in the past. I'm currently using all three drivers. Is there any way I can keep the Ethernet from being locked out by other drivers? From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 15 15:09:05 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BC071065673 for ; Fri, 15 Apr 2011 15:09:05 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 12ACC8FC08 for ; Fri, 15 Apr 2011 15:09:04 +0000 (UTC) Received: by wyf23 with SMTP id 23so2799009wyf.13 for ; Fri, 15 Apr 2011 08:09:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:subject:date:content-type :content-transfer-encoding:x-mailer; bh=eiBS0ryhSxU37zRjBgdtRgFuogLKSy0Vo5esglN/Avc=; b=Exy82h3RC0CmdrJVRLPa59zR3SduKR5+Uv+IyXnG4Yg+FYLCGNmQy+b1uwKuSD3sVC otCYEFdggLMEUsKV12wRR9ULZlfCSGoYGt2ny/BECqojR3isIJKmH4KJtVX9RZJaQrVP 7FNzfa1JzryTQs2NyvsltO02jELhA5eY47va4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:content-type :content-transfer-encoding:x-mailer; b=MGEWvduzfUJ2wje8N+hvpfqqoyi5cKNTgjA6ykX3EIlTarT7A7VdeZJyPireccFMIS 6v8VqSgSrPG+SLHQu93DFLWBkL74zav26O4Waybt1Vsbh1jrQGKtd/VuBtJzhQ5Kf/oE FOygL8G7OriuNmrB2UXCoc/AotN23e0cJubnQ= Received: by 10.216.253.207 with SMTP id f57mr5315551wes.110.1302880143884; Fri, 15 Apr 2011 08:09:03 -0700 (PDT) Received: from DEV ([82.193.208.173]) by mx.google.com with ESMTPS id d59sm1359756wed.45.2011.04.15.08.08.57 (version=SSLv3 cipher=OTHER); Fri, 15 Apr 2011 08:09:03 -0700 (PDT) Message-ID: <20110415.150349.671.1@DEV> From: rank1seeker@gmail.com To: freebsd-hackers@freebsd.org Date: Fri, 15 Apr 2011 17:03:49 +0200 Content-Type: text/plain; charset="Windows-1250" Content-Transfer-Encoding: quoted-printable X-Mailer: POP Peeper (3.7.0.0) Subject: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 15:09:05 -0000 I would like implementation of boolean sysctl var, that would show, is = system in a single user mode.=0D=0AI would like it from 8.3 = onwards.=0D=0A=0D=0A=0D=0ADomagoj Smol=E8i=E6=0D=0A From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 15 15:16:15 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1BBB1065673 for ; Fri, 15 Apr 2011 15:16:15 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 9D1408FC0A for ; Fri, 15 Apr 2011 15:16:14 +0000 (UTC) Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3FFG3CT037910 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 16 Apr 2011 00:46:07 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110415.150349.671.1@DEV> Date: Fri, 15 Apr 2011 17:16:02 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> References: <20110415.150349.671.1@DEV> To: rank1seeker@gmail.com X-Mailer: Apple Mail (2.1084) X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 15:16:16 -0000 On 15/04/2011, at 17:03, rank1seeker@gmail.com wrote: > I would like implementation of boolean sysctl var, that would show, is = system in a single user mode. > I would like it from 8.3 onwards. AFAIK the kernel doesn't have a "single user" mode. It's just that when you boot into single user mode it asks you want to = run rather than starting /sbin/init. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 15 15:54:34 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 919001065677 for ; Fri, 15 Apr 2011 15:54:34 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 29A1D8FC28 for ; Fri, 15 Apr 2011 15:54:33 +0000 (UTC) Received: by wyf23 with SMTP id 23so2847407wyf.13 for ; Fri, 15 Apr 2011 08:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:subject:date:in-reply-to :references:x-mailer; bh=VCRyn32O8MZ57U5OQteu2oC9v7SyfOnkeXFauwXQ0ww=; b=w7V+Jz8tpyHgwsO1Y5Zgh789Y5xV4kwth/m+TACbubDi6dr/HO0hZJxUgQazZTxyAy M8YRDB49W36wkYsR0kPZYPjC0p+x1eKG8Un1NGok4sGPgVVp9GQJY2TMR1HvDbl1TMAh RZXE82nl0j4r+9f58WHp3SthJKBM9eRTD4o+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; b=qYYsKxgdh8QScgnsBNRpQnifYkXOqSXXbQHkuvD56iX8RqzhrbxuHfQgKOZYIVLPyT 4IOvckitfp7ZiZS4tUD3Okk6C940FK7QIup1Rauv8C1Llv4bQ1W1MLSpi4wuth5AY/f5 OgMuUzDCIqYERcaDpCx1jqoBYfwqEsoRuXhf4= Received: by 10.227.209.137 with SMTP id gg9mr2176908wbb.124.1302882872809; Fri, 15 Apr 2011 08:54:32 -0700 (PDT) Received: from DEV ([82.193.208.173]) by mx.google.com with ESMTPS id l24sm1698305wbc.64.2011.04.15.08.54.30 (version=SSLv3 cipher=OTHER); Fri, 15 Apr 2011 08:54:31 -0700 (PDT) Message-ID: <20110415.154921.875.2@DEV> From: rank1seeker@gmail.com To: freebsd-hackers@freebsd.org Date: Fri, 15 Apr 2011 17:49:21 +0200 In-Reply-To: <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> X-Mailer: POP Peeper (3.7.0.0) Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 15:54:34 -0000 > On 15/04/2011, at 17:03, rank1seeker@gmail.com wrote: > > I would like implementation of boolean sysctl var, that would show, is system in a single user mode. > > I would like it from 8.3 onwards. > > AFAIK the kernel doesn't have a "single user" mode. > > It's just that when you boot into single user mode it asks you want to run rather than starting /sbin/init. I see, but 'ps' shows /sbin/init as PID 1, in both SUM and MUM. How can I fiducially ensure that I am in SUM. On what to rely/look on. I wana put it in sh's function, for usage in scripts. From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 15 16:12:36 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B221065672 for ; Fri, 15 Apr 2011 16:12:36 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6A98FC0A for ; Fri, 15 Apr 2011 16:12:35 +0000 (UTC) Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3FGCRvE039812 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 16 Apr 2011 01:42:31 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110415.154921.875.2@DEV> Date: Fri, 15 Apr 2011 18:12:26 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> To: rank1seeker@gmail.com X-Mailer: Apple Mail (2.1084) X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 16:12:36 -0000 On 15/04/2011, at 17:49, rank1seeker@gmail.com wrote: >> On 15/04/2011, at 17:03, rank1seeker@gmail.com wrote: >>> I would like implementation of boolean sysctl var, that would show, is > system in a single user mode. >>> I would like it from 8.3 onwards. >> >> AFAIK the kernel doesn't have a "single user" mode. >> >> It's just that when you boot into single user mode it asks you want to > run rather than starting /sbin/init. > > I see, but 'ps' shows /sbin/init as PID 1, in both SUM and MUM. > How can I fiducially ensure that I am in SUM. > On what to rely/look on. Oh oops, I guess the kernel runs init -s which then asks you.. > I wana put it in sh's function, for usage in scripts. Why? -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 15 17:17:24 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE251065678 for ; Fri, 15 Apr 2011 17:17:24 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 94A7A8FC1A for ; Fri, 15 Apr 2011 17:17:23 +0000 (UTC) Received: by wwc33 with SMTP id 33so3354680wwc.31 for ; Fri, 15 Apr 2011 10:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:subject:date:in-reply-to :references:x-mailer; bh=4TObRypZQ7jxmMGl3m6nv3IaMKnT+/z5HqPZQnDGt3Y=; b=T0iX8eh3bayjD4ekUAl/pPFZwkd+4XswsJGVU2QzNxwNkPue+gQQnCflQnckvKlXyf pVYlD0A20OpHH57jPhYePR7Wb6Xb00EMbOKn3T0yGUeQb8RAZD+n7oUMYKRN3eBjiDf5 ULVssXwTKgcT/X0pcJSOVNPrwWBan+jsIXbm4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; b=W2pHOj1URQfhvEMeBd+ZjFyw0i3qd7LREmMwfOvg/ChT3Bg8+F3P6HQvkT/sXPE1A4 ESm4bdzeTp1HoNXUo6EbcVQRIZwOQn7N01Q/os41X8yEZ+QbsF161C63yj2GYCw+nGj8 fanyCmk4okdbRUTs5CaC2OVOuDlAZkqTcvjpc= Received: by 10.216.15.137 with SMTP id f9mr2165760wef.62.1302887842460; Fri, 15 Apr 2011 10:17:22 -0700 (PDT) Received: from DEV ([82.193.208.173]) by mx.google.com with ESMTPS id r57sm1416095wes.1.2011.04.15.10.17.19 (version=SSLv3 cipher=OTHER); Fri, 15 Apr 2011 10:17:21 -0700 (PDT) Message-ID: <20110415.171211.343.3@DEV> From: rank1seeker@gmail.com To: freebsd-hackers@freebsd.org Date: Fri, 15 Apr 2011 19:12:11 +0200 In-Reply-To: References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> X-Mailer: POP Peeper (3.7.0.0) Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 17:17:24 -0000 > On 15/04/2011, at 17:49, rank1seeker@gmail.com wrote: > >> On 15/04/2011, at 17:03, rank1seeker@gmail.com wrote: > >>> I would like implementation of boolean sysctl var, that would show, is > > system in a single user mode. > >>> I would like it from 8.3 onwards. > >> > >> AFAIK the kernel doesn't have a "single user" mode. > >> > >> It's just that when you boot into single user mode it asks you want to > > run rather than starting /sbin/init. > > > > I see, but 'ps' shows /sbin/init as PID 1, in both SUM and MUM. > > How can I fiducially ensure that I am in SUM. > > On what to rely/look on. > > Oh oops, I guess the kernel runs init -s which then asks you.. So, what is solution? Currently I need to mess with lookup, in env variables. It must cover cases of rebooting into SUM and drop from MUM (# shutdown now) in SUM. From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 15 17:24:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 623D7106564A for ; Fri, 15 Apr 2011 17:24:42 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 194CE8FC0A for ; Fri, 15 Apr 2011 17:24:40 +0000 (UTC) Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3FHOWFO043547 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 16 Apr 2011 02:54:36 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110415.171211.343.3@DEV> Date: Fri, 15 Apr 2011 19:24:31 +0200 Content-Transfer-Encoding: 7bit Message-Id: <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> To: rank1seeker@gmail.com X-Mailer: Apple Mail (2.1084) X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 17:24:42 -0000 On 15/04/2011, at 19:12, rank1seeker@gmail.com wrote: >> Oh oops, I guess the kernel runs init -s which then asks you.. > > So, what is solution? > Currently I need to mess with lookup, in env variables. > > It must cover cases of rebooting into SUM and drop from MUM (# shutdown > now) in SUM. There IS no "solution" because it isn't really a problem. You still didn't reply to my asking why you need to know.. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 11:20:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E0471065670 for ; Sat, 16 Apr 2011 11:20:07 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id AC89B8FC1B for ; Sat, 16 Apr 2011 11:20:06 +0000 (UTC) Received: by wwk4 with SMTP id 4so374455wwk.1 for ; Sat, 16 Apr 2011 04:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:subject:date:in-reply-to :references:x-mailer; bh=BvC0nJSvH0VlOR89SfWLHjeyi9Q9BNZDxCKhLDVbmZ0=; b=CzatlE4cRKHRFuCeKGtxDJpkEioIVTku5dEsFZZcN4n9XF0F+JDW8Uan+Rn+xGEFy1 ps30nDkUtXdO2z3EkCbUTs0TbcoSfQnSNCxLdojEDJQA4XHgBxTnf743oGWO3/vh0zed YG4WwxVHA1qO4V2VV4tBYhk9uk5i5g6gGLj0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; b=BWlcdpfvAxZvUHuup29+KfsRgQZPGqSWytZrYJT23NebQ65WeoAa8/YjsYykR2gby8 gZWXW3+799tpIqEKOInDos+J6Cq4naA97VEbo3E1WN+GC6YIc2XL210MYHYPQ6dKEhtp MSuAAxVYzdoEU4E+ZRU7++ssyN3raTEZGRh64= Received: by 10.216.62.137 with SMTP id y9mr8419901wec.107.1302952805565; Sat, 16 Apr 2011 04:20:05 -0700 (PDT) Received: from DEV ([82.193.208.173]) by mx.google.com with ESMTPS id d59sm1695900wed.45.2011.04.16.04.20.01 (version=SSLv3 cipher=OTHER); Sat, 16 Apr 2011 04:20:03 -0700 (PDT) Message-ID: <20110416.111455.390.4@DEV> From: rank1seeker@gmail.com To: freebsd-hackers@freebsd.org Date: Sat, 16 Apr 2011 13:14:55 +0200 In-Reply-To: <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> X-Mailer: POP Peeper (3.7.0.0) Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 11:20:07 -0000 > On 15/04/2011, at 19:12, rank1seeker@gmail.com wrote: > >> Oh oops, I guess the kernel runs init -s which then asks you.. > > > > So, what is solution? > > Currently I need to mess with lookup, in env variables. > > > > It must cover cases of rebooting into SUM and drop from MUM (# shutdown > > now) in SUM. > > There IS no "solution" because it isn't really a problem. It is mine GOAL, to achieve. > You still didn't reply to my asking why you need to know.. Why?! Because! Why, why, why ...? God told me! Why Did the Chicken Cross the Road? Why ... Is it really a relevant for this discussion?! I truly prefer focusing on a goal and finding a way of achieving it. Your question is just an open road for an endless chater, with many new roads, for splitting into endless subchaters ... I wana create an sh function, which returns 0 if sys is in SUM or return 1 if in MUM. Then I can use that function, wherever I want. I.e; (I CAN NOT BELIEVE I AM TYPING SO MUCH!) If I use geli encryption AND I am upgrading from 8.2 to 8.3, then upon rebuild of whole system, I must install kernel and world in a ONE SHOT! (Just a rebuild of a same version of OS doesn't require this) So I need to drop into SUM and install kernel and world, NOT regulary install kernel, then reboot into SUM and then install world! This is just a one scenario ... Now that does it! Do you know, or not, what should I look for, to prove that I am in SUM? (As human I know when I am in SUM, as I initiate it, but scripts are retards, so they need it, not me ...) Simple as that. From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 11:46:35 2011 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31B36106564A for ; Sat, 16 Apr 2011 11:46:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 77D398FC15 for ; Sat, 16 Apr 2011 11:46:33 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA10404; Sat, 16 Apr 2011 14:46:32 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QB3xQ-000JQc-G0; Sat, 16 Apr 2011 14:46:32 +0300 Message-ID: <4DA98197.8060104@FreeBSD.org> Date: Sat, 16 Apr 2011 14:46:31 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110308 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: hackers@FreeBSD.org, freebsd-threads@FreeBSD.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: Subject: puzzled: fork +libthr X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 11:46:35 -0000 Guys, I am trying to debug this chromium issue: http://trillian.chruetertee.ch/chromium/ticket/13 Not sure SOCK_SEQPACKET mentioned in the ticket is an actual culprit, the problem that interests me is that pthread_cond_wait() returns EPERM where it shouldn't. That happens on stable/8. I compared ktrace of chromium on stable/8 and head. Startup traces are very similar until execution gets to one particular place. At that place stable/8 chromium executes pthread_cond_wait - I see _umtx_op(UMTX_OP_CV_WAIT) and that's where EPERM is returned. On the other hand it seems that head chromium executes something different at exactly the same place, perhaps sem_wait - I see _umtx_op(UMTX_OP_WAIT_UINT_PRIVATE). So this is puzzle #1 for me why chromimum build or run-time chooses a different thing to call/use at that place. The second puzzle is the EPERM return value itself, on stable/8. >From what I seem chromium does a bunch of forks before it gets to the place of interest. My debugging shows that those forks are "single-threaded" (i.e. code in thr_fork.c is not called). And then in a process/thread that makes that pthread_cond_wait call I see that libthr and kernel have different opinions about what current TID is. Userland part uses what is actually a kernel TID of its parent thread (the one that called fork). And given how the work is divided between userland and kernel in libthr, that mismatch leads to serious consequences. So my question is why libthr doesn't see its actual TID. Maybe some initialization code is not invoked. BTW, chromium is linked to both libc and libthr (per ldd). But it seems that there are no pthread calls up the fork chain until that pthread_cond_wait call. Maybe this could ring a bell for someone knowledgeable in the area. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 12:42:50 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3FB4106566B for ; Sat, 16 Apr 2011 12:42:50 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 503ED8FC13 for ; Sat, 16 Apr 2011 12:42:48 +0000 (UTC) Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3GCgeU4046714 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 16 Apr 2011 22:12:45 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110416.111455.390.4@DEV> Date: Sat, 16 Apr 2011 14:42:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> To: rank1seeker@gmail.com X-Mailer: Apple Mail (2.1084) X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 12:42:50 -0000 On 16/04/2011, at 13:14, rank1seeker@gmail.com wrote: >> There IS no "solution" because it isn't really a problem. >=20 > It is mine GOAL, to achieve. >=20 >> You still didn't reply to my asking why you need to know.. >=20 > Why?! > Because! > Why, why, why ...? > God told me! > Why Did the Chicken Cross the Road? > Why ... > Is it really a relevant for this discussion?! Yes, because there is no concept of single user mode to the kernel. = That's why there is no sysctl for it. > I truly prefer focusing on a goal and finding a way of achieving it. > Your question is just an open road for an endless chater, with many = new=20 > roads, for splitting into endless subchaters ... >=20 > I wana create an sh function, which returns 0 if sys is in SUM or = return 1=20 > if in MUM. > Then I can use that function, wherever I want. >=20 > I.e; (I CAN NOT BELIEVE I AM TYPING SO MUCH!) Get used to it, > If I use geli encryption AND I am upgrading from 8.2 to 8.3, then upon=20= > rebuild of whole system, I must install kernel and world in a ONE = SHOT!=20 > (Just a rebuild of a same version of OS doesn't require this) > So I need to drop into SUM and install kernel and world, NOT regulary=20= > install kernel, then reboot into SUM and then install world! > This is just a one scenario ... > Now that does it! > Do you know, or not, what should I look for, to prove that I am in = SUM? (As=20 > human I know when I am in SUM, as I initiate it, but scripts are = retards,=20 > so they need it, not me ...) > Simple as that. I think you're looking at it the wrong way. It isn't that being in multi user mode causes a problem as such, it's = because something happens when you run /etc/rc which causes the problem. Your example doesn't say why you need to be in single user mode when = using geli.. The only reason you need to be in single user mode during = an upgrade is so that running programs don't find libraries ripped out = from under them and then they crash. In that case you don't need to reboot into single user mode, you just = make sure there aren't any non-kernel processes (besides sh) which are = running. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 14:29:56 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5917B106564A for ; Sat, 16 Apr 2011 14:29:56 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id DE3E58FC08 for ; Sat, 16 Apr 2011 14:29:55 +0000 (UTC) Received: by wwc33 with SMTP id 33so4071958wwc.31 for ; Sat, 16 Apr 2011 07:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:from:to:subject:date:in-reply-to :references:x-mailer; bh=w++y6+OGYbWYeDeQBTHJ8+cIP+ig9z/RJwXfgm4pTnE=; b=gx/bdW1Yukr/lruagyZmxByk9EujYZUR1XNE0Bn+Eb8Nyv8ZspEZDjBd64Hg1MaKVl 6EXzl2DO+mwF9BBGY8sDtU6EguZYxt6oE5dUOQpdeGGhXr2nB3roxVyTGclZhGYYmkhp 2J94UOBZxss94VZgtgW9e8z4Ywh10VeGHEb2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; b=ptbjfpEt7rVGzy3qcxZrr9Go+/ZVhY1XNQzPFZaQ5U+I3ZmmiHu4s4zJP+jvwU0bGq 3DDZygcL9BYO7hNTvALj31AR6r7o5lR6JtdrMo485N8SOPih0Q3aL0QTJRCnK5EkTkQi 6HifNQa0wdRX2u4lQzrMwfva10w+FZnXyUK0M= Received: by 10.216.24.92 with SMTP id w70mr697442wew.43.1302964194807; Sat, 16 Apr 2011 07:29:54 -0700 (PDT) Received: from DEV ([82.193.208.173]) by mx.google.com with ESMTPS id s40sm1759224weq.28.2011.04.16.07.29.50 (version=SSLv3 cipher=OTHER); Sat, 16 Apr 2011 07:29:53 -0700 (PDT) Message-ID: <20110416.142444.546.5@DEV> From: rank1seeker@gmail.com To: freebsd-hackers@freebsd.org Date: Sat, 16 Apr 2011 16:24:44 +0200 In-Reply-To: References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> X-Mailer: POP Peeper (3.7.0.0) Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 14:29:56 -0000 > Yes, because there is no concept of single user mode to the kernel. That's why there is no sysctl for it. I've already accepted that as a fact, so let's not pull that cat, with rope, around, ...anymore. > > I truly prefer focusing on a goal and finding a way of achieving it. > > Your question is just an open road for an endless chater, with many new > > roads, for splitting into endless subchaters ... > > > > I wana create an sh function, which returns 0 if sys is in SUM or return 1 > > if in MUM. > > Then I can use that function, wherever I want. > > > > I.e; (I CAN NOT BELIEVE I AM TYPING SO MUCH!) > > Get used to it, > > > If I use geli encryption AND I am upgrading from 8.2 to 8.3, then upon > > rebuild of whole system, I must install kernel and world in a ONE SHOT! > > (Just a rebuild of a same version of OS doesn't require this) > > So I need to drop into SUM and install kernel and world, NOT regulary > > install kernel, then reboot into SUM and then install world! > > This is just a one scenario ... > > Now that does it! > > Do you know, or not, what should I look for, to prove that I am in SUM? (As > > human I know when I am in SUM, as I initiate it, but scripts are retards, > > so they need it, not me ...) > > Simple as that. > > I think you're looking at it the wrong way. > It isn't that being in multi user mode causes a problem as such, it's because something happens when you run /etc/rc which causes the problem. > > Your example doesn't say why you need to be in single user mode when using geli.. The only reason you need to be in single user mode during an upgrade is so that running programs don't find libraries ripped out from under them and then they crash. > > In that case you don't need to reboot into single user mode, you just make sure there aren't any non-kernel processes (besides sh) which are running. I know all this!!! I KNEW chatter would start to go this way! After compilation of kernel and world in MUM, kernel is installed in MUM, but to install world, we reboot into SUM, then install world. (HANDBOOK) Now, in case of GELI usage AND if upgrading is taking place, i.e; 8.2 -> 8.3, once you reboot into SUM to install world, you are doomed, BECAUSE ... Kernel will bitch (GELI part), about world->kernel mismatch and you won't be able to install world as you cant decrypt geom providers!! The only way to save yourself in that case is to restore /boot/kernel.old, or one is doomed. So that is way, they both need to be installed in SUM, in one shot! Kernel then world! But this is just a ONE example, of usage of THAT function! Next time it won't be GELI case but something else. And now I brag about encryption, compilation of world and kernel, bla, bla..., what is NOT a subject, of this "thread" DO YOU KNOW, what to look for, in sys that will indicate to my function, that it is in SUM? Domagoj S. From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 14:44:31 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D60FB1065670 for ; Sat, 16 Apr 2011 14:44:31 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 82A7E8FC13 for ; Sat, 16 Apr 2011 14:44:30 +0000 (UTC) Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3GEiLiP051593 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 17 Apr 2011 00:14:25 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110416.142444.546.5@DEV> Date: Sat, 16 Apr 2011 16:44:20 +0200 Content-Transfer-Encoding: 7bit Message-Id: <97731093-4056-4D26-8D4E-4BE077B45610@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> <20110416.142444.546.5@DEV> To: rank1seeker@gmail.com X-Mailer: Apple Mail (2.1084) X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 14:44:31 -0000 On 16/04/2011, at 16:24, rank1seeker@gmail.com wrote: >> >> In that case you don't need to reboot into single user mode, you just > make sure there aren't any non-kernel processes (besides sh) which are > running. > > I know all this!!! > I KNEW chatter would start to go this way! > After compilation of kernel and world in MUM, kernel is installed in MUM, > but to install world, we reboot into SUM, then install world. (HANDBOOK) > Now, in case of GELI usage AND if upgrading is taking place, i.e; 8.2 -> > 8.3, once you reboot into SUM to install world, you are doomed, BECAUSE > ... > Kernel will bitch (GELI part), about world->kernel mismatch and you won't > be able to install world as you cant decrypt geom providers!! > The only way to save yourself in that case is to restore /boot/kernel.old, > or one is doomed. > > So that is way, they both need to be installed in SUM, in one shot! Kernel > then world! > > But this is just a ONE example, of usage of THAT function! > Next time it won't be GELI case but something else. > And now I brag about encryption, compilation of world and kernel, bla, > bla..., what is NOT a subject, of this "thread" > > > DO YOU KNOW, what to look for, in sys that will indicate to my function, > that it is in SUM? Well, I give up. You aren't reading & thinking about what I'm writing. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 15:31:14 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF4AF1065670 for ; Sat, 16 Apr 2011 15:31:14 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 98E3C8FC12 for ; Sat, 16 Apr 2011 15:31:14 +0000 (UTC) Received: by gyg13 with SMTP id 13so1383394gyg.13 for ; Sat, 16 Apr 2011 08:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=lCotGO3+2HABkM4JNGEilPtsIojTgnBsKL73bmoK7ak=; b=p13u0OVm95ln/pl4KhjoBQEbR68CwPi5UmDkjpCutf8jfvHRZ7EG4AUvP9lh18jlMH FvfRJF6wkCIFpewH/eGeJRyrr+xIdWl3Cx4cyD27pAmwFRF8DlnMrEOJH2QPnof2KO/8 Uuze0AwvP8I5s8lYgGAOLdKVtEOejIhgWsk10= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xc3CGVkIMgWJY23O5abcitPTi8/DXvW9QXog0zHa4oFGqtj/TSmLQvc5Btjo7ECN1N 2LXXCqZJeDYASgOHirxgR0QMr4//rxk5XKHxa3coiCl5Umfe4m1KIuvlmYOD4IxKYYLs HD4H+Ro81LYDXTbJ6+FudSpQQsQ/kIItU5sk0= MIME-Version: 1.0 Received: by 10.90.181.18 with SMTP id d18mr3280194agf.82.1302967873400; Sat, 16 Apr 2011 08:31:13 -0700 (PDT) Received: by 10.90.67.9 with HTTP; Sat, 16 Apr 2011 08:31:13 -0700 (PDT) In-Reply-To: <20110416.142444.546.5@DEV> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> <20110416.142444.546.5@DEV> Date: Sat, 16 Apr 2011 08:31:13 -0700 Message-ID: From: Freddie Cash To: rank1seeker@gmail.com Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 15:31:15 -0000 On Sat, Apr 16, 2011 at 7:24 AM, wrote: > After compilation of kernel and world in MUM, kernel is installed in MUM, > but to install world, we reboot into SUM, then install world. (HANDBOOK) Note: You do not have to be in SUM to install the world and/or the kernel. You can install them just fine in multi-user mode. I do this all the time on remote system, as dropping to SUM would knock off the SSH connection. All you have to do is make sure no one else is logged in, stop as many services and daemons as possible, then do the installworld, and reboot. It's not recommended in the Handbook, but it's not forbidden either. > So that is way, they both need to be installed in SUM, in one shot! Kernel > then world! Or ... they can be installed in MUM without issue. > DO YOU KNOW, what to look for, in sys that will indicate to my function, > that it is in SUM? No network configured, no daemons running, just a single shell running. IOW, everything can be done manually in MUM to "simulate" SUM. -- Freddie Cash fjwcash@gmail.com From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 15:42:02 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D1AA106566B for ; Sat, 16 Apr 2011 15:42:02 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 2FF3F8FC13 for ; Sat, 16 Apr 2011 15:42:00 +0000 (UTC) Received: from [192.168.42.215] (maarsy.rocketrange.no [128.39.153.30]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3GFfqHf053758 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 17 Apr 2011 01:11:57 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: Date: Sat, 16 Apr 2011 17:41:51 +0200 Content-Transfer-Encoding: 7bit Message-Id: <8DBD8E84-82A8-41F1-9AA3-A0E31440EF98@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> <20110416.142444.546.5@DEV> To: Freddie Cash X-Mailer: Apple Mail (2.1084) X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: rank1seeker@gmail.com, freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 15:42:02 -0000 On 16/04/2011, at 17:31, Freddie Cash wrote: >> DO YOU KNOW, what to look for, in sys that will indicate to my function, >> that it is in SUM? > > No network configured, no daemons running, just a single shell > running. IOW, everything can be done manually in MUM to "simulate" > SUM. My point is that the difference is only in your brain. The kernel doesn't know the difference because there isn't one. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 17:20:36 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C0D106566B for ; Sat, 16 Apr 2011 17:20:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3D38FC08 for ; Sat, 16 Apr 2011 17:20:35 +0000 (UTC) Received: by pxi6 with SMTP id 6so4292848pxi.17 for ; Sat, 16 Apr 2011 10:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BjqnrKFoTJk+T9pUbmyA/ygpGacqpbhP4jBBgBT7C6k=; b=woUFnWwmEFGAlrOuteM0/wxcCyCfHk98cD0/Nc7bgkKqIoYsjQlQOugFwIlYHhTosC wofYs3wUhIgwk1ofS2qAuOWS9XPSj95KzP7719YFj1gRmlR+dLFlMxWSvKVMouGx3cK8 QGJ6Xi9/mxyqV0tIO0YRQKUzv0o0+GN68lvlA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=c2Z6zt7MK8mmBfRMY4mhrtTsSN2UfS3gtnOuKvr5rzGSORqLCxeZLq/irlacKRrPeh A26acqVG0vj89EJmYVGfMMty0KdeKgueM1k+3O3G9APldMXTmUdR3V8raS5TlPhttWhF K/NXyi9W7kLDOEeP5YUQAh2AKrGzEQfAwVkZU= MIME-Version: 1.0 Received: by 10.68.11.226 with SMTP id t2mr3894870pbb.212.1302974435630; Sat, 16 Apr 2011 10:20:35 -0700 (PDT) Received: by 10.68.42.3 with HTTP; Sat, 16 Apr 2011 10:20:35 -0700 (PDT) In-Reply-To: <8DBD8E84-82A8-41F1-9AA3-A0E31440EF98@gsoft.com.au> References: <20110415.150349.671.1@DEV> <22B12EE4-AE7B-49F7-B6BA-3FE7F967F508@gsoft.com.au> <20110415.154921.875.2@DEV> <20110415.171211.343.3@DEV> <6F20BB76-0D6A-4AB5-99DF-15954D8C2C9D@gsoft.com.au> <20110416.111455.390.4@DEV> <20110416.142444.546.5@DEV> <8DBD8E84-82A8-41F1-9AA3-A0E31440EF98@gsoft.com.au> Date: Sat, 16 Apr 2011 10:20:35 -0700 Message-ID: From: Garrett Cooper To: "Daniel O'Connor" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: rank1seeker@gmail.com, freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 17:20:36 -0000 On Sat, Apr 16, 2011 at 8:41 AM, Daniel O'Connor wr= ote: > > On 16/04/2011, at 17:31, Freddie Cash wrote: >>> DO YOU KNOW, what to look for, in sys that will indicate to my function= , >>> that it is in SUM? >> >> No network configured, no daemons running, just a single shell >> running. =A0IOW, everything can be done manually in MUM to "simulate" >> SUM. > > My point is that the difference is only in your brain. > > The kernel doesn't know the difference because there isn't one. Well, not from its perspective. From init's/rc's perspective, sure.. there sort of is one. You could check for /var/run/dmesg.boot beforehand, but not if you're dropping into singleuser mode from multiuser mode. You can do some rc tricks to determine whether or not certain services have been started to achieve whatever you want to for your scripts. Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 21:55:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99BA61065703 for ; Sat, 16 Apr 2011 21:55:42 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from imr-da02.mx.aol.com (imr-da02.mx.aol.com [205.188.105.144]) by mx1.freebsd.org (Postfix) with ESMTP id 5B30C8FC14 for ; Sat, 16 Apr 2011 21:55:42 +0000 (UTC) Received: from imo-ma03.mx.aol.com (imo-ma03.mx.aol.com [64.12.78.138]) by imr-da02.mx.aol.com (8.14.1/8.14.1) with ESMTP id p3GLtexc010190 for ; Sat, 16 Apr 2011 17:55:40 -0400 Received: from dieterbsd@engineer.com by imo-ma03.mx.aol.com (mail_out_v42.9.) id n.def.139af619 (43976) for ; Sat, 16 Apr 2011 17:55:38 -0400 (EDT) Received: from smtprly-me03.mx.aol.com (smtprly-me03.mx.aol.com [64.12.95.104]) by cia-dd04.mx.aol.com (v129.9) with ESMTP id MAILCIADD041-b30f4daa105517e; Sat, 16 Apr 2011 17:55:38 -0400 Received: from web-mmc-d04 (web-mmc-d04.sim.aol.com [205.188.103.94]) by smtprly-me03.mx.aol.com (v129.9) with ESMTP id MAILSMTPRLYME037-b30f4daa105517e; Sat, 16 Apr 2011 17:55:33 -0400 To: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Date: Sat, 16 Apr 2011 17:55:32 -0400 X-MB-Message-Source: WebUI X-AOL-IP: 67.206.161.196 X-MB-Message-Type: User MIME-Version: 1.0 From: dieterbsd@engineer.com Content-Type: text/plain; charset="us-ascii" X-Mailer: Mail.com Webmail 33540-STANDARD Received: from 67.206.161.196 by web-mmc-d04.sysops.aol.com (205.188.103.94) with HTTP (WebMailUI); Sat, 16 Apr 2011 17:55:32 -0400 Message-Id: <8CDCA9824BFE47E-176C-A720@web-mmc-d04.sysops.aol.com> X-Spam-Flag: NO X-AOL-SENDER: dieterbsd@engineer.com Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 21:55:42 -0000 > once you reboot into SUM to install world, you are doomed, BECAUSE > ... > Kernel will bitch (GELI part), about world->kernel mismatch and you > won't be able to install world as you cant decrypt geom providers!! Suggestion 1: Install the new stuff into different disk partition(s), leaving the partition(s) you are currently running alone. Then if something doesn't work and the new installation doesn't boot you are not doomed, you can simply boot the previous partition(s) again. Suggestion 2: The kernel may not have an official flag for single vs multi user mode but you can fake it. Try something like "pgrep syslogd". If syslogd is running assume multiuser mode. If syslogd is not running assume single user mode. From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 23:19:54 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E63106566B for ; Sat, 16 Apr 2011 23:19:54 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA438FC13 for ; Sat, 16 Apr 2011 23:19:54 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.4/8.14.4) with ESMTP id p3GMkreA005967; Sat, 16 Apr 2011 16:46:53 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.4/8.14.4/Submit) with ESMTP id p3GMkr49005964; Sat, 16 Apr 2011 16:46:53 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sat, 16 Apr 2011 16:46:53 -0600 (MDT) From: Warren Block To: dieterbsd@engineer.com In-Reply-To: <8CDCA9824BFE47E-176C-A720@web-mmc-d04.sysops.aol.com> Message-ID: References: <8CDCA9824BFE47E-176C-A720@web-mmc-d04.sysops.aol.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (wonkity.com [127.0.0.1]); Sat, 16 Apr 2011 16:46:54 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 23:19:54 -0000 On Sat, 16 Apr 2011, dieterbsd@engineer.com wrote: > Suggestion 2: The kernel may not have an official flag for single > vs multi user mode but you can fake it. Try something like > "pgrep syslogd". If syslogd is running assume multiuser mode. If > syslogd is not running assume single user mode. Another option: kern.hostid is set nonzero pretty early in the rc scripts. From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 16 23:38:47 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A89D10657B0 for ; Sat, 16 Apr 2011 23:38:47 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8978FC16 for ; Sat, 16 Apr 2011 23:38:45 +0000 (UTC) Received: by iwn33 with SMTP id 33so3967903iwn.13 for ; Sat, 16 Apr 2011 16:38:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:x-openpgp-key-id:x-openpgp-key-fingerprint :x-openpgp-key-url; bh=eHkr4q4jksdk3JdBZROfbMSTFQ/YClIAzQa5GYVJNAU=; b=lqZWsetn4Ah08/VN5O/YSnF3fYh/8whhdOLFT4ra5JyUsRLJGb2faOGIYamTWBGIDa STgPd5Edo6eJVGnLhhdS4xt5cn+nHcjj710qpKkkJqmMu9q/duNqvvwWPG8Lv4nj3Lnq RWdKavWqRRVzGORrbVnkBborAK/qUH6FVi9tQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-openpgp-key-id :x-openpgp-key-fingerprint:x-openpgp-key-url; b=U/voNBER1w1AcCMGtYj1ExG9Cu4eNhhiq/nNOlhjilLUWsBJ+EAeOhphd9axPhbb0C kGWEHZEKn3v+Gllrn/kbLYJ9lmSl12VcQCxgBahvanwgv1/w5/MCq3h4jmT93+KriLox CiNGDFrf4RYT6skK9AUHbT4Qi26EcCuFyBatA= Received: by 10.42.97.71 with SMTP id m7mr4731324icn.77.1302997124979; Sat, 16 Apr 2011 16:38:44 -0700 (PDT) Received: from DataIX.net (adsl-99-19-43-8.dsl.klmzmi.sbcglobal.net [99.19.43.8]) by mx.google.com with ESMTPS id xc15sm2073013icb.2.2011.04.16.16.38.43 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 16 Apr 2011 16:38:43 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.4/8.14.4) with ESMTP id p3GNce7b005969 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Apr 2011 19:38:40 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.4/8.14.4/Submit) id p3GNcdYM005968; Sat, 16 Apr 2011 19:38:39 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Sat, 16 Apr 2011 19:38:39 -0400 From: "J. Hellenthal" To: Warren Block Message-ID: <20110416233839.GA72223@DataIX.net> References: <8CDCA9824BFE47E-176C-A720@web-mmc-d04.sysops.aol.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline In-Reply-To: X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E X-OpenPGP-Key-URL: http://bit.ly/0x89D8547E Cc: freebsd-hackers@freebsd.org, dieterbsd@engineer.com Subject: Re: Add SUM sysctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2011 23:38:47 -0000 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 16, 2011 at 04:46:53PM -0600, Warren Block wrote: >On Sat, 16 Apr 2011, dieterbsd@engineer.com wrote: > >>Suggestion 2: The kernel may not have an official flag for single >>vs multi user mode but you can fake it. Try something like >>"pgrep syslogd". If syslogd is running assume multiuser mode. If >>syslogd is not running assume single user mode. > >Another option: kern.hostid is set nonzero pretty early in the rc >scripts. Same as getty(8). That also will not be running in SU and in most cases is a clear indication that nothing else is running unless you have a remote only machine without a console in which you have purposely disabled getty(8). --=20 Regards, J. Hellenthal WWJD --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJNqih+AAoJEJBXh4mJ2FR+0YYH/RvGZP0VM3EPGh9xXX2MAAlZ 4YPxqABxxfUoHj8MOkYfIUx/Fzs38KGOfsm7o+uC/mYGKw0rpYttoUNyFpYrrWm/ rii7vsNZBA90s5fyvdiZy5IwsoT6aeDvHLVC5Y6TBBvqCk3O9tNlr+0RcP9lPoOp +p2mpptgtssosYj8lGByA0OwYyj3AD7MK5OGUY/f1hhKv88FKwziKoJzj4GPMhmV OHz1ZzvxjUIr4vDZOLsYjZCvldNIatUgPpJA5SX9sHdPu+ir6zTkOgaZZjsVy+re +IAVyXJMDMCJ0sWAsI0vJPp3LSVcXLj+eefgNPeVdMvmtzA0uEuDRtH3UAdAt60= =DcRK -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--