From owner-freebsd-hackers@FreeBSD.ORG Sun May 19 16:17:39 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 780257C2; Sun, 19 May 2013 16:17:39 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 069D3F30; Sun, 19 May 2013 16:17:39 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 47B08358C65; Sun, 19 May 2013 18:17:38 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 2362D28493; Sun, 19 May 2013 18:17:38 +0200 (CEST) Date: Sun, 19 May 2013 18:17:38 +0200 From: Jilles Tjoelker To: Paul LeoNerd Evans Subject: Re: Managing userland data pointers in kqueue/kevent Message-ID: <20130519161737.GA26506@stack.nl> References: <20130513185357.1c552be5@shy.leonerd.org.uk> <20130513191513.786f4f02@shy.leonerd.org.uk> <8A02C28F-89CB-4AE3-A91A-89565F041FDE@gmail.com> <20130513194411.5a2dfa2e@shy.leonerd.org.uk> <519327DF.6060002@freebsd.org> <20130515132959.7f113255@shy.leonerd.org.uk> <20130515133458.41f980e9@shy.leonerd.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130515133458.41f980e9@shy.leonerd.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Adrian Chadd , Eugen-Andrei Gavriloaie X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 16:17:39 -0000 On Wed, May 15, 2013 at 01:34:58PM +0100, Paul LeoNerd Evans wrote: > On Wed, 15 May 2013 13:29:59 +0100 > Paul "LeoNerd" Evans wrote: > > Is that not the exact thing I suggested? > > The "extension to create register a kevent to catch these events" is > > that you put the EV_DROPWATCH bit flag in the event at the time you > > register it. > > The "returned event [that] could have all the appropriate informaiton > > for the event being dropped" is that you receive an event with > > EV_DROPPED set on it. It being a real event includes of course the > > udata pointer, so you can handle it. > In fact, to requote the original PR I wrote[1] on the subject: > --- > I propose the addition of a new flag applicable to any kevent watch > structure, documented thusly: > The flags field can contain the following values: > .. > EV_DROPWATCH Requests that the kernel will send an EV_DROPPED event > on this watch when it has finished watching it for any > reason, including EV_DELETE, expiry because of > EV_ONESHOT, or because the filehandle was closed by > close(2). > > EV_DROPPED This flag is returned by the kernel if it is now about > to drop the watch. After this flag has been received, > no further events will occur on this watch. > This flag then makes it trivial to build a generic wrapper for kqueue > that can always manage its memory correctly. > a) at EV_ADD time, simply set flags |= EV_DROPWATCH > b) after an event has been processed that included the EV_DROPPED > flag, free() the pointer given in the udata field. An important detail is missing: how do you avoid using up all kernel memory on knotes if someone keeps adding new file descriptors with EV_ADD | EV_DROPWATCH and closing the file descriptors again without ever draining the kqueue? This problem did not use to exist for file descriptor events before: the number of such knotes was limited to the number of open file descriptors. However, it does already exist for most of the other event types. For example, pwait -v will return the exit status even if it was suspended (^Z) while the process terminated and the parent reaped the zombie. For EVFILT_TIMER, the worst effect is a denial of service of EVFILT_TIMER on all other processes in the system. EVFILT_USER does not appear to check anything and appears to allow arbitrary kernel memory consumption. The EVFILT_TIMER needs to keep its global limit and EVFILT_USER needs something similar. For the rest, call an event that is no longer associated to a kernel object (e.g. EVFILT_READ whose file descriptor is closed, EVFILT_PROC whose process has terminated and been reaped by the parent or EVFILT_AIO whose I/O request is completed) "unbound". The number of events that are not unbound is limited by existing limits on the other kernel objects. A possible fix is to reject (such as with [ENOMEM]) adding new events when there are too many unbound events in the queue already. The application should then allow kevent() to return pending events first before it adds new ones. If the kernel returns unbound events in preference to other events, a kevent() call with nevents >= 2 * nchanges cannot result in a net increase in the number of current and potential unbound events, since it allows the kernel to return (and forget) as many unbound events as it may add (nchanges entries are required for EV_ERROR leaving nchanges for returning other events). > It is not required that these two flags have distinct values; since > one is userland->kernel and the other kernel->userland, they could for > neatness reuse the same bit field. I think it would be consistent with other EV_* to use the same name and value for both. -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Mon May 20 17:49:21 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CBD31B62 for ; Mon, 20 May 2013 17:49:21 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qe0-f53.google.com (mail-qe0-f53.google.com [209.85.128.53]) by mx1.freebsd.org (Postfix) with ESMTP id 927D391F for ; Mon, 20 May 2013 17:49:21 +0000 (UTC) Received: by mail-qe0-f53.google.com with SMTP id s14so224795qeb.12 for ; Mon, 20 May 2013 10:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=FqpC7TfBi+zvMEzxbgH6n2CrdO2ForDV8X9y1ORXUsE=; b=eISAFlUhUfgOmSvBEX3sjh04+xnHbW/X4vAxCBGckmVeT37TgHT7Hg5ZWnmY/PZSKA U+LDq03/6RyJqS1TQvDYv13qQxrHLonD00BKCzd+xgGio1RedVPfGrKPSPT2P6E6Ef1R 9PjShlK/kTMKwZsT0GxTuPsb87yEcclywObmWPDDz1l0/up8Er9fmRwGDGEyeuDkYh45 5ji7DOhQ6Df31aW2XmkyCdGrhi5GlQDkJMmngIemWiO8fpcIfrhi6aWkaW1/LzhsGhT4 K7xZqgiN46N8WbfUWCh1TvDOpcE/gHtnDAvgih3EFil04tf5YdCqQ7Mx8ZIdzhQruJG1 Fq1Q== MIME-Version: 1.0 X-Received: by 10.224.4.74 with SMTP id 10mr226137qaq.38.1369072155484; Mon, 20 May 2013 10:49:15 -0700 (PDT) Received: by 10.49.133.137 with HTTP; Mon, 20 May 2013 10:49:13 -0700 (PDT) In-Reply-To: <51976D13.4010604@peterschmitt.fr> References: <51976D13.4010604@peterschmitt.fr> Date: Mon, 20 May 2013 11:49:13 -0600 Message-ID: Subject: Re: blogbench and write-open serialization From: asomers@gmail.com To: florent+FreeBSD-hackers@peterschmitt.fr Content-Type: multipart/mixed; boundary=001a11c2523e7fe4c604dd29f365 X-Mailman-Approved-At: Mon, 20 May 2013 18:19:06 +0000 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 17:49:21 -0000 --001a11c2523e7fe4c604dd29f365 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, May 18, 2013 at 5:59 AM, Florent Peterschmitt wrote: > Le 18/05/2013 06:04, Ivan Voras a =E9crit : > >> During the BSDCan & DevSummit I got interested in finding out why >> blogbench is so slow on FreeBSD. After talking to jhb, it looked like >> one of the reasons might be that opening files with O_RDWR or O_WRONLY >> (anything opening the file for writing) is serialized. >> >> To check this, I've written a small test program, which I've run on >> CentOS 6.3 and FreeBSD 10-HEAD on the same hardware. Here are the result= s: >> >> https://wiki.freebsd.org/Benchmarking/OpenCloseBenchmark >> >> Conclusions: >> >> * Linux opens and closes files much faster than FreeBSD >> * Linux does not serialize write-open operations, while FreeBSD does >> * Even with O_RDONLY, FreeBSD is much slower in opening (and closing) >> files. >> >> I'd welcome a review of these results and comments. > > > Hi, > > I'm no able to say anything about that (because I've no idea of how does > Linux or FreeBSD works ), but could it be a problem from filesystem ? > > Everytime I had UFS I found the entire system very slow when doing some I= /O > (many little freezes), and with ZFS it's globally much better. > > _______________________________________________ > 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 largely reproduced your results, but saw even worse scaling. * Linux was much faster, for all thread counts and on all file systems * Linux's performance degraded by about 25% at high thread counts. FreeBSD's penalty was file-system dependent, but usually higher * The filesystem and hard disk mattered little on linux (tested tmpfs and ext4). The hard disk mattered little on FreeBSD, but the file system was very significant. * On FreeBSD, tmpfs was the fasted for a single thread. For nine threads, tmpfs was fastest for writes (about 33% faster than UFS or ZFS), but substantially slower than ZFS for reads. * For O_RDONLY, ZFS scales much better than UFS as the number of threads increases, but at low thread counts UFS was faster. I was testing on a dual-socket, 6 core/socket Xeon E5645 @ 2.4GHz machine. For Linux, I used Debian 6.0.6 with the 2.6.32-5 kernel. For FreeBSD, I was using a custom kernel based on stable/9. --001a11c2523e7fe4c604dd29f365-- From owner-freebsd-hackers@FreeBSD.ORG Mon May 20 19:23:23 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B93513A for ; Mon, 20 May 2013 19:23:23 +0000 (UTC) (envelope-from lidl@hydra.pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::3c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D360174F for ; Mon, 20 May 2013 19:23:23 +0000 (UTC) Received: from hydra.pix.net (localhost [127.0.0.1]) by hydra.pix.net (8.14.5/8.14.5) with ESMTP id r4KJNGXF032594 for ; Mon, 20 May 2013 15:23:16 -0400 (EDT) (envelope-from lidl@hydra.pix.net) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.8 at mail.pix.net Received: (from lidl@localhost) by hydra.pix.net (8.14.5/8.14.5/Submit) id r4KJNGnk032593 for freebsd-hackers@freebsd.org; Mon, 20 May 2013 15:23:16 -0400 (EDT) (envelope-from lidl) Date: Mon, 20 May 2013 15:23:16 -0400 From: Kurt Lidl To: freebsd-hackers@freebsd.org Subject: find -delete broken, or just used improperly? Message-ID: <20130520192316.GA32531@pix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 19:23:23 -0000 OK, maybe I'm missing something obvious, but... find(1) says: -delete Delete found files and/or directories. Always returns true. This executes from the current working directory as find recurses down the tree. It will not attempt to delete a filename with a ``/'' character in its pathname relative to ``.'' for security reasons. Depth-first traversal processing is implied by this option. Following symlinks is incompatible with this option. However, it fails even when the path is absolute: bhyve9# mkdir /tmp/foo bhyve9# find /tmp/foo -empty -delete find: -delete: /tmp/foo: relative path potentially not safe Shouldn't this work? I ran into this during a build of stable/9 with WITHOUT_SHAREDOCS set, which ultimately triggers this bit of /usr/src/Makefile.inc1: .for dist in ${EXTRA_DISTRIBUTIONS} find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete .endfor The actual observed failure is this: ===> etc/sendmail (distribute) cd /usr/src/etc/sendmail; make install -DNO_SUBDIR DESTDIR=/usr/obj/usr/src/release/dist/base SHARED=copies find //usr/obj/usr/src/release/dist/doc -empty -delete find: -delete: //usr/obj/usr/src/release/dist/doc: relative path potentially not safe *** [distributeworld] Error code 1 Stop in /usr/src. *** [distributeworld] Error code 1 Stop in /usr/src. *** [base.txz] Error code 1 Stop in /usr/src/release. *** [release] Error code 1 Stop in /usr/src/release. Thanks for any insight. -Kurt From owner-freebsd-hackers@FreeBSD.ORG Mon May 20 20:42:21 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF9F52F0; Mon, 20 May 2013 20:42:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id C2DC41889; Mon, 20 May 2013 20:42:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EC593B9A6; Mon, 20 May 2013 16:42:20 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Subject: Re: Adding a FOREACH_CONTINUE() variant to queue(3) Date: Mon, 20 May 2013 15:39:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <518092BF.9070105@freebsd.org> <5180AF55.5070000@freebsd.org> <5180C740.1060104@freebsd.org> In-Reply-To: <5180C740.1060104@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305201539.57848.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 20 May 2013 16:42:21 -0400 (EDT) Cc: Lawrence Stewart X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 20:42:22 -0000 On Wednesday, May 01, 2013 3:41:52 am Lawrence Stewart wrote: > On 05/01/13 15:59, Lawrence Stewart wrote: > > On 05/01/13 15:29, Poul-Henning Kamp wrote: > >> In message <518092BF.9070105@freebsd.org>, Lawrence Stewart writes: > >>> [reposting from freebsd-arch@ - was probably the wrong list] > >> > >>> #define TAILQ_FOREACH_CONTINUE(var, head, field) \ > >> > >> Obligatory bikeshedding: > >> > >> I find the suffix "_CONTINUE" non-obvious, as there may not have > >> been any previos FOREACH involved. > >> > >> TAILQ_FOREACH_FROM(...) ? > > > > Agreed. Thanks for the input. > > Here's an untested patch for consideration: > > http://people.freebsd.org/~lstewart/patches/misc/queue_foreach_from_10.x.r250136.patch > > I didn't do _SAFE variants as I don't have an immediate use for them. Looks ok to me. I agree with phk@ and prefer the _FROM name. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon May 20 21:47:47 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7BA45F3D for ; Mon, 20 May 2013 21:47:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 459371FA8 for ; Mon, 20 May 2013 21:47:47 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id BF09D1203CF; Mon, 20 May 2013 23:47:31 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 959BB28493; Mon, 20 May 2013 23:47:31 +0200 (CEST) Date: Mon, 20 May 2013 23:47:31 +0200 From: Jilles Tjoelker To: Kurt Lidl Subject: Re: find -delete broken, or just used improperly? Message-ID: <20130520214731.GA43407@stack.nl> References: <20130520192316.GA32531@pix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130520192316.GA32531@pix.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 May 2013 21:47:47 -0000 On Mon, May 20, 2013 at 03:23:16PM -0400, Kurt Lidl wrote: > OK, maybe I'm missing something obvious, but... > find(1) says: > -delete > Delete found files and/or directories. Always returns true. > This executes from the current working directory as find recurses > down the tree. It will not attempt to delete a filename with a > ``/'' character in its pathname relative to ``.'' for security > reasons. Depth-first traversal processing is implied by this > option. Following symlinks is incompatible with this option. > However, it fails even when the path is absolute: > bhyve9# mkdir /tmp/foo > bhyve9# find /tmp/foo -empty -delete > find: -delete: /tmp/foo: relative path potentially not safe > Shouldn't this work? The "relative path" refers to a pathname that contains a slash other than at the beginning or end and may therefore refer to somewhere else if a directory is concurrently replaced by a symlink. When -L is not specified and "." can be opened, the fts(3) code underlying find(1) is careful to avoid following symlinks or being dropped in different locations by moving the directory fts is currently traversing. If a problematic concurrent modification is detected, fts will not enter the directory or abort. Files found in the search are returned via the current working directory and a pathname not containing a slash. For paranoia, find(1) verifies this when -delete is used. However, it is too paranoid about the root of the traversal. It is already assumed that the initial pathname does not refer to directories or symlinks that might be replaced by untrusted users; otherwise, the whole traversal would be unsafe. Therefore, it is not necessary to do the check for fts_level == FTS_ROOTLEVEL. The below patch allows deleting the pathname given to find itself: Index: usr.bin/find/function.c =================================================================== --- usr.bin/find/function.c (revision 250661) +++ usr.bin/find/function.c (working copy) @@ -442,7 +442,8 @@ errx(1, "-delete: forbidden when symlinks are followed"); /* Potentially unsafe - do not accept relative paths whatsoever */ - if (strchr(entry->fts_accpath, '/') != NULL) + if (entry->fts_level > FTS_ROOTLEVEL && + strchr(entry->fts_accpath, '/') != NULL) errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Tue May 21 16:17:28 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04FC3FBC for ; Tue, 21 May 2013 16:17:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id CCBABBFD for ; Tue, 21 May 2013 16:17:27 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B5037B964; Tue, 21 May 2013 12:17:24 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Subject: Re: find -delete broken, or just used improperly? Date: Tue, 21 May 2013 11:06:39 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <20130520192316.GA32531@pix.net> <20130520214731.GA43407@stack.nl> In-Reply-To: <20130520214731.GA43407@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305211106.39313.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 21 May 2013 12:17:24 -0400 (EDT) Cc: Kurt Lidl , Jilles Tjoelker X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 16:17:28 -0000 On Monday, May 20, 2013 5:47:31 pm Jilles Tjoelker wrote: > On Mon, May 20, 2013 at 03:23:16PM -0400, Kurt Lidl wrote: > > OK, maybe I'm missing something obvious, but... > > > find(1) says: > > > -delete > > Delete found files and/or directories. Always returns true. > > This executes from the current working directory as find recurses > > down the tree. It will not attempt to delete a filename with a > > ``/'' character in its pathname relative to ``.'' for security > > reasons. Depth-first traversal processing is implied by this > > option. Following symlinks is incompatible with this option. > > > However, it fails even when the path is absolute: > > > bhyve9# mkdir /tmp/foo > > bhyve9# find /tmp/foo -empty -delete > > find: -delete: /tmp/foo: relative path potentially not safe > > > Shouldn't this work? > > The "relative path" refers to a pathname that contains a slash other > than at the beginning or end and may therefore refer to somewhere else > if a directory is concurrently replaced by a symlink. > > When -L is not specified and "." can be opened, the fts(3) code > underlying find(1) is careful to avoid following symlinks or being > dropped in different locations by moving the directory fts is currently > traversing. If a problematic concurrent modification is detected, fts > will not enter the directory or abort. Files found in the search are > returned via the current working directory and a pathname not containing > a slash. > > For paranoia, find(1) verifies this when -delete is used. However, it is > too paranoid about the root of the traversal. It is already assumed that > the initial pathname does not refer to directories or symlinks that > might be replaced by untrusted users; otherwise, the whole traversal > would be unsafe. Therefore, it is not necessary to do the check for > fts_level == FTS_ROOTLEVEL. > > The below patch allows deleting the pathname given to find itself: > > Index: usr.bin/find/function.c > =================================================================== > --- usr.bin/find/function.c (revision 250661) > +++ usr.bin/find/function.c (working copy) > @@ -442,7 +442,8 @@ > errx(1, "-delete: forbidden when symlinks are followed"); > > /* Potentially unsafe - do not accept relative paths whatsoever */ > - if (strchr(entry->fts_accpath, '/') != NULL) > + if (entry->fts_level > FTS_ROOTLEVEL && > + strchr(entry->fts_accpath, '/') != NULL) > errx(1, "-delete: %s: relative path potentially not safe", > entry->fts_accpath); I'm curious, how would you instruct a patched find to avoid deleteing the /tmp/foo directory (e.g. if you wanted this to be a job that pruned empty dirs from /tmp/foo but never pruned the directory itself). Would -mindepth 1 do it? (Just asking. I have also found this message annoying but most of the jobs I have seen it on probably don't want to delete the root path, just descendants.) -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue May 21 18:04:57 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2DB5CE63; Tue, 21 May 2013 18:04:57 +0000 (UTC) (envelope-from lidl@pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::3c]) by mx1.freebsd.org (Postfix) with ESMTP id 41AE9226; Tue, 21 May 2013 18:04:56 +0000 (UTC) Received: from torb.pix.net (torb.pix.net [IPv6:2001:470:e254:10:12dd:b1ff:febf:eca9]) (authenticated bits=0) by hydra.pix.net (8.14.5/8.14.5) with ESMTP id r4LI4tWL042392; Tue, 21 May 2013 14:04:55 -0400 (EDT) (envelope-from lidl@pix.net) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.8 at mail.pix.net Message-ID: <519BB747.8030107@pix.net> Date: Tue, 21 May 2013 14:04:55 -0400 From: Kurt Lidl User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin Subject: Re: find -delete broken, or just used improperly? References: <20130520192316.GA32531@pix.net> <20130520214731.GA43407@stack.nl> <201305211106.39313.jhb@freebsd.org> In-Reply-To: <201305211106.39313.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Jilles Tjoelker X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 18:04:57 -0000 On 5/21/13 11:06 AM, John Baldwin wrote: > On Monday, May 20, 2013 5:47:31 pm Jilles Tjoelker wrote: >> On Mon, May 20, 2013 at 03:23:16PM -0400, Kurt Lidl wrote: >>> OK, maybe I'm missing something obvious, but... >> >>> find(1) says: >> >>> -delete >>> Delete found files and/or directories. Always returns true. >>> This executes from the current working directory as find recurses >>> down the tree. It will not attempt to delete a filename with a >>> ``/'' character in its pathname relative to ``.'' for security >>> reasons. Depth-first traversal processing is implied by this >>> option. Following symlinks is incompatible with this option. >> >>> However, it fails even when the path is absolute: >> >>> bhyve9# mkdir /tmp/foo >>> bhyve9# find /tmp/foo -empty -delete >>> find: -delete: /tmp/foo: relative path potentially not safe >> >>> Shouldn't this work? >> >> The "relative path" refers to a pathname that contains a slash other >> than at the beginning or end and may therefore refer to somewhere else >> if a directory is concurrently replaced by a symlink. >> >> When -L is not specified and "." can be opened, the fts(3) code >> underlying find(1) is careful to avoid following symlinks or being >> dropped in different locations by moving the directory fts is currently >> traversing. If a problematic concurrent modification is detected, fts >> will not enter the directory or abort. Files found in the search are >> returned via the current working directory and a pathname not containing >> a slash. >> >> For paranoia, find(1) verifies this when -delete is used. However, it is >> too paranoid about the root of the traversal. It is already assumed that >> the initial pathname does not refer to directories or symlinks that >> might be replaced by untrusted users; otherwise, the whole traversal >> would be unsafe. Therefore, it is not necessary to do the check for >> fts_level == FTS_ROOTLEVEL. >> >> The below patch allows deleting the pathname given to find itself: >> >> Index: usr.bin/find/function.c >> =================================================================== >> --- usr.bin/find/function.c (revision 250661) >> +++ usr.bin/find/function.c (working copy) >> @@ -442,7 +442,8 @@ >> errx(1, "-delete: forbidden when symlinks are followed"); >> >> /* Potentially unsafe - do not accept relative paths whatsoever */ >> - if (strchr(entry->fts_accpath, '/') != NULL) >> + if (entry->fts_level > FTS_ROOTLEVEL && >> + strchr(entry->fts_accpath, '/') != NULL) >> errx(1, "-delete: %s: relative path potentially not safe", >> entry->fts_accpath); > > I'm curious, how would you instruct a patched find to avoid deleteing the > /tmp/foo directory (e.g. if you wanted this to be a job that pruned empty > dirs from /tmp/foo but never pruned the directory itself). Would -mindepth 1 > do it? (Just asking. I have also found this message annoying but most of > the jobs I have seen it on probably don't want to delete the root path, > just descendants.) Using "-mindepth 1" does indeed preserve the target directory. Without it, the target directory is removed if all the children files/directories are empty. I've just finished a complete build of a recent stable/9: make buildworld && make buildkernel && cd release && make release With WITHOUT_SHAREDOCS= set in my src.conf, and Jilles' patch to find, and the following patch to Makefile.inc1, it now builds a release properly. bhyve9# hg diff Makefile.inc1 diff -r ca8ef48b4ba6 Makefile.inc1 --- a/Makefile.inc1 Thu May 16 10:21:04 2013 -0400 +++ b/Makefile.inc1 Tue May 21 13:58:13 2013 -0400 @@ -754,7 +754,7 @@ ${IMAKEENV} rm -rf ${INSTALLTMP} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} - find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete + find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete .endfor .if defined(NO_ROOT) .for dist in base ${EXTRA_DISTRIBUTIONS} If one doesn't have the "-mindepth 1" in the find command, it will remove the usr/share/doc directory entirely, which will cause a failure later in the 'make release' target code... -Kurt From owner-freebsd-hackers@FreeBSD.ORG Wed May 22 02:50:08 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 43E8DF5B; Wed, 22 May 2013 02:50:08 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id CD36EF97; Wed, 22 May 2013 02:50:07 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 1BF337E81E; Wed, 22 May 2013 12:49:59 +1000 (EST) Message-ID: <519C3256.7020409@freebsd.org> Date: Wed, 22 May 2013 12:49:58 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130521 Thunderbird/17.0.6 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: zfsloader triggering reset when interacting with v86int() Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: dim@FreeBSD.org, avg@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 02:50:08 -0000 Hi all, I have an ageing Toshiba Portege R600 laptop (Intel ULV SU9400 1.4GHz Core2 CPU, 3GB RAM) running the latest v3.2 BIOS. I recently stuck a new Samsung 840 Pro 256GB SSD into it and decided to do my usual trick of dual booting Windows 7 and FreeBSD-on-ZFS-root. Windows 7 won't boot from a GPT scheme without a (U)EFI BIOS, so I had to use MBR + BSD labels for FreeBSD which I've never done before with ZFS. I followed the guide at [1] using the FreeBSD head r250260 snapshot from [2]. Rebooting into my newly configured FreeBSD slice from the boot0 F3 option, I'd see zfsloader start running and then the machine would reset. The last line flashed up on screen before the reset was something like "BIOS drive C:". With Andriy's (avg@) help, I went digging and traced the problem to zfsloader attempting to probe "disk0:" (floppy drive, though the machine doesn't have one physically). The code call path looks roughly like this with some functions omitted in the middle related to bios disk strategy. zfs_probe_dev -> open -> disk_open -> ptable_open -> ptblread -> -> bd_read -> bd_io -> bd_chs_io -> v86int() -> BOOM Turns out putting a simple printf above the call to v86int() resolved the problem and the system would progress to a successful boot. On a whim, I also tested adding an mfence above the call which also allowed the boot to complete successfully. Andriy also suggested I test his patch at [3] (applied to libi386/biosmem.c) which I did, but it did not fix the reset. After discussing further on IRC with Andriy (avg@) and Dimitry (dim@), it looked more like a case of BIOS-behaving-badly, so I went hunting and discovered that if I disabled "USB Floppy Emulation" (the only BIOS option related to floppies; defaults to enabled), the standard unmolested zfsloader would work fine. Re-enabling "USB Floppy Emulation" reliably triggers the zfsloader reset unless running my tweaked code. Two things fall out from my trip down this rabbit hole: 1. My BIOS is doing something nasty and/or stupid and I know how to work around it. Yay for me (although I should note that I was successfully running the regular non-ZFS loader previously without encountering this problem). 2. It would probably be sensible to avoid probing drives which have no possibility of being a ZFS candidate to minimise the chances of tickling BIOS bugs like the one I found. Andriy suggested only probing drives of a minimum size (128MB is mentioned at [4]). The problem is that to know the size of a disk you have to open it, and the open code path is what triggers the reset. I'm in well over my head here so I'm interested to hear thoughts on point 2 and/or any other theories about possible FreeBSD causes of the reset I'm seeing on the off chance my BIOS isn't actually at fault. Willing to test ideas/patches. Cheers, Lawrence [1] https://wiki.freebsd.org/RootOnZFS/ZFSBootPartition [2] http://mirror.aarnet.edu.au/pub/FreeBSD/snapshots/amd64/amd64/ISO-IMAGES/10.0/FreeBSD-10.0-CURRENT-amd64-20130505-r250260-release.iso [3] http://thread.gmane.org/gmane.os.freebsd.current/143966/focus=148879 [4] http://docs.oracle.com/cd/E19253-01/819-5461/setup-1/ From owner-freebsd-hackers@FreeBSD.ORG Wed May 22 13:06:07 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6098AF50; Wed, 22 May 2013 13:06:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 375AFEA4; Wed, 22 May 2013 13:06:07 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8546DB968; Wed, 22 May 2013 09:06:06 -0400 (EDT) From: John Baldwin To: Lawrence Stewart Subject: Re: zfsloader triggering reset when interacting with v86int() Date: Wed, 22 May 2013 09:02:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <519C3256.7020409@freebsd.org> In-Reply-To: <519C3256.7020409@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305220902.34716.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 22 May 2013 09:06:06 -0400 (EDT) Cc: freebsd-hackers@freebsd.org, dim@freebsd.org, avg@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 13:06:07 -0000 On Tuesday, May 21, 2013 10:49:58 pm Lawrence Stewart wrote: > Hi all, > > I have an ageing Toshiba Portege R600 laptop (Intel ULV SU9400 1.4GHz > Core2 CPU, 3GB RAM) running the latest v3.2 BIOS. I recently stuck a new > Samsung 840 Pro 256GB SSD into it and decided to do my usual trick of > dual booting Windows 7 and FreeBSD-on-ZFS-root. Windows 7 won't boot > from a GPT scheme without a (U)EFI BIOS, so I had to use MBR + BSD > labels for FreeBSD which I've never done before with ZFS. I followed the > guide at [1] using the FreeBSD head r250260 snapshot from [2]. > > Rebooting into my newly configured FreeBSD slice from the boot0 F3 > option, I'd see zfsloader start running and then the machine would > reset. The last line flashed up on screen before the reset was something > like "BIOS drive C:". > > With Andriy's (avg@) help, I went digging and traced the problem to > zfsloader attempting to probe "disk0:" (floppy drive, though the machine > doesn't have one physically). The code call path looks roughly like this > with some functions omitted in the middle related to bios disk strategy. > > zfs_probe_dev -> open -> disk_open -> ptable_open -> ptblread -> > -> bd_read -> bd_io -> bd_chs_io -> v86int() -> BOOM > > Turns out putting a simple printf above the call to v86int() resolved > the problem and the system would progress to a successful boot. On a > whim, I also tested adding an mfence above the call which also allowed > the boot to complete successfully. > > Andriy also suggested I test his patch at [3] (applied to > libi386/biosmem.c) which I did, but it did not fix the reset. > > After discussing further on IRC with Andriy (avg@) and Dimitry (dim@), > it looked more like a case of BIOS-behaving-badly, so I went hunting and > discovered that if I disabled "USB Floppy Emulation" (the only BIOS > option related to floppies; defaults to enabled), the standard > unmolested zfsloader would work fine. Re-enabling "USB Floppy Emulation" > reliably triggers the zfsloader reset unless running my tweaked code. > > Two things fall out from my trip down this rabbit hole: > > 1. My BIOS is doing something nasty and/or stupid and I know how to work > around it. Yay for me (although I should note that I was successfully > running the regular non-ZFS loader previously without encountering this > problem). > > 2. It would probably be sensible to avoid probing drives which have no > possibility of being a ZFS candidate to minimise the chances of tickling > BIOS bugs like the one I found. Andriy suggested only probing drives of > a minimum size (128MB is mentioned at [4]). The problem is that to know > the size of a disk you have to open it, and the open code path is what > triggers the reset. > > > I'm in well over my head here so I'm interested to hear thoughts on > point 2 and/or any other theories about possible FreeBSD causes of the > reset I'm seeing on the off chance my BIOS isn't actually at fault. > Willing to test ideas/patches. Can you try an older loader such as from 8.3 release before all the recent changes to rototill the disk partition code? Also, the BIOS "knows" which devices are floppies (0x00 - 0x7f) vs hard drives (0x80 - 0xff) and we should probably just not prove for ZFS on floppies. Of course, I think USB floppies might present themselves as hard drives. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed May 22 14:04:47 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx2.freebsd.org (mx2.FreeBSD.org [8.8.178.116]) by hub.freebsd.org (Postfix) with ESMTP id 7DC85669; Wed, 22 May 2013 14:04:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id CD95A2152; Wed, 22 May 2013 14:04:45 +0000 (UTC) Message-ID: <519CCFF1.1030209@FreeBSD.org> Date: Wed, 22 May 2013 18:02:25 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: zfsloader triggering reset when interacting with v86int() References: <519C3256.7020409@freebsd.org> <201305220902.34716.jhb@freebsd.org> In-Reply-To: <201305220902.34716.jhb@freebsd.org> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Lawrence Stewart , dim@freebsd.org, avg@freebsd.org, freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 14:04:47 -0000 On 22.05.2013 17:02, John Baldwin wrote: >> I'm in well over my head here so I'm interested to hear thoughts on >> point 2 and/or any other theories about possible FreeBSD causes of the >> reset I'm seeing on the off chance my BIOS isn't actually at fault. >> Willing to test ideas/patches. > > Can you try an older loader such as from 8.3 release before all the recent > changes to rototill the disk partition code? It will unable to boot fresh ZFS installation. > Also, the BIOS "knows" which devices are floppies (0x00 - 0x7f) vs hard drives > (0x80 - 0xff) and we should probably just not prove for ZFS on floppies. Yes, you can break into loader prompt and run lsdev command, hard disks names will be start from letter 'C'. -- -- WBR, Andrey V. Elsukov From owner-freebsd-hackers@FreeBSD.ORG Wed May 22 22:48:30 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A5151B7 for ; Wed, 22 May 2013 22:48:30 +0000 (UTC) (envelope-from noel.hunt@gmail.com) Received: from mail-wg0-x22d.google.com (mail-wg0-x22d.google.com [IPv6:2a00:1450:400c:c00::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 85FE8DB7 for ; Wed, 22 May 2013 22:48:29 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id n12so1815601wgh.24 for ; Wed, 22 May 2013 15:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=LQ60rs5M1fV0z/UNvbOU6eLZCJ5TzXX9GkJACWaN4Hk=; b=OB/0rvA4HoJSq2wVwaUxZivVn2WSptVqLVMwXiIYW7YHoxxwRVjYV3tqHtRx4XmzDT 2MGtcaECfvUxfdUoT1r9Lzc+mx+sOn7k6B454n8jP81T5DtBYcI3ATbrf/Rla8/sYD94 A6sF7thXnFA4sBEdmDM4PKvxPJ2Z6c2z+tHJ00obdfjjGxk33jEjMckXxVgzZr0qLGiF G1z+leE1bty91HCj3mLiSN1y+WmMCQdtXfptE8RHzTeJe0s2FuwiPJ/VXxOV/cf8Dt/D kMurDUXfueZs99087gVSonLSafl1456JXy+rpaz8xt3nnvnzpOPApfduca3dB5+Itxnk jWXg== MIME-Version: 1.0 X-Received: by 10.180.9.238 with SMTP id d14mr38059647wib.18.1369262908564; Wed, 22 May 2013 15:48:28 -0700 (PDT) Received: by 10.180.145.7 with HTTP; Wed, 22 May 2013 15:48:28 -0700 (PDT) Date: Thu, 23 May 2013 08:48:28 +1000 Message-ID: Subject: signal vs. sigaction and SIGCHLD From: Noel Hunt To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 22:48:30 -0000 I have a small test program which simply forks and execs its command line arguments, but after the fork and before the exec, it sends a SIGSTOP to the child. The parent then sleeps for 3 seconds before exiting. However, a signal handler for SIGCHLD has been installed and I was expecting the parent to be notified of the SIGSTOP sent to the child, but with the `signal' interface this doesn't appear to work. If I change the code to use `sigaction' and `sigprocmask' (to unblock any blocked SIGCHLD), this program works the way intended, that is, the signal handler is called: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 #define SIGACTION 11 12 static void waithandler(int i){ 13 int pid, cursig; 14 int tstat; 15 16 #ifdef SIGACTION 17 pid = waitpid(-1, &tstat, WUNTRACED); 18 #else 19 pid = wait(&tstat); 20 signal(SIGCHLD, waithandler); 21 #endif 22 if (pid < 0) 23 return; 24 25 printf("waithandler: child (%d)", pid); 26 if (WIFSTOPPED(tstat)) { 27 printf(" received"); 28 cursig = WSTOPSIG(tstat); 29 if (cursig == SIGSTOP) 30 printf(" SIGSTOP\n"); 31 else if (cursig == SIGTRAP) 32 printf(" SIGTRAP\n"); 33 else 34 printf(" %d\n", cursig); 35 } else { 36 printf(" exited status=%d\n", WEXITSTATUS(tstat)); 37 } 38 } 39 40 main(int argc, char **argv){ 41 int i, j; 42 int fd, hangpid; 43 FILE *ttyerr; 44 char ctl[16]; 45 #ifdef SIGACTION 46 sigset_t sigmask[2]; 47 struct sigaction sa; 48 49 sa.sa_flags = 0; 50 sigemptyset(&sa.sa_mask); 51 sa.sa_handler = waithandler; 52 sigaction(SIGCHLD, &sa, NULL); 53 sigemptyset(&sigmask[0]); 54 sigaddset(&sigmask[0], SIGCHLD); 55 sigprocmask(SIG_UNBLOCK, &sigmask[0], &sigmask[1]); 56 #else 57 58 signal(SIGCHLD, waithandler); 59 #endif 60 ttyerr = fopen("/dev/tty", "w"); 61 if (argc <= 1) { 62 if( ttyerr ) 63 fprintf(ttyerr,"Usage: %s cmd [args...]\n",argv[0],*argv); 64 exit(1); 65 } 66 if( (hangpid=fork())==0 ){ 67 kill(getpid(), SIGSTOP); 68 execvp(argv[1], argv+1); 69 perror(argv[1]); 70 exit(1); 71 } 72 if(hangpid==-1){ 73 perror("fork"); 74 exit(1); 75 } 76 if( ttyerr ){ 77 fprintf(ttyerr,"/proc/%d\n",hangpid); 78 fclose(ttyerr); 79 } 80 sleep(3); 81 } The file is `hang.c'. I compile and run it like this: % ./hang echo foo bar baz waithandler: child (2280) received SIGSTOP /proc/2280 If I recompile with `#undef SIGACTION', waithandler is not called. I should add that even with the sigaction(2) interface, without the `sigprocmask' call, it still doesn't work, which suggests that SIGCHLD is being blocked. I understand that the default action upon receipt of SIGCHLD is `discard signal', but I would expect that the very act of installing a handler with `signal(SIGCHLD, waithandler)' would prevent the signal from being ignored. Can anyone explain what is going on here? From owner-freebsd-hackers@FreeBSD.ORG Wed May 22 23:09:47 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2925F84C for ; Wed, 22 May 2013 23:09:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-x22f.google.com (mail-we0-x22f.google.com [IPv6:2a00:1450:400c:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id B669EE60 for ; Wed, 22 May 2013 23:09:46 +0000 (UTC) Received: by mail-we0-f175.google.com with SMTP id p60so1763407wes.34 for ; Wed, 22 May 2013 16:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=pe2xjxp1FDyE9ZupIxApqc4AH6EpgQWgslBrj8OvYGM=; b=yiSMQWXwU9fkC3LlCtSfV1ImJZ08eyg/49s1XX4rceIlxxaKYhc/UQY/jIowQKcQSX pUdAe4ych/Z39/X+/0gcL68qo7WSMJhWAtnNGjovc1tPrz22/tMswJAJHRgGMl43fPkr 11ah1Cj/Aj1x2byigqqcvwN2F5PqCVoR4wew5cXFvUdLAIuz+BPzfgWhy87GHk0BVWdG bDFyd2EiOajXT353dt9HmP2De3rpoaK694V+um343Cg3nMsx0k4pNDsUybM2cVyf33HE fUDl0aGfS0DftFfvQSR3ediuriWOBq0nlUVVl55tGEDwOC6ZY3RZcSQfA/UeoFT4C9xy 6kyA== X-Received: by 10.180.79.40 with SMTP id g8mr19092012wix.3.1369264185946; Wed, 22 May 2013 16:09:45 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fp16sm13997492wic.6.2013.05.22.16.09.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 22 May 2013 16:09:44 -0700 (PDT) Date: Thu, 23 May 2013 01:09:40 +0200 From: Mateusz Guzik To: Noel Hunt Subject: Re: signal vs. sigaction and SIGCHLD Message-ID: <20130522230940.GA19960@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Noel Hunt , freebsd-hackers@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 23:09:47 -0000 On Thu, May 23, 2013 at 08:48:28AM +1000, Noel Hunt wrote: > I have a small test program which simply forks and execs > its command line arguments, but after the fork and before > the exec, it sends a SIGSTOP to the child. The parent then > sleeps for 3 seconds before exiting. However, a signal > handler for SIGCHLD has been installed and I was expecting > the parent to be notified of the SIGSTOP sent to the child, > but with the `signal' interface this doesn't appear to work. > > If I change the code to use `sigaction' and `sigprocmask' > (to unblock any blocked SIGCHLD), this program works the > way intended, that is, the signal handler is called: > > 12 static void waithandler(int i){ > 13 int pid, cursig; > 14 int tstat; > 15 > 16 #ifdef SIGACTION > 17 pid = waitpid(-1, &tstat, WUNTRACED); > 18 #else > 19 pid = wait(&tstat); > 20 signal(SIGCHLD, waithandler); You wait differently in case both cases. wait(2) waits for any child to exit, which clearly is not happening here. If you perform the same waitpid in both cases it should work fine. > If I recompile with `#undef SIGACTION', waithandler is not > called. > As noted earlier it is called. You can easly check that by printfing something at the beginning. > I should add that even with the sigaction(2) interface, without > the `sigprocmask' call, it still doesn't work, which suggests > that SIGCHLD is being blocked. > It could be that inherited signal mask blocks it. -- Mateusz Guzik From owner-freebsd-hackers@FreeBSD.ORG Thu May 23 18:04:22 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E833B607 for ; Thu, 23 May 2013 18:04:22 +0000 (UTC) (envelope-from lsanfil@marvell.com) Received: from na3sys009aog131.obsmtp.com (na3sys009aog131.obsmtp.com [74.125.149.247]) by mx1.freebsd.org (Postfix) with ESMTP id B0EB06B6 for ; Thu, 23 May 2013 18:04:22 +0000 (UTC) Received: from SC-OWA01.marvell.com ([199.233.58.136]) (using TLSv1) by na3sys009aob131.postini.com ([74.125.148.12]) with SMTP ID DSNKUZ5aH60FdDaApMLkZfmuJnxRaOan+bzG@postini.com; Thu, 23 May 2013 11:04:22 PDT Received: from SC-VEXCH4.marvell.com ([0000:0000:0000:0000:0000:0000:0.0.0.1]) by SC-OWA01.marvell.com ([10.93.76.21]) with mapi; Thu, 23 May 2013 11:00:21 -0700 From: Lino Sanfilippo To: Hackers freeBSD Date: Thu, 23 May 2013 11:00:16 -0700 Subject: Low Tx-Rx performance with 10Gb NICs Thread-Topic: Low Tx-Rx performance with 10Gb NICs Thread-Index: Ac5X32GSZCFCGAkmTY2F8befgEbjIw== Message-ID: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: At8Q BVoP Bxxx COw2 C133 C2/D C85l FVks GDzM Gvv3 IQnL IRq5 KBPG KWis K145 LLM/; 1; ZgByAGUAZQBiAHMAZAAtAGgAYQBjAGsAZQByAHMAQABmAHIAZQBlAGIAcwBkAC4AbwByAGcA; Sosha1_v1; 7; {2BF2B9B9-7DE6-4C06-9E37-1A4D0A4BEA20}; bABzAGEAbgBmAGkAbABAAG0AYQByAHYAZQBsAGwALgBjAG8AbQA=; Thu, 23 May 2013 18:00:16 GMT; TABvAHcAIABUAHgALQBSAHgAIABwAGUAcgBmAG8AcgBtAGEAbgBjAGUAIAB3AGkAdABoACAAMQAwAEcAYgAgAE4ASQBDAHMA x-cr-puzzleid: {2BF2B9B9-7DE6-4C06-9E37-1A4D0A4BEA20} acceptlanguage: de-DE, en-US MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Axel Fischer , Ralf Assmann , Markus Althoff X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 18:04:23 -0000 Hi all, I am currently doing some performance tests with 10Gb NICs and encounter a = strange behavior in case when I do Rx and Tx at the same time: while the Rx rate stays more = or less stable (almost the same that I see with only Rx traffic) the Tx rate breaks down = drastically. The tests are done with netperf (4 TCP streams for Rx and Tx respectively),= the test machine is an Intel i7 (with HT 8 cores at 3,4 GHz) with 16GB RAM running 32 bit FreeB= SD 9.0 with default system settings. The results are like the following: TX Only: 2290.32 Mb/s Port=3D1001 TX 2357.73 Mb/s Port=3D1002 TX 2340.08 Mb/s Port=3D1003 TX 2382.87 Mb/s Port=3D1004 TX TX Total Result: Mb/s 9371 RX Only: 1257.43 Mb/s Port=3D1001 RX 1901.75 Mb/s Port=3D1002 RX 2605.19 Mb/s Port=3D1003 RX 1986.69 Mb/s Port=3D1004 RX RX Total Result: Mb/s 7751.06 Rx+TX: 251.11 Mb/s Port=3D1001 TX 3069.74 Mb/s Port=3D2001 RX 178.35 Mb/s Port=3D1002 TX 1118.30 Mb/s Port=3D2002 RX 138.05 Mb/s Port=3D1003 TX 1661.22 Mb/s Port=3D2003 RX 129.23 Mb/s Port=3D1004 TX 1851.75 Mb/s Port=3D2004 RX RX+TX Total Result: Mb/s 8397.75 While the results for Tx and Rx are similar to what I get on Linux, the results for Tx+Rx are not. On Linux I see total rates of about 15-18 Gb= /s. I expected to see the same on FreeBSD and I wonder why I do not. The result= s are quite the same for Intel, Broadcom and Marvell NICs, so I suspect the c= ause to be in the protocol stack rather than in the drivers. Is there a known issue concerning high traffic on Tx and Rx paths? Are the= re any system settings I could adjust to get the expected performance? Any hints are very= appreciated. Regards, Lino From owner-freebsd-hackers@FreeBSD.ORG Thu May 23 18:21:49 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E80A31D for ; Thu, 23 May 2013 18:21:49 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 34CC78B2 for ; Thu, 23 May 2013 18:21:49 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id 16so9795917iea.3 for ; Thu, 23 May 2013 11:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=n7Dq/p5YvMQsOuQSnaM8V/V62CN+MoJc3HqQfPgZeKk=; b=rqxjB9WaV0jjZ7TcXyifueTVxIAtB7isG92CpfgN1EMVXL5vH5eTehaxzeNsl+Z6g4 9HbCu75WCaOLdY69tj+gf2g6bLgREXf9myQPG6kercwHK0194JYVAa7m68Ijec18kB8t EYINE9bvTOSBVu9o8A3epwy+ElDNWjIPcjSQmo6S1W7325Ks1HmK0YZB7HPfsCf6gyMx +6bnT/g3yzbwaxn5WEYkkZxTB4qsOlgG8nLkMDUyPO+gtdKuwGWQ9eeDuyTaGOQ+MXln z0sge2gx7bF5+ZjJd24U+kjlnyh6TK6RLSU9BVG7l2tx4Xy64YEGUBXJmhlfQK3RckiV YJmA== X-Received: by 10.42.47.77 with SMTP id n13mr10348190icf.12.1369333308928; Thu, 23 May 2013 11:21:48 -0700 (PDT) MIME-Version: 1.0 Sender: mozolevsky@gmail.com Received: by 10.64.143.133 with HTTP; Thu, 23 May 2013 11:21:08 -0700 (PDT) In-Reply-To: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> References: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> From: Igor Mozolevsky Date: Thu, 23 May 2013 19:21:08 +0100 X-Google-Sender-Auth: F3_2Ts6rk1-g928ZZeoBPqxI_xk Message-ID: Subject: Re: Low Tx-Rx performance with 10Gb NICs To: Lino Sanfilippo Content-Type: text/plain; charset=UTF-8 Cc: Hackers freeBSD , Axel Fischer , Ralf Assmann , Markus Althoff X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 May 2013 18:21:49 -0000 On 23 May 2013 19:00, Lino Sanfilippo wrote: > Is there a known issue concerning high traffic on Tx and Rx paths? Are there any system > settings I could adjust to get the expected performance? Any hints are very appreciated. check your ierrs and oerrs: netstat -s 1, I've noticed I'm getting ierrs on em chips, but none on fxp chips (connected to the same wire/switch); might be unrelated to yours, but worth a check... -- Igor M. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 00:50:34 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8722E5B7 for ; Fri, 24 May 2013 00:50:34 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9D1B66 for ; Fri, 24 May 2013 00:50:34 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 642B67E81E; Fri, 24 May 2013 10:50:33 +1000 (EST) Message-ID: <519EB958.8050207@freebsd.org> Date: Fri, 24 May 2013 10:50:32 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130521 Thunderbird/17.0.6 MIME-Version: 1.0 To: Computer Network Man Subject: Re: A problem with alq module! References: <5193511D.8030503@freebsd.org> <5193519A.8030303@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 00:50:34 -0000 On 05/23/13 17:03, Computer Network Man wrote: > Dear Lawrence; > Wow! many thanks for your patch. We tested and it worked and solved our > problem. Committed. Thanks for the bug report and for testing the patch. Cheers, Lawrence From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 07:34:13 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52679FC2 for ; Fri, 24 May 2013 07:34:13 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [188.252.31.196]) by mx1.freebsd.org (Postfix) with ESMTP id B54962AC for ; Fri, 24 May 2013 07:34:12 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6) with ESMTP id r4O7XtAP014136 for ; Fri, 24 May 2013 09:33:55 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6/Submit) with ESMTP id r4O7Xt3H014133 for ; Fri, 24 May 2013 09:33:55 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 24 May 2013 09:33:55 +0200 (CEST) From: Wojciech Puchar To: freebsd-hackers@freebsd.org Subject: stupid question about sendmail Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 24 May 2013 09:33:56 +0200 (CEST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 07:34:13 -0000 how to redirect recipient address. i mean - if someone try to send to x@y.pl from serwer then it should be redirected to local account, while the rest of mails to domain @y.pl should get out normally. alternatively outgoing mail to x@y.pl should be rejected. tried access.db - To:x@y.pl REJECT doesn't work any idea. thank you From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 07:37:26 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3B3D272 for ; Fri, 24 May 2013 07:37:26 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x22c.google.com (mail-ie0-x22c.google.com [IPv6:2607:f8b0:4001:c03::22c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB7C2D5 for ; Fri, 24 May 2013 07:37:26 +0000 (UTC) Received: by mail-ie0-f172.google.com with SMTP id 16so11426906iea.31 for ; Fri, 24 May 2013 00:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=oHcL6k/wEr2AQJBJ6coAkZI9jls/97wTP8NkgqHkr5k=; b=HYHpU68twt1i/dWogBcJ6O2RLmxmvpa6zKBg+JKZGMdS+f2cFOiOwCQ6v7e+DxSu38 mSBAmXK9J0l6Nt1sYLA66xU/QIX8CJJ/GocJJ1L4UnvjO3rOHlJV4BwZh4egsFwO9PDO sy+pWDdN7fHaow99WGYWwg5dBac0HERtAaXzM4eAeBDL+s9H5EbRp+lQBTBAUacSTCoP FJ1JyBGhJT9mmgCLfo1RIN5nd6qwjGSaMehMkqyPcpNbRqxBk99dSBQqnzwcM4DTIcdy GiEmUf76wiBiGs943MN5uMr8MoyDZotiDGu6zo98zIMyzkU77i/a6xPy6wtsHYliTN+l UmVA== MIME-Version: 1.0 X-Received: by 10.50.153.113 with SMTP id vf17mr3023864igb.101.1369381046335; Fri, 24 May 2013 00:37:26 -0700 (PDT) Received: by 10.64.23.243 with HTTP; Fri, 24 May 2013 00:37:25 -0700 (PDT) Received: by 10.64.23.243 with HTTP; Fri, 24 May 2013 00:37:25 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 May 2013 08:37:25 +0100 Message-ID: Subject: Re: stupid question about sendmail From: Chris Rees To: Wojciech Puchar Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 07:37:26 -0000 On 24 May 2013 08:34, "Wojciech Puchar" wrote: > > how to redirect recipient address. i mean - if someone try to send to x@y.pl from serwer then it should be redirected to local account, while the rest of mails to domain @y.pl should get out normally. > > alternatively outgoing mail to x@y.pl should be rejected. > > > tried access.db - > > To:x@y.pl REJECT > > doesn't work > > > any idea. thank you Try a sendmail list? Chris From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 07:37:47 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2B52E364 for ; Fri, 24 May 2013 07:37:47 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id 9C59F2F0 for ; Fri, 24 May 2013 07:37:46 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.7/8.14.7) with ESMTP id r4O7biw6079586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 May 2013 09:37:44 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.7/8.14.7/Submit) with ESMTP id r4O7biIk079583; Fri, 24 May 2013 09:37:44 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Fri, 24 May 2013 09:37:44 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: Wojciech Puchar Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-550610177-1369381064=:72982" X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 07:37:47 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-550610177-1369381064=:72982 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Fri, 24 May 2013 09:33+0200, Wojciech Puchar wrote: > how to redirect recipient address. i mean - if someone try to send to x@y.pl > from serwer then it should be redirected to local account, while the rest of > mails to domain @y.pl should get out normally. > > alternatively outgoing mail to x@y.pl should be rejected. > > tried access.db - > > To:x@y.pl REJECT > > doesn't work > > any idea. thank you Don't use /etc/mail/access, use /etc/mail/aliases. E.g.: x: /dev/null -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --2055831798-550610177-1369381064=:72982-- From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 07:56:41 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0F183CB3 for ; Fri, 24 May 2013 07:56:41 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [188.252.31.196]) by mx1.freebsd.org (Postfix) with ESMTP id 5F78162B for ; Fri, 24 May 2013 07:56:40 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6) with ESMTP id r4O7tQBn014233; Fri, 24 May 2013 09:55:26 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6/Submit) with ESMTP id r4O7tQRp014230; Fri, 24 May 2013 09:55:26 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 24 May 2013 09:55:26 +0200 (CEST) From: Wojciech Puchar To: =?ISO-8859-15?Q?Trond_Endrest=F8l?= Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: 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 passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 24 May 2013 09:55:26 +0200 (CEST) Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 07:56:41 -0000 >> >> To:x@y.pl REJECT >> >> doesn't work >> >> any idea. thank you > > Don't use /etc/mail/access, use /etc/mail/aliases. > > E.g.: > > x: /dev/null x is NOT on my server. it will not work. all i want is when someone send a mail from my server to x@y.pl (which is someone else domain) it will not get there and be blocked or redirected From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 08:19:40 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A69FA80E for ; Fri, 24 May 2013 08:19:40 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id 200BC801 for ; Fri, 24 May 2013 08:19:39 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.7/8.14.7) with ESMTP id r4O8JYu4079891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 May 2013 10:19:34 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.7/8.14.7/Submit) with ESMTP id r4O8JYhD079888; Fri, 24 May 2013 10:19:34 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Fri, 24 May 2013 10:19:34 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: Wojciech Puchar Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-1415850095-1369383574=:72982" X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 08:19:40 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-1415850095-1369383574=:72982 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Fri, 24 May 2013 09:55+0200, Wojciech Puchar wrote: > > > > > > To:x@y.pl REJECT > > > > > > doesn't work > > > > > > any idea. thank you > > > > Don't use /etc/mail/access, use /etc/mail/aliases. > > > > E.g.: > > > > x: /dev/null > > x is NOT on my server. it will not work. > > all i want is when someone send a mail from my server to x@y.pl (which is > someone else domain) it will not get there and be blocked or redirected My bad, take a look at the /etc/mail/genericstable file: http://www.sendmail.com/sm/open_source/docs/m4/features.html Maybe a line like this one will help you achieve your goal: jax@bar.com error:5.7.0:550 Address invalid -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --2055831798-1415850095-1369383574=:72982-- From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 08:59:58 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D5F4A4A8 for ; Fri, 24 May 2013 08:59:58 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA15AAC for ; Fri, 24 May 2013 08:59:57 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.7/8.14.7) with ESMTP id r4O8xsAS080233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 May 2013 10:59:54 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.7/8.14.7/Submit) with ESMTP id r4O8xsqv080230; Fri, 24 May 2013 10:59:54 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Fri, 24 May 2013 10:59:54 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: Wojciech Puchar Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="2055831798-1415850095-1369383574=:72982" Content-ID: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 08:59:58 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-1415850095-1369383574=:72982 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: On Fri, 24 May 2013 10:19+0200, Trond Endrestøl wrote: > My bad, take a look at the /etc/mail/genericstable file: > > http://www.sendmail.com/sm/open_source/docs/m4/features.html > > Maybe a line like this one will help you achieve your goal: > > jax@bar.com error:5.7.0:550 Address invalid I was wrong again, sorry, but I believe I got it right this time: 1. Edit the /etc/mail/access file. 2. Insert a line like this one: To:mailbox@some.domain.tld REJECT 3. Save the /etc/mail/access file. 4. Change to the /etc/mail directory if not already there. 5. Run the make command to update the /etc/mail/access.db. 6. Try to send email to the blacklisted recipient. 7. If successful, the sender should recieve: reason: 550 5.2.1 ... Mailbox disabled for this recipient -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --2055831798-1415850095-1369383574=:72982-- From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:04:36 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97EF7EAE for ; Fri, 24 May 2013 10:04:36 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [188.252.31.196]) by mx1.freebsd.org (Postfix) with ESMTP id 213068A for ; Fri, 24 May 2013 10:04:35 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6) with ESMTP id r4OA3JA1002181; Fri, 24 May 2013 12:03:19 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6/Submit) with ESMTP id r4OA3JBv002178; Fri, 24 May 2013 12:03:19 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 24 May 2013 12:03:19 +0200 (CEST) From: Wojciech Puchar To: =?ISO-8859-15?Q?Trond_Endrest=F8l?= Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: 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 passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 24 May 2013 12:03:19 +0200 (CEST) Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:04:36 -0000 >> all i want is when someone send a mail from my server to x@y.pl (which is >> someone else domain) it will not get there and be blocked or redirected > > My bad, take a look at the /etc/mail/genericstable file: > > http://www.sendmail.com/sm/open_source/docs/m4/features.html > > Maybe a line like this one will help you achieve your goal: > > jax@bar.com error:5.7.0:550 Address invalid > i tried it. maybe i do something wrong but tried on my home server wojtek@3miasto.net.pl error:5.7.0:550 Address invalid (TAB separates fields) in /etc/mail/genericstable and FEATURE(`genericstable') in wojtek.tensor.gdynia.pl.mc did make make install /etc/rc.d/sendmail restart and tried to send mail to wojtek@3miasto.net.pl mail is not blocked any more ideas? thank you! From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:04:59 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 145E5F9A for ; Fri, 24 May 2013 10:04:59 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [188.252.31.196]) by mx1.freebsd.org (Postfix) with ESMTP id 9028697 for ; Fri, 24 May 2013 10:04:58 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6) with ESMTP id r4OA3cMp002187; Fri, 24 May 2013 12:03:38 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6/Submit) with ESMTP id r4OA3co2002184; Fri, 24 May 2013 12:03:38 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 24 May 2013 12:03:38 +0200 (CEST) From: Wojciech Puchar To: =?ISO-8859-15?Q?Trond_Endrest=F8l?= Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: 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 passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 24 May 2013 12:03:38 +0200 (CEST) Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:04:59 -0000 >> >> http://www.sendmail.com/sm/open_source/docs/m4/features.html >> >> Maybe a line like this one will help you achieve your goal: >> >> jax@bar.com error:5.7.0:550 Address invalid > > I was wrong again, sorry, but I believe I got it right this time: > > 1. Edit the /etc/mail/access file. > > 2. Insert a line like this one: > > To:mailbox@some.domain.tld REJECT tried too. doesn't work. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:16:27 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C415E89E for ; Fri, 24 May 2013 10:16:27 +0000 (UTC) (envelope-from prvs=8498cab4e=welcomet@amazon.com) Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id 63D72173 for ; Fri, 24 May 2013 10:16:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=welcomet@amazon.com; q=dns/txt; s=amazon201209; t=1369390587; x=1400926587; h=from:to:subject:date:message-id:mime-version; bh=ZCqhtu3DAra6F8Z7l8wf5mvdzXhmnbQFmW85qsOEdeI=; b=jD/iDmdsyDRBEP/mSCeA/T6L90u0DnSqHkTrXZ/1I2PxGJzXDjpsVfwz c2FoUfp4/i4w0ChrXy8ZAxSGALtNmdYlbIWQg0Ugx35S9Tz1buDdClb9f euUE73M2WX1FW4KR1AWzpH9wByisgAa/NhbFOuJhexOvqCAp4QPqAmh7X o=; X-IronPort-AV: E=Sophos;i="4.87,734,1363132800"; d="scan'208,217";a="566927361" Received: from smtp-in-9002.sea19.amazon.com ([10.186.174.20]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 May 2013 10:16:25 +0000 Received: from ex10-hub-14001.ant.amazon.com (ex10-hub-14001.ant.amazon.com [10.36.60.87]) by smtp-in-9002.sea19.amazon.com (8.13.8/8.13.8) with ESMTP id r4OAF3pb006038 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK) for ; Fri, 24 May 2013 10:16:24 GMT Received: from EX10-MBX-14001.ant.amazon.com ([fe80::b957:af21:f5bc:52d1]) by ex10-hub-14001.ant.amazon.com ([::1]) with mapi id 14.02.0247.003; Fri, 24 May 2013 03:15:24 -0700 From: "Welcome, Traiano" To: "freebsd-hackers@freebsd.org" Subject: Writing a (BSD like) Operating Systems From Scratch Thread-Topic: Writing a (BSD like) Operating Systems From Scratch Thread-Index: Ac5YY10UujfiegY2TwCTmdycZz/xLQ== Date: Fri, 24 May 2013 10:15:23 +0000 Message-ID: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.36.9.182] MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:16:27 -0000 Hi All I've been read thousands of pages of FreeBSD and Linux Kernel source code a= nd books on the internals of BSD and Linux over the years in attempt to dev= elop a complete understanding of operating systems (or at least, UNIX like = ones). However, I feel that I'm as mystified as to the finer details as whe= n I first started. So I've concluded that the best way to really understand= the deep dark details of UNIX is to try and write one from scratch (using = the general guidelines of standards like POSIX etc ...), and maybe taking a= peek at BSD and Linux from time to time. My questions around this are: a) What kind of hardware (processor) would I use as a development plat= form, given the requirements of cheap, well documented, easily obtainable,= easy to debug etc ... I believe the hardware platform chosen should satisf= y the following requirements: - Cheap and relatively commodity (easy to get hold of) - Well documented architecture and API (there's a nice assembly la= nguage for it) - Supports single and multi-core multi-tasking, memory management b) Are there recommended books or other resources that "hand hold" one= through the process of implementing a "toy operating system" , that are: - Current, circa 2011 - 2013 - For hardware that meets the characteristics of a) above - Offer a simple start from the very basics of operating system de= sign and implementation to the gory details c) What would be the best practical entry point design and implementa= tion of operating systems? E.g should I begin with studying the assembly la= nguage for a chosen hardware platform first, then move on to booting someth= ing of memory, or should I start with the high level architectural details= of the O.S ? Many thanks in Advance for your thoughts! Traiano Welcome From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:24:27 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E571FC97; Fri, 24 May 2013 10:24:27 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id AE1231E5; Fri, 24 May 2013 10:24:27 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 7358F1203CF; Fri, 24 May 2013 12:24:11 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5CA7028493; Fri, 24 May 2013 12:24:11 +0200 (CEST) Date: Fri, 24 May 2013 12:24:11 +0200 From: Jilles Tjoelker To: John Baldwin Subject: Re: find -delete broken, or just used improperly? Message-ID: <20130524102411.GA3984@stack.nl> References: <20130520192316.GA32531@pix.net> <20130520214731.GA43407@stack.nl> <201305211106.39313.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305211106.39313.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Kurt Lidl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:24:28 -0000 On Tue, May 21, 2013 at 11:06:39AM -0400, John Baldwin wrote: > On Monday, May 20, 2013 5:47:31 pm Jilles Tjoelker wrote: > > The below patch allows deleting the pathname given to find itself: > > Index: usr.bin/find/function.c > > =================================================================== > > --- usr.bin/find/function.c (revision 250661) > > +++ usr.bin/find/function.c (working copy) > > @@ -442,7 +442,8 @@ > > errx(1, "-delete: forbidden when symlinks are followed"); > > > > /* Potentially unsafe - do not accept relative paths whatsoever */ > > - if (strchr(entry->fts_accpath, '/') != NULL) > > + if (entry->fts_level > FTS_ROOTLEVEL && > > + strchr(entry->fts_accpath, '/') != NULL) > > errx(1, "-delete: %s: relative path potentially not safe", > > entry->fts_accpath); > I'm curious, how would you instruct a patched find to avoid deleteing > the /tmp/foo directory (e.g. if you wanted this to be a job that > pruned empty dirs from /tmp/foo but never pruned the directory > itself). Would -mindepth 1 do it? (Just asking. I have also found > this message annoying but most of the jobs I have seen it on probably > don't want to delete the root path, just descendants.) -mindepth 1 works, as does cd /tmp/foo && find . -... (-delete silently ignores . and ..). -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:31:19 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5154B5 for ; Fri, 24 May 2013 10:31:19 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [IPv6:2607:f8b0:4001:c03::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 7859C246 for ; Fri, 24 May 2013 10:31:19 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id aq17so11754470iec.15 for ; Fri, 24 May 2013 03:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ny5S0e7il4pLF5vcLBUjXwhG3VsibQxCnUQ34ycOuw0=; b=ktxjFBQrrcJKQsXdf0FgAV69SDjYCgWRUdn7XALpN48v4EfnDX+Si2Ymo9li3gmE4F FEWrkCjD8abzBSgrdUcp+nsst1JVUZHbHdKSamD7nH2sZGbKm9niigFgOTI0GWsjJChe J3N/xSB5HatmZzEwflHkjBWJgXqm2r9QADMa2Cx/w7px5OD5b6UE85l6oRtSiGvZ7g+s nYe/XQE6wXs02/RIMVX+ZQNkhlJGPpN7miP4eUH1HvhbGxxVtoA/gkeyUGhPPYI/mJDF 7fmhEmiwwVo+421hkOOYTwxmFDj4z4w10X0qx2uzVxRL3ETh/ejLR/aoiI/pLxtnNVX7 CD+A== MIME-Version: 1.0 X-Received: by 10.50.118.69 with SMTP id kk5mr2085681igb.36.1369391479156; Fri, 24 May 2013 03:31:19 -0700 (PDT) Received: by 10.64.23.243 with HTTP; Fri, 24 May 2013 03:31:19 -0700 (PDT) Received: by 10.64.23.243 with HTTP; Fri, 24 May 2013 03:31:19 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 May 2013 11:31:19 +0100 Message-ID: Subject: Re: stupid question about sendmail From: Chris Rees To: Wojciech Puchar Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-hackers@freebsd.org, =?ISO-8859-1?Q?Trond_Endrest=F8l?= X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:31:19 -0000 On 24 May 2013 11:05, "Wojciech Puchar" wrote: >>> >>> >>> http://www.sendmail.com/sm/open_source/docs/m4/features.html >>> >>> Maybe a line like this one will help you achieve your goal: >>> >>> jax@bar.com error:5.7.0:550 Address invalid >> >> >> I was wrong again, sorry, but I believe I got it right this time: >> >> 1. Edit the /etc/mail/access file. >> >> 2. Insert a line like this one: >> >> To:mailbox@some.domain.tld REJECT > > > tried too. > > doesn't work. > http://www.sendmail.com/sm/open_source/support/public_forums/ There is also an IRC channel, #sendmail on Freenode. Chris From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:45:11 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62DCC8B5 for ; Fri, 24 May 2013 10:45:11 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id CCB04331 for ; Fri, 24 May 2013 10:45:10 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.7/8.14.7) with ESMTP id r4OAj7CH081145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 May 2013 12:45:07 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.7/8.14.7/Submit) with ESMTP id r4OAj7W1081142; Fri, 24 May 2013 12:45:07 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Fri, 24 May 2013 12:45:07 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: Wojciech Puchar Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="2055831798-179746802-1369392269=:72982" Content-ID: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:45:11 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-179746802-1369392269=:72982 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: On Fri, 24 May 2013 12:03+0200, Wojciech Puchar wrote: > > 1. Edit the /etc/mail/access file. > > > > 2. Insert a line like this one: > > > > To:mailbox@some.domain.tld REJECT > > tried too. > > doesn't work. Make sure you edit the /etc/mail/access file, not the /etc/mail/access.db file. The latter is a hashmap used by sendmail for rapid lookup. The former is the source used to generate the /etc/mail/access.db file. Sendmail will never read the /etc/mail/access file. Don't forget to run the make command afterwards to update the /etc/mail/access.db file, and other changed files. Your .mc file must contain this line exactly as shown: FEATURE(access_db, `hash -o -T /etc/mail/access') Yes, sendmail will indeed access the /etc/mail/access.db file, not the /etc/mail/access file. If you changed the .mc file, then install the corresponding .cf files using the make install command. -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --2055831798-179746802-1369392269=:72982-- From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 10:48:42 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D001EAAE for ; Fri, 24 May 2013 10:48:42 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id 75438359 for ; Fri, 24 May 2013 10:48:42 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.7/8.14.7) with ESMTP id r4OAmcPs081184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 May 2013 12:48:38 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.7/8.14.7/Submit) with ESMTP id r4OAmcbJ081181; Fri, 24 May 2013 12:48:38 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Fri, 24 May 2013 12:48:38 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: Wojciech Puchar Subject: Re: stupid question about sendmail In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="2055831798-179746802-1369392269=:72982" Content-ID: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:48:42 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2055831798-179746802-1369392269=:72982 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: On Fri, 24 May 2013 12:45+0200, Trond Endrestøl wrote: > On Fri, 24 May 2013 12:03+0200, Wojciech Puchar wrote: > > > > 1. Edit the /etc/mail/access file. > > > > > > 2. Insert a line like this one: > > > > > > To:mailbox@some.domain.tld REJECT > > > > tried too. > > > > doesn't work. > > Make sure you edit the /etc/mail/access file, not the > /etc/mail/access.db file. > > The latter is a hashmap used by sendmail for rapid lookup. The former > is the source used to generate the /etc/mail/access.db file. > > Sendmail will never read the /etc/mail/access file. > > Don't forget to run the make command afterwards to update the > /etc/mail/access.db file, and other changed files. > > Your .mc file must contain this line exactly as shown: > > FEATURE(access_db, `hash -o -T /etc/mail/access') > > Yes, sendmail will indeed access the /etc/mail/access.db file, not the > /etc/mail/access file. > > If you changed the .mc file, then install the corresponding .cf files > using the make install command. One final(?) note: You might need this line as well: FEATURE(blacklist_recipients) -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --2055831798-179746802-1369392269=:72982 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-ID: Content-Description: Content-Disposition: INLINE _______________________________________________ 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" --2055831798-179746802-1369392269=:72982-- From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 15:13:15 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D12EBE62 for ; Fri, 24 May 2013 15:13:15 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from flat.berklix.org (flat.berklix.org [83.236.223.115]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF41852 for ; Fri, 24 May 2013 15:13:14 +0000 (UTC) Received: from mart.js.berklix.net (p5DCBF7C2.dip0.t-ipconnect.de [93.203.247.194]) (authenticated bits=128) by flat.berklix.org (8.14.5/8.14.5) with ESMTP id r4OEMGAL069573 for ; Fri, 24 May 2013 16:22:25 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id r4ODeGR7090568 for ; Fri, 24 May 2013 15:40:16 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id r4ODcju4009740; Fri, 24 May 2013 15:40:11 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201305241340.r4ODcju4009740@fire.js.berklix.net> To: "Welcome, Traiano" Subject: Re: Writing a (BSD like) Operating Systems From Scratch From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Fri, 24 May 2013 10:15:23 -0000." <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> Date: Fri, 24 May 2013 15:38:45 +0200 Sender: jhs@berklix.com Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 15:13:15 -0000 "Welcome, Traiano" wrote: > Hi All > I've been read thousands of pages of FreeBSD and Linux Kernel source code and books on the internals of BSD and Linux over the years in attempt to develop a complete understanding of operating systems (or at least, UNIX like ones). However, I feel that I'm as mystified as to the finer details as when I first started. So I've concluded that the best way to really understand the deep dark details of UNIX is to try and write one from scratch (using the general guidelines of standards like POSIX etc ...), and maybe taking a peek at BSD and Linux from time to time. My questions around this are: Sorry, but your questions & text (see mega line above, no folds ! Ugh) tell me A) You dont know enough, & would be better working with an existing project, be it a BSD Linux Minix Sprite Mach whatever. Maybe also doing some formal training in OSs eg a Uni. degree in computing or whatever. B) You havent realised technology is moving faster & with ever more more people working on OSs & tools, its like looking in from the edge of an exploding galaxy & trying to understand all within: by the time you do, its grown ! C) If people devoted tons of time over years to help you along, it would be their & your time wasted to achieve anothernice OS time that would be better spent if you & they worked together on improving an existing OS - see (A) above. Sorry it's not what you want to hear but modern OS are too big for 1 man, & evolving too fast, even those called Jollitz Tannenbaum or Linus, got replaced/ supplemented by Teams. Choose a project team & an aspect/ technology within the team, & that will be useful not a waste of time. Some OS's http://berklix.com/free/ Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com Reply below not above, like a play script. Indent old text with "> ". Send plain text. No quoted-printable, HTML, base64, multipart/alternative. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 15:28:29 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF6F5384 for ; Fri, 24 May 2013 15:28:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5BD90D for ; Fri, 24 May 2013 15:28:29 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EB444B977; Fri, 24 May 2013 11:28:28 -0400 (EDT) From: John Baldwin To: Jilles Tjoelker Subject: Re: find -delete broken, or just used improperly? Date: Fri, 24 May 2013 09:46:29 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <20130520192316.GA32531@pix.net> <201305211106.39313.jhb@freebsd.org> <20130524102411.GA3984@stack.nl> In-Reply-To: <20130524102411.GA3984@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305240946.29590.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 24 May 2013 11:28:29 -0400 (EDT) Cc: freebsd-hackers@freebsd.org, Kurt Lidl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 15:28:29 -0000 On Friday, May 24, 2013 6:24:11 am Jilles Tjoelker wrote: > On Tue, May 21, 2013 at 11:06:39AM -0400, John Baldwin wrote: > > On Monday, May 20, 2013 5:47:31 pm Jilles Tjoelker wrote: > > > The below patch allows deleting the pathname given to find itself: > > > > Index: usr.bin/find/function.c > > > =================================================================== > > > --- usr.bin/find/function.c (revision 250661) > > > +++ usr.bin/find/function.c (working copy) > > > @@ -442,7 +442,8 @@ > > > errx(1, "-delete: forbidden when symlinks are followed"); > > > > > > /* Potentially unsafe - do not accept relative paths whatsoever */ > > > - if (strchr(entry->fts_accpath, '/') != NULL) > > > + if (entry->fts_level > FTS_ROOTLEVEL && > > > + strchr(entry->fts_accpath, '/') != NULL) > > > errx(1, "-delete: %s: relative path potentially not safe", > > > entry->fts_accpath); > > > I'm curious, how would you instruct a patched find to avoid deleteing > > the /tmp/foo directory (e.g. if you wanted this to be a job that > > pruned empty dirs from /tmp/foo but never pruned the directory > > itself). Would -mindepth 1 do it? (Just asking. I have also found > > this message annoying but most of the jobs I have seen it on probably > > don't want to delete the root path, just descendants.) > > -mindepth 1 works, as does cd /tmp/foo && find . -... (-delete silently > ignores . and ..). Right, my only concern is that this fix will introduce a change in behavior that I think might be significant, so we should make sure to advertise it well in UPDATING, etc. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 15:41:26 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18C736E5 for ; Fri, 24 May 2013 15:41:26 +0000 (UTC) (envelope-from mozolevsky@gmail.com) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) by mx1.freebsd.org (Postfix) with ESMTP id D03AA9C7 for ; Fri, 24 May 2013 15:41:25 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id n1so2506901qcx.30 for ; Fri, 24 May 2013 08:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=vQ8DMyVm0jCiL9F3EgnCgoGWz3Fu8Ykg/rrU0TxPULU=; b=xbLOjjf8DHJOXbk9lzac/74LXwd53mq6Vns/YfnKMrIwBz3rSxliLCZzfOL2MSgzPl ZKYPHCvPOIEwtg0tukHm+1enj5UiTDk8VmvxsHyiyoI2qEQH9XcBzLmjBBBa5vAx62ZR 0edMM1L2SD/gjMiOc8zz0NfOGBxLvzPhRAdcrEJ/0GApJ/qJRoAjbQl9vtwAYSbfLbSf HflK2ZUQmOtKjKiRULrHUQVeL5GlYmwHSHpq+5wvDXbDA02bDSKkQgYXghH5HSV27Sei 5SNwpsDb5mosamBb89kR6+A5zHXwJr9w2BOMkMYLPUw5fSWu6Hv/00K78Jx94h89VI5e nFgQ== MIME-Version: 1.0 X-Received: by 10.49.24.198 with SMTP id w6mr19010149qef.58.1369410085338; Fri, 24 May 2013 08:41:25 -0700 (PDT) Sender: mozolevsky@gmail.com Received: by 10.224.221.207 with HTTP; Fri, 24 May 2013 08:41:25 -0700 (PDT) In-Reply-To: <1369406798.20748.30.camel@EL-DT095.site> References: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> <1369406798.20748.30.camel@EL-DT095.site> Date: Fri, 24 May 2013 16:41:25 +0100 X-Google-Sender-Auth: 95e5dXWKfOl-67gqMLd2fpk6jnc Message-ID: Subject: Low Tx-Rx performance with 10Gb NICs From: Igor Mozolevsky To: Axel Fischer Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Hackers freeBSD , Markus Althoff , Lino Sanfilippo , Igor Mozolevsky , Ralf Assmann X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 15:41:26 -0000 On Friday, 24 May 2013, Axel Fischer wrote: Additionally I noticed the following TCP errors > with netstat -s ...: > > 1186 data packets (1717328 bytes) retransmitted > 6847875 window update packets > 2319 duplicate acks > 25831 out-of-order packets (37403288 bytes) > 3733 discarded due to memory problems (drops) > 1186 segment rexmits in SACK recovery episodes > 1717328 byte rexmits in SACK recovery episodes > > > Looks like your data is flooding your memory buffers, have a look through https://calomel.org/freebsd_network_tuning.html -- Igor M. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 15:44:52 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 650CB8E3 for ; Fri, 24 May 2013 15:44:52 +0000 (UTC) (envelope-from ca+envelope@esmtp.org) Received: from zardoc.esmtp.org (zardoc.esmtp.org [70.36.157.240]) by mx1.freebsd.org (Postfix) with ESMTP id 45B369EF for ; Fri, 24 May 2013 15:44:52 +0000 (UTC) Received: from quiet.esmtp.org (localhost. [127.0.0.1]) by zardoc.esmtp.org (MeTA1-1.0.Alpha14.0) with ESMTPS (TLS=TLSv1/SSLv3, cipher=DHE-RSA-AES256-SHA, bits=256, verify=OK) id S00000000001DA07900; Fri, 24 May 2013 08:34:44 -0700 Received: (from ca@localhost) by quiet.esmtp.org (8.14.3/8.12.10.Beta0/Submit) id r4OFYiSK012519 for freebsd-hackers@freebsd.org; Fri, 24 May 2013 08:34:44 -0700 (PDT) Date: Fri, 24 May 2013 08:34:44 -0700 From: Claus Assmann To: freebsd-hackers@freebsd.org Subject: Re: stupid question about sendmail Message-ID: <20130524153444.GA30499@quiet.esmtp.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-27) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: freebsd-hackers@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 15:44:52 -0000 On Fri, May 24, 2013, Trond Endrestøl wrote: [freebsd-hackers doesn't seem like the appropriate list...] > > FEATURE(access_db, `hash -o -T /etc/mail/access') Do NOT use -o. Moreover, do not specify arguments that are default. FEATURE(`access_db') is the best choice. > One final(?) note: You might need this line as well: > FEATURE(blacklist_recipients) That's not a "might", that's a "MUST" for this case. Note: (sendmail's) cf/README is a rather useful document. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 15:45:52 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76C179E5 for ; Fri, 24 May 2013 15:45:52 +0000 (UTC) (envelope-from outbackdingo@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) by mx1.freebsd.org (Postfix) with ESMTP id 40932A06 for ; Fri, 24 May 2013 15:45:52 +0000 (UTC) Received: by mail-ob0-f176.google.com with SMTP id wp18so5636030obc.35 for ; Fri, 24 May 2013 08:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=b14fbMUSBpJ7nparn7/3dYL5GwZd4a3kyF91xJb5CEk=; b=C47KIJP2ObUQqPaerVtisnEwGddK9NKlrJV/uHoVWSoZoDoP+2Ul7T6UUtZnoDRGJC U6XiU29C4pG5WyRjkCIN2qi8wptDCnh8UwZzKQXhTxBAsTm2s3Jg1RI5y4fOKHwu5Fot oeSyvG94r0naGxo//n0hBO5vjCpUzJmCDhdk8U4sQYzhQIYksNtpglsLVDyFnDsaiKIu szt4GovVvhjWkBLoMrsfvyOrYC7nkW5FoiAu+XmqdpovXuoeoshQXQStXGbYKLqCC2/q mi5mREAJ8+Or8Bc3DqIR9T89awvpvBejUtN8qrq0slNcScZzB8fGtUJGNJCOXWUjfbe1 L6JA== MIME-Version: 1.0 X-Received: by 10.60.94.212 with SMTP id de20mr5104374oeb.129.1369410351811; Fri, 24 May 2013 08:45:51 -0700 (PDT) Received: by 10.76.96.49 with HTTP; Fri, 24 May 2013 08:45:51 -0700 (PDT) In-Reply-To: References: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> <1369406798.20748.30.camel@EL-DT095.site> Date: Fri, 24 May 2013 11:45:51 -0400 Message-ID: Subject: Re: Low Tx-Rx performance with 10Gb NICs From: Outback Dingo To: Igor Mozolevsky Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Hackers freeBSD , Axel Fischer , Ralf Assmann , Lino Sanfilippo , Markus Althoff X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 15:45:52 -0000 On Fri, May 24, 2013 at 11:41 AM, Igor Mozolevsky wrote: > On Friday, 24 May 2013, Axel Fischer wrote: > > > Additionally I noticed the following TCP errors > > with netstat -s ...: > > > > 1186 data packets (1717328 bytes) retransmitted > > 6847875 window update packets > > 2319 duplicate acks > > 25831 out-of-order packets (37403288 bytes) > > 3733 discarded due to memory problems (drops) > > 1186 segment rexmits in SACK recovery episodes > > 1717328 byte rexmits in SACK recovery episodes > > > > > > > > Looks like your data is flooding your memory buffers, have a look through > https://calomel.org/freebsd_network_tuning.html > > Ive got an 10Gb ix card i cant get to do more then 1.2Gbs send on FreeBSD 9-stable pretty frustrating hunting down the issue. > -- > Igor M. > _______________________________________________ > 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" > From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 14:47:38 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6E3BE5E0 for ; Fri, 24 May 2013 14:47:38 +0000 (UTC) (envelope-from afischer@marvell.com) Received: from na3sys009aog117.obsmtp.com (na3sys009aog117.obsmtp.com [74.125.149.242]) by mx1.freebsd.org (Postfix) with ESMTP id 3CE776E5 for ; Fri, 24 May 2013 14:47:38 +0000 (UTC) Received: from SC-OWA01.marvell.com ([199.233.58.136]) (using TLSv1) by na3sys009aob117.postini.com ([74.125.148.12]) with SMTP ID DSNKUZ99guz85HL7JFM4HQkgBAEo4ZIXZTNO@postini.com; Fri, 24 May 2013 07:47:38 PDT Received: from maili.marvell.com (10.93.76.43) by sc-owa01.marvell.com (10.93.76.21) with Microsoft SMTP Server id 8.3.213.0; Fri, 24 May 2013 07:46:45 -0700 Received: from [10.9.2.76] (unknown [10.9.2.76]) by maili.marvell.com (Postfix) with ESMTP id 0B2091CCDAE; Fri, 24 May 2013 07:46:43 -0700 (PDT) Subject: Re: Low Tx-Rx performance with 10Gb NICs From: Axel Fischer To: Igor Mozolevsky In-Reply-To: References: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 24 May 2013 16:46:38 +0200 Message-ID: <1369406798.20748.30.camel@EL-DT095.site> MIME-Version: 1.0 X-Mailer: Evolution 2.32.1 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 24 May 2013 16:27:59 +0000 Cc: Hackers freeBSD , Ralf Assmann , Lino Sanfilippo , Markus Althoff X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 14:47:38 -0000 Hi Igor, my name is Axel Fischer. working at Marvell SC. In addition to your reply to my colleague Lino Sanfilippo I did some performance measurements on FreeBSD 9 with a commercial 10 GBit network card. Unlike on other OS the FreeBSD performance for duplex rx/tx operation never exceeded the limit about 9.5 GBit/s. Normally a performance of at least 16 GBit (up to line speed 20 GBit in duplex mode) is expected. As Lino already mentioned the CPU/bus system (in general the HW) does not set a limit. Furthermore I noticed that the CPU(s) load is not very high, about 30 %. Here is an overview of the measurements: netperf rx-tx 4 streams / 60s 1768.16 Mb/s Port=2001 RX 999.33 Mb/s Port=2002 RX 72.16 Mb/s Port=1001 TX 61.49 Mb/s Port=1002 TX 2302.76 Mb/s Port=2003 RX 73.48 Mb/s Port=1003 TX 2416.23 Mb/s Port=2004 RX 76.02 Mb/s Port=1004 TX ==== > RX+TX Total Result: Mb/s 7769.63 CPU load: last pid: 1739; load averages: 0.97, 0.49, 0.21 up 0+00:02:26 11:02:52 46 processes: 2 running, 44 sleeping CPU 0: 2.0% user, 0.0% nice, 23.2% system, 0.4% interrupt, 74.4% idle CPU 1: 1.2% user, 0.0% nice, 19.7% system, 0.4% interrupt, 78.7% idle CPU 2: 0.0% user, 0.0% nice, 0.0% system, 80.7% interrupt, 19.3% idle CPU 3: 0.0% user, 0.0% nice, 0.8% system, 1.6% interrupt, 97.6% idle CPU 4: 2.4% user, 0.0% nice, 25.6% system, 0.0% interrupt, 72.0% idle CPU 5: 3.1% user, 0.0% nice, 25.6% system, 0.0% interrupt, 71.3% idle CPU 6: 0.0% user, 0.0% nice, 0.4% system, 32.7% interrupt, 66.9% idle CPU 7: 0.4% user, 0.0% nice, 1.6% system, 0.0% interrupt, 98.0% idle Mem: 14M Active, 7548K Inact, 66M Wired, 24K Cache, 16M Buf, 3326M Free Swap: 4096M Total, 4096M Free Additionally I noticed the following TCP errors with netstat -s ...: 1186 data packets (1717328 bytes) retransmitted 6847875 window update packets 2319 duplicate acks 25831 out-of-order packets (37403288 bytes) 3733 discarded due to memory problems (drops) 1186 segment rexmits in SACK recovery episodes 1717328 byte rexmits in SACK recovery episodes My questions: - What is the max. performance (duplex) on FreeBSD 9 that you have measured with a 10 GBit NIC ? (Expected > 16 GBit/s on appropriate HW) Thank you in advance, Axel -------- Weitergeleitete Nachricht -------- Von: Igor Mozolevsky An: Lino Sanfilippo Kopie: Hackers freeBSD , Axel Fischer , Ralf Assmann , Markus Althoff Betreff: Re: Low Tx-Rx performance with 10Gb NICs Datum: Thu, 23 May 2013 11:21:08 -0700 On 23 May 2013 19:00, Lino Sanfilippo wrote: > Is there a known issue concerning high traffic on Tx and Rx paths? Are there any system > settings I could adjust to get the expected performance? Any hints are very appreciated. check your ierrs and oerrs: netstat -s 1, I've noticed I'm getting ierrs on em chips, but none on fxp chips (connected to the same wire/switch); might be unrelated to yours, but worth a check... -- Axel Fischer | R&D Software / SW Engineer | Marvell Semiconductor Germany GmbH Office +49 (7243) 502 370 | Fax +49 (7243) 502 982 afischer@marvell.com M A R V E L L |www.marvell.com This communication, together with any attachments hereto or links contained herein, is for the sole use of the intended recipient(s) and may contain information that is confidential or legally protected. If you are not the intended recipient, you are hereby notified that any review, disclosure, copying, dissemination, distribution or use of this communication is STRICTLY PROHIBITED. If you have received this communication in error, please notify the sender immediately by return e-mail message and delete the original and all copies of the communication, along with any attachments hereto or links herein, from your system. Marvell Semiconductor Germany GmbH, Siemensstr. 23, 76275 Ettlingen, Amtsgericht Mannheim HRB 361620 Geschäftsführer: Dipl.-Volksw. Mathias Horak From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 16:58:09 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A05F19C2 for ; Fri, 24 May 2013 16:58:09 +0000 (UTC) (envelope-from prvs=8498cab4e=welcomet@amazon.com) Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5E598EFB for ; Fri, 24 May 2013 16:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=welcomet@amazon.com; q=dns/txt; s=amazon201209; t=1369414689; x=1400950689; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=nCgrs/MG7dJ5lHyIsKIWOnDwB89B1AptQpHeE+MIP68=; b=PFDoFn014zJSURJGMxqb6HjIlGQ9F3bygnC95fvNrzVIwxBGa/U9VCeS 6nMtLd96hHckPXU34FdXLSAUHOYM541lImaDXHexMSgWv5LUMfdkd6OGc VntJ85q/+vadmQZ/mYAEh5a4abRuIomXcOp943IY5zDvZ8DKavVmcTkU9 k=; X-IronPort-AV: E=Sophos;i="4.87,736,1363132800"; d="scan'208";a="567025844" Received: from smtp-in-9003.sea19.amazon.com ([10.186.104.20]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 May 2013 16:57:53 +0000 Received: from ex10-hub-12001.ant.amazon.com (ex10-hub-12001.ant.amazon.com [10.32.58.112]) by smtp-in-9003.sea19.amazon.com (8.13.8/8.13.8) with ESMTP id r4OGvEWr025265 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Fri, 24 May 2013 16:57:52 GMT Received: from EX10-MBX-14001.ant.amazon.com ([fe80::b957:af21:f5bc:52d1]) by ex10-hub-12001.ant.amazon.com ([::1]) with mapi id 14.02.0247.003; Fri, 24 May 2013 09:57:44 -0700 From: "Welcome, Traiano" To: "Julian H. Stacey" Subject: RE: Writing a (BSD like) Operating Systems From Scratch Thread-Topic: Writing a (BSD like) Operating Systems From Scratch Thread-Index: AQHOWJFipkXHyTJtb0mlz+AchHmtp5kUiALA Date: Fri, 24 May 2013 16:57:44 +0000 Message-ID: <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> References: Your message "Fri, 24 May 2013 10:15:23 -0000." <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> In-Reply-To: <201305241340.r4ODcju4009740@fire.js.berklix.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.22.10.20] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 16:58:09 -0000 Hi Julian Thanks, any response is appreciated, here's mine: > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > hackers@freebsd.org] On Behalf Of Julian H. Stacey > Sent: 24 May 2013 15:39 > To: Welcome, Traiano > Cc: freebsd-hackers@freebsd.org > Subject: Re: Writing a (BSD like) Operating Systems From Scratch >=20 > "Welcome, Traiano" wrote: > > Hi All > > I've been read thousands of pages of FreeBSD and Linux Kernel source > code and books on the internals of BSD and Linux over the years in attemp= t > to develop a complete understanding of operating systems (or at least, UN= IX > like ones). However, I feel that I'm as mystified as to the finer details= as > when I first started. So I've concluded that the best way to really under= stand > the deep dark details of UNIX is to try and write one from scratch (using= the > general guidelines of standards like POSIX etc ...), and maybe taking a p= eek at > BSD and Linux from time to time. My questions around this are: >=20 > Sorry, but your questions & text (see mega line above, no folds ! Ugh) te= ll me >=20 > A) You dont know enough, & would be better working with an > existing > project, be it a BSD Linux Minix Sprite Mach whatever. Maybe > also doing some formal training in OSs eg a Uni. degree > in computing or whatever. Right on the mark, Julian! The don't know enough part especially, hence the= _questions_ (Normally asked by people who don't know enough). May I ask where you get the divine wisdom to know where I "would be better= working with" ? don't you think that would be best left up to me? So what if formal training in OSes is not an option to me ? Not all of us h= ave the wealth and time, nor privilege of coming from a family that can=20 afford such an education, like myself for example. What do you recommend fo= r those of us who have neither the wealth nor luxury of time to pursue " a Uni. degree in computing or whatever." ? You appear not to realize that to even begin working with one of the existi= ng projects, you'd best have a solid understanding of OSes to begin with,=20 which brings up an interesting catch -22 that goes something like: "You can't join the club, because you don't know enough. You can't know en= ough 'till you join our club".=20 Is that the case or am I mistaken ? >=20 > B) You havent realised technology is moving faster & with ever more > more people working on OSs & tools, its like looking in > from the edge of an exploding galaxy & trying to understand > all within: by the time you do, its grown ! >=20 May I ask how you jumped to that conclusion? What makes you think I want to= keep at the cutting edge of everything?=20 All I want to begin at the very basis and build up from there at my own pac= e, until I'm capable of building something very=20 Basic, functional and something I can use to illustrate to myself the desig= n principles involved in building operating systems. > C) If people devoted tons of time over years to help you along, > it would be their & your time wasted to achieve anothernice > OS time that would be better spent if you & they worked > together on improving an existing OS - see (A) above. Where did you get the idea that I'm asking for tons of time over years ? Ha= ve you a record of me going around the internet pestering people for answer= s on how to build operating systems? All I asked for was a couple of links = and pointers, maybe a good book or two. Besides, I'd be of no using helpin= g to build spacecraft if I can barely build a cart, so no, my time would no= t be better spent helping people who really have a clue to improve existing= OSes. > Sorry it's not what you want to hear but modern OS are too big for > 1 man, & evolving too fast, even those called Jollitz Tannenbaum or Linus= , got > replaced/ supplemented by Teams. Choose a project team & an aspect/ > technology within the team, & that will be useful not a waste of time. I don't accept the conjecture that modern OSes are too big for one man. Mod= ern OSes and their associated entourage of userpace and plugin modules mayb= e, but not the basic kernel/supervisor program. An OS is as big or small as= you make it. I would like to eat this particular elephant one bite at a ti= me.=20 > Some OS's http://berklix.com/free/ >=20 Thanks, nice link :-) > Cheers, > Julian > -- > Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich > http://berklix.com Reply below not above, like a play script. Indent ol= d text > with "> ". > Send plain text. No quoted-printable, HTML, base64, multipart/alternati= ve. > _______________________________________________ > 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" From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 18:45:39 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5200665C for ; Fri, 24 May 2013 18:45:39 +0000 (UTC) (envelope-from trond@fagskolen.gjovik.no) Received: from smtp.fagskolen.gjovik.no (smtp.fagskolen.gjovik.no [IPv6:2001:700:1100:1:200:ff:fe00:b]) by mx1.freebsd.org (Postfix) with ESMTP id B90A68F7 for ; Fri, 24 May 2013 18:45:38 +0000 (UTC) Received: from mail.fig.ol.no (localhost [127.0.0.1]) by mail.fig.ol.no (8.14.7/8.14.7) with ESMTP id r4OIjYwD085538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 24 May 2013 20:45:34 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) Received: from localhost (trond@localhost) by mail.fig.ol.no (8.14.7/8.14.7/Submit) with ESMTP id r4OIjYgc085535 for ; Fri, 24 May 2013 20:45:34 +0200 (CEST) (envelope-from trond@fagskolen.gjovik.no) X-Authentication-Warning: mail.fig.ol.no: trond owned process doing -bs Date: Fri, 24 May 2013 20:45:34 +0200 (CEST) From: =?ISO-8859-1?Q?Trond_Endrest=F8l?= Sender: Trond.Endrestol@fagskolen.gjovik.no To: freebsd-hackers@freebsd.org Subject: Re: stupid question about sendmail In-Reply-To: <20130524153444.GA30499@quiet.esmtp.org> Message-ID: References: <20130524153444.GA30499@quiet.esmtp.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) Organization: Fagskolen Innlandet OpenPGP: url=http://fig.ol.no/~trond/trond.key MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="===============5470477227809393701==" Content-ID: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.fig.ol.no X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:45:39 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --===============5470477227809393701== Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: Content-Disposition: INLINE On Fri, 24 May 2013 08:34-0700, Claus Assmann wrote: > On Fri, May 24, 2013, Trond Endrestøl wrote: > > [freebsd-hackers doesn't seem like the appropriate list...] > > > > FEATURE(access_db, `hash -o -T /etc/mail/access') > > Do NOT use -o. Moreover, do not specify arguments that are default. > FEATURE(`access_db') > is the best choice. Then I guess the defaults in freebsd.mc should be changed as well: http://svnweb.freebsd.org/base/stable/9/etc/sendmail/freebsd.mc?revision=249867&view=markup > > One final(?) note: You might need this line as well: > > > FEATURE(blacklist_recipients) > > That's not a "might", that's a "MUST" for this case. > > Note: (sendmail's) cf/README is a rather useful document. Thank you for the clarification. I only hope our friend in Poland got what he needed. -- +-------------------------------+------------------------------------+ | Vennlig hilsen, | Best regards, | | Trond Endrestøl, | Trond Endrestøl, | | IT-ansvarlig, | System administrator, | | Fagskolen Innlandet, | Gjøvik Technical College, Norway, | | tlf. mob. 952 62 567, | Cellular...: +47 952 62 567, | | sentralbord 61 14 54 00. | Switchboard: +47 61 14 54 00. | +-------------------------------+------------------------------------+ --===============5470477227809393701==-- From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 18:51:38 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEDDA7D7 for ; Fri, 24 May 2013 18:51:38 +0000 (UTC) (envelope-from florent@peterschmitt.fr) Received: from peterschmitt.fr (peterschmitt.fr [5.135.177.31]) by mx1.freebsd.org (Postfix) with ESMTP id 9F58C94F for ; Fri, 24 May 2013 18:51:38 +0000 (UTC) Received: from [192.168.0.130] (4ab54-4-88-163-248-31.fbx.proxad.net [88.163.248.31]) by peterschmitt.fr (Postfix) with ESMTPSA id 73C077D0E for ; Fri, 24 May 2013 20:45:45 +0200 (CEST) Message-ID: <519FB557.1010403@peterschmitt.fr> Date: Fri, 24 May 2013 20:45:43 +0200 From: Florent Peterschmitt User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: Writing a (BSD like) Operating Systems From Scratch References: Your message "Fri, 24 May 2013 10:15:23 -0000." <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> In-Reply-To: <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: florent+FreeBSD-hackers@peterschmitt.fr List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:51:39 -0000 Le 24/05/2013 18:57, Welcome, Traiano a écrit : > Hi Julian > > Thanks, any response is appreciated, here's mine: > > >> -----Original Message----- >> From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- >> hackers@freebsd.org] On Behalf Of Julian H. Stacey >> Sent: 24 May 2013 15:39 >> To: Welcome, Traiano >> Cc: freebsd-hackers@freebsd.org >> Subject: Re: Writing a (BSD like) Operating Systems From Scratch >> >> "Welcome, Traiano" wrote: >>> Hi All >>> I've been read thousands of pages of FreeBSD and Linux Kernel source >> code and books on the internals of BSD and Linux over the years in attempt >> to develop a complete understanding of operating systems (or at least, UNIX >> like ones). However, I feel that I'm as mystified as to the finer details as >> when I first started. So I've concluded that the best way to really understand >> the deep dark details of UNIX is to try and write one from scratch (using the >> general guidelines of standards like POSIX etc ...), and maybe taking a peek at >> BSD and Linux from time to time. My questions around this are: >> >> Sorry, but your questions & text (see mega line above, no folds ! Ugh) tell me >> >> A) You dont know enough, & would be better working with an >> existing >> project, be it a BSD Linux Minix Sprite Mach whatever. Maybe >> also doing some formal training in OSs eg a Uni. degree >> in computing or whatever. > > > Right on the mark, Julian! The don't know enough part especially, hence the _questions_ (Normally asked by people who don't know enough). > May I ask where you get the divine wisdom to know where I "would be better working with" ? don't you think that would be best left up to me? > So what if formal training in OSes is not an option to me ? Not all of us have the wealth and time, nor privilege of coming from a family that can > afford such an education, like myself for example. What do you recommend for those of us who have neither the wealth nor luxury of time to pursue > " a Uni. degree in computing or whatever." ? > > You appear not to realize that to even begin working with one of the existing projects, you'd best have a solid understanding of OSes to begin with, > which brings up an interesting catch -22 that goes something like: > > "You can't join the club, because you don't know enough. You can't know enough 'till you join our club". > > Is that the case or am I mistaken ? I don't think there is any kind of "club". There are just peoples that know better than others how does works one or many parts of the system, but not the entire system and other peoples krowing other parts, etc. You'll see (if not already) that everytime you discover new things, you discorver in the same time there is a lot to do more ! Even on a little system on a classic computer (ARM, x86…) >> >> B) You havent realised technology is moving faster & with ever more >> more people working on OSs & tools, its like looking in >> from the edge of an exploding galaxy & trying to understand >> all within: by the time you do, its grown ! >> > > May I ask how you jumped to that conclusion? What makes you think I want to keep at the cutting edge of everything? > All I want to begin at the very basis and build up from there at my own pace, until I'm capable of building something very > Basic, functional and something I can use to illustrate to myself the design principles involved in building operating systems. > > >> C) If people devoted tons of time over years to help you along, >> it would be their & your time wasted to achieve anothernice >> OS time that would be better spent if you & they worked >> together on improving an existing OS - see (A) above. > > > Where did you get the idea that I'm asking for tons of time over years ? Have you a record of me going around the internet pestering people for answers on how to build operating systems? All I asked for was a couple of links and pointers, maybe a good book or two. Besides, I'd be of no using helping to build spacecraft if I can barely build a cart, so no, my time would not be better spent helping people who really have a clue to improve existing OSes. Dont be so aggressive. He is juste saying it has much more chances to be a waste of time to _start and continue_ developping from scratch than continue developping existing projects. Starting from scratch is absolutely not the only way to learn by ourself. > >> Sorry it's not what you want to hear but modern OS are too big for >> 1 man, & evolving too fast, even those called Jollitz Tannenbaum or Linus, got >> replaced/ supplemented by Teams. Choose a project team & an aspect/ >> technology within the team, & that will be useful not a waste of time. > > I don't accept the conjecture that modern OSes are too big for one man. Modern OSes and their associated entourage of userpace and plugin modules maybe, but not the basic kernel/supervisor program. An OS is as big or small as you make it. I would like to eat this particular elephant one bite at a time. I agree on this point. If you take a very tiny micro-controller, for a single (wo)man it is ok of course. But you'll learne about uC and not about computers which are much more developped than uC. PS: can you please take care about line wrapping ? I don't krow if it's the good word but the previous answer has'nt been broke to fitt on my screen ;) From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 18:52:04 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FEE3960 for ; Fri, 24 May 2013 18:52:04 +0000 (UTC) (envelope-from ca+envelope@esmtp.org) Received: from zardoc.esmtp.org (zardoc.esmtp.org [70.36.157.240]) by mx1.freebsd.org (Postfix) with ESMTP id 6F08F96B for ; Fri, 24 May 2013 18:52:04 +0000 (UTC) Received: from quiet.esmtp.org (localhost. [127.0.0.1]) by zardoc.esmtp.org (MeTA1-1.0.Alpha14.0) with ESMTPS (TLS=TLSv1/SSLv3, cipher=DHE-RSA-AES256-SHA, bits=256, verify=OK) id S00000000001DA24600; Fri, 24 May 2013 11:52:03 -0700 Received: (from ca@localhost) by quiet.esmtp.org (8.14.3/8.12.10.Beta0/Submit) id r4OIq3jI014536 for freebsd-hackers@freebsd.org; Fri, 24 May 2013 11:52:03 -0700 (PDT) Date: Fri, 24 May 2013 11:52:02 -0700 From: Claus Assmann To: freebsd-hackers@freebsd.org Subject: Re: stupid question about sendmail Message-ID: <20130524185202.GA20384@quiet.esmtp.org> References: <20130524153444.GA30499@quiet.esmtp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-27) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: freebsd-hackers@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:52:04 -0000 On Fri, May 24, 2013, Trond Endrestøl wrote: > On Fri, 24 May 2013 08:34-0700, Claus Assmann wrote: > > > > FEATURE(access_db, `hash -o -T /etc/mail/access') > > Do NOT use -o. Moreover, do not specify arguments that are default. > Then I guess the defaults in freebsd.mc should be changed as well: > http://svnweb.freebsd.org/base/stable/9/etc/sendmail/freebsd.mc?revision=249867&view=markup That default was probably chosen so the MTA does not complain if the map doesn't exist. Of course that doesn't work so well if you really want to use the map but make some mistake -- then an error is silently ignored and you wonder "Why doesn't this work?" Hence for this case: do NOT use -o. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 18:59:03 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7AC4BC8B for ; Fri, 24 May 2013 18:59:03 +0000 (UTC) (envelope-from reichert@numachi.com) Received: from away.numachi.com (away.numachi.com [66.228.38.138]) by mx1.freebsd.org (Postfix) with SMTP id 2AC789CC for ; Fri, 24 May 2013 18:59:02 +0000 (UTC) Received: (qmail 26412 invoked from network); 24 May 2013 18:52:21 -0000 Received: from unknown (HELO meisai.numachi.com) (71.181.44.212) by away.numachi.com with SMTP; 24 May 2013 18:52:21 -0000 Received: (qmail 86085 invoked by uid 1001); 24 May 2013 18:33:50 -0000 Date: Fri, 24 May 2013 14:33:50 -0400 From: Brian Reichert To: "Welcome, Traiano" Subject: Re: Writing a (BSD like) Operating Systems From Scratch Message-ID: <20130524183350.GY11165@numachi.com> References: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> User-Agent: Mutt/1.5.9i Cc: "freebsd-hackers@freebsd.org" , "Julian H. Stacey" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 18:59:03 -0000 On Fri, May 24, 2013 at 04:57:44PM +0000, Welcome, Traiano wrote: > Hi Julian > > Thanks, any response is appreciated, here's mine: I typed into Google: "how to write an OS", and got lots of hits. Have you explored them? http://www.acm.uiuc.edu/sigops/roll_your_own/ http://mikeos.berlios.de/write-your-own-os.html http://stackoverflow.com/questions/254149/how-do-you-write-a-basic-operating-system -- Brian Reichert BSD admin/developer at large From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 19:12:07 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F08C320B for ; Fri, 24 May 2013 19:12:07 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com [IPv6:2607:f8b0:4002:c01::230]) by mx1.freebsd.org (Postfix) with ESMTP id AEDB9A86 for ; Fri, 24 May 2013 19:12:07 +0000 (UTC) Received: by mail-yh0-f48.google.com with SMTP id f35so384351yha.35 for ; Fri, 24 May 2013 12:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=xv+LKnGGUTApj0RskmAd6pIDHIwlH/X1TKtLPUu2zP4=; b=cmp8VOOTbIZ0tM4U7pgVGqdqGSn4fMyCIvzThrLo3PVXnnipA6k6ha3151INKc6I0p huNCiSyRrSRhvvSGfMX3w3Tdyn1gfV6lDtSlaYG0Mamuzhm6pZnlfzMY9LTb4VPMCwWR P1qgAMwyAsckrSgMC6WzPUpwn2iewIqV0nIVc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=xv+LKnGGUTApj0RskmAd6pIDHIwlH/X1TKtLPUu2zP4=; b=ZBek+MMcVFnYEt36T4L6OXJ8m1xNd+Qx4NfQr3kUb/VcDNP7TZTWv0AVefadeZGtZU U4x25unBYzdGzPQDxuSKE6qeleZxxOh785laC/shv+IsYXuQPgjyHyOloMbXFG3A9aaU ziqakTiic+LC99ogJl1xGkbVNZOIbAxVt8rOhkRJkELZTVyVlNCdSmIxRpHhsgAOCdgT 35QLa4634mhYQAbFUPLkRa3ogHANhsuNWKz9vDh4iPyO7RLzlPcTULFjRXdZztO33LWM /omsaFddD3NssNIFlOp2RP8mPj5lcunhPraM/aeetUuJx/ZQLYh67SZb5QkiFDED6lDP Auig== X-Received: by 10.236.123.100 with SMTP id u64mr10425221yhh.4.1369422727016; Fri, 24 May 2013 12:12:07 -0700 (PDT) Received: from [192.168.2.101] ([187.114.197.44]) by mx.google.com with ESMTPSA id m74sm25405323yhm.0.2013.05.24.12.12.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 May 2013 12:12:06 -0700 (PDT) Message-ID: <519FBB7E.2060804@bsd.com.br> Date: Fri, 24 May 2013 16:11:58 -0300 From: =?windows-1252?Q?Otac=EDlio?= User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130406 Thunderbird/17.0.5 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: Writing a (BSD like) Operating Systems From Scratch References: Your message "Fri, 24 May 2013 10:15:23 -0000." <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> <519FB557.1010403@peterschmitt.fr> In-Reply-To: <519FB557.1010403@peterschmitt.fr> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Gm-Message-State: ALoCoQmFxTOzOc3a+tnH1s+Cp18YhafOVzGSSbDZbrMmAzFuQUgqRF1OxiYEcSlD+/k0KNYIXnUd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 19:12:08 -0000 On 24/05/2013 15:45, Florent Peterschmitt wrote: > Le 24/05/2013 18:57, Welcome, Traiano a écrit : >> Hi Julian >> >> Thanks, any response is appreciated, here's mine: >> >> >>> -----Original Message----- >>> From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- >>> hackers@freebsd.org] On Behalf Of Julian H. Stacey >>> Sent: 24 May 2013 15:39 >>> To: Welcome, Traiano >>> Cc: freebsd-hackers@freebsd.org >>> Subject: Re: Writing a (BSD like) Operating Systems From Scratch >>> >>> "Welcome, Traiano" wrote: >>>> Hi All >>>> I've been read thousands of pages of FreeBSD and Linux Kernel source >>> code and books on the internals of BSD and Linux over the years in >>> attempt >>> to develop a complete understanding of operating systems (or at >>> least, UNIX >>> like ones). However, I feel that I'm as mystified as to the finer >>> details as >>> when I first started. So I've concluded that the best way to really >>> understand >>> the deep dark details of UNIX is to try and write one from scratch >>> (using the >>> general guidelines of standards like POSIX etc ...), and maybe taking >>> a peek at >>> BSD and Linux from time to time. My questions around this are: >>> >>> Sorry, but your questions & text (see mega line above, no folds ! >>> Ugh) tell me >>> >>> A) You dont know enough, & would be better working with an >>> existing >>> project, be it a BSD Linux Minix Sprite Mach whatever. Maybe >>> also doing some formal training in OSs eg a Uni. degree >>> in computing or whatever. >> >> >> Right on the mark, Julian! The don't know enough part especially, >> hence the _questions_ (Normally asked by people who don't know enough). >> May I ask where you get the divine wisdom to know where I "would be >> better working with" ? don't you think that would be best left up to me? >> So what if formal training in OSes is not an option to me ? Not all of >> us have the wealth and time, nor privilege of coming from a family >> that can >> afford such an education, like myself for example. What do you >> recommend for those of us who have neither the wealth nor luxury of >> time to pursue >> " a Uni. degree in computing or whatever." ? >> >> You appear not to realize that to even begin working with one of the >> existing projects, you'd best have a solid understanding of OSes to >> begin with, >> which brings up an interesting catch -22 that goes something like: >> >> "You can't join the club, because you don't know enough. You can't >> know enough 'till you join our club". >> >> Is that the case or am I mistaken ? > > I don't think there is any kind of "club". There are just peoples that > know better than others how does works one or many parts of the system, > but not the entire system and other peoples krowing other parts, etc. > > You'll see (if not already) that everytime you discover new things, you > discorver in the same time there is a lot to do more ! Even on a little > system on a classic computer (ARM, x86…) > >>> >>> B) You havent realised technology is moving faster & with ever more >>> more people working on OSs & tools, its like looking in >>> from the edge of an exploding galaxy & trying to understand >>> all within: by the time you do, its grown ! >>> >> >> May I ask how you jumped to that conclusion? What makes you think I >> want to keep at the cutting edge of everything? >> All I want to begin at the very basis and build up from there at my >> own pace, until I'm capable of building something very >> Basic, functional and something I can use to illustrate to myself the >> design principles involved in building operating systems. >> >> >>> C) If people devoted tons of time over years to help you along, >>> it would be their & your time wasted to achieve anothernice >>> OS time that would be better spent if you & they worked >>> together on improving an existing OS - see (A) above. >> >> >> Where did you get the idea that I'm asking for tons of time over years >> ? Have you a record of me going around the internet pestering people >> for answers on how to build operating systems? All I asked for was a >> couple of links and pointers, maybe a good book or two. Besides, I'd >> be of no using helping to build spacecraft if I can barely build a >> cart, so no, my time would not be better spent helping people who >> really have a clue to improve existing OSes. > > Dont be so aggressive. He is juste saying it has much more chances to be > a waste of time to _start and continue_ developping from scratch than > continue developping existing projects. Starting from scratch is > absolutely not the only way to learn by ourself. >> >>> Sorry it's not what you want to hear but modern OS are too big for >>> 1 man, & evolving too fast, even those called Jollitz Tannenbaum or >>> Linus, got >>> replaced/ supplemented by Teams. Choose a project team & an aspect/ >>> technology within the team, & that will be useful not a waste of time. >> >> I don't accept the conjecture that modern OSes are too big for one >> man. Modern OSes and their associated entourage of userpace and plugin >> modules maybe, but not the basic kernel/supervisor program. An OS is >> as big or small as you make it. I would like to eat this particular >> elephant one bite at a time. > > I agree on this point. If you take a very tiny micro-controller, for a > single (wo)man it is ok of course. But you'll learne about uC and not > about computers which are much more developped than uC. > > PS: can you please take care about line wrapping ? I don't krow if it's > the good word but the previous answer has'nt been broke to fitt on my > screen ;) > _______________________________________________ > 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 think that the best place to start is with this system: http://www.minix3.org/ And with this book: http://www.amazon.com/gp/product/0131429388/qid=1137005040/sr=8-1/ref=pd_bbs_1/102-1327526-9316154?n=507846&s=books&v=glance Like a Linus! From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 19:26:02 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B29616AC for ; Fri, 24 May 2013 19:26:02 +0000 (UTC) (envelope-from prvs=8498cab4e=welcomet@amazon.com) Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id 6E38BB47 for ; Fri, 24 May 2013 19:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=welcomet@amazon.com; q=dns/txt; s=amazon201209; t=1369423562; x=1400959562; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Bwcpzm9u9ucZHyF9n543OD+TDixDoP4GoKDVBQ7bHNw=; b=kmbmq6G4697QVUQSeFyKn6A9IXsfT1MYZwlL/cbujZzPrbcjNLeJb1S1 NBTo1w+/Xiq8kI5U6uRC9LZEDByoVaeBOaxLBi/wtVqeXl1YUQwgC56P0 opjShI1HtppN4d2NDd3y8HvsFQq06GINBykVgmwz3WxQRJgoSIlNrple1 E=; X-IronPort-AV: E=Sophos;i="4.87,737,1363132800"; d="scan'208";a="567067001" Received: from smtp-in-9001.sea19.amazon.com ([10.186.144.32]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 May 2013 19:25:55 +0000 Received: from ex10-hub-12001.ant.amazon.com (ex10-hub-12001.ant.amazon.com [10.32.58.112]) by smtp-in-9001.sea19.amazon.com (8.13.8/8.13.8) with ESMTP id r4OJPpZv013152 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Fri, 24 May 2013 19:25:53 GMT Received: from EX10-HUB-14002.ant.amazon.com (10.36.60.29) by ex10-hub-12001.ant.amazon.com (10.32.58.112) with Microsoft SMTP Server (TLS) id 14.2.247.3; Fri, 24 May 2013 12:25:50 -0700 Received: from EX10-MBX-14001.ant.amazon.com ([fe80::b957:af21:f5bc:52d1]) by ex10-hub-14002.ant.amazon.com ([::1]) with mapi id 14.02.0342.003; Fri, 24 May 2013 12:25:50 -0700 From: "Welcome, Traiano" To: Brian Reichert Subject: RE: Writing a (BSD like) Operating Systems From Scratch Thread-Topic: Writing a (BSD like) Operating Systems From Scratch Thread-Index: AQHOWK/YFgWxx5eymk+0u1NFoIc3NJkUtGtw Date: Fri, 24 May 2013 19:25:50 +0000 Message-ID: <8F56C8EF8265DF489B64A19B10910AC7025E3E82@ex10-mbx-14001.ant.amazon.com> References: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> <20130524183350.GY11165@numachi.com> In-Reply-To: <20130524183350.GY11165@numachi.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.185.137.99] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-hackers@freebsd.org" , "Julian H. Stacey" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 19:26:02 -0000 Hi Brian Indeed I have, these particular three sites led to my formulation of those= questions (see verdict inline): > -----Original Message----- > From: Brian Reichert [mailto:reichert@numachi.com] > Sent: 24 May 2013 20:34 > To: Welcome, Traiano > Cc: Julian H. Stacey; freebsd-hackers@freebsd.org > Subject: Re: Writing a (BSD like) Operating Systems From Scratch >=20 > On Fri, May 24, 2013 at 04:57:44PM +0000, Welcome, Traiano wrote: > > Hi Julian > > > > Thanks, any response is appreciated, here's mine: >=20 > I typed into Google: "how to write an OS", and got lots of hits. > Have you explored them? >=20 > http://www.acm.uiuc.edu/sigops/roll_your_own/ Nice general outline, and I could possibly adopt the broad development appr= oach there, but stuff like the following puts me completely off: - "the testbed needs to be a 386 with at least 2 megs of ram an a network a= nd video card" - "gcc-2.7.2.3 Later version will not work with c++ due to exception handli= nd" (Seems a little too dated, I'd like an example based on current hardware an= d current toolchains) >=20 > http://mikeos.berlios.de/write-your-own-os.html >=20 This is the best kickstarter for beginners I've found to date, definitely a= resource I'll be using more often. > http://stackoverflow.com/questions/254149/how-do-you-write-a- > basic-operating-system >=20 Tanenbaum's books are classic. The challenge now (for me) is to apply the t= heory and examples in the book to something I've built and understand from = the ground up. >=20 > -- > Brian Reichert > BSD admin/developer at large From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 19:30:13 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48DE7823 for ; Fri, 24 May 2013 19:30:13 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [188.252.31.196]) by mx1.freebsd.org (Postfix) with ESMTP id BE6A3BDB for ; Fri, 24 May 2013 19:30:12 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6) with ESMTP id r4OJU1ih005652 for ; Fri, 24 May 2013 21:30:01 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6/Submit) with ESMTP id r4OJU1mN005649 for ; Fri, 24 May 2013 21:30:01 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 24 May 2013 21:30:01 +0200 (CEST) From: Wojciech Puchar To: freebsd-hackers@freebsd.org Subject: Re: stupid question about sendmail In-Reply-To: <20130524153444.GA30499@quiet.esmtp.org> Message-ID: References: <20130524153444.GA30499@quiet.esmtp.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 24 May 2013 21:30:01 +0200 (CEST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 19:30:13 -0000 works fine after your advice. thank you very much. FEATURE(`access_db') FEATURE(`blacklist_recipients') On Fri, 24 May 2013, Claus Assmann wrote: > On Fri, May 24, 2013, Trond Endrest?l wrote: > > [freebsd-hackers doesn't seem like the appropriate list...] > >>> FEATURE(access_db, `hash -o -T /etc/mail/access') > > Do NOT use -o. Moreover, do not specify arguments that are default. > FEATURE(`access_db') > is the best choice. > >> One final(?) note: You might need this line as well: > >> FEATURE(blacklist_recipients) > > That's not a "might", that's a "MUST" for this case. > > Note: (sendmail's) cf/README is a rather useful document. > From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 19:44:41 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 95928C7D for ; Fri, 24 May 2013 19:44:41 +0000 (UTC) (envelope-from waksmundzki@gmail.com) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) by mx1.freebsd.org (Postfix) with ESMTP id 68C4AD10 for ; Fri, 24 May 2013 19:44:41 +0000 (UTC) Received: by mail-ie0-f179.google.com with SMTP id c13so13583549ieb.10 for ; Fri, 24 May 2013 12:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=kbJz3puLTUZ9e4H9kQYDFMdNCiBw7vqg4dHiusyWW4Y=; b=Am8K+XrdRbnqV0Wob8Oy48KGWy0SMaDni/wngEf25aIe7wp52F9iSpyIDeGteNyQVu QnE6a4oH+JtCEmhKhot8QxxMwnsLZp0fSktVXZAVyRUqs43zpPlU4tLqD9rYWpgSDW4i NZDz4ao/p+drDqNI6X3HbrUG30sTaaC9nA1fd/zsq99mSIj2siFkpMbphXWAjAG1bHZA pCsyOHG/yLG9BDvOLhL9cR/oJAtNJgzakKriE8rdj0ykA5Tj7znJJ53e3DgvtOcA+IgH Xv6E2UzyV9sw2YsLLO1+FeqqCvENFKyGo3bEArZy39v3Y0/N8O68qwL5x8+d7oz97pac hpqw== X-Received: by 10.50.82.98 with SMTP id h2mr398616igy.33.1369424681143; Fri, 24 May 2013 12:44:41 -0700 (PDT) Received: from [192.168.1.107] (c-98-253-129-150.hsd1.il.comcast.net. [98.253.129.150]) by mx.google.com with ESMTPSA id ji5sm5143690igb.0.2013.05.24.12.44.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 May 2013 12:44:40 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: Low Tx-Rx performance with 10Gb NICs From: Robert Waksmundzki In-Reply-To: <1369406798.20748.30.camel@EL-DT095.site> Date: Fri, 24 May 2013 14:44:37 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <175CCF5F49938B4D99B2E3EF7F558EBE381FA6E5AA@SC-VEXCH4.marvell.com> <1369406798.20748.30.camel@EL-DT095.site> To: Axel Fischer X-Mailer: Apple Mail (2.1503) Cc: Hackers freeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 19:44:41 -0000 Hello Axel Have you done any sysctl.conf tuning? Perhaps simply you don't have = enough buffers. "netstat -m" will check for mbufs and "vmstat -z" will check for reached = kernel limits.= From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 20:33:44 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1BE0265A for ; Fri, 24 May 2013 20:33:44 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [188.252.31.196]) by mx1.freebsd.org (Postfix) with ESMTP id AB400F5E for ; Fri, 24 May 2013 20:33:42 +0000 (UTC) Received: from wojtek.tensor.gdynia.pl (localhost [127.0.0.1]) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6) with ESMTP id r4OKXGc1005807; Fri, 24 May 2013 22:33:16 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.6/8.14.6/Submit) with ESMTP id r4OKXGql005804; Fri, 24 May 2013 22:33:16 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 24 May 2013 22:33:16 +0200 (CEST) From: Wojciech Puchar To: "Welcome, Traiano" Subject: Re: Writing a (BSD like) Operating Systems From Scratch In-Reply-To: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> Message-ID: References: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.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 passed SPF test, not delayed by milter-greylist-4.2.7 (wojtek.tensor.gdynia.pl [127.0.0.1]); Fri, 24 May 2013 22:33:16 +0200 (CEST) Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 20:33:44 -0000 > > I've been read thousands of pages of FreeBSD and Linux Kernel source code and books on the internals of BSD and Linux over the years in attempt to develop a complete understanding of operating systems (or at least, UNIX like ones). However, I feel that I'm as mystified as to the finer details as when I first started. So I've concluded that the best way to really understand the deep dark details of UNIX is to try and write one from scratch (using the general guidelines of standards like POSIX etc ...), and maybe taking a peek at BSD and Linux from time to time. My questions around this are: except writing TCP/IP stack and filesystem it should be possible to do by single person. > > a) What kind of hardware (processor) would I use as a development platform, given the requirements of cheap, well documented, easily obtainable, easy to debug etc ... I believe the hardware platform chosen should satisfy the following requirements: any except PCs unless you will like to deal with CPU and other (over)complexity. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 22:19:09 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 214BF6D1 for ; Fri, 24 May 2013 22:19:09 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id E7E465E8 for ; Fri, 24 May 2013 22:19:08 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id 10so13819237ied.33 for ; Fri, 24 May 2013 15:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=1VHvOXLqTkV5tTW/XdD8rP4ebgUAIq8OP4vbSYGCnaA=; b=BfaecgFYcT5IrHpVec69WAKhUnm4XfAbBLsYkBOD+9IMQu96klv4S00mtD5A9ge2Pd j5igP4bPI4vJnLE72aTGNQzLHGrO2C/HMV2TzgPF/54SDVARUzouuBaZLjIQRdahmmwH O4Wv3nNEjcY1kBW+h34VZmwUQvgPFQDSHlGClwSwutL+QbYlzaaan2FNQ383yLGaFouw gKNcVsxU4q3RFBBOiKkZ9Ay9CoI+LjXByDp4XXRdR/zn/loIrgLc0q7RFLtExoiw8RdF sXkt0rPz0cXYRPrzTS5SHHFmV8wS/OLquWzoNCuggXIqruXz6NQDmARTSrxbxZprFxgV d3HQ== X-Received: by 10.50.114.228 with SMTP id jj4mr630858igb.38.1369433948621; Fri, 24 May 2013 15:19:08 -0700 (PDT) Received: from [192.168.1.34] (c-98-212-197-211.hsd1.il.comcast.net. [98.212.197.211]) by mx.google.com with ESMTPSA id n5sm1387551igx.1.2013.05.24.15.19.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 May 2013 15:19:08 -0700 (PDT) Message-ID: <519FE73F.4030502@gmail.com> Date: Fri, 24 May 2013 17:18:39 -0500 From: Joshua Isom User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Brian Reichert Subject: Re: Writing a (BSD like) Operating Systems From Scratch References: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> <20130524183350.GY11165@numachi.com> In-Reply-To: <20130524183350.GY11165@numachi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-hackers@freebsd.org" , "Julian H. Stacey" , "Welcome, Traiano" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 22:19:09 -0000 On 5/24/2013 1:33 PM, Brian Reichert wrote: > On Fri, May 24, 2013 at 04:57:44PM +0000, Welcome, Traiano wrote: >> Hi Julian >> >> Thanks, any response is appreciated, here's mine: > > I typed into Google: "how to write an OS", and got lots of hits. > Have you explored them? > > http://www.acm.uiuc.edu/sigops/roll_your_own/ > > http://mikeos.berlios.de/write-your-own-os.html > > http://stackoverflow.com/questions/254149/how-do-you-write-a-basic-operating-system > > Might I also recommend Contiki. I've never used it, but an existing, compact, full featured OS should be a good place to start. From owner-freebsd-hackers@FreeBSD.ORG Fri May 24 23:52:02 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F06287A for ; Fri, 24 May 2013 23:52:02 +0000 (UTC) (envelope-from jorge.garcia.gonzalez@gmail.com) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx1.freebsd.org (Postfix) with ESMTP id 20EC8A5C for ; Fri, 24 May 2013 23:52:01 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id hz10so3517186vcb.38 for ; Fri, 24 May 2013 16:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=U9I23mAJauNcEVMZhN3sP/bS92MAwD3OP4q7HZcHEaY=; b=mvDhbh5IIAtDLSpIjqJzZdBZI2+/a+0PQOz/cePvSgUN5XRNtvykp/VY/KxSVh80Q5 5awtepupZcUIWhXj9jGL3J56ccdjMZPV0dHOO1wtRpY9rErn/rE6Qp46+66FUlCKRW72 E7lB5flAUfYblEhuLnhbx5MEdw+3ozQGchnurSedys7LqenhqwNbd1KHwsgXbDW0OFos lXJ+ztU6SAjm1uJTSSOUYIxJTzRiwkeksm8ax15GernAjaN2WSBCd/ZZ04Or+fJjQuJb IxZGrA5MYtltUdB37SzoflVuhEWC6l4md+2DLF0x39+rHgR2DFeUFVYI8YCJvotVvgPj 4PyQ== X-Received: by 10.58.41.99 with SMTP id e3mr9899191vel.4.1369439514743; Fri, 24 May 2013 16:51:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.117.10 with HTTP; Fri, 24 May 2013 16:51:24 -0700 (PDT) In-Reply-To: <519FE73F.4030502@gmail.com> References: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> <20130524183350.GY11165@numachi.com> <519FE73F.4030502@gmail.com> From: Jorge Alberto Garcia Date: Fri, 24 May 2013 18:51:24 -0500 Message-ID: Subject: Re: Writing a (BSD like) Operating Systems From Scratch To: Joshua Isom Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-hackers@freebsd.org" , "Julian H. Stacey" , "Welcome, Traiano" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 23:52:02 -0000 Hello Joshua, i think you should try XV6, i am pretty one person can understand it to get a general yet down to the earth felling about a unix like system; then try with Minix2 http://pdos.csail.mit.edu/6.828/2012/xv6.html Tnx. -J.A. Garcia On Fri, May 24, 2013 at 5:18 PM, Joshua Isom wrote: > On 5/24/2013 1:33 PM, Brian Reichert wrote: > >> On Fri, May 24, 2013 at 04:57:44PM +0000, Welcome, Traiano wrote: >> >>> Hi Julian >>> >>> Thanks, any response is appreciated, here's mine: >>> >> >> I typed into Google: "how to write an OS", and got lots of hits. >> Have you explored them? >> >> http://www.acm.uiuc.edu/**sigops/roll_your_own/ >> >> http://mikeos.berlios.de/**write-your-own-os.html >> >> http://stackoverflow.com/**questions/254149/how-do-you-** >> write-a-basic-operating-system >> >> >> > Might I also recommend Contiki. I've never used it, but an existing, > compact, full featured OS should be a good place to start. > > ______________________________**_________________ > 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 " > From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 05:44:35 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A237FDB3 for ; Sat, 25 May 2013 05:44:35 +0000 (UTC) (envelope-from prvs=8502563be=welcomet@amazon.com) Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx1.freebsd.org (Postfix) with ESMTP id 62448F1D for ; Sat, 25 May 2013 05:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=welcomet@amazon.com; q=dns/txt; s=amazon201209; t=1369460675; x=1400996675; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=MuyGXpo4hQ3HCltxsesK3IKVjclDnv+vdPAbJWkoErk=; b=MQ96OChPJUiEl2ey4Qun6lA3UH893yeWZxux4CssJ09xxPqnvsqlOFxh JaZKK6/qEW33YLcoZCkExlQmStvweX7Lm9pxtpL7UdImPQhpqQA/Pc1Hz sx+J5ZiRQ8ftkUrV2uqXlX55Pu5366/oLo9VWBuTmHIm6CJ+C+mUu5Pyi g=; X-IronPort-AV: E=Sophos;i="4.87,739,1363132800"; d="scan'208";a="567155344" Received: from smtp-in-5102.iad5.amazon.com ([10.218.9.29]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 May 2013 05:44:33 +0000 Received: from ex10-hub-12001.ant.amazon.com (ex10-hub-12001.ant.amazon.com [10.32.58.112]) by smtp-in-5102.iad5.amazon.com (8.13.8/8.13.8) with ESMTP id r4P5iU8w013488 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Sat, 25 May 2013 05:44:33 GMT Received: from EX10-HUB-14002.ant.amazon.com (10.36.60.29) by ex10-hub-12001.ant.amazon.com (10.32.58.112) with Microsoft SMTP Server (TLS) id 14.2.247.3; Fri, 24 May 2013 22:44:30 -0700 Received: from EX10-MBX-14001.ant.amazon.com ([fe80::b957:af21:f5bc:52d1]) by ex10-hub-14002.ant.amazon.com ([::1]) with mapi id 14.02.0342.003; Fri, 24 May 2013 22:44:30 -0700 From: "Welcome, Traiano" To: Wojciech Puchar Subject: RE: Writing a (BSD like) Operating Systems From Scratch Thread-Topic: Writing a (BSD like) Operating Systems From Scratch Thread-Index: Ac5YY10UujfiegY2TwCTmdycZz/xLQAlTqUAAARECkA= Date: Sat, 25 May 2013 05:44:28 +0000 Message-ID: <8F56C8EF8265DF489B64A19B10910AC7025E4E12@ex10-mbx-14001.ant.amazon.com> References: <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.36.9.178] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 05:44:35 -0000 Hi Wojciech > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org [mailto:owner-freebsd- > hackers@freebsd.org] On Behalf Of Wojciech Puchar > Sent: 24 May 2013 22:33 > To: Welcome, Traiano > Cc: freebsd-hackers@freebsd.org > Subject: Re: Writing a (BSD like) Operating Systems From Scratch >=20 > > > > I've been read thousands of pages of FreeBSD and Linux Kernel source > code and books on the internals of BSD and Linux over the years in attemp= t > to develop a complete understanding of operating systems (or at least, UN= IX > like ones). However, I feel that I'm as mystified as to the finer details= as > when I first started. So I've concluded that the best way to really under= stand > the deep dark details of UNIX is to try and write one from scratch (using= the > general guidelines of standards like POSIX etc ...), and maybe taking a p= eek at > BSD and Linux from time to time. My questions around this are: >=20 > except writing TCP/IP stack and filesystem it should be possible to do by > single person. Agreed. Like everyone else, I'd pilfer the TCP/IP stack. Although a rudimen= tary filesystem may actually be doable by one person (hmmm ... reiser comes= to mind ;-) ) >=20 > > > > a) What kind of hardware (processor) would I use as a development > platform, given the requirements of cheap, well documented, easily > obtainable, easy to debug etc ... I believe the hardware platform chosen > should satisfy the following requirements: >=20 > any except PCs unless you will like to deal with CPU and other > (over)complexity. Exactly my thinking. Most of the online links to operating system developme= nt involve x86 hardware, although more and more Microcontrollers are appear= ing for embedded market with features that previously only existed in mains= tream microprocessors. Ideally, the platform I'd choose would have a small = enough instruction set to learn (small relative to Intel's mainstream proce= ssors), maybe something like the ARM processor used on Raspberry Pi, or Zi= log's ez80 Acclaim series.=20 >=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" From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 08:06:41 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 785A6CCD for ; Sat, 25 May 2013 08:06:41 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 10CD55E6 for ; Sat, 25 May 2013 08:06:40 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id 0905ABC5B5; Sat, 25 May 2013 08:06:40 +0000 (UTC) Date: Sat, 25 May 2013 10:06:40 +0200 From: Jeremie Le Hen To: freebsd-hackers@FreeBSD.org Subject: Turn libc.so into an ld script Message-ID: <20130525080639.GS71389@caravan.chchile.org> Mail-Followup-To: freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="FsscpQKzF/jJk6ya" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 08:06:41 -0000 --FsscpQKzF/jJk6ya Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, There has been quite a while since the SSP glue has been committed in the tree. Yet there has always been a gloomy corner case since then that was reported from time to time, mainly by port maintainers, which has been hard to reproduce. This is the main showstopper to enable SSP for ports by default. On i386 for PIC objects, gcc uses the __stack_chk_fail_local hidden symbol instead of calling __stack_chk_fail directly [1]. This happen not only with our gcc-4.2.1 but also with the latest gcc-4.8. If you want the very nasty details, see [2]. OTOH the problem doesn't exist on other architectures. It also doesn't exist with Clang as the latter will somehow manage to create the function in the object file at compile time (contrary to only referencing it through a symbol that will be brought in at link time). In a perfect world, when an object file is compiled with -fstack-protector, it will be linked into a binary or a DSO with this same flag as well, so GCC will add libssp_nonshared.a to the linker command-line. Unfortunately, we don't control softwares in ports and we may have such broken DSO. This is the whole point of this patch. I wrote a specific test that exhibits the error: http://people.freebsd.org/~jlh/twisted_ssp_linktime_fail.shar If you run "make main" on i386, it will fail. More details at [3]. So the attached patch turns libc.so into an ld script which will automatically _propose_ libssp_nonshared.a along with the real libc DSO to the linker. It is important to understand that the object file contained in this library will be pulled in the resulting binary _only if_ the linker notices one of its symbols is needed (i.e. one of the SSP symbol is missing). Otherwise nothing is changed, except a slight theorical overhead that I wasn't able to measure on my Core 2 developement machine with -j 4: x current + current_libc_ldscript +------------------------------------------------------------------------------+ | ++ x+ xx + x| |||_____________M__M_______A____A___________________|__________| | +------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 4 9130 9227 9136 9157 46.740418 + 4 9126 9207 9132 9148 39.420807 Any objection to the patch? Thanks for reading, [1] See comment here if you wonder why: sed -n 19460,+3p src/contrib/gcc/config/i386/i386.c [2] When compiling a source file to an object file, if you use something which is external to the compilation unit, GCC doesn't know yet if this symbol will be inside or outside the DSO. So it expects the worst case and routes the symbol through the GOT, which means additional space and extra relocation for rtld(1). Declaring a symbol has hidden tells GCC to use the optimal route (no GOT), but on the other hand this means the symbol has to be provided in the same DSO (namely libssp_nonshared.a). On i386, GCC actually uses an hidden symbol for SSP in PIC objects to save PIC register setup, as said in [1]. [3] As abstractly explained in [2], the problem shows up as long as you compile a PIC (or PIE) object but you don't link it directly with libssp_nonshared.a. So in the test I gave, you can also trigger the problem by setting "BIN_CFLAGS= -fstack-protector-all -fPIE" and leaving BIN_LDFLAGS blank, whatever you did with LIB_{CFLAGS,LDFLAGS}. This won't happen without -fPIE here, because a non-hidden symbol will be emitted in that case. -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. --FsscpQKzF/jJk6ya Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="libc_ldscript.diff" Index: lib/libc/Makefile =================================================================== --- lib/libc/Makefile (revision 250307) +++ lib/libc/Makefile (working copy) @@ -33,6 +33,12 @@ INSTALL_PIC_ARCHIVE= PRECIOUSLIB= +# Only use an ld script in place of the so file on i386, because of +# the way -fstack-protector works on gcc. +.if ${MACHINE_CPUARCH} == "i386" +SHLIB_LDSCRIPT=libc.ldscript +.endif + .ifndef NO_THREAD_STACK_UNWIND CANCELPOINTS_CFLAGS=-fexceptions CFLAGS+=${CANCELPOINTS_CFLAGS} Index: lib/libc/libc.ldscript =================================================================== --- lib/libc/libc.ldscript (revision 0) +++ lib/libc/libc.ldscript (working copy) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +GROUP ( @@SHLIB@@ @@LIBDIR@@/libssp_nonshared.a ) --FsscpQKzF/jJk6ya-- From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 10:55:21 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E97F9DB1 for ; Sat, 25 May 2013 10:55:21 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id AA4BFB08 for ; Sat, 25 May 2013 10:55:21 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UgC87-0001uy-SB for freebsd-hackers@freebsd.org; Sat, 25 May 2013 12:55:19 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 May 2013 12:55:19 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 May 2013 12:55:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Subject: Re: Writing a (BSD like) Operating Systems From Scratch Date: Sat, 25 May 2013 12:55:09 +0200 Lines: 61 Message-ID: References: Your message "Fri, 24 May 2013 10:15:23 -0000." <8F56C8EF8265DF489B64A19B10910AC7025C53B2@ex10-mbx-14001.ant.amazon.com> <201305241340.r4ODcju4009740@fire.js.berklix.net> <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2VDABWLKFQQDWSTJAWNPA" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130322 Thunderbird/17.0.4 In-Reply-To: <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> X-Enigmail-Version: 1.5.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 10:55:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2VDABWLKFQQDWSTJAWNPA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 24/05/2013 18:57, Welcome, Traiano wrote: > You appear not to realize that to even begin working with one of the ex= isting projects, you'd best have a solid understanding of OSes to begin w= ith,=20 > which brings up an interesting catch -22 that goes something like: >=20 > "You can't join the club, because you don't know enough. You can't kno= w enough 'till you join our club".=20 Not at all - it all depends on how strongly you wish to do it and how much time you can devote to it. It won't be easy. Documentation is basically the source, and people have no time to help you or guide you (nor can you expect them to since they are mostly volunteers and have their own lives to live - this is why Julian suggested a uni which is paid to teach you). The usual way things like this work (and which I've taken, as well as most people here that I know) is that you begin at one subsystem, write something in it, then if you feel the need expand to subystems connected to that one, and repeat if necessary. If you wish to be productive, you could ask for a suggestion of such subsystems which could be easy-ish to begin with. > I don't accept the conjecture that modern OSes are too big for one man.= Modern OSes and their associated entourage of userpace and plugin module= s maybe, but not the basic kernel/supervisor program. An OS is as big or = small as you make it.=20 Oh yes they are. The most you can hope for if you try to do it yourself is to write an "example" OS kernel which will do the few things you yourself are able to do, or even realize that they need to be done. The usual way THAT works is that as you go along you find out how the seemingly simple thing you thought needs to be done is only a small part of what is really needed, or completely insufficient, and that to solve the problem correctly, you need another 5 years to work at it - and there is a LOT of problems like that. Ask Matt Dillon [NHF, respect] :) ------enig2VDABWLKFQQDWSTJAWNPA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlGgmI0ACgkQ/QjVBj3/HSxCVwCgimRUZ5fO7x6Vc7ASbPfVsKj1 wm4AoJ5MR11ewsendpygujMKEPoJJ0yQ =cexn -----END PGP SIGNATURE----- ------enig2VDABWLKFQQDWSTJAWNPA-- From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 11:29:56 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 95A5460F for ; Sat, 25 May 2013 11:29:56 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from flat.berklix.org (flat.berklix.org [83.236.223.115]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB99CE0 for ; Sat, 25 May 2013 11:29:55 +0000 (UTC) Received: from mart.js.berklix.net (p5DCBDF1C.dip0.t-ipconnect.de [93.203.223.28]) (authenticated bits=128) by flat.berklix.org (8.14.5/8.14.5) with ESMTP id r4PBTm2k074885; Sat, 25 May 2013 13:29:48 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id r4P1Ng6q094469; Sat, 25 May 2013 03:23:42 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id r4P1NWqR031017; Sat, 25 May 2013 03:24:00 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201305250124.r4P1NWqR031017@fire.js.berklix.net> To: "Welcome, Traiano" Subject: Re: Writing a (BSD like) Operating Systems From Scratch From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Fri, 24 May 2013 16:57:44 -0000." <8F56C8EF8265DF489B64A19B10910AC7025DF4B3@ex10-mbx-14001.ant.amazon.com> Date: Sat, 25 May 2013 03:23:32 +0200 Sender: jhs@berklix.com Cc: "freebsd-hackers@freebsd.org" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 11:29:56 -0000 "Welcome, Traiano" wrote: > May I ask where you get the divine wisdom to know where I "would be better working with" ? don't you think that would be best left up to me? etc ... elided As politeness fails: Waste your own time as you want. Don't waste FreeBSD people's time, asking advice how to waste your time, with no benefit to FreeBSD. We're better ignoring that & using send-pr to send patches to FreeBSD on anything else we choose :-) If you want to be a useless lone wolf Not contributing to FreeBSD, do just that, go away & don't freeload for help. I hope instead you'll want to work as a team member & contribute where you think best, but If you want to screw around with an OS on your own - Do It On Your Own. As to who I am, it shouldn't matter as an idea should stand or fall on its merits, but in case it's a genuine question: I'm someone who learnt in 1983 that H/W for OS's evolves faster than small teams can keep up. Who saw a waster in 80s/90's who wanted to rewrite everything, & contributed nothing. Who saw OSs evolve faster than individuals, & knows team work is required, each dividing into specialisms to support the aggregate OS. Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com Reply below not above, like a play script. Indent old text with "> ". Send plain text. No quoted-printable, HTML, base64, multipart/alternative. From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 13:18:59 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 833ECCA3 for ; Sat, 25 May 2013 13:18:59 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from flat.berklix.org (flat.berklix.org [83.236.223.115]) by mx1.freebsd.org (Postfix) with ESMTP id 194D913D for ; Sat, 25 May 2013 13:18:58 +0000 (UTC) Received: from mart.js.berklix.net (p5DCBD652.dip0.t-ipconnect.de [93.203.214.82]) (authenticated bits=128) by flat.berklix.org (8.14.5/8.14.5) with ESMTP id r4PDIoXa075164; Sat, 25 May 2013 15:18:50 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id r4PDJ0Hs097230; Sat, 25 May 2013 15:19:00 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id r4PDIN4n022811; Sat, 25 May 2013 15:18:28 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201305251318.r4PDIN4n022811@fire.js.berklix.net> To: Jorge Alberto Garcia Subject: Re: Writing a (BSD like) Operating Systems From Scratch From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Fri, 24 May 2013 18:51:24 CDT." Date: Sat, 25 May 2013 15:18:23 +0200 Sender: jhs@berklix.com Cc: "freebsd-hackers@freebsd.org" , Joshua Isom , "Welcome, Traiano" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 13:18:59 -0000 Jorge Alberto Garcia wrote: > > Hello Joshua, i think you should try XV6, i am pretty one person can > understand it to get a general yet down to the earth felling about a unix > like system; then try with Minix2 > > http://pdos.csail.mit.edu/6.828/2012/xv6.html > > Tnx. > -J.A. Garcia Great to read about XV6, fond memories reading the Lions book in the 80s :-) FYI http://www.minix3.org "MINIX 3 won a grant from the European Research Council for 2.5 million Euro to further research in highly reliable operating systems." Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com Reply below not above, like a play script. Indent old text with "> ". Send plain text. No quoted-printable, HTML, base64, multipart/alternative. From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 14:04:13 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1F71A87E for ; Sat, 25 May 2013 14:04:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 08E1726B for ; Sat, 25 May 2013 14:04:13 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4PE4CVf071992 for ; Sat, 25 May 2013 14:04:12 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4PE4Cic071990 for freebsd-hackers@FreeBSD.org; Sat, 25 May 2013 14:04:12 GMT (envelope-from bdrewery) Received: (qmail 6437 invoked from network); 25 May 2013 09:04:11 -0500 Received: from unknown (HELO ?10.10.1.133?) (freebsd@shatow.net@10.10.1.133) by sweb.xzibition.com with ESMTPA; 25 May 2013 09:04:11 -0500 Message-ID: <51A0C4CD.6000709@FreeBSD.org> Date: Sat, 25 May 2013 09:03:57 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org, Jeremie Le Hen Subject: Re: Turn libc.so into an ld script References: <20130525080639.GS71389@caravan.chchile.org> In-Reply-To: <20130525080639.GS71389@caravan.chchile.org> X-Enigmail-Version: 1.5.1 OpenPGP: id=3C9B0CF9; url=http://www.shatow.net/bryan/bryan.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2QWFUPXFEWVEIJIRFAVTU" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 14:04:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2QWFUPXFEWVEIJIRFAVTU Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've been running my systems with this modification since Feb 2012 and have seen no problems beyond file(1) usage on /usr/lib/libc.so in openssl's configure. I've taken ports/168010 and ports/138228 for exp-runs. I want to get (optional) SSP support into ports this year. I'll start a libc.ld exp-run tomorrow. It will be ran against 9.1-RELEASE since HEAD currently only has 1/2 of the ports tree passing due to the clang switch. Bryan On 5/25/2013 3:06 AM, Jeremie Le Hen wrote: > Hi, >=20 > There has been quite a while since the SSP glue has been committed in > the tree. Yet there has always been a gloomy corner case since then > that was reported from time to time, mainly by port maintainers, which > has been hard to reproduce. This is the main showstopper to enable SSP= > for ports by default. >=20 > On i386 for PIC objects, gcc uses the __stack_chk_fail_local hidden > symbol instead of calling __stack_chk_fail directly [1]. This happen > not only with our gcc-4.2.1 but also with the latest gcc-4.8. If you > want the very nasty details, see [2]. >=20 > OTOH the problem doesn't exist on other architectures. It also doesn't= > exist with Clang as the latter will somehow manage to create the > function in the object file at compile time (contrary to only > referencing it through a symbol that will be brought in at link time). >=20 > In a perfect world, when an object file is compiled with > -fstack-protector, it will be linked into a binary or a DSO with this > same flag as well, so GCC will add libssp_nonshared.a to the linker > command-line. Unfortunately, we don't control softwares in ports and w= e > may have such broken DSO. This is the whole point of this patch. >=20 > I wrote a specific test that exhibits the error: > http://people.freebsd.org/~jlh/twisted_ssp_linktime_fail.shar > If you run "make main" on i386, it will fail. More details at [3]. >=20 > So the attached patch turns libc.so into an ld script which will > automatically _propose_ libssp_nonshared.a along with the real libc DSO= > to the linker. It is important to understand that the object file > contained in this library will be pulled in the resulting binary > _only if_ the linker notices one of its symbols is needed (i.e. one of > the SSP symbol is missing). Otherwise nothing is changed, except a > slight theorical overhead that I wasn't able to measure on my Core 2 > developement machine with -j 4: >=20 > x current > + current_libc_ldscript > +----------------------------------------------------------------------= --------+ > | ++ x+ xx + = x| > |||_____________M__M_______A____A___________________|__________| = | > +----------------------------------------------------------------------= --------+ > N Min Max Median Avg St= ddev > x 4 9130 9227 9136 9157 46.74= 0418 > + 4 9126 9207 9132 9148 39.42= 0807 >=20 >=20 > Any objection to the patch? >=20 > Thanks for reading, >=20 >=20 > [1] See comment here if you wonder why: > sed -n 19460,+3p src/contrib/gcc/config/i386/i386.c >=20 > [2] When compiling a source file to an object file, if you use somethin= g > which is external to the compilation unit, GCC doesn't know yet if > this symbol will be inside or outside the DSO. So it expects the > worst case and routes the symbol through the GOT, which means > additional space and extra relocation for rtld(1). >=20 > Declaring a symbol has hidden tells GCC to use the optimal route (n= o > GOT), but on the other hand this means the symbol has to be provide= d > in the same DSO (namely libssp_nonshared.a). >=20 > On i386, GCC actually uses an hidden symbol for SSP in PIC objects > to save PIC register setup, as said in [1]. >=20 > [3] As abstractly explained in [2], the problem shows up as long as you= > compile a PIC (or PIE) object but you don't link it directly with > libssp_nonshared.a. > =20 > So in the test I gave, you can also trigger the problem by setting > "BIN_CFLAGS=3D -fstack-protector-all -fPIE" and leaving BIN_LDFLAGS= > blank, whatever you did with LIB_{CFLAGS,LDFLAGS}. >=20 > This won't happen without -fPIE here, because a non-hidden symbol > will be emitted in that case. >=20 >=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.o= rg" >=20 --=20 Regards, Bryan Drewery ------enig2QWFUPXFEWVEIJIRFAVTU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRoMTTAAoJEG54KsA8mwz5bl4P/2JZycpXMTyqAlXt3OW5XxDR rq/9L+CdnEn4KZHD6BgktN1k547LQdW2CrJ/NRaSgExESKdjEN2aCEEetUC38VFy 94HuKHw4PfXVE4V574OHHxXWiyU+Hc7J8zVJ0AArdP7E91SH+h990vETJ7EmNAtm yAjA/guBKob/dpL2dvLkzHkMAEqp3bcNpthEaTbx9jjKmpy+zV3vUQL3RmGCc7Dl dE1pad/oe+PhWBPGGwGXPz/eV9aU7n6vVpo3BIFGPqe2wI2EoXpqqPxVA5Qb2feH ix4yK7W0KZkYuIz5CdxkZJE6mpKBsh7i6fUugX3528+N9CTsc5BN3K13TC9rctF/ P0IO7+sP6bdNMOJ55kq/ojUgdx2RB9ZZZzVHEHZoE+wzOekOY9JC17HKZsLj7P86 uI/lDAbEPjUG/C5+sktnmjhF2gFVXgPeAnkp8H4Rn3Uih6PFH5VO8xU15/6q6Gal eegIyb7H3TDLWdHC4+6H2ZEjqxvSJeZyYp4ElKiOw/yW2f7xye4lEzOu+DIqpORS MfRP8C4vsYsPeVu397c4MOSejaF1wDp2W9HbElRmdxp0jizLBNBlJKhAooCRyl3N 5XD68CxrAO8B95uCF7CMr3vuco7YQrx2sRk90XbyMjAB+a4CwoM3f2zsV3B3DeFd /yHortaoJGwylLr98Oq8 =NgG8 -----END PGP SIGNATURE----- ------enig2QWFUPXFEWVEIJIRFAVTU-- From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 15:44:03 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A6766F24 for ; Sat, 25 May 2013 15:44:03 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 6E00D79F for ; Sat, 25 May 2013 15:44:03 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id BD276E6A2E for ; Sat, 25 May 2013 16:44:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=message-id :date:from:mime-version:to:subject:content-type :content-transfer-encoding; s=mail; bh=E/8oBOcVir68oOt9L44UL5pf7 4M=; b=npidSlScdtI/jeoJqb/r4O2E28sPCYyXzd1GIfaxWWj9HDuY1M6Aq8wpb w/8LZDzCIBYVkavlKgRFH2LexrwniBY4o2Z8GBeGfdpSGpjTJgKoYaWBas2uJPNz O2GL73pdeTeRZaONiYAAiRRpe1/Dn7Gj54y0UmJh15tAzRCvwk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=message-id :date:from:mime-version:to:subject:content-type :content-transfer-encoding; q=dns; s=mail; b=dckOrD4ljJP2bfTS0f6 gEKkaRNmNIpB6QpjAO0FJTiOXJzeJu2jWU+0dzcVb26nx0Y2XAWESEzSqvmxz7fj dsl8/k435pK+ffN6TGePKMSXhHfpT4JPRP7+02IGkyjRjcIdxpSudkCHVGkBhCSn elP6Pq8cqaWiNQ9ZEcUPx+Ic= Received: from [192.168.2.61] (unknown [93.89.81.205]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 8E070E6A2D for ; Sat, 25 May 2013 16:44:01 +0100 (BST) Message-ID: <51A0DC3F.9030301@cran.org.uk> Date: Sat, 25 May 2013 16:43:59 +0100 From: Bruce Cran User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: FreeBSD installers and future direction Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 15:44:03 -0000 I heard there was some discussion at BSDCan about the direction of a future FreeBSD installer. Considering we currently have bsdinstall, pc-sysinstall, and an effort to revive sysinstall, I'd be interested to know what was decided (if anything) and whether I could help make progress towards getting a single really good installer/frontend - instead of the current situation with several, none of which have a much-needed UI for setting up an installation on ZFS. -- Bruce Cran From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 16:15:59 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6901629 for ; Sat, 25 May 2013 16:15:59 +0000 (UTC) (envelope-from mattjeet@gmail.com) Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [IPv6:2a00:1450:400c:c03::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 6228D880 for ; Sat, 25 May 2013 16:15:59 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id u59so2857619wes.29 for ; Sat, 25 May 2013 09:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=hxc6pGtZtTp2gdWx8bwYT8GK+XDqxKqcHQdnM4CF9Yw=; b=SY/W7pdApcqWCaCOClESBK1i9hhJTOkqc46krp7L5fD3IUhBzh38Sumjs6FqefLoFU ogAIdtJ5SrxM2XzoK32fRwaSpn518CA5EWiCOQVq5k2qSqcsUGCXOsMdh2VhDQ257iCB ZmyVd5zcbxBsqWiptwPNcSAHSyGP9MmbB9waIsBmXnu6i0OiRYzxoCGpCy25HFANkC7k brLVe7by0iBmrqp7bA6mudG9lPh+f7+0YOL6pl9fPbr5twDdfozZx7roHrCbMGcIgrS7 7qRRUPjqj6jZWvTtOwC1h+mDZ2A9IT028soHvjjRNcXimBbtZfNeScJzUy0sMsGktxSo qKlg== MIME-Version: 1.0 X-Received: by 10.180.149.200 with SMTP id uc8mr2754462wib.3.1369498558602; Sat, 25 May 2013 09:15:58 -0700 (PDT) Sender: mattjeet@gmail.com Received: by 10.194.40.5 with HTTP; Sat, 25 May 2013 09:15:58 -0700 (PDT) In-Reply-To: <51A0DC3F.9030301@cran.org.uk> References: <51A0DC3F.9030301@cran.org.uk> Date: Sat, 25 May 2013 09:15:58 -0700 X-Google-Sender-Auth: _UdnQtHK-LPEiSIsQ_e5nNKD0Uk Message-ID: Subject: Re: FreeBSD installers and future direction From: Matt Olander To: Bruce Cran Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Devin Teske , Kris Moore X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: matt@ixsystems.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 16:15:59 -0000 On Sat, May 25, 2013 at 8:43 AM, Bruce Cran wrote: > > I heard there was some discussion at BSDCan about the direction of a futu= re FreeBSD installer. Considering we currently have bsdinstall, pc-sysinst= all, and an effort to revive sysinstall, I'd be interested to know what was= decided (if anything) and whether I could help make progress towards getti= ng a single really good installer/frontend - instead of the current situati= on with several, none of which have a much-needed UI for setting up an inst= allation on ZFS. Hey Bruce, >From my vague recollection, we discussed improving bsdinstall by tying it in with pc-sysinstall, which we've been threatening to do for at least a year. Also, there was much discussion about Devin's bsdconfig perhaps tying in with a Google SoC Project. I think Devin was nominated for most of the work, since he was unable to defend himself :P Cheers, -matt From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 17:29:48 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C14B5C3C for ; Sat, 25 May 2013 17:29:48 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 502F0B60 for ; Sat, 25 May 2013 17:29:48 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id ea20so5447735lab.12 for ; Sat, 25 May 2013 10:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=KrgvuvOkPArOaO471orBdF+tp3ZkzQThvFSRv2Pzf4o=; b=K5XtdJ5I4SI85oEZEVkli6tCgIIvyuPzedH4OPoRiJxCUr15jtJ3HrJuUCkkHey3zG aDnHMzF9NHcXBL2WwpviqyAo9Kv973IysNHWbgsv4h2nF6/t4JvFM2Q3VugHa/FpKkCV 3dv+MiXWYXSxUFGa3CgkRdTY+uBGQgly8iH6j6TZnAmplRaBeCLRS/9CLyB4lOU5WodW XXzWI8j6TX4qfMVXkLhbekfBrW8H7ggn27+kzuQAnu4QtRafqwIykqPN3PnXiiQgNMvL 430yJJuI2SYSJZvlx/WUX2WpHXHilFWKOE/sZXO49lkVU9hnLyPWKe5QIe33jbDN1qck PNXw== MIME-Version: 1.0 X-Received: by 10.112.148.166 with SMTP id tt6mr10819278lbb.129.1369502986637; Sat, 25 May 2013 10:29:46 -0700 (PDT) Received: by 10.112.59.233 with HTTP; Sat, 25 May 2013 10:29:46 -0700 (PDT) Date: Sat, 25 May 2013 13:29:46 -0400 Message-ID: Subject: Creative X-Fi Audio Notebook (SB0950) support? From: Zhihao Yuan To: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 17:29:48 -0000 It's not a X-Fi sound card at all. Its chip is CA0106-WBTLF (from Wikipedia). But it's the only sound card available on ExpressCard, so it's kinda a great choice for laptop users. Is that possible to add its support into FreeBSD OSS? On my FreeBSD 8.4 machine, it's recognized as May 25 12:36:27 elitebook kernel: ugen2.3: at usbus2 May 25 12:36:27 elitebook kernel: uhid0: on usbus2 May 25 12:36:27 elitebook kernel: ukbd0: on usbus2 May 25 12:36:27 elitebook kernel: kbd2 at ukbd0 May 25 12:36:27 elitebook kernel: uaudio0: on usbus2 May 25 12:36:27 elitebook kernel: uaudio0: No playback. May 25 12:36:27 elitebook kernel: uaudio0: Record: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer. May 25 12:36:27 elitebook kernel: uaudio0: No MIDI sequencer. May 25 12:36:27 elitebook kernel: pcm6: on uaudio0 May 25 12:36:27 elitebook kernel: uaudio0: HID volume keys found. OSSv4 (including the latest versions in hg) does not work either, -- Zhihao Yuan, ID lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 18:26:38 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A04A2B94 for ; Sat, 25 May 2013 18:26:38 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 6671FE69 for ; Sat, 25 May 2013 18:26:38 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 6D843E6A2E for ; Sat, 25 May 2013 19:26:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; s=mail; bh=/7jjFJCfQEEx MpjWuzQ+l7/IR20=; b=Y1AfIND1pRjhuAaCP8M/9ZLgdfpPuE998P9IlxEx2Bx0 qLKJPtqYH+sL7QOo24BBemewAZYnEFyYw+h4Cj1yDcjvFowlqkZ7C/qoYoIJZV+I T2q0RcFI5CnkdGXLNqP+1KRRNbcD5jKnN1D8uuIrYKao/5Fu5pOkdoHC9mtDHEc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=mail; b=ki0wMi ymu5bBEsLEkZ6jaewnsvA/B4oHztfynRSpy/DKGdEC9DWELarYulIsvca+Rs/TiS BcrdcXAsF2t5wtnsrC4HawHN5U8r9cCQ2jWV7bfKwXy1gDYbaP8LNMvbx7mGwS/O ztpwXFIvybufg/Ytvq2fW5UoZ3E9kuUQjqJk4= Received: from [192.168.2.61] (unknown [93.89.81.205]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 52CB9E6A2D for ; Sat, 25 May 2013 19:26:37 +0100 (BST) Message-ID: <51A1025A.2020607@cran.org.uk> Date: Sat, 25 May 2013 19:26:34 +0100 From: Bruce Cran User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: FreeBSD installers and future direction References: <51A0DC3F.9030301@cran.org.uk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 18:26:38 -0000 On 25/05/2013 17:15, Matt Olander wrote: > From my vague recollection, we discussed improving bsdinstall by tying > it in with pc-sysinstall, which we've been threatening to do for at > least a year. Also, there was much discussion about Devin's bsdconfig > perhaps tying in with a Google SoC Project. > > I think Devin was nominated for most of the work, since he was unable > to defend himself :P Thanks. From previous discussions with Devin I think he has other plans for the installer that don't involve pc-sysinstall. But since it seems the future is all sh(1) code, I won't be able to contribute. https://wiki.freebsd.org/PCBSDInstallMerge lists a few limitations with pc-sysinstall - are these being fixed? -- Bruce From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 19:16:43 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52AF8D25; Sat, 25 May 2013 19:16:43 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 04A9210D; Sat, 25 May 2013 19:16:42 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id D4426BC982; Sat, 25 May 2013 19:16:41 +0000 (UTC) Date: Sat, 25 May 2013 21:16:41 +0200 From: Jeremie Le Hen To: Bryan Drewery Subject: Re: Turn libc.so into an ld script Message-ID: <20130525191641.GC70224@caravan.chchile.org> Mail-Followup-To: Bryan Drewery , freebsd-hackers@FreeBSD.org References: <20130525080639.GS71389@caravan.chchile.org> <51A0C4CD.6000709@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51A0C4CD.6000709@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Jeremie Le Hen , freebsd-hackers@FreeBSD.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 19:16:43 -0000 On Sat, May 25, 2013 at 09:03:57AM -0500, Bryan Drewery wrote: > I've been running my systems with this modification since Feb 2012 and > have seen no problems beyond file(1) usage on /usr/lib/libc.so in > openssl's configure. > > I've taken ports/168010 and ports/138228 for exp-runs. I want to get > (optional) SSP support into ports this year. > > I'll start a libc.ld exp-run tomorrow. It will be ran against > 9.1-RELEASE since HEAD currently only has 1/2 of the ports tree passing > due to the clang switch. Ok thank you for helping on this :). I talked with kan@ on IRC, and he suggested that having arch-specific deviation for this may not be a good idea. As I explained in my previous e-mail, there is no impact speed-wise or space-wise, so would you mind to do the exp-run using this patch instead please? http://people.freebsd.org/~jlh/libc_ldscript_noarch.diff Thanks, > On 5/25/2013 3:06 AM, Jeremie Le Hen wrote: > > Hi, > > > > There has been quite a while since the SSP glue has been committed in > > the tree. Yet there has always been a gloomy corner case since then > > that was reported from time to time, mainly by port maintainers, which > > has been hard to reproduce. This is the main showstopper to enable SSP > > for ports by default. > > > > On i386 for PIC objects, gcc uses the __stack_chk_fail_local hidden > > symbol instead of calling __stack_chk_fail directly [1]. This happen > > not only with our gcc-4.2.1 but also with the latest gcc-4.8. If you > > want the very nasty details, see [2]. > > > > OTOH the problem doesn't exist on other architectures. It also doesn't > > exist with Clang as the latter will somehow manage to create the > > function in the object file at compile time (contrary to only > > referencing it through a symbol that will be brought in at link time). > > > > In a perfect world, when an object file is compiled with > > -fstack-protector, it will be linked into a binary or a DSO with this > > same flag as well, so GCC will add libssp_nonshared.a to the linker > > command-line. Unfortunately, we don't control softwares in ports and we > > may have such broken DSO. This is the whole point of this patch. > > > > I wrote a specific test that exhibits the error: > > http://people.freebsd.org/~jlh/twisted_ssp_linktime_fail.shar > > If you run "make main" on i386, it will fail. More details at [3]. > > > > So the attached patch turns libc.so into an ld script which will > > automatically _propose_ libssp_nonshared.a along with the real libc DSO > > to the linker. It is important to understand that the object file > > contained in this library will be pulled in the resulting binary > > _only if_ the linker notices one of its symbols is needed (i.e. one of > > the SSP symbol is missing). Otherwise nothing is changed, except a > > slight theorical overhead that I wasn't able to measure on my Core 2 > > developement machine with -j 4: > > > > x current > > + current_libc_ldscript > > +------------------------------------------------------------------------------+ > > | ++ x+ xx + x| > > |||_____________M__M_______A____A___________________|__________| | > > +------------------------------------------------------------------------------+ > > N Min Max Median Avg Stddev > > x 4 9130 9227 9136 9157 46.740418 > > + 4 9126 9207 9132 9148 39.420807 > > > > > > Any objection to the patch? > > > > Thanks for reading, > > > > > > [1] See comment here if you wonder why: > > sed -n 19460,+3p src/contrib/gcc/config/i386/i386.c > > > > [2] When compiling a source file to an object file, if you use something > > which is external to the compilation unit, GCC doesn't know yet if > > this symbol will be inside or outside the DSO. So it expects the > > worst case and routes the symbol through the GOT, which means > > additional space and extra relocation for rtld(1). > > > > Declaring a symbol has hidden tells GCC to use the optimal route (no > > GOT), but on the other hand this means the symbol has to be provided > > in the same DSO (namely libssp_nonshared.a). > > > > On i386, GCC actually uses an hidden symbol for SSP in PIC objects > > to save PIC register setup, as said in [1]. > > > > [3] As abstractly explained in [2], the problem shows up as long as you > > compile a PIC (or PIE) object but you don't link it directly with > > libssp_nonshared.a. > > > > So in the test I gave, you can also trigger the problem by setting > > "BIN_CFLAGS= -fstack-protector-all -fPIE" and leaving BIN_LDFLAGS > > blank, whatever you did with LIB_{CFLAGS,LDFLAGS}. > > > > This won't happen without -fPIE here, because a non-hidden symbol > > will be emitted in that case. -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-freebsd-hackers@FreeBSD.ORG Sat May 25 20:27:16 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AC0224F for ; Sat, 25 May 2013 20:27:16 +0000 (UTC) (envelope-from lee_thomas@aslantools.com) Received: from roproxy1-pub.unifiedlayer.com (roproxy1-pub.unifiedlayer.com [69.89.25.95]) by mx1.freebsd.org (Postfix) with SMTP id 570AD644 for ; Sat, 25 May 2013 20:27:15 +0000 (UTC) Received: (qmail 28096 invoked by uid 0); 25 May 2013 20:27:07 -0000 Received: from unknown (HELO mailchannelsproxy2.unifiedlayer.com) (66.147.243.71) by roproxy1.unifiedlayer.com with SMTP; 25 May 2013 20:27:07 -0000 X-Sender-Id: {:fast21.fastdomain.com:lthomasn:fast21.fastdomain.com} {sentby:program running on server} Received: from fast21.fastdomain.com (fast21.fastdomain.com [74.220.199.21]) by 0.0.0.0:2500 (trex/4.8.65); Sat, 25 May 2013 20:27:07 GMT Received: from localhost ([127.0.0.1]:46627 helo=fast21.fastdomain.com) by fast21.fastdomain.com with esmtp (Exim 4.80) (envelope-from ) id 1UgL3T-0004yn-LG for freebsd-hackers@freebsd.org; Sat, 25 May 2013 14:27:07 -0600 To: Subject: Performance improvement to strnlen(). X-PHP-Script: aslantools.com/mail/index.php for 173.71.114.222 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_2697a7f791e36da50ef742466c06863a" Date: Sat, 25 May 2013 16:27:07 -0400 From: Lee Thomas Organization: Aslan Tools Message-ID: X-Sender: lee_thomas@aslantools.com User-Agent: Roundcube Webmail/0.8.4 X-Identified-User: {:fast21.fastdomain.com:lthomasn:fast21.fastdomain.com} {sentby:program running on server} X-Mailman-Approved-At: Sat, 25 May 2013 21:20:48 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2013 20:27:16 -0000 --=_2697a7f791e36da50ef742466c06863a Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8; format=flowed Hello FreeBSD devs, I have found a performance improvement to libc's strnlen(). lib/libc/string/strnlen.c is a trivial byte-by-byte implementation, where strlen.c has a smarter word-by-word implementation. I have implemented strnlen similarly to strlen. It runs about 4x as fast, at the cost of a binary codesize increase from 30 bytes to 221. In writing this I needed a test, and there isn't one in tools/regression/lib/libc/string, so I wrote a unit test for strnlen. This really only makes sense for a word-by-word implementation, as it tests each combination of string and limit length, overread characters, and starting alignment. Could someone please review these patches? I am not very experienced in C, and am even less experienced with FreeBSD's style guidelines, so they likely have a bunch of style and idiom issues. Even if one or both of them prove not worth committing, it would still be useful for my learning. If/When these patches prove worthy of submitting, what is the next step after that? Should I submit a PR, or is there some other process? This code is quite similar to the existing strlen.c, and doesn't do anything fancy with e.g. endianness, but I haven't tested it for correctness or performance on anything other than x86... And finally, there is some other low-hanging fruit in the other strn* functions. Would it be worth it for me to give those the same treatment? Thanks, Lee Thomas Test platform: $uname -a FreeBSD LeeDesktop 9.1-STABLE FreeBSD 9.1-STABLE #15 r250831: Mon May 20 17:31:28 EDT 2013 lthomas@LeeDesktop:/usr/obj/usr/src/sys/NOSOUND amd64 $dmesg | grep CPU: CPU: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz (2666.81-MHz K8-class CPU) $clang --version FreeBSD clang version 3.2 (tags/RELEASE_32/final 170710) 20121221 Target: x86_64-unknown-freebsd9.1 Thread model: posix My timing test was a file of 10000 strings, of uniformly random length, 50% between 0 and 20 bytes long, and 50% between 21 and 1000 bytes long. Each was filled with random generated bytes in the range [1, 255]. The test executables run their strlen on each string in the file 1000 times, and a shell script ran the test programs alternately 100 times. Here are the clang results; gcc results are roughly the same. I will share the actual timing code if someone wants it, but it is pretty ugly C++ and shell and I don't guarantee it working :-). Results: x ./times_bsd_strnlen.txt + ./times_my_strnlen.txt +--------------------------------------------------------------------------+ |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |+ x| |A A| +--------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 101 1.8685486 1.8693889 1.8687506 1.8687894 0.0001484903 + 101 0.42704683 0.42779486 0.42712813 0.42715597 0.00010681494 Difference at 95.0% confidence -1.44163 +/- 3.56739e-05 -77.1426% +/- 0.00190893% (Student's t, pooled s = 0.000129342) Note: I manually shortened the histogram, as it was 100 lines long of exactly the same. --=_2697a7f791e36da50ef742466c06863a Content-Transfer-Encoding: base64 Content-Type: text/plain; name=strnlen.diff Content-Disposition: attachment; filename=strnlen.diff; size=3185 SW5kZXg6IHN0cm5sZW4uYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09CmRpZmYgLS1naXQgYS9oZWFkL2xpYi9saWJjL3N0 cmluZy9zdHJubGVuLmMgYi9oZWFkL2xpYi9saWJjL3N0cmluZy9zdHJubGVuLmMKLS0tIGEvaGVh ZC9saWIvbGliYy9zdHJpbmcvc3Rybmxlbi5jCShyZXZpc2lvbiAyNTA5NTEpCisrKyBiL2hlYWQv bGliL2xpYmMvc3RyaW5nL3N0cm5sZW4uYwkod29ya2luZyBjb3B5KQpAQCAtMSw1ICsxLDYgQEAK IC8qLQotICogQ29weXJpZ2h0IChjKSAyMDA5IERhdmlkIFNjaHVsdHogPGRhc0BGcmVlQlNELm9y Zz4KKyAqIENvcHlyaWdodCAoYykgMjAwOSwgMjAxMCBYaW4gTEkgPGRlbHBoaWpARnJlZUJTRC5v cmc+CisgKiBDb3B5cmlnaHQgKGMpIDIwMTMgTGVlIFRob21hcyA8bGVlX3Rob21hc0BBc2xhblRv b2xzLmNvbT4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24g YW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC0y NywxNiArMjgsOTEgQEAKICNpbmNsdWRlIDxzeXMvY2RlZnMuaD4KIF9fRkJTRElEKCIkRnJlZUJT RCQiKTsKIAorI2luY2x1ZGUgPHN5cy9saW1pdHMuaD4KKyNpbmNsdWRlIDxzeXMvdHlwZXMuaD4K ICNpbmNsdWRlIDxzdHJpbmcuaD4KIAorLyoKKyAqIFBvcnRhYmxlIHN0cm5sZW4oKSBmb3IgMzIt Yml0IGFuZCA2NC1iaXQgc3lzdGVtcy4KKyAqCisgKiBSYXRpb25hbGU6IGl0IGlzIGdlbmVyYWxs eSBtdWNoIG1vcmUgZWZmaWNpZW50IHRvIGRvIHdvcmQgbGVuZ3RoCisgKiBvcGVyYXRpb25zIGFu ZCBhdm9pZCBicmFuY2hlcyBvbiBtb2Rlcm4gY29tcHV0ZXIgc3lzdGVtcywgYXMKKyAqIGNvbXBh cmVkIHRvIGJ5dGUtbGVuZ3RoIG9wZXJhdGlvbnMgd2l0aCBhIGxvdCBvZiBicmFuY2hlcy4KKyAq CisgKiBUaGUgZXhwcmVzc2lvbjoKKyAqCisgKgkoKHggLSAweDAxLi4uLjAxKSAmIH54ICYgMHg4 MC4uLi44MCkKKyAqCisgKiB3b3VsZCBldmFsdWF0ZSB0byBhIG5vbi16ZXJvIHZhbHVlIGlmZiBh bnkgb2YgdGhlIGJ5dGVzIGluIHRoZQorICogb3JpZ2luYWwgd29yZCBpcyB6ZXJvLgorICoKKyAq IE9uIG11bHRpLWlzc3VlIHByb2Nlc3NvcnMsIHdlIGNhbiBkaXZpZGUgdGhlIGFib3ZlIGV4cHJl c3Npb24gaW50bzoKKyAqCWEpICAoeCAtIDB4MDEuLi4uMDEpCisgKgliKSAofnggJiAweDgwLi4u LjgwKQorICoJYykgYSAmIGIKKyAqCisgKiBXaGVyZSwgYSkgYW5kIGIpIGNhbiBiZSBwYXJ0aWFs bHkgY29tcHV0ZWQgaW4gcGFyYWxsZWwuCisgKgorICogVGhlIGFsZ29yaXRobSBhYm92ZSBpcyBm b3VuZCBvbiAiSGFja2VyJ3MgRGVsaWdodCIgYnkKKyAqIEhlbnJ5IFMuIFdhcnJlbiwgSnIuCisg Ki8KKworLyogTWFnaWMgbnVtYmVycyBmb3IgdGhlIGFsZ29yaXRobSAqLworI2lmIExPTkdfQklU ID09IDMyCitzdGF0aWMgY29uc3QgdW5zaWduZWQgbG9uZyBtYXNrMDEgPSAweDAxMDEwMTAxOwor c3RhdGljIGNvbnN0IHVuc2lnbmVkIGxvbmcgbWFzazgwID0gMHg4MDgwODA4MDsKKyNlbGlmIExP TkdfQklUID09IDY0CitzdGF0aWMgY29uc3QgdW5zaWduZWQgbG9uZyBtYXNrMDEgPSAweDAxMDEw MTAxMDEwMTAxMDE7CitzdGF0aWMgY29uc3QgdW5zaWduZWQgbG9uZyBtYXNrODAgPSAweDgwODA4 MDgwODA4MDgwODA7CisjZWxzZQorI2Vycm9yIFVuc3VwcG9ydGVkIHdvcmQgc2l6ZQorI2VuZGlm CisKKyNkZWZpbmUJTE9OR1BUUl9NQVNLIChzaXplb2YobG9uZykgLSAxKQorCiBzaXplX3QKLXN0 cm5sZW4oY29uc3QgY2hhciAqcywgc2l6ZV90IG1heGxlbikKK3N0cm5sZW4oY29uc3QgY2hhciAq c3RyLCBzaXplX3QgbWF4bGVuKQogewotCXNpemVfdCBsZW47CisJY29uc3QgY2hhciAqc3RvcCwg KnNob3J0X3N0b3A7CisJY29uc3QgY2hhciAqcDsKKwljb25zdCB1bnNpZ25lZCBsb25nICpscDsK Kwlsb25nIHZhLCB2YjsKIAotCWZvciAobGVuID0gMDsgbGVuIDwgbWF4bGVuOyBsZW4rKywgcysr KSB7Ci0JCWlmICghKnMpCi0JCQlicmVhazsKKwlpZiAobWF4bGVuPT0wKSByZXR1cm4gMDsKKwor CXN0b3A9c3RyK21heGxlbjsKKwkvKgorCSAqIEJlZm9yZSB0cnlpbmcgdGhlIGhhcmQgKHVuYWxp Z25lZCBieXRlLWJ5LWJ5dGUgYWNjZXNzKSB3YXkKKwkgKiB0byBmaWd1cmUgb3V0IHdoZXRoZXIg dGhlcmUgaXMgYSBudWwgY2hhcmFjdGVyLCB0cnkgdG8gc2VlCisJICogaWYgdGhlcmUgaXMgYSBu dWwgY2hhcmFjdGVyIGlzIHdpdGhpbiB0aGlzIGFjY2Vzc2libGUgd29yZAorCSAqIGZpcnN0Lgor CSAqCisJICogcCBhbmQgKHAgJiB+TE9OR1BUUl9NQVNLKSBtdXN0IGJlIGVxdWFsbHkgYWNjZXNz aWJsZSBzaW5jZQorCSAqIHRoZXkgYWx3YXlzIGZhbGwgaW4gdGhlIHNhbWUgbWVtb3J5IHBhZ2Us IGFzIGxvbmcgYXMgcGFnZQorCSAqIGJvdW5kYXJpZXMgaXMgaW50ZWdyYWwgbXVsdGlwbGUgb2Yg d29yZCBzaXplLgorCSAqLworCWxwID0gKGNvbnN0IHVuc2lnbmVkIGxvbmcgKikoKHVpbnRwdHJf dClzdHIgJiB+TE9OR1BUUl9NQVNLKTsKKwl2YSA9ICgqbHAgLSBtYXNrMDEpOworCXZiID0gKCh+ KmxwKSAmIG1hc2s4MCk7CisJbHArKzsKKwlpZiAodmEgJiB2YikgeworCQkvKiBDaGVjayBpZiB3 ZSBoYXZlIFwwIGluIHRoZSBmaXJzdCBwYXJ0ICovCisJCXNob3J0X3N0b3A9KGNvbnN0IGNoYXIg KilscDsKKwkJaWYgKHN0b3A8c2hvcnRfc3RvcCkgc2hvcnRfc3RvcD1zdG9wOworCQlmb3IgKHA9 c3RyOyBwICE9IHNob3J0X3N0b3A7IHArKykKKwkJCWlmICgqcCA9PSAnXDAnKQorCQkJCXJldHVy biAocC1zdHIpOwogCX0KLQlyZXR1cm4gKGxlbik7CisJLyogU2NhbiB0aGUgcmVzdCBvZiB0aGUg c3RyaW5nIHVzaW5nIHdvcmQgc2l6ZWQgb3BlcmF0aW9uICovCisJZm9yICg7IChjb25zdCBjaGFy ICopbHAgPCBzdG9wOyBscCsrKSB7CisJCXZhID0gKCpscCAtIG1hc2swMSk7CisJCXZiID0gKCh+ KmxwKSAmIG1hc2s4MCk7CisJCWlmICh2YSAmIHZiKSB7CisJCQlmb3IgKHA9KGNvbnN0IGNoYXIg KilscDsgcCAhPSBzdG9wOyBwKyspCisJCQkJaWYgKCpwID09ICdcMCcpCisJCQkJCWJyZWFrOwor CQkJcmV0dXJuIChwLXN0cik7CisJCX0KKwl9CisJcmV0dXJuIChtYXhsZW4pOwogfQo= --=_2697a7f791e36da50ef742466c06863a Content-Transfer-Encoding: base64 Content-Type: text/plain; name=test-strnlen.diff Content-Disposition: attachment; filename=test-strnlen.diff; size=4392 SW5kZXg6IE1ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KZGlmZiAtLWdpdCBhL2hlYWQvdG9vbHMvcmVncmVz c2lvbi9saWIvbGliYy9zdHJpbmcvTWFrZWZpbGUgYi9oZWFkL3Rvb2xzL3JlZ3Jlc3Npb24vbGli L2xpYmMvc3RyaW5nL01ha2VmaWxlCi0tLSBhL2hlYWQvdG9vbHMvcmVncmVzc2lvbi9saWIvbGli Yy9zdHJpbmcvTWFrZWZpbGUJKHJldmlzaW9uIDI1MDk1MSkKKysrIGIvaGVhZC90b29scy9yZWdy ZXNzaW9uL2xpYi9saWJjL3N0cmluZy9NYWtlZmlsZQkod29ya2luZyBjb3B5KQpAQCAtNCw3ICs0 LDcgQEAKIExERkxBR1MrPQktTC91c3IvbG9jYWwvbGliCiBMRExJQlM9CQktbHRhcAogCi1URVNU Uz0JdGVzdC1zdHBuY3B5IHRlc3Qtc3RyZXJyb3IgdGVzdC13Y3NjYXNlY21wIHRlc3Qtd2Nzbmxl bgorVEVTVFM9CXRlc3Qtc3RwbmNweSB0ZXN0LXN0cmVycm9yIHRlc3Qtc3RybmxlbiB0ZXN0LXdj c2Nhc2VjbXAgdGVzdC13Y3NubGVuCiAKIC5QSE9OWTogdGVzdHMKIHRlc3RzOiAke1RFU1RTfQpJ bmRleDogdGVzdC1zdHJubGVuLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpkaWZmIC0tZ2l0IGEvaGVhZC90b29scy9y ZWdyZXNzaW9uL2xpYi9saWJjL3N0cmluZy90ZXN0LXN0cm5sZW4uYyBiL2hlYWQvdG9vbHMvcmVn cmVzc2lvbi9saWIvbGliYy9zdHJpbmcvdGVzdC1zdHJubGVuLmMKbmV3IGZpbGUgbW9kZSAxMDY0 NAotLS0gL2Rldi9udWxsCShyZXZpc2lvbiAwKQorKysgYi9oZWFkL3Rvb2xzL3JlZ3Jlc3Npb24v bGliL2xpYmMvc3RyaW5nL3Rlc3Qtc3Rybmxlbi5jCSh3b3JraW5nIGNvcHkpCkBAIC0wLDAgKzEs ODMgQEAKKy8qLQorICogQ29weXJpZ2h0IChjKSAyMDEzIExlZSBUaG9tYXMgPGxlZV90aG9tYXNA QXNsYW5Ub29scy5jb20+CisgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICoKKyAqIFJlZGlzdHJp YnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91 dAorICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxv d2luZyBjb25kaXRpb25zCisgKiBhcmUgbWV0OgorICogMS4gUmVkaXN0cmlidXRpb25zIG9mIHNv dXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHQKKyAqICAgIG5vdGljZSwg dGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci4KKyAq IDIuIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJv dmUgY29weXJpZ2h0CisgKiAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0 aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlCisgKiAgICBkb2N1bWVudGF0aW9uIGFuZC9v ciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLgorICoKKyAq IFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIEFVVEhPUiBBTkQgQ09OVFJJQlVUT1JT IGBgQVMgSVMnJyBBTkQKKyAqIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5D TFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRQorICogSU1QTElFRCBXQVJSQU5USUVTIE9G IE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UKKyAq IEFSRSBESVNDTEFJTUVELiAgSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBPUiBDT05UUklC VVRPUlMgQkUgTElBQkxFCisgKiBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUws IFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTAorICogREFNQUdFUyAoSU5DTFVE SU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMK KyAqIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5F U1MgSU5URVJSVVBUSU9OKQorICogSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkgT0Yg TElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QKKyAqIExJQUJJTElUWSwgT1Ig VE9SVCAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBX QVkKKyAqIE9VVCBPRiBUSEUgVVNFIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBP RiBUSEUgUE9TU0lCSUxJVFkgT0YKKyAqIFNVQ0ggREFNQUdFLgorICovCisjaW5jbHVkZSA8c3lz L2NkZWZzLmg+CitfX0ZCU0RJRCgiJEZyZWVCU0QkIik7CisKKyNpbmNsdWRlIDxzdGRpby5oPgor I2luY2x1ZGUgPHN0ZGxpYi5oPgorI2luY2x1ZGUgPHN0cmluZy5oPgorCisjZGVmaW5lIE1BWF9M RU4gKHNpemVvZihsb25nKSAqIDIpCitzdGF0aWMgdm9pZCB0ZXN0X3N0cm5sZW4oY2hhciBqdW5r X2ZpbGwsIHNpemVfdCBzdHJfbGVuLCBzaXplX3QgYWwpOworCisvKgorICogVGVzdHMgc3Rybmxl biBmb3IgdmFyaW91cyBsZW5ndGhzLCBidWZmZXIgcmVzdHJpY3Rpb25zLCBhbmQgYWxpZ25tZW50 cy4KKyAqIFNpbmNlIHN0cm5sZW4gcG90ZW50aWFsbHkgcmVhZHMgKGFuZCBicmFuY2hlcykgb24g YWxsIG9mIHRoZSBieXRlcyBpbiB0aGUKKyAqIGFsaWduZWQgd29yZHMgY29udGFpbmluZyB0aGUg c3RhcnQgYW5kIGVuZCBvZiB0aGUgdW5hbGlnbmVkIHN0cmluZywgd2UKKyAqIG5lZWQgdG8gdGVz dCBib3RoIHplcm8gYW5kIG5vbnplcm8gdmFsdWVzIG9mIHRob3NlIHJlYWQtYnV0LWRpc3JlZ2Fy ZGVkIGJ5dGVzLgorICogTm90ZSB0aGF0IHRoZSByZWFkcyB0aGVtc2VsdmVzIGFyZSBzYWZlIGJl Y2F1c2UgdGhlIHBhZ2Ugc2l6ZSBpcyBhbiBpbnRlZ2VyCisgKiBtdWx0aXBsZSBvZiB0aGUgd29y ZHNpemUuCisgKi8KK2ludAorbWFpbihpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisJc2l6ZV90 IGFsLCBzdHJfbGVuLCBydW5zOworCWNoYXIganVua19maWxsOworCXByaW50ZigiMS4uMVxuIik7 CisJZm9yIChqdW5rX2ZpbGwgPSAwOyBqdW5rX2ZpbGwgPD0gMTsganVua19maWxsKyspIHsKKwkJ Zm9yIChzdHJfbGVuID0gMDsgc3RyX2xlbiA8IE1BWF9MRU47IHN0cl9sZW4rKykgeworCQkJZm9y IChhbCA9IHNpemVvZihsb25nKTsgYWwgPCAyICogc2l6ZW9mKGxvbmcpOyBhbCsrKSB7CisJCQkJ dGVzdF9zdHJubGVuKGp1bmtfZmlsbCwgc3RyX2xlbiwgYWwpOworCQkJfQorCQl9CisJfQorCXBy aW50Zigib2sgMSAtIHN0cm5sZW5cbiIpOworCXJldHVybiAwOworfQorc3RhdGljIHZvaWQgCit0 ZXN0X3N0cm5sZW4oY2hhciBqdW5rX2ZpbGwsIHNpemVfdCBzdHJfbGVuLCBzaXplX3QgYWwpCit7 CisJLyoKKwkgKiBSZXF1aXJlZCBzaXplIGlzIDIqc2l6ZW9mKGxvbmcpIGp1bmssIE1BWF9MRU4g Y2hhcnMsIDEgbnVsLCBhbmQgCisJICogdGhlbiBzaXplb2YobG9uZykganVuaworCSAqLworCWNo YXIgYnVmW01BWF9MRU4gKyAxICsgMyAqIHNpemVvZihsb25nKV07CisJY2hhciAqIHN0cjsKKwlz aXplX3QgbGltaXRfbGVuLCBjb3JyZWN0X3Jlc3VsdDsKKwkKKwlzdHIgPSBidWYgKyBhbDsKKwlt ZW1zZXQoYnVmLCBqdW5rX2ZpbGwsIGFsKTsKKwltZW1zZXQoc3RyLCAnYScsIHN0cl9sZW4pOwor CXN0cltzdHJfbGVuXSA9ICdcMCc7CisJbWVtc2V0KHN0ciArIHN0cl9sZW4gKyAxLCBqdW5rX2Zp bGwsIHNpemVvZihsb25nKSk7CisJZm9yIChsaW1pdF9sZW4gPSAwOyBsaW1pdF9sZW4gPCBNQVhf TEVOICsgMjsgbGltaXRfbGVuKyspIHsKKwkJY29ycmVjdF9yZXN1bHQgPSBsaW1pdF9sZW4gPCBz dHJfbGVuID8gbGltaXRfbGVuIDogc3RyX2xlbjsKKwkJaWYgKHN0cm5sZW4oc3RyLCBsaW1pdF9s ZW4pICE9IGNvcnJlY3RfcmVzdWx0KSB7CisJCQlwcmludGYoIm5vdCBvayAtIHN0cm5sZW5cbiIp OworCQkJZXhpdCgxKTsKKwkJfQorCX0KK30KClByb3BlcnR5IGNoYW5nZXMgb246IGhlYWQvdG9v bHMvcmVncmVzc2lvbi9saWIvbGliYy9zdHJpbmcvdGVzdC1zdHJubGVuLmMKX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpB ZGRlZDogc3ZuOm1pbWUtdHlwZQojIyAtMCwwICsxICMjCit0ZXh0L3BsYWluClwgTm8gbmV3bGlu ZSBhdCBlbmQgb2YgcHJvcGVydHkKQWRkZWQ6IHN2bjprZXl3b3JkcwojIyAtMCwwICsxICMjCitG cmVlQlNEPSVIClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgcHJvcGVydHkKQWRkZWQ6IHN2bjplb2wt c3R5bGUKIyMgLTAsMCArMSAjIworbmF0aXZlClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgcHJvcGVy dHkK --=_2697a7f791e36da50ef742466c06863a--