BSD Planet * BSD People
July 02, 2009
Some notes on using emacsclient on KDE, as I'm trying to integrate it with Qt Creator, because Qt Creator doesn't have Emacs key bindings (so far, my biggest gripe). There's an albeit painful keystroke to pass the current file off to an external editor, so I'm trying to get it...
by jdarnold at July 02, 2009 04:56 PM
July 01, 2009
Karolina Lesisska sent out a cry for help: apparently
the Polish
BSD magazine
will be closed unless sales go up really soon (by monday, worst).
So be sure to go and get a copy from your nearest book store right now!
What, you're still there?! Well, as a reaser on what you'll
get, there are a bunch of
articles available in PDF format,
which include an article on
Installing NetBSD by Patrick Pippen, and
an interview with Simon Burge, Antti Kantee and Greg Oster
by Federico Biancuzzi.
Get your
subscription
today!
July 01, 2009 08:03 PM
June 25, 2009
I've used window(8) the past few days, and felt an urge
to start up with some pre-defined windows. Unfortunately
the manpage wasn't that obvious, and examples are
scarce. In the end, I managed to get
what I want, which I'm posting here as
example code.
The following .windowrc will start two windows, the upper
one with 1/3rd of the screen running tcpdump, the lower
with a shell in it:
# cat .windowrc
window r=1, nr=$nrow/3-1, l=tcpdump\ pcn0, sh=tcpdump \-ni pcn0
window r=$nrow/3, nr=2*$nrow/3+1
June 25, 2009 11:39 PM
June 23, 2009
An article on Lifehacker featured an interesting utility called iotop, which gives a birds eye view of what your hard drive is up to. The commentors mentioned a couple of other interesting tools, although many seemed to be confused as to what iotop is measuring as opposed to some of...
by jdarnold at June 23, 2009 03:01 PM
Here I am, on the afternoon of a work day, sitting at home waiting for an eircom technician to come set it up my phone line. How nice. The story goes like this:<div><br /></div><div>Two weeks ago, I placed an online order to request a phone line, explicitly specifying that the physical installation is already done (even though I don't know if it works or not, but that should be fairly easy for them to check). A few days later, the technician called me saying that he'd come today (two weeks after), anytime from 12.00 to 15.00, but that I'd call the company the same day to get a more accurate schedule.</div><div><br /></div><div>Fine, I'll wait until the 23rd to do that call. But you know what happened, right? I called them this morning and they said that, effectively, the technician was coming today, from 12.30 <i>onwards</i> but they were unable to provide me any more specific information because the technicians have <i>multiple appointments</i>. What? Again, WHAT? At this age of technology, can't we implement a system to track technicians and their schedules? Can't we make some approximations of how long each visit will take? I bet it's trivial if you put in just some common sense.</div><div><br /></div><div>People have jobs, and they can't leave anytime for unknown periods of time; granted, I have some more freedom at Google, but that is absolutely not the case for most other companies. If you have to be at home at 12.30 sharp, and the appointment will last 30 minutes approximately, that is one thing, but having to be at home from 12.30 for an unexpected period of time, that is a very different thing.</div><div><br /></div><div>Just wondering... couldn't they just make the technician call you about 20-30 minutes before arrival so that you could make the same arrangements as him and be there at the same time? It doesn't seem such an insane request.</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-2459937406467822931?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at June 23, 2009 12:48 PM
June 22, 2009
Let's face it: spawning child processes in Unix is a "mess". Yes, the interfaces involved (fork, wait, pipe) are really elegant and easy to understand, but every single time you need to spawn a new child process to, later on, execute a random command, you have to write quite a bunch of error-prone code to cope with it. If you have ever used any other programming language with higher-level abstraction layers — just check Python's subprocess.Popen — you surely understand what I mean.<div><br /><div><div>The current code in ATF has many places were child processes have to be spawned. I recently had to add yet another case of this, and... enough was enough. Since then, I've been working on a C API to spawn child processes from within ATF's internals and just pushed it to the repository. It's still fairly incomplete, but with minor tweaks, it'll keep all the dirty details of process management contained in a single, one-day-to-be-portable module.</div><div><br /></div><div>The interface tries to mimic the one that was designed on my Boost.Process Summer of Code project, but in C, which is quite painful. The main idea is to have a fork function to which you pass the subroutine you want to run on the child, the behavior you want for the stdout stream and the behavior you want for the stderr steam. These behaviors can be any of capture (aka create pipes for IPC communcations), silence (aka redirect to /dev/null), redirect to file descriptor and redirect to file. For simplicity, I've omitted stdin. With all this information, the fork function returns you an opaque structure representing the child, from which you can obtain the IPC channels if you requested them and on which you can wait for finalization.</div><div><br /></div><div>Here is a little example, with tons of details such as error handling or resource finalization removed for simplicity. The code below would spawn "/bin/ls" and store its output in two files named ls.out and ls.err:</div><pre>static<br />atf_error_t<br />run_ls(const void *v)<br />{<br /> system("/bin/ls");<br /> return atf_no_error();<br />}<br /><br />static<br />void<br />some_function(...)<br />{<br /> atf_process_stream_t outsb, errsb;<br /> atf_process_child_t child;<br /> atf_process_status_t status;<br /><br /> atf_process_status_init_redirect_path(&amp;outsb, "ls.out");<br /> atf_process_status_init_redirect_path(&amp;errsb, "ls.err");<br /><br /> atf_process_fork(&amp;child, run_ls, &amp;outsb, &amp;errsb, NULL);<br /> ... yeah, here comes the concurrency! ...<br /> atf_process_child_wait(&amp;child, &amp;status);<br /><br /> if (atf_process_status_exited(&amp;status))<br /> printf("Exit: %d\n", atf_process_status_exitstatus(&amp;status));<br /> else<br /> printf("Error!");<br />}</pre><div>Yeah, quite verbose, huh? Well, it's the price to pay to simulate namespaces and similar other things in C. I'm not too happy with the interface yet, though, because I've already encountered a few gotchas when trying to convert some of the existing old fork calls to the new module. But, should you want to check the whole mess, <a href="http://mtn-host.prjek.net/viewmtn/atf/revision/info/3ba2af4ab1cad67108c3fb1aea15e8e0168667ff">check out the corresponding revision</a>.</div></div></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-1880013018173418859?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at June 22, 2009 09:48 PM
June 15, 2009
Paul Goyette
writes:
`` After the recent update to sysmon_envsys(9) I've started reviewing some of
the existing sensor drivers with an eye to providing some enhanced
functionality.
The sys/arch/x86/x86/ipmi.c driver is the next candidate on my review list,
and it appears that the driver has access to some alarm limits even if
they've not been set by userland. Furthermore, it appears that the current
driver uses these "built-in" alarm limits for setting the sensor state,
overriding any limits that might be specified by the user.
[...]
I don't have any ipmi hardware myself, to test these changes, so I'd
appreciate it if someone who has ipmi would verify that these changes (a)
don't break anything and hopefully (b) successfully implement features 1 & 2
above.''
I'm sure Paul will be happy to hear about your findings with
his patch. Get going!
June 15, 2009 06:56 PM
Slashdot links to an
article
that aims at comparing operating system sizes,
and their growths.
Of course operating system means Linux today, right?
Not quite, actually. They also have
a page dedicated to BSD growth.
BSD here means FreeBSD, NeTBSD, OpenBSD and Darwin,
and for NetBSD they look at the number of external
symbols for data (empty / block storage, read only
and read-writable) plus code. More symbols can mean
more code or more features features, but also more
bugs, so it's left to your own interpretation. :)
Also interesting are the
timelines, which I wonder a bit
about. My own perception was that release ("stable")
branches survive their direct successor for quite some
time, and
NetBSD's documentation
confirms this. Anyone want to double-check the
numbers and the graph? Updates welcome! :)
June 15, 2009 06:50 PM
June 13, 2009
It has been three weeks since I moved to Dublin, Ireland, and I finally have settled into my new apartment. It has taken me two weeks (I was pretty busy during the first one) to go through ads, visits and offers to finally get a place that is cozy, nicely decorated and decently located, all at a quite reasonable price. I could have gotten nicer places for a bit more money, but I'm happy with this one so far.<br /><br />If you are looking forward to finding a place to stay in Dublin, this post contains some suggestions based on my experience:<br /><br />First of all, keep in mind that Dublin is outrageously expensive. The prices for housing here are insane at the moment (OK, not as expensive as NYC or SF, but really expensive anyway). Be prepared to spend around 1K EUR for a nice 1 bedroom apartment, and 1.5K EUR for a nice 2 bedroom apartment. Things may improve in the next months, as they just did for the first quarter of the year.<br /><br />With that said, your first point of reference should be <a href="http://daft.ie/">daft</a>. This is the place where all landlords and agencies put their ads, and the place where everyone is looking for apartments. To get started, you need to know where you want to live. Get a rough idea and then locate that place in one of the <a href="http://en.wikipedia.org/wiki/Dublin_postal_districts">Dublin postal districts</a> and the ones surrounding it. Given that public transportation is... well... suboptimal, you don't want to live too far from your workplace. Then, hunt for places within your budget... and a budget a bit higher: you can always <i>try to</i> negotiate the rent down and get a nicer apartment than you would otherwise, still staying within your initial budget.<br /><br />Once you have selected some of the apartments you want to check, call the landlords or agents and ask for an appointment as soon as possible. And, during the visit, check a few basic stuff:<br /><div><ul><li>Whether the house is old or new: if it's new, it'll probably be in nicer condition overall.</li><li>Water pressure: old houses have poor water pressure.</li><li>Electric shower: this is really scary to me, but it is what most old houses have to deal with poor water pressure.</li><li>Carpet: nice, but a horrible mess to clean up.</li><li>Garbage collection service: if the building does not do this for you, you'll have to pay for garbage collection separately. I just bought 3 bin tags and those were almost 9 EUR. Yes: 9 EUR to pay for the collection of THREE garbage bags.</li><li>Location of supermarkets: Dublin is basically a big town, so most roads don't have shops. Make sure that you have a supermarket nearby where you can walk to to get basic stuff.</li><li>Availability of cable/phone: you'll need this for Internet.</li><li>Furniture: most apartments in Dublin are provided fully-furnished, so make sure to pick one with furniture that you like. Ask if you are allowed to replace some. Pay special attention to the mattress and couches!!</li><li>Cutlery: OK, this is part of the furniture, but check what you have. Your landlord may provide you additional stuff for free upon request.</li><li>Washer and <i>dryer</i>: you want to have a dryer, as most lease contracts state you cannot hung clothes on public places.</li><li>Heating and double-windows: you'll need this during the winter.</li></ul>And, at last, don't hurry! The housing market has improved during the last months, so if you see a place that you like, you'll <i>most likely</i> have a few days to decide whether you want it or not (in the past, you had to decide during viewing time, or otherwise it'd be gone afterwards). Think well about your decision and negotiate; don't show yourself as impatient or you'd get worse deals!</div><div><br /></div><div>I think that's all for know. If there is anything else, the post will be updated :)</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-6501743084580398314?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at June 13, 2009 01:48 AM
June 10, 2009
I've just decided to enable AdSense on this blog and see what the results are. If they are not worth it (what I'm expecting), I'll disable ads after a while. But who knows, maybe I get a nice surprise!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-7459230551314143568?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at June 10, 2009 10:48 PM
I'm trying out Nokia's fancy new Qt Creator IDE for developing Qt 4.5 applications. Looks pretty nice, even if Qt itself is a little fugly, given all the weird macros it uses to get its work done. Maybe this IDE will shield me from the worst of it? Anyway, I'm...
by jdarnold at June 10, 2009 06:25 PM
May 31, 2009
With t new NetBSD release, maintenance for the next-to-last release
is stopped. I.e. with NetBSD 5.0 out the door,
no more fixes are applied to the NetBSD 3.0 release branch
This was announced explicitly
on the NetBSD blog
and on the NetBSD-Announce list,
and I'd like to point out one small fact here:
With 3.0 out in Dec 2005, 4.0 out in Dec 2007 and 5.0
out in Apr 2009. In summary, this gives NetBSD 3.0
about
three and a half years of support after its release!
Not too bad for a volunteer effort. :-)
May 31, 2009 03:38 PM
May 14, 2009
These days, I'm starting to cook by myself (aka learning) and yesterday I made paella for 6 people while staying in NYC (leaving on Sunday...). This is the third time in two weeks that I cook this Spanish dish, but I think the results were pretty good despite the lack of ingredients. After all, cooking is not as hard as I originally thought! And it's pretty fun too!<br /><br />Just blogging this because the results look nice:<br /><br /><div style='text-align:center;margin:0px auto 10px;'><a href='http://2.bp.blogspot.com/_xLbGV919cEE/SgxglPObEeI/AAAAAAAAC5Q/na0_iEsVnAY/s1600-h/IMG_1329.JPG'><img src='http://2.bp.blogspot.com/_xLbGV919cEE/SgxglPObEeI/AAAAAAAAC5Q/na0_iEsVnAY/s400/IMG_1329.JPG' border='0' alt='' /></a>&nbsp;</div>P.S. I'm now eating the leftovers from yesterday. Yummm! :-)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4620782319169725789?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at May 14, 2009 06:48 PM
May 13, 2009
The project I'm currently working on at university uses Subversion as its version control system. Unfortunately, the project itself has no mailing list to receive notifications on every commit, and the managers refuse to set this up. They do not see the value of such a list and they are scared of it because they probably assume that <i>everyone</i> ought to be subscribed to it.<br /><br />Having worked on projects that have a commit notification mailing list available, I strongly advise to have such a list anytime you have more than one developer working on a project[1]. Bonus points if every commit message comes with a bundled copy of the change's diff (in unified form!). This list <i>must be independent from the regular development mailing list</i> and it <i>must be opt-in</i>: i.e. never subscribe anyone by default, let themselves subscribe if they want to! Not everyone will need to receive this information, but it comes very useful... and it's extremely valuable for the project managers themselves!<br /><br />Why is this useful? Being subscribed to the commit notification mailing list, it is extremely easy to know what is going on on the project[2]. It is also really easy to review the code submissions as soon as they are made which, with proper reviews by other developers, <i>trains the authors</i> and improves their skills. And if the revision diff is inlined, it is trivial to pinpoint mistakes in it (be them style errors, subtle bugs, or serious design problems) by replying to the email.<br /><br />So, to my current project managers: if you read me, here is a wish-list item. And, for everyone else, if you need to set up a new project, consider creating this mailing list as soon as possible. Maybe few developers will subscribe to it, but those that do will pay attention and will provide very valuable feedback in the form of replies.<br /><br />1: Shame on me for not having such a mailing list for ATF. Haven't investigated how to do so with Monotone.<br /><br />2: Of course, the developers must be conscious to commit early and often, and to provide well-formed changesets: i.e. self-contained and with descriptive logs.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4782427967638867417?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at May 13, 2009 09:48 PM
May 09, 2009
Wow. <a href="http://tech.slashdot.org/article.pl?sid=09/05/08/169226&from=rss">DEBUG.EXE is being finally phased out in Windows 7</a>. I can't believe it was still there.<br /><br />This brings me back two different memories. I had used this program in the past (a long while ago!) and it caused me both pain and joy.<br /><br />Regarding pain: I had an MS-DOS 5.x book that spent a whole section on DEBUG.EXE, and one of the examples in it contained a command that caused the program in memory to be written to some specific sectors of the floppy disk. Guess what I tried? I executed that same command but told it to use my hard disk instead of the floppy drive. Result: a corrupted file system. Had to run scandisk (remember it?), which marked some sectors as faulty and I thought I had ruined my precious 125MB WD Caviar hard disk. It wasn't until much, much, much later that I learnt that such a thing was not possible, and that really formatting the disk with a tool that had no memory of "bad" sectors (aka, Linux's newfs) could revert the disk to a clean state. (Actually, I kept that hard disk until very recently.)<br /><br />Regarding joy: On a boring weekend away from home, I used DEBUG.EXE on an old portable machine without internet connection to hack a version of PacMan. I disassembled the code until I found where it kept track of the player's lives and tweaked the counter to be infinite (or extra large, can't remember). <i>That</i> was fun. I could get to levels me and my father (who used to be an avid player) had never seen before!<br /><br />It's a pity this tool is going, but it must go. It is way too outdated compared to current debuggers. I wonder if anyone is still using it.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-446058185749523279?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at May 09, 2009 03:48 AM
May 08, 2009
As part of the project I'm currently involved in at university, I started (re)writing a <a href="http://www.pintool.org/">Pin</a> tool to gather run-time traces of applications parallelized with OpenMP. This tool has to support two modes: one to generate a single trace for the whole application and one to generate one trace per parallel region of the application.<br /><br />In the initial versions of my rewrite, I followed the idea of the previous version of the tool: have a <tt>-split</tt> flag in the frontend that enables or disables the behavior described above. This flag was backed by an abstract class, <tt>Tracer</tt>, and two implementations: <tt>PlainTracer</tt> and <tt>SplittedTracer</tt>. The thread-initialization callback of the tool then allocated one of these objects for every new thread and the <i>per-instruction injected code</i> used a pointer to the interface to call the appropriate specialized instrumentation routine. This pretty much looked like this:<pre>void<br />thread_start_callback(int tid, ...)<br />{<br /> if (splitting)<br /> tracers[tid] = new SplittedTracer();<br /> else<br /> tracers[tid] = new PlainTracer();<br />}<br /><br />void<br />per_instruction_callback(...)<br />{<br /> Tracer* t = tracers[PIN_ThreadId()];<br /> t->instruction_callback(...);<br />}</pre>I knew from the very beginning that such an implementation was going to be inefficient due to the pointer dereference at each instruction and the vtable lookup for the correct virtual method implementation. However, it was a very quick way to move forward because I could reuse some small parts of the old implementation.<br /><br />There were two ways to optimize this: the first one involved writing different versions of <tt>per_instruction_callback</tt>, one for plain tracing and the other for splitted tracing, and then deciding which one to insert depending on the flag. The other way was to use template metaprogramming.<br /><br />As you can imagine, this being C++, I opted to use template metaprogramming to heavily abstract the code in the Pin tool. Now, I have an abstract core parametrized on the Tracer type. When instantiated, I provide the correct Tracer class and the compiler does all the magic for me. With this design, there is no need to have a parent Tracer class &mdash; though I'd welcome having C++0x concepts available &mdash;, and the callbacks can be easily inlined because there is no run-time vtable lookup. It looks something like this:<pre>template< class Tracer ><br />class BasicTool {<br /> Tracer* tracers[MAX_THREADS];<br /><br /> Tracer* allocate_tracer(void) const = 0;<br /><br />public:<br /> Tracer*<br /> get_tracer(int tid)<br /> {<br /> return tracers[tid];<br /> }<br />};<br /><br />class PlainTool : public BasicTool< PlainTracer > {<br /> PlainTracer*<br /> allocate_tracer(void) const<br /> {<br /> return new PlainTracer();<br /> }<br /><br />public:<br /> ...<br />} the_plain_tool;<br /><br />// This is tool-specific, non-templated yet.<br />void<br />per_instruction_callback(...)<br />{<br /> the_plain_tool.get_tracer(PIN_ThreadId()).instruction_callback(...);<br />}</pre>What this design also does is force me to have two different Pin tools: one for plain tracing and another one for splitted tracing. Of course, I chose it to be this way because I'm not a fan of run-time options (the <tt>-split</tt> flag). Having two separate tools with well-defined, non-optional features makes testing much, much easier and... follows the Unix philosophy of having each tool do exactly one thing, but doing it right!<br /><br />Result: around a 15% speedup. And C++ was supposed to be slow? ;-) You just need to know what the language provides you and choose wisely. (Read: my initial, naive prototype had a run-time of 10 minutes to trace part of a small benchmark; after several rounds of optimizations, it's down to 1 minute and 50 seconds to trace the <i>whole</i> benchmark!)<br /><br />Disclaimer: The code above is an oversimplification of what the tool contains. It is completely fictitious and obviates many details. I will admit, though, that the real code is too complex at the moment. I'm looking for ways to simplify it.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4155033642151738049?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at May 08, 2009 01:48 AM
May 07, 2009
On netbsd-users, Cem Kayali has
posted a script to adjust the CPU frequency according to the system temperature,
and thus reduce fan noise. This is different from pkgsrc's estd,
which just adjusts the CPU speed according to the system load, so
it's quite the contrary. Cem uses the envstat(4) framework to
determine CPU temperature, and then slows the CPU down with sysctl(1).
An alternative approach was
suggested by Jeremy Reed,
which hints at the powerd(8) script hooks that can be set to
act on corresponting ACPI Thermal Zone (acpitz) events.
See
Jeremy Reed's blog posting
for a few more ideas, plus a hint that this may become
documented even better in the future.
While there: At his website,
Jeremy has a number of open questions
around NetBSD, and I guess answering them would be good
for mankind. Any takers?
May 07, 2009 10:18 PM
May 04, 2009
Mindaugas Rasiukevicius has worked in the SMP corner of the
NetBSD kernel in the past few months, and he has written
an article that introduces the work done by him and others,
see
his posting
for a bit more information, or
his article directly.
The article introduces real-time scheduling and the scheduling
classes found in NetBSD 5.0, and gives an estimate on the
response timeframe that can be expected for real-time applications.
Setting scheduling policy and priority from a userland
application is shown next, and programming examples for
thread affinity, dynamic CPU sets and processor sets are
shown. Besires C APIs, there are also a number or new commands
in NetBSD 5.0 that can be used to control things from the command
line, e.g. to define scheduling behaviour and manipulate
processor sets. My favourite gem is the CPU used in the
cpuctl(8) example, which is identified as "AMD Engineering Sample". :-)
May 04, 2009 11:02 PM
By pure chance when trying to understand a build error of some C++ code I'm working on, I came across the correct C++ way of checking for numeric limits. Here is how.<br /><br />In C, when you need to check for the limits of native numeric types, such as <tt>int</tt> or <tt>unsigned long</tt>, you include the <tt>limits.h</tt> header file and then use the <tt>INT_MIN</tt>/<tt>INT_MAX</tt> and <tt>ULONG_MAX</tt> macros respectively. In the C++ world, there is a corresponding <tt>climits</tt> header file to get the definition of these macros, so I always thought this was the way to follow.<br /><br />However, it turns out that the C++ standard defines a <tt>limits</tt> header file too, which provides the <tt>numeric_limits&lt;T&gt;</tt> template. This template class is specialized in <lt>T</lt> for every numeric type and provides a set of static methods to query properties about the corresponding type. The simplest ones are <tt>min()</tt> and <tt>max()</tt>, which are what we need to replace the old-style <tt>*_MIN</tt> and <tt>*_MAX</tt> macros.<br /><br />As an example, this C code:<pre>#include &lt;limits.h&gt;<br />#include &lt;stdio.h&gt;<br />#include &lt;stdlib.h&gt;<br /><br />int<br />main(void)<br />{<br /> printf("Integer range: %d to %d\n", INT_MIN, INT_MAX);<br /> return EXIT_SUCCESS;<br />}</pre>becomes the following in C++:<pre>#include &lt;cstdlib&gt;<br />#include &lt;iostream&gt;<br />#include &lt;limits&gt;<br /><br />int<br />main(void)<br />{<br /> std::cout &lt;&lt; "Integer range: "<br /> &lt;&lt; std::numeric_limits&lt; int &gt::min()<br /> &lt;&lt; " to "<br /> &lt;&lt; std::numeric_limits&lt; int &gt::max()<br /> &lt;&lt; "\n";<br /> return EXIT_SUCCESS;<br />}</pre>Check out the <a href="http://www.cplusplus.com/reference/std/limits/numeric_limits/">documentation</a> for more details on additional methods!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-8028620398342481804?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at May 04, 2009 09:48 PM
The NetBSD Project recently launched a new <a href="http://blog.netbsd.org/">official blog for NetBSD</a>. From here, I'd like to invite you to visit it and <a href="http://blog.netbsd.org/tnf/feed/entries/atom">subscribe to it</a>. It's only with your support (through reading and, specially, <i>commenting</i>) that developers will post more entries! Enjoy :-)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-5467658448048251016?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at May 04, 2009 06:48 PM
May 03, 2009
I've finished my PhD thesis some time ago, and as the
system described in it is heavily based on NetBSD, I feel
it's relevant for mentioning here.
The full title is ``System Administration Training in the
Virtual Unix Lab -- An e-learning system with diagnosis via a
domain specific language as base for an architecture for tutorial
assistance and user adaption''. The book was published
in Jan 2009 by Shaker, Germany as
ISBN 978-3-8322-7874-8,
and it is also available for online
purchase and if you look around a bit on
my VUlab page, you will
find a permitted local copy for downloading as well.
Here's the backmatter of the book: ``Practical exercises in system administration can render a machine
unusable, and restoring the machine requires manpower which is often
scarce. As a result, there is a lack of dedicated exercise machines
which can be used in the education of system administration. The Virtual
Unix Laboratory is an interactive e-learning system that provides a
solution for this situation. After sign-up, machines are installed on
which students can do their exercises with full "root"-access. At the
end of the exercise, the system checks which parts were done correctly,
and gives feedback.
The first part of this book describes the goals of the Virtual Unix
Lab and related works, followed by observations about education of
system administration. In the second part, the Verification Unit Domain
Specific Language (VUDSL) is defined, and diagnosis of the Virtual Unix
Lab exercise results and feedback to the user are realized with it. An
evaluation of the system shows interesting results and identify areas
for further improvement. The third part explains how tutoring and user
adaption can be realized. An architecture for a tutoring component for
the Virtual Unix Lab is described, and user adaption is based on the
user model built by the tutoring component.''
The system was implemented on a machine running NetBSD, training
systems available were NetBSD/sparc and Solaris/sparc.
Interesting technical points where configuring access to the lab
machines by enabling IPfilter rules from the user's webbrowser,
and disabling the rules by an at(1) job. Also, the system to
install the lab clients used disk images and NetBSD in netbooted
environment.
I hope that's enough of a reason to post this here.
</commercial block>
May 03, 2009 11:53 PM
May 02, 2009
NetBSD's
systat(1)
offers the -t option to switch to the display after a given
number of cycles. I'd love to have something similar in
screen(1), but couldn't find it from a brief RoTFM.
As a result, I came up with the following line, which -- when
ran inside a screen(1) session -- skips through screens 0 to
4:
sh -c 'n=0; while true ; do echo n=$n ; screen -x -X select $n ; \
n=`expr $n + 1`; if [ $n = 4 ]; then n=0; fi ; sleep 5 ; done'
This assumes that there are four screen sessions running.
Determining the number of screen sessions actually running
as well as skipping the one running this code is left as
an exercise to the reader.
If anyone has a better solution, I'd love to hear about it! :)
May 02, 2009 11:34 PM
May 01, 2009
Following the recent release of NetBSD 5.0, there is
(of course) a lot of discussion in many forums.
Here's one that I'd like to point out,
asking "why NetBSD?", and answering it at the same time,
listing the pros of NetBSD (esp. with what comes in 5.0:
long support cycles, stability, Xen, Journaling, documentation),
and some of the drawbacks (the packages system, no binary updates,
no Java). The author also lists a number of personal things why
he uses NetBSD.
May 01, 2009 05:29 PM
Izumi Tsutsui has
released
a version of his
Cobalt restore/install CD
based on NetBSD 5.0.
What is it? Citing from the
Restore CD HowTo:
``
The Cobalt Qube/Raq is a server appliance. To put it simply, they are just computers without keyboard and monitor and without the ability to attach one. There are several versions of Qubes and Raqs in existence, older MIPS based and newer AMD-K6 based.
[...]
Because the Qube does not have an easy way to attach a monitor, a keyboard and most importantly a CDROM drive, there is no easy way to install a new operating system on it. This is where the Restore CD comes in. The Qube has the ability to boot an operating system over the network. A Restore CD provides the environment allowing the Qube to boot an operating system and perform an unattended install of the operating system onto hard drive. ''
May 01, 2009 12:36 PM
BSDCan 2009 will be held on 8-9 May 2009 at University of Ottawa, and will be preceded by two days of Tutorials on 6-7 May 2009.
Actually, that's next week!
If you're interested to go there, check
the schedule - there
are a number of NetBSD related presentations announced
which may be of interest. They include talks on
kernel development in userland,
journalling in FFS with WAPBL,
building a Cable ISP with Open Source Software,
and building thin client products with NetBSD.
Oh, and if you go there and do a NetBSD booth, that would
be most excellent! :-)
May 01, 2009 12:19 PM
April 30, 2009
Andrew Doran has made an overview of NetBSD 5.0,
available as HTML and
PDF,
which includes a general description of what
NetBSD is, what's new in 5.0 and what is important
for users of workstations, servers and embedded apps as well
as for developers and hobbyists. Besires the lists of features,
the most interesting part is a number of benchmarks
that show that NetBSD can compare well to FreeBSD
and Linux (by usually beating them 8-).
A list of possible features for NetBSD 6.0 concludes.
Some details on the benchmarks:
- hackbench IRC server simulation:
- sysbench: MySQL OLTP simluation:
- build.sh: Compile benchmark:
April 30, 2009 12:52 AM
NetBSD 5.0 is released:
``NetBSD 5.0 features greatly improved performance and scalability on modern multiprocessor (SMP) and multi-core systems. Multi-threaded applications can now efficiently make use of more than one CPU or core, and system performance is much better under I/O and network load.
In addition to scalability and performance improvements, a significant number of major features have been added. Some highlights are: a preview of metadata journaling for FFS file systems (known as WAPBL), the jemalloc memory allocator, X.Org instead of XFree86 on a number of ports, the Power Management Framework, ACPI suspend/resume support on many laptops, write support for UDF file systems, the Automated Testing Framework, the Runnable Userspace Meta Program framework, Xen 3.3 support for both i386 and amd64, POSIX message queues and asynchronous I/O, and many new hardware device drivers. For all the details, see
the full release notes. ''
Citing from the release announcement, ``ISO images can be downloaded using BitTorrent, and we encourage users
who wish to install via ISO images to take advantage of this, as the
images are very well seeded at
http://www.NetBSD.org/mirrors/torrents/
Complete source and binaries for NetBSD 5.0 are available for download
at many sites around the world. A list of download sites providing FTP,
AnonCVS, and other services may be found at:
http://www.NetBSD.org/mirrors/
We are very grateful to all of those who donated during the 2007 fund
drive, which brought us many of the great advances found in 5.0. For
more information on how you can help NetBSD, see
http://www.NetBSD.org/donations/''
See the
NetBSD 5.0 release announcement
for more details.
April 30, 2009 12:21 AM
April 29, 2009
The latest issue of Linux Format magazine has a very nice article on how to pick the best distro. This is a subject rife with controversy, but they do a very nice job of remaining bias free and objective. By listing a wide variety of user types, you can pick...
by jdarnold at April 29, 2009 02:16 PM
April 27, 2009
The official NetBSD Blog
was online for some time, as a few people have discovered.
The setup went into production use now, and it will
be used for "official" news from the NetBSD project.
While we're at Web 2.0 things, there is now a
NetBSD source on Twitter, too. Enjoy!
April 27, 2009 06:35 PM
April 22, 2009
This year's projects for NetBSD and the Google "Summer of Code"
have been selected, and we were able go get sponsoring
for eleven projects!
Working areas include all areas from the NetBSD operating
system, including system install and bootstrap, userland,
file systems, networking, and embedded environments.
Here is a list of the students and projects, in no particular order:
Note that the project pages are fresh from the press, and will
get more and more data over the course of the summer. Be
sure to get back and check every now and then!
Also, see
the NetBSD press release
for more information.
Good luck to all the students, and may your project be a success!
April 22, 2009 12:05 AM
April 17, 2009
NetBSD used to publish code under a license that asks people
to mention that they use NetBSD code if they do so. Now
searching for the corresponding license string on Google
scores about 20.000 hits, and there a number of hits in
that that lead to products which use NetBSD that I haven't
seen before yet:
-
Codian IP VCR 2200 Series: ``The IP VCR 2200 series of IP Video Conference Recorders allow you to record video and slides from standard video conferencing equipment. The content can be streamed live or played back on demand at multiple speeds to a PC or any video conferencing endpoint. ''
[license notice]
- Adobe / Macromedia Fireworks MX 2004:
``Rapidly prototype websites and application interfaces with Adobe® Fireworks® CS4 software. Create and optimize images for the web more quickly and accurately than ever before with an enhanced toolset.''
[license notice]
-
Thecus NAS:
``A look under the hood shows that the N8800 means business. Equipped with eight 3.5" SATA hard disk bays, the N8800 offers massive storage capacity in a 2U rack mount form factor. This combination brings a powerful yet cost-effective network attached storage solution that is perfect for medium-to-large organizations.'' - this one is probably thanks to Wasabi Systems
[PDF with license notice]
- MyProxy:
``MyProxy is open source software for managing X.509 Public Key Infrastructure (PKI) security credentials (certificates and private keys). MyProxy combines an online credential repository with an online certificate authority to allow users to securely obtain credentials when and where needed.''
[license notice]
- AudioCodes has several products:
-
MediaPack 20x:
``The MP-20x series of Analog Telephone Adapters are cost-effective, advanced products, which allow the connection of ordinary analog telephones or fax machines to a Voice over Broadband (VoBB) service.''
-
Tulip AC494 ATA:
``The Tulip AC494 ATA is a complete, ready-to-use reference design of an Analog Telephone Adapter (ATA) with data routing capabilities. Utilizing AudioCodes field-proven DSP VoIP software and the integrated AC494 System on Chip (SoC), the Tulip AC494 ATA offers OEMs and ODMs an excellent and cost-effective solution for the rapidly growing residential and Small Office / Home Office (SOHO) VoIP market.''
-
Mediant 1000 MSBG:
``The Mediant 1000 MSBG is an all-in-one multi-service access solution for Service Providers offering managed services and distributed Enterprises. This multi-service business gateway is designed to provide converged Voice & Data services for business customers at wire speed, while maintaining SLA parameters for superior voice quality.
The Mediant 1000 MSBG is based on AudioCodes? VoIPerfect best-of-breed Media Gateway technology, combined with Enterprise class Session Border Controller, Data & Voice security elements, Data Routing, LAN Switching and WAN Access.''
See also AudioCodec's license notice.
-
PTP Spider (PRO and zero):
``The SPIDER is a DVR which can record and index a week's worth of broadcasts of up to 8 T.V. channels.
The SPIDER is the fast, easy, and cost-effective way to monitor what is being said on television about your organization, products, services, and competitors. ''
[Brochure and page with license notice]
- Fujitsu Apache Web server on BS2000/OSD:
``APACHE Web server is a porting of the APACHE Software Foundation?s APACHE httpd 2.2.8 World Wide Web server and also contains security-related patches.''
[Data sheet with license notice]
(Side note:
Siemens' BS2000 is among the dinosaurs of
mainframe operating systems on this planet... seeing NetBSD being
used to get modern Open Source software like Apache
migrated to such a beast makes me feel funny :-)
- StereoStream:
``StereoStream streams music from your iTunes library on your Mac over WiFi to your iPhone or iPod Touch. ''
[license notice]
This goes in a long list of software that apparently was
made to work on Apple's iPhone and iPod Touch... which
are known to make heavy use of NetBSD inside.
This goes in the same tradition as there are
numerous games for Sony's Playstation which all use
NetBSD code.
-
F5 BIG-IP product family:
``BIG-IP product modules let you easily incorporate new functionality -- everything from Web acceleration to topology-based load balancing -- so you can quickly adapt to changing application and business challenges.''
[Features guide with license notice. See also this file from a product reselled by Dell :-]
-
Intel® Blade Server Ethernet Switch Modules SBCEGBESW1 and SBCEGBESW10:
``6 x Ethernet 10Base-T, Ethernet 100Base-TX, Ethernet 1000Base-T, 1 Gbps - dramatically reduces cabling resulting in easier access and service. The modularity of the solution provides plenty of bandwidth and flexibility. ''
[See the license notice in the CLI Guide]
So much for now. If you find any notices about NetBSD being
used in products - maybe in your new toy's manual - drop
me a line.
April 17, 2009 01:18 AM
April 16, 2009
Soren Jacobsen
writes:
``Today, we have two things to be happy about. First, the fourth release
candidate of NetBSD 5.0 is available for download. Second, this
announcement, like RC3's, coincides with an important birthday: that of
Billy West.
Below are some highlighted changes since RC3:
- Added the RLIMIT_AS resource, which limits the total address space
available to processes.
- Improved NFS server stability
- FFS improvements
- A fix for a pf(4) DoS
- re(4) now works with the RealTek 8111C, which is found on many current
motherboards with Intel chipsets
As usual, src/doc/CHANGES-5.0 has the full details.
Binaries of 5.0_RC4 are available for download at
ftp://ftp.NetBSD.org/pub/NetBSD-daily/netbsd-5-0-RC4/
Those of you tracking by source can either continue following the netbsd-5
branch or use the netbsd-5-0-RC4 tag.
As always, we want your feedback. This time, we are especially
interested in hearing from people who are using NFS.''
April 16, 2009 10:42 PM
April 06, 2009
The time for students to send in their applications for this year's
Summer of Code
is over, and we'd like to thank all students who have send in
applications. We'll be busy ranking applications in the next
few days, before the winners of the slots this year will be
announces. If you're into numbers, see
this blog posting.
Here's a request for students who have sent in applications:
Please have a close look on your applications!
Any updates and comments made by our team of
mentors will not be sent out automatically, unfortunately,
we've learned. So check by repeatedly at your application in the next
few days. A good place to further discuss any applications
are
out tech-* mailing lists.
Finally, the list of accepted students will be announced
on April 20th, 2009. For more information, see
the Google Summer of Code 2009 site.
April 06, 2009 11:01 PM
April 02, 2009
The Google Summer of Code 2009 application deadline for students is tomorrow and NetBSD has got very few applications so far. If you have the interest in working on a cool operating system project, where almost any project idea can fit, take the time to read <a href="http://www.netbsd.org/contrib/soc-projects.html">our proposals</a> and apply! New, original ideas not listed there will also be considered.<br /><br />It'd be a pity if the number of assigned slots to NetBSD was small due to the low number of applications! We did much better past year.<br /><br />Note that there are a couple of <a href="http://www.NetBSD.org/~jmmv/atf/">ATF</a>-related proposals in there. Help will be certainly welcome (by me ;-) in those areas!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4081034348232814307?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at April 02, 2009 09:48 AM
April 01, 2009
I've been holding back this announcement until all affected parties knew in advance. They do know now, so I'm happy to announce that I'll be joining Google Dublin on May 25th as a Google.com Software Engineer!<br /><br />Thanks to everyone who made that possible.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-898144593109126185?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at April 01, 2009 12:48 PM
March 25, 2009
Zafer Aydogan's latest release candidat of his
Jibbed Live CD
now also offers booting a Xen3 Dom0 kernel from
the CD, and allows starting further DomUs.
Other news in RC3 are that packages can now be
installed with pkg_add for from pkgsrc (enough RAM
assumed :), and that sysinst plus official sets
from NetBSD's FTP server are on the CD, so NetBSD
can be installed on a harddisk from Jibbed, too.
All this goes with the usual contents of the CD,
i.e. a NetBSD based lice CD with a XFCE desktop.
March 25, 2009 08:14 PM
March 24, 2009
After waking up today and finding 80+ spam comments all around old posts in this blog, I have decided to set all new comments for posts older than 14 days old to be moderated. Took half an hour to clean them all. Thank you, spammers.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-5724407113147228616?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at March 24, 2009 01:48 PM
March 23, 2009
In the past, I had come by some C++ code that used unnamed namespaces everywhere as the following code shows, and I didn't really know what the meaning of it was:<pre>namespace {<br /><br />class something {<br />...<br />};<br /><br />} // namespace</pre>Until now.<br /><br />Not using unnamed namespaces in my own code bit me with name clash errors. How? Take ATF. Some of its files declare classes in .cpp files (not headers). I just copy/pasted some ATF code in another project and linked the libraries produced by each project together. Boom! Link error because of duplicate symbols. And the linker is quite right in saying so!<br /><br />For some reason, I always assumed that classes declared in the .cpp files would be private to the module. But if you just think a little bit about it, just a little, this cannot ever be the case: how could the compiler tell the difference between a class definition in a header file and a class definition in a source file? The compiler sees preprocessed sources, not what the programmer wrote, so all class definitions look the same!<br /><br />So how do you resolve this problem? Can you have a static class, pretty much like you can have a static variable or function? No, you cannot. Then, how do you declare implementation-specific classes private to a module? Put them in an unnamed namespace as the code above shows and you are all set. Every translation unit has its own unnamed namespace and everything you put in it will not conflict with any other translation unit.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4053902384158212165?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at March 23, 2009 03:48 PM
March 11, 2009
$ python Python 2.5.2 (r252:60911, Dec 1 2008, 17:47:46) [GCC 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is...
by jdarnold at March 11, 2009 05:58 PM
March 10, 2009
My favorite Linux magazine, Linux Format (out of the UK) has some interesting news: A very nice podcast, which can be found at Tux Radar. Three editors talk about a wide range of Linux subjects. I have been finding it very entertaining, even if they don't have their RSS feed...
by jdarnold at March 10, 2009 02:08 PM
March 05, 2009
For a long time, ATF has shipped with <a href="http://portal.pc.ac.upc.edu/viewmtn/atf/revision/browse/92e15dcd3de700ceaf558c43ed9de90e3c7d20d5/tests/build">build-time tests for its own header files</a> to ensure that these files are self-contained and can be included from other sources without having to manually pull in obscure dependencies. However, the way I wrote these tests was a hack since the first day: I use automake to generate a temporary library that builds small source files, each one including one of the public header files. This approach works but has two drawbacks. First, if you do not have the source tree, you cannot reproduce these tests -- and one of ATF's major features is the ability to install tests and reproduce them even if you install from binaries, remember? And second, it's not reusable: I now find myself needing to do this exact same thing in another project... what if I could just use ATF for it?<br /><br />Even if the above were not an issue, build-time checks are a nice thing to have in virtually every project that installs libraries. You need to make sure that the installed library is linkable to new source code and, currently, there is no easy way to do this. As a matter of fact, <a href="http://cvsweb.netbsd.org/bsdweb.cgi/src/regress/include/?only_with_tag=MAIN">the NetBSD tree has such tests</a> and they haven't been migrated to ATF for a reason.<br /><br />I'm trying to implement this in ATF at the moment. However, running the compiler in a transparent way is a tricky thing. Which compiler do you execute? Which flags do you need to pass? How do you provide a portable-enough interface for the callers?<br /><br />The approach I have in mind involves caching the same compiler and flags used to build ATF itself and using those as defaults anywhere ATF needs to run the compiler itself. Then, make ATF provide some helper check functions that call the compiler for specific purposes and hide all the required logic inside them. That should work, I expect. Any better ideas?<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-6226640212762863520?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at March 05, 2009 03:48 PM
March 02, 2009
If you are a frequent C/C++ programmer, you know how annoying a code plagued of preprocessor conditionals can be: they hide build problems quite often either because of, for example, trivial syntax errors or unused/undefined variables.<br /><br />I was recently given some C++ code to rewrite^Wclean up and one of the things I did not like was a macro called <tt>DPRINT</tt> alongside with its use of <tt>fprintf</tt>. Why? First because this is C++, so you should be using iostreams. Second because by using iostreams you do not have to think about the correct printf-formatter for every type you need to print. And third because it obviously relied on the preprocessor and, how not, debug builds were already broken.<br /><br />I wanted to come up with an approach to print debug messages that involved the preprocessor as less as possible. This application (a simulator) needs to be extremely efficient in non-debug builds, so leaving calls to printf all around that internally translated to noops at <tt>runtime</tt> wasn't a nice option because some serious overhead would still be left. So, if you don't use the preprocessor, how can you achieve this? Simple: current compilers have very good optimizers so you can rely on them to do the right thing for release builds.<br /><br />The approach I use is as follows: I define a custom <tt>debug_stream</tt> class that contains a reference to a <tt>std::ostream</tt> object. Then, I provide a custom <tt>operator&lt;&lt;</tt> that delegates the insertion to the output stream. Here is the only place where the preprocessor is involved: a small conditional is used to omit the delegation in release builds:<pre>template&lt; typename T &gt;<br />inline<br />debug_stream&<br />operator<<(debug_stream& d, const T& t)<br />{<br />#if !defined(NDEBUG)<br /> d.get() &lt;&lt; t;<br />#endif // !defined(NDEBUG)<br /> return d;<br />}</pre>There is also a global instance of a <tt>debug_stream</tt> called <tt>debug</tt>. With this in mind, I can later print debugging messages anywhere in the code as follows:<pre>debug << "This is a debug message!\n";</pre>So how does this not introduce any overhead in release builds?<br /><br />In release builds, <tt>operator&lt;&lt;</tt> is effectively a noop. It does nothing. As long as the compiler can determine this, it will strip out the calls to the insertion operator.<br /><br />But there is an important caveat. This approach requires you to be extremely careful in what you insert in the stream. Any object you construct as part of the insertion or any function you call may have side effects. Therefore, the compiler must generate the call to the code anyway because it cannot predict what its effects will be. How do you avoid that? There are two approaches. The first one involves defining everything involved in the debug call as inline or static; the trick is to make the compiler <i>see</i> all the code involved and thus be able to strip it out after seeing it has no side effects. The second approach is simply to <i>avoid</i> such object constructions or function calls completely. Debug-specific code should not have side effects, or otherwise you risk having different application behavior in debug and release builds! Not nice at all.<br /><br />A last note: the above is just a proof of concept. The code we have right now is more complex than what I showed above as it supports debug classes, the selection of which classes to print at runtime and prefixes every line with the class name. All of this requires several inline magic to get things right but it seems to be working just fine now :-)<br /><br />So, the conclusion: in most situations, <b>you do not need to use the preprocessor</b>. Find a way around it and your developers will be happier. Really.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-8416455013608697521?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at March 02, 2009 02:48 PM
February 26, 2009
I did a bad thing the other day and have just barely lived to tell about it. I turned of my Linux box without shutting down. All you Linux & Unix veterans know my horror when I realized what I had just done. I hit the shutdown button and, when...
by jdarnold at February 26, 2009 09:52 PM
February 25, 2009
So Best Buy had the much maligned Seagate 7200.11 Barracuda 1.5 terabyte hard drive on sale for a mere US$130. Given a couple of Best Buy rebates, I just couldn't resist picking it up for just a little of US$120 - incredible! I immediately went to the Seagate page...
by jdarnold at February 25, 2009 02:33 PM
January 27, 2009
I have many different Web 2.0 personas and I'd love to pull together all the various postings and updates I do into one stream and display that. Of course, this all has a name and it is Lifestreaming. Personally, I think it is a dumb name. I like the web,...
by jdarnold at January 27, 2009 02:36 AM
January 22, 2009
I have a machine at work, a Dell Optiplex 745, that cannot boot GENERIC NetBSD kernels. There is a problem in one of the uhci/ehci, bge or azalia drivers that causes a lockup at boot time because of a shared interrupt problem. Disabling ehci or azalia from the kernel lets the machine boot. In order to do that, there are two options: either you rebuild your kernel without the offending driver, or you boot into the userconf prompt with -c and, from there, manually disable the driver at each boot. None of the options are quite convincing.<br /><br />Of course, disabling a faulty driver is not the correct solution, but the workaround is useful on its own. I've just added a <tt>userconf</tt> command to the boot loader and its configuration file -- <tt>/boot</tt> and <tt>/boot.cfg</tt> respectively -- so that the end user can pass random userconf commands to the kernel in an automated way. userconf is a kernel feature that lets you change the parameters of builtin drivers and enable/disable them before the hardware detection routines are run.<br /><br />With this new feature in the boot loader, you can customize a GENERIC kernel without having to rebuild it! Yes, modules could help here too, but we are not there yet for hardware drivers. Note that OpenBSD has had a similar feature for a while with <tt>config -e</tt>, but they actually modify the kernel binary.<br /><br />You can check the patch out and comment about it in <a href="http://mail-index.netbsd.org/tech-kern/2009/01/22/msg004081.html">my post to tech-kern</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-8525327239297766482?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 22, 2009 11:48 AM
January 18, 2009
I am very happy to announce the availability of the <a href="http://www.netbsd.org/~jmmv/atf/news.html#20090118-atf-0-6-released">0.6 release</a> of <a href="http://www.netbsd.org/~jmmv/atf/">ATF</a>. I have to apologize for this taking so long because the code has been mostly-ready for a while. However, doing the actual release procedure is painful. Testing the code in many different configurations to make sure it works, preparing the release files, uploading them, announcing the new release on multiple sites... not something I like doing often.<br /><br />Doing some late reviews, I have to admit that the code has some rough edges, but these could not delay 0.6 any more. The reason is that this release will unblock the <a href="http://netbsd-soc.sourceforge.net/projects/atfify/">NetBSD-SoC atfify</a> project, making it possible to finally integrate all the work done in it into the main NetBSD source tree.<br /><br />Explicit thanks go to Lukasz Strzygowski. He was not supposed to contribute to ATF during his Summer of Code 2008 project, but he did, and he actually provided very valuable code.<br /><br />The next step is to update the NetBSD source tree to ATF 0.6. I have extensive local changes for this in my working copy, but I'm very tired at the moment. I think I'll postpone their commit until tomorrow so that I don't screw up something badly.<br /><br />Enjoy it and I'm looking for your feedback on the new stuff!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-6329902342984575652?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 18, 2009 08:48 PM
January 15, 2009
NetBSD-current has recently switched time_t to be a 64-bit type on all platforms to cope with the year-2038 problem. This is causing all sorts of trouble, and a problem I found yesterday was that, after a clean install of NetBSD/amd64, it was impossible to change the data of any user through chfn. The command failed with:<br /><br /><tt>chfn: /etc/master.passwd: entry root inconsistent expire<br />chfn: /etc/master.passwd: unchanged</tt><br /><br />Suspiciously, the data presented by chfn showed an expiration date for root set in a seemingly-random day (October 14th, 2021). That seemed like some part of the system not parsing the user database correctly and generating random values. A sample test program that walked through the passwords database with <tt>getpwent(3)</tt> showed an invalid expiration date for root, even when <tt>/etc/master.passwd</tt> had a 0 in that field.<br /><br />After some debugging, I found out that libc tries to be compatible with old-format binary password databases (those generated by pwd_mkdb). In order to deal with compatibility, libc checks to see if the database has a VERSION field set in it. If not, it assumes it is an old version and thus time_t may not be 64-bit. If the VERSION field is set, it uses the new time_t.<br /><br />So what was the problem? pwd_mkdb did not set the VERSION field even though it wrote a new-format database. libc assumed it was laid out according to the old format but it was not, so it got garbage data during parsing. After some hacking, I fixed it as described <a href="http://mail-index.netbsd.org/current-users/2009/01/14/msg007274.html">in a post to current-users</a>.<br /><br />Soon after, Christos Zoulas (the one who did all the time_t work) told me that he had already done these changes in his branch but forgot to merge them. He did now, and the code in the main branch should work fine. I still think there is a <a href="http://mail-index.netbsd.org/current-users/2009/01/15/msg007292.html">minor problem</a> in it, but the major issue after installation should be gone.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4863984440774264958?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 15, 2009 03:48 PM
January 14, 2009
Out of boredom, I installed MS-DOS and Windows 3.1 on my machine a few days ago &mdash; yeah, I was inspired by the Hot Dog Stand comments <a href="http://blogs.msdn.com/oldnewthing/archive/2009/01/09/9301047.aspx">in this post</a>. Check it out <a href="http://www.facebook.com/album.php?aid=51162&l=cd240&id=690369819">here</a>. Don't be scared, it was just a virtual machine!<br /><br />Anyway, this was fun because it reminded me of something. Back in 1994, my father bought a Pentium 60Mhz. After ordering it, we imagined how fast it could be compared to our older machine, a 386DX 40Mhz. Based on magazine reviews of those days, we supposed that Windows 3.1 could start in 1 or 2 seconds. But what a disappointment when we got the machine. It certainly was faster than the 386, but it took many more seconds to start Windows.<br /><br />Now, trying this same thing on the Macbook Pro, Windows 3.1 actually starts in less than 1 second. Finally, after almost 15 years, our thoughts have become true!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-8071982422576327275?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 14, 2009 02:48 PM
January 05, 2009
I'm learning Python these days while writing an script to automate the testing of ATF under multiple virtual machines. I had this code in a shell script, but it is so ugly and clumsy that I don't even dare to add it to the repository. Hopefully, the new version in Python will be more robust and versatile enough to be published.<br /><br />One of the things I've been impressed by is the <tt>subprocess</tt> module and, in special, its <tt>Popen</tt> class. By using this class, it is trivial to spawn subprocesses and perform some IPC with them. Unfortunately, <tt>Popen</tt> does not provide any way to silence the output of the children. As I see it, it'd be nice if you'd pass an <tt>IGNORE</tt> flag as the stdout/stderr behavior, much like you can currently set those to <tt>PIPE</tt> or set stderr to <tt>STDOUT</tt>.<br /><br />The following trivial module implements this idea. It extends <tt>Popen</tt> so that the callers can pass the <tt>IGNORE</tt> value to the stdout/stderr arguments. (Yes, it is trivial but it is also one of the first Python code I write so... it may contain obviously non-Pythonic, ugly things.) The idea is that this exposes the same interface so that it can be used as a drop-in replacement. OK, OK, it lacks some methods and the constructor does not match the original signature, but this is enough for my current use cases!<br /><br /><pre>import subprocess<br /><br /><br />IGNORE = -3<br />STDOUT = subprocess.STDOUT<br />assert IGNORE != STDOUT, "IGNORE constant is invalid"<br /><br /><br />class Popen(subprocess.Popen):<br /> """Extension of subprocess.Popen with built-in support<br /> for silencing the output channels of a child process"""<br /><br /> __null = None<br /><br /> def __init__(self, args, stdout = None, stderr = None):<br /> subprocess.Popen.__init__(self, args = args,<br /> stdout = self._channel(stdout),<br /> stderr = self._channel(stderr))<br /><br /> def __del__(self):<br /> self._close_null()<br /><br /> def wait(self):<br /> r = subprocess.Popen.wait(self)<br /> self._close_null()<br /> return r<br /><br /> def _null_instance(self):<br /> if self.__null == None:<br /> self.__null = open("/dev/null", "w")<br /> return self.__null<br /><br /> def _close_null(self):<br /> if self.__null != None:<br /> self.__null.close()<br /> self.__null = None<br /> assert self.__null == None, \<br /> "Inconsistent internal state"<br /><br /> def _channel(self, behavior):<br /> if behavior == IGNORE:<br /> return self._null_instance()<br /> else:<br /> return behavior</pre>By the way, <a href="http://mail.python.org/pipermail/python-dev/2006-June/065868.html">somebody else suggested this same thing</a> a while ago. Don't know why it hasn't been implemented in the mainstream <tt>subprocess</tt> module.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-5034477034631058067?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 05, 2009 12:48 PM
January 04, 2009
I need to get rid of lots of stuff that I haven't used for a long time and that are only taking space here. Most of them will go to the trash but, if you are interested, let me know and make an offer for them! Yes, "for free" is valid on some items ;) Those items that have a price is the ones that I think are most valuable and I will keep them unless someone wants to buy them.<br /><br />Keep in mind that all this stuff is in Barcelona, Spain, and that shipping is not too practical for me. Still, if you are very interested in some item, we can probably sort it out.<br /><br />With all that said, <a href="http://www.NetBSD.org/~jmmv/sale.html/">check the list out</a>. I may keep updating it during the following days.<br /><br />PS: How can I have accumulated so much crap?...<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4028938358549094547?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 04, 2009 08:48 PM
January 02, 2009
I reinstalled NetBSD-current recently on my shark (Digital DNARD) and, out of curiosity, I wanted to see if the new-style kernel modules worked fine on this platform. To test that, I attempted to load the puffs module and failed with an error message saying something like "kobj_reloc: unexpected relocation type 1". Similarly, the same error appeared when running the simpler regression tests in /usr/tests/modules.<br /><br />After seeing that error message, I tracked it down in the source code and ended in src/sys/arch/arm/arm32/kobj_machdep.c. A quick look at it and at src/sys/arch/arm/include/elf_machdep.h revealed that the kernel was lacking support for the R_ARM_PC24 relocation type. "It can't be too difficult to implement", I thought. Hah!<br /><br />Based on documentation, I understood that R_ARM_PC24 is used in "short" jumps. This relocation is used to signal the runtime system that the offset to the target address of a branch instruction has to be relocated. This offset is a 24-bit number and, when loaded, it has to be shifted two bits to the left to accommodate for the fact that instructions are 32-bit aligned. Before the relocation, there is some addend encoded in the instruction that has to be loaded, sign-extended and shifted two bits to the left and, after all that, added to the calculated address.<br /><br />I spent hours trying to implement support for the R_ARM_PC24 relocation type because it didn't want to work as expected. I even ended up looking at the Linux code to see how they dealt with it, and I found out that I was doing exactly the same as them. So what was the problem? A while later I realized that this whole thing wasn't working because the relocated address to be stored in the branch instruction didn't fit in the 24 bits! That makes things harder to solve.<br /><br />At that point, I looked at the port-arm mailing list and found that several <a href="http://mail-index.netbsd.org/port-arm/2008/12/19/msg000580.html">other people were looking at this same issue</a>. Great, some time "wasted" but a lot of new stuff learnt. Anyway, it turns out there are basically two solutions to the problem described above. The first involves generating jump trampolines for the addresses that fall too far away. The second one is simpler: just change the kernel to load the modules closer to the kernel text, and thus make the jump offsets fit into the 24 bits of the instructions. Effectively, there is a guy that has got <a href="http://mail-index.netbsd.org/port-arm/2009/01/01/msg000606.html">almost everything working</a> already.<br /><br />Let's see if they can get it working soon!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-4758537924824408744?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 02, 2009 02:48 PM
January 01, 2009
Happy new year to everyone!<br /><br />I know that the blog has been quite dead recently. Let's see if it can revive during 2009 (but not today). I already have a few ideas for future posts so stay tuned!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-2268427611138490967?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at January 01, 2009 09:48 PM
December 17, 2008
That's it. Two days ago I landed in Barcelona and my stay in NYC finished. I was happy to see family and friends again, but I'm missing NYC and, in special, the people there a lot.<br /><br />I'm actually considering moving to NYC as soon as I find a decent job there and postponing the acquisition of a Ph.D. Many people says I should just do that, but some friends say that my feelings will eventually go away and I'll feel comfortable here again. I know that this second thing is true, but why should I accept that if there is a chance for a change? Why can't I try to go and live there? Why do I have to hurt the people I met there? I can think of some reasons to stay in Barcelona for, but I can also think of more interesting reasons to leave.<br /><br />Anyway... don't worry, this is not the common post you'll find in this blog! I think I'll just go back to blogging about technical stuff. I know I still have to prepare a summary post for the stay and probably a relatively small selection of photos, but I think that will come later. If you ever can go to NYC, don't doubt: just do it.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17885055-8310489269669067628?l=julipedia.blogspot.com'/></div></content>
by Julio Merino at December 17, 2008 10:48 PM
December 05, 2008
Trying to rebuild the latest Boxee and run into these problems: 1] AppManager.h:52 - change "static bool CAppManager::RunInBG(InstallOrUpgradeAppBG* pJob);" to "static bool RunInBG(InstallOrUpgradeAppBG* pJob);". g++ doesn't like the redundant qualification. Wonder what version of g++ the XBMC crew uses, as that's a common error I see alot from code coming...
by jdarnold at December 05, 2008 04:00 AM
December 02, 2008
If you consider your smtp-auth location to be private, this is what you want.
December 02, 2008 12:48 AM
November 29, 2008
Using OpenVPN to create a secure pathway between home and office
November 29, 2008 06:48 PM
If you have multiple VPN clients, this is a practical solution.
November 29, 2008 12:48 AM
November 27, 2008
How to create a CA and generate your own SSL certificates
November 27, 2008 08:48 PM
November 23, 2008
Boxee has me so excited about a home theater computer that I have begun to spec out building a new one to add to my home theater set up. Coincidentally enough, ASUS has recently come out with a new motherboard complete with HDMI out and 7.1 hi def audio, so...
by jdarnold at November 23, 2008 01:32 PM
November 18, 2008
Well, actually the next step in the boxee media machine process (see here and here for previous steps), is to see if I could get a remote control and an HDMI output to work. First up was the remote. In Linux, the way to go is LIRC (Linux Ifrared Remote...
by jdarnold at November 18, 2008 02:12 PM
November 16, 2008
After working with boxee on my openSUSE box, I decided in order to get a better feel for how boxee is supposed to work, I installed Ubuntu 8.04 "Hardy", which is the officially supported version of Linux. I still find it an annoying distro. It never gets the boot partition...
by jdarnold at November 16, 2008 04:10 PM
November 07, 2008
November 06, 2008
It's alive! As yet another side project, I have been trying to get Boxee to work on my openSUSE box. Boxee is a cool new media player / social app that lets you play all kinds of multimedia, including streaming video from sites like Hulu, CNN, last.fm etc. It first...
by jdarnold at November 06, 2008 05:58 PM
October 04, 2008
Mailing lists can outlive their usefulness
October 04, 2008 11:48 PM
August 30, 2008
an HDD failed. gmirror to the rescue.
August 30, 2008 03:48 AM
July 05, 2008
This makes jails easier
July 05, 2008 11:48 PM
June 23, 2008
Adding RAID-1 to an existing FreeBSD 7 installation
June 23, 2008 11:48 PM
March 20, 2008
Unpacking the box, installing PC-BSD
March 20, 2008 12:48 AM
March 17, 2008
The GeForce 8600 GT with two monitors
March 17, 2008 12:48 AM