<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>stas' weblog - Home</title>
  <id>tag:blog.springdaemons.com,2008:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://blog.springdaemons.com/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://blog.springdaemons.com/" rel="alternate" type="text/html"/>
  <updated>2008-11-12T00:47:11Z</updated>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-11-12:5164</id>
    <published>2008-11-12T00:42:00Z</published>
    <updated>2008-11-12T00:47:11Z</updated>
    <category term="photo"/>
    <link href="http://blog.springdaemons.com/2008/11/12/moon" rel="alternate" type="text/html"/>
    <title>Moon</title>
<content type="html">
            &lt;p&gt;&lt;img title=&quot;Moon&quot; src=&quot;/assets/2008/11/12/moon.jpeg&quot; alt=&quot;Moon&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Shot tonight with Zuiko Digital 40&#8211;150.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-10-31:4585</id>
    <published>2008-10-31T00:48:00Z</published>
    <updated>2008-10-31T00:50:17Z</updated>
    <category term="FreeBSD"/>
    <link href="http://blog.springdaemons.com/2008/10/31/u-boot-ffs-ufs-support" rel="alternate" type="text/html"/>
    <title>U-boot FFS/UFS support</title>
<content type="html">
            &lt;p&gt;Yes, it&#8217;s there. Well, you might say I was supposed to do something useful instead like improving FreeBSD rather
than fighting with this huge and unstructured piece of code&#8230; However, for some time u-boot will be here
for FreeBSD too before we will be able to roll out a featue-comparable embedded bootloader.&lt;/p&gt;

&lt;p&gt;So I spend a couple of days and implemented FFS support for u-boot. This means now you&#8217;re able to have a complete
FreeBSD system booting directly from FFS-formatted media from u-boot. Both UFS1 and UFS2 should be supported,
though I only tested UFS2 support. This listing shows at91&#8217;s uboot displaying the listing of FFS-formatted CompactFlash
partiton:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ATAMAN-TB&amp;gt; ffsls ide 0:1 /
INODE   SIZE           NAME
2       512            ./
2       512            ../
3       512            .snap/
4       2322058        kernel
5       578            rc.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can grab the patch here: &lt;a href=&quot;http://www.SpringDaemons.com/stas/u-boot-ffs.patch&quot;&gt;FFS patch&lt;/a&gt;. This should apply
clearly on u-boot 1.3.4 tree.&lt;/p&gt;

&lt;p&gt;To build U-boot on FreeBSD you will also need the ompatibilty patch which could be downloaded
&lt;a href=&quot;http://www.SpringDaemons.com/stas/u-boot-freebsd.patch&quot;&gt;here&lt;/a&gt;. After that you can use toolchains
provided by devel/cross-gcc and devel/cross-binutils ports to build u-boot for the required platform.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-10-30:4579</id>
    <published>2008-10-30T22:36:00Z</published>
    <updated>2008-10-31T00:32:35Z</updated>
    <category term="russian"/>
    <link href="http://blog.springdaemons.com/2008/10/30/crysis" rel="alternate" type="text/html"/>
    <title>Cri^Hysis</title>
<content type="html">
            &lt;p&gt;Международный финансовый кризис ещё только начинается, но в общественном сознании он похоже уже достиг своего апологея.
А пока банкиры, финансисты и прочие спекулянты подсчитывают убытки, их сограждане всеми доступными способами
пытаются поддержать этих несчастных людей в беде:
&lt;a href=&quot;http://blog.SpringDaemons.com/assets/2008/10/30/crisis-full.jpeg&quot;&gt;&lt;img src=&quot;http://blog.SpringDaemons.com/assets/2008/10/30/crisis.jpeg&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Такой вот забавный кризис. В общем, без хлеба не останемся... Главное, ко всему подходить с долей юмора.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-10-25:4303</id>
    <published>2008-10-25T20:02:00Z</published>
    <updated>2008-10-25T20:04:42Z</updated>
    <category term="hardware"/>
    <link href="http://blog.springdaemons.com/2008/10/25/russian-electronics-we-don-t-need-microelectronic-technology-we-do-pico-for-decades-already" rel="alternate" type="text/html"/>
    <title>Russian electronics. We don't need microelectronic technology, we were doing pico- for decades already.</title>
<content type="html">
            &lt;p&gt;&lt;img title=&quot;Picoelectronic device&quot; src=&quot;/assets/2008/10/25/pico.jpeg&quot; alt=&quot;Picoelectronics&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This suspicious device was found recently at MEPhI microelectronics departent catacombs. After breaking the deivice's
case to our great disappointment we weren't able to discover any signs of microelectronic footprint inside. The pins
weren't even connected (at least it &lt;em&gt;seems&lt;/em&gt; so). It looks like the soviet microelectonics went beyond the current
nano-sized structures several decades ago. &lt;em&gt;Picoelectronic&lt;/em&gt; device, indeed. :-)&lt;/p&gt;

&lt;p&gt;PS: I would really like to know which microprocessor architecture this device implements. Getting FreeBSD runned
there will be really great!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-10-21:4146</id>
    <published>2008-10-21T16:50:00Z</published>
    <updated>2008-10-21T16:51:24Z</updated>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2008/10/21/50-years-of-lisp" rel="alternate" type="text/html"/>
    <title>50 years of LISP</title>
<content type="html">
            &lt;p&gt;&lt;img title=&quot;Doing wrong&quot; src=&quot;/assets/2008/10/21/lisp.jpeg&quot; alt=&quot;Lisp&quot; /&gt;&lt;/p&gt;

&lt;p&gt;50 years ago John McCarthy published  a number of papers for his researh in designing
a new programming language. These were the firts steps of Lisp, definitely the most
advanced and beautiful programming language in the history. The researh linked
with this language made a great influence on almost every modern programming
language, and the Lisp itself is still in use.&lt;/p&gt;

&lt;p&gt;Long live Lisp and John McCarthy! &lt;em&gt;Happy birthday!&lt;/em&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-10-20:4129</id>
    <published>2008-10-20T20:32:00Z</published>
    <updated>2008-10-20T20:47:00Z</updated>
    <category term="misc"/>
    <link href="http://blog.springdaemons.com/2008/10/20/finals-tomorrow" rel="alternate" type="text/html"/>
    <title>Finals tomorrow</title>
<content type="html">
            &lt;p&gt;&lt;img title=&quot;Finals study&quot; src=&quot;/assets/2008/10/20/finals.jpeg&quot; alt=&quot;Finals&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;No comments...&lt;/em&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-09-20:2978</id>
    <published>2008-09-20T22:39:00Z</published>
    <updated>2008-09-21T23:33:47Z</updated>
    <category term="FreeBSD"/>
    <category term="enlightenment"/>
    <category term="software"/>
    <category term="e17"/>
    <category term="freebsd"/>
    <link href="http://blog.springdaemons.com/2008/9/20/entrance-port" rel="alternate" type="text/html"/>
    <title>Entrance port</title>
<content type="html">
            &lt;p&gt;For a long time I have been asked whether I'm planning to port entrance to FreeBSD or not. Entrance is a graphic login manager similar to XDM but
built around Enlightenment project E17 core libraries  and with e17 look&amp;amp;feel. But this application has a lot of drawbacks too - the code isn't
stable enough, so it's not a good idea probably to use it as login manager running as root.&lt;/p&gt;

&lt;p&gt;After several recent inquries, I decided to create a port for this anyway, thus FreeBSD users will be able to preview and test this beatiful
XDM replacement. If you're interested, you can download the port tarball &lt;a href=&quot;http://www.SpringDaemons.com/stas/entrance.tar.bz2&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you want for entrance to start automatically on startup either add an appropriate line to /etc/ttys, or define entranced_enable=&quot;YES&quot;
in /etc/rc.conf. You can also run entrance by hand by executing ${PREFIX}/sbin/entranced. By default, entranced on FreeBSD binds to
first free tty (ttyv8), thus if you've tweaked your ttys configuration so ttyv8 isn't free anymore, change entrance config before trying
to run it. You can use entrance_edit utility to tweak its configuration.&lt;/p&gt;

&lt;p&gt;If you want to preview entrance in existing X11 session, run entrance -T. This will open a new X11 window with entrance
running inside it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/2008/9/20/entrance.jpeg&quot; alt=&quot;Entrance&quot; /&gt;&lt;/p&gt;

&lt;p&gt;PS: I have no plans currently to add this to the ports collection due to issued described above. Someone need to audit the code
before it could be added to the official collection.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-03-12:684</id>
    <published>2008-03-12T00:51:00Z</published>
    <updated>2008-03-12T00:54:36Z</updated>
    <category term="hardware"/>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2008/3/12/hacking-the-d-link-dgs-1248t-switch" rel="alternate" type="text/html"/>
    <title>Hacking the D-Link DGS-1248T switch</title>
<content type="html">
            &lt;p&gt;What would you do if your D-Link (TrendNet, Allied Telesyn or other crappy manufacturer) broke after the warranty period is exhausted?&lt;/p&gt;

&lt;p&gt;Recently, exactly that happened to me: our DGS-1248T manageable switch, which we used to connect non-critical
servers to, stopped working. Well, in fact, it continued to switch packets, but it become totally unmanageable, nothing better than these lower-end Compex or Surecom switches. Good value for money, isn't it? This brick, truly speaking, never worked fine &amp;mdash; its f*cking so-called web-interface is compatible only with IE5, it has no telnet port, it has even no... rs232 interface.&lt;/p&gt;

&lt;p&gt;Not willing to pay anything more to D-Link, I decied to fix it myself. At least, I decided, it would be a lot of fun, even if I fail to do that. Furthermore, my boss volunteered to help me out &amp;mdash; being a good hardware engineer in the past, he's able to easily fix PCBs using just a 40W soldering iron. So, I rolled up my sleeves, took the screwdriver and opened the box:&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;DGS-1248T disassembled&quot; src=&quot;/assets/2008/3/11/dlink_1.jpeg&quot; alt=&quot;DL1248T disassmbled&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The hardware inside was semi-standard for such kind of devices &amp;mdash; a printed circuit board with an ARM940T based Samsung S3C2510A SoC mircocontroller as its CPU, forth Vitesse Switch-on-a-chip cores, and a number of Vitesse PHYs (in fact, I thought Vitesse only produce teapots... probably D-Link just missed components &amp;mdash; they're hot like a boiled water).&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;S3C2510A cpu&quot; src=&quot;/assets/2008/3/11/cpu_1.jpeg&quot; alt=&quot;S3C2510A cpu&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Vitesse folks seems to have a good sense of humor &amp;mdash; their PHY chip is called SimpilPHY.&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Vitesse SimpliPHYs&quot; src=&quot;/assets/2008/3/11/vitess_1.jpeg&quot; alt=&quot;Vitesse PHYs&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately, there was no rs232 connector on the board &amp;mdash; thus, no chance to see what happened to it. In fact, there was place to put a standard DB-9 connector on the PCB, but no signal output at all. Clearly, there was something missing... By looking in the CPU manual (well, not the CPU one, but evaluation board manual for previous Samsung model &amp;mdash; 2410), I discovered, that the processor uses TTL voltage logic, and output driver for rs232 is recuired. And... near the UART contacts there was a place exactly for MAX2332 UART driver. Looks like they just took their development board and removed all debug components in retail version. Woot, woot!&lt;/p&gt;

&lt;p&gt;We took our old oscilloscope to ensure if there were signals at the contact box. Yes, they were!&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;Our old good oscilloscope&quot; src=&quot;/assets/2008/3/11/osc.jpeg&quot; alt=&quot;Our old good oscilloscope&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Next we put the MAX2332 microscheme where it belongs to, and even placed the standard DB-9 connecter to simplify
things a bit.&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;UART attached&quot; src=&quot;/assets/2008/3/11/uart_1.jpeg&quot; alt=&quot;UART attached&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now the switch board looked like a real ARM development board. I even put a reset button on it:-) However, this didn't
helped much. The console attached showed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;uart init successful
flash init successful
Get my mac[0-13-46-36-39-da]

image verify failed, loader mode
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Not very informative. In this mode, the console didn't answered any keys, even echo didn't worked. Funny enough, there was one active TCP port on the switches management IP address &amp;mdash; port 80, that acted like an echo server. Definitely, something bad happened to firmware.&lt;/p&gt;

&lt;p&gt;Fortunately, there was yet one nice connector on the board &amp;mdash; &lt;a href=&quot;http://en.wikipedia.org/wiki/JTAG&quot;&gt;JTAG&lt;/a&gt;. JTAG stands for Joint Test Action Group, and presents IEEE 1149.1  standard for testing integrated circuits with boundary scans. Nowaday, most SoC manufacturers, implement comprehencive in-circuit debug solutions using JTAG as a serial interface to the chip. In particular, ARM 9 core uses standartized JTAG-based protocol, that allows developer to submit and execute any command on CPU, set breakpoints, and so on. It's not too surprising, that this allows you to do whatever you want with target platform, including reflashing. All you need is to configure a memory controller to map flash properly and implement a program that will run on target hardware and reflash the memory.&lt;/p&gt;

&lt;p&gt;In fact, there're a lot of excellent JTAG software available, &lt;a href=&quot;http://openocd.berlios.de/&quot;&gt;OpenOCD&lt;/a&gt; being among of them. This excellent piece of software can make you feel like debugging a locally runned program while communicating with an embedded processor via JTAG. Using it GDB-server interface you can easily connect your GDB instance to it, and
fully control the board. Besides that, it also provide a custom telnet interface, where you can perform a lot of high-level
debugging tasks like examining the target memory, modifing it, viewing registers and so on. It also provide interface through
which the flash modules can be programmed, and it's easily extensible. It took nothing more than a hour for me to
understand the OpenOCD code structure, and perform all required modifications to support D-Link configuration. The switch developers employed AMD AM29LV800 flash chip as it's media &amp;mdash; it's a pretty standard chip, so only the identity of the memory and a couple of knobs has to be added to OpenOCD code to support it.&lt;/p&gt;

&lt;p&gt;Having nothing else to do, I decided to reflash the switch with recent image available from D-Link. From the processor state it was clear they mapped the flash to 0x80000000 with bootloader occuping the address space up to 0x80030000, and the OS image put just after that address. What's suspicious &amp;mdash; D-Link guys configured all eight banks, though only three were really used. Furthermore, all banks were configured in the way as they provide 16MiB of memory each, though it was not true (e.g. flash is only 1 MiB). Have they ever thinked about folks who had to reverse engineer their software in future?;-)&lt;/p&gt;

&lt;p&gt;Luckily enough, the switch started working after the reflashing. It happily blinked with all its LEDs, clearly showing how it's happy to be healthy again, displaying on console:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; uart init successful
 flash init successful
 Get my mac[0-13-46-36-39-da]
image verify successful, jump to 0x80030000
cpu init finished 
system init successful 

 flash alloc[222bb8]


web server running... [5307]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Not sure which OS it runs, probably VxWorks or RTEMS. My first assumptions were it'll be some flavour of Linux, but things don't look like this. Probably, some information might be extracted from the image intself, but I didn't looked into this yet. I noticed, however, that the image consists of  small unpacker and compressed code. So it has to be unpacked before anything could be analyzed further.&lt;/p&gt;

&lt;p&gt;Unfortunately, the chip can't run FreeBSD, or any other BSD as it got no MMU. Thus my dreams about 48-port BGP router have no chances to come true:-(&lt;/p&gt;

&lt;p&gt;Anyway, now you know what to do if your switch or router will broke out. Don't pay D-Link extra money for missed functionality &amp;mdash; just fix the device yourself. It's easy enough.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2008-01-10:48</id>
    <published>2008-01-10T00:31:00Z</published>
    <updated>2008-11-09T21:57:22Z</updated>
    <category term="FreeBSD"/>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2008/1/10/using-mercurial-for-local-freebsd-development" rel="alternate" type="text/html"/>
    <title>Using Mercurial for local FreeBSD development</title>
<content type="html">
            &lt;p&gt;For a long time The FreeBSD project used CVS as its version control system
almost exclusively. Recently a number of more sophisticated version
control systems were developed, and it's becoming quite common that the
developer uses something other than CVS for local development work. It was
shown over years that using CVS for big long-term work on FreeBSD source code,
especially when it should be constantly synced with the main FreeBSD repo,
can become a major pain. That's why, in part, the FreeBSD projects provides
access to a Perforce repo to work on FreeBSD related projects.&lt;/p&gt;

&lt;p&gt;This tiny tutorial shows how one can configure and use &lt;a href=&quot;http://www.selenic.com/mercurial/&quot;&gt;Mercurial&lt;/a&gt; to do
his local development work in FreeBSD repo, while staying in sync with
the main development tree.&lt;/p&gt;

&lt;h1&gt;Checking out the source code&lt;/h1&gt;

&lt;p&gt;One of the most handy ways to obtain the FreeBSD source code is
to use CVSup. This program uses sophisticated algorithms to efficiently
transfer a large number of file over network. These also were specifically
optimizes to use with CVS, so it tries to transfer deltas, not entire
files, whenever possible.&lt;/p&gt;

&lt;p&gt;You can find more information about CVSup in the FreeBSD Handbook.&lt;/p&gt;

&lt;p&gt;For example, I use the following supfile to keep in sync with the FreeBSD repo.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*default host=CHANGE_THIS.FreeBSD.org
*default base=/var/db/mercurial-cvsup/
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix

src-all tag=.           prefix=/work/src/mercurial/fbsd-src-HEAD
src-all tag=RELENG_7 prefix=/work/src/mercurial/fbsd-src-RELENG_7
src-all tag=RELENG_6 prefix=/work/src/mercurial/fbsd-src-RELENG_6
src-all tag=RELENG_5 prefix=/work/src/mercurial/fbsd-src-RELENG_5
src-all tag=RELENG_4 prefix=/work/src/mercurial/fbsd-src-RELENG_4

ports-all tag=. prefix=/work/src/mercurial/fbsd-ports
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In this configuration all source files will be placed under
/work/src/mercurial/. I use separate Mercurial repos for different
FreeBSD branches, though you can probably use native Hg branches
for this. I discovered that keeping different repositories works better
for me as it's much lesser error probability and doesn't impact the speed
much (if it does it at all).&lt;/p&gt;

&lt;h1&gt;Creating Mercurial repository&lt;/h1&gt;

&lt;p&gt;After obtaining the source you have to initialize Hg repository for the
first time. It's very simple, luckily enough. Just enter into the each
of repository folders, e.g. /work/src/mercurial/fbsd-src-HEAD from the above,
and type the following commands:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% hg init # will create .hg folder and initialize its contents
% hg add  # will schedule all new files for the addition
% hg commit -m 'Initial import of the FreeBSD tree'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After that all downloaded source code will be managed by Mercurial.
If you need to ignore some files, use .hgignore(5) file for this.&lt;/p&gt;

&lt;h1&gt;Keeping repositories in sync&lt;/h1&gt;

&lt;p&gt;Obviously, you want to be in sync with the main FreeBSD development
tree. In fact, it's not harder than creating the repo.&lt;/p&gt;

&lt;p&gt;To update your repository you need to perform the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieve the fresh source code with the supfile you used in the previous step&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter to the repository's directory and execute the following commands:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% hg addremove        # will schedule new files to the
                      # addition and all nonexistent for
                      # removal
% hg commit -m 'Update from upstream'
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can perform these steps from cron(8) to update your repos e.g.
once a day. For example, I use the following script to do this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/csh

set HG=/usr/local/bin/hg
set CSUP='/usr/bin/csup -L0'
set SUPFILE=/home/stas/mercurial-supfile
set BRANCHES=(fbsd-ports fbsd-src-RELENG_7 fbsd-src-RELENG_6 \
        fbsd-src-RELENG_5 fbsd-src-RELENG_4 fbsd-src-HEAD)
set REPOPATH=/work/src/mercurial

echo $BRANCHES

#
# Update sources via CVSUP
#

${CSUP} ${SUPFILE}

if ($status != 0) then
        echo &quot;Error occurred during update&quot;
        exit 1
endif

#
# Add and commit changes into mercurial repo
#
foreach branch (${BRANCHES})
        cd ${REPOPATH}/${branch} &amp;amp;&amp;amp; ${HG} addremove &amp;amp;&amp;amp;
            ${HG} ci -m 'Update from upstream'
end
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Performing local development work on the repositories&lt;/h1&gt;

&lt;p&gt;This is what we have done all the previous steps for.&lt;/p&gt;

&lt;p&gt;Mercurial is the true distributed VCS and encourages the use of separate repository
for the every project you work on. In fact, the repository clone operation is very
fast and cheap - Mercurial uses copy-on-write technology to avoid unnecessary copies.&lt;/p&gt;

&lt;p&gt;For example if you're going to do some work on the Project1 for the FreeBSD HEAD
you start by creating the corresponding repository:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% hg clone /path/to/repo/fbsd-src-HEAD fbsd-HEAD-project1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After that you can safely use fbsd-HEAD-project1 for all project1-related development
work, commit changes, rollback them, view the history. Refer to the Hg documentation
to learn more about Mercurial and it's abilities.&lt;/p&gt;

&lt;p&gt;In case if you need to merge with the recent HEAD after some time, you can easily do that:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% cd /path/to/fbsd-HEAD-project1
% hg pull /path/to/repo/fbsd-src-HEAD
% hg merge
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;resolve conflicts, etc&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% hg commit -m 'Merge upstream'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can do that whenever you want without any consequences. Mercurial keeps the history
of merges, so you won't receive suspicious conflicts. Furthermore, after the merge operation
Hg will integrate all the history from the merged tree into your tree, so you'll be able
to easily check the difference between your tree and the main tree. Suppose, for example,
after some development you've received the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;changeset:   310:d44952c166fd
tag:         tip
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Wed Jan 09 18:57:24 2008 +0300
summary:     - Add new files.

changeset:   309:937d50c4af02
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Fri Nov 30 19:02:37 2007 +0300
summary:     - Fix build.

changeset:   308:610151747720
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Wed Nov 28 11:45:56 2007 +0300
summary:     - Fix build.

changeset:   307:023d52500562
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Tue Nov 27 23:17:43 2007 +0300
summary:     - Add forgotten file.

changeset:   306:af6c5a6c4ff4
parent:      235:28745515f10e
parent:      304:4724d224afe3
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Tue Nov 27 21:40:58 2007 +0300
summary:     - Branch merge.

changeset:   305:4724d224afe3
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Tue Nov 27 02:53:22 2007 +0300
summary:     Update master tree

changeset:   304:4d9fc65e6661
user:        Stanislav Sedov &amp;lt;stas@FreeBSD.org&amp;gt;
date:        Mon Nov 26 02:52:57 2007 +0300
summary:     Update master tree
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now you can get the diff between the main tree as on Tue Nov 27
and your last revision by using the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;% hg diff -r 305 -r tip
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Statistics&lt;/h1&gt;

&lt;p&gt;As of time writing the space consumed by my repositories distributed as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;629M    fbsd-ports&lt;/li&gt;
&lt;li&gt;659M    fbsd-src-HEAD&lt;/li&gt;
&lt;li&gt;481M    fbsd-src-RELENG_4&lt;/li&gt;
&lt;li&gt;568M    fbsd-src-RELENG_5&lt;/li&gt;
&lt;li&gt;600M    fbsd-src-RELENG_6&lt;/li&gt;
&lt;li&gt;657M    fbsd-src-RELENG_7&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not so much for such a handy tool.&lt;/p&gt;

&lt;h1&gt;Additional info&lt;/h1&gt;

&lt;p&gt;For additional information about Mercurial refer to the included manual
pages. The &lt;a href=&quot;http://hgbook.red-bean.com/hgbook.html&quot;&gt;Distributed revision control with Mercurial&lt;/a&gt; book also is
the great source of information about Hg.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2007-12-22:45</id>
    <published>2007-12-22T13:14:00Z</published>
    <updated>2007-12-22T16:21:29Z</updated>
    <category term="hardware"/>
    <category term="mips"/>
    <category term="misc"/>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2007/12/22/first-russian-mips-compatible-microprocessor" rel="alternate" type="text/html"/>
    <title>First russian MIPS-compatible microprocessor</title>
<content type="html">
            &lt;p&gt;Recently I was involved into the practical part of microprocessor's course, included into our department's masters program, where I served as TA. Well, in fact, not just TA, but the entire 2x2 hour course was developed and teached by me and
my &lt;a href=&quot;http://kibab.ya.ru&quot;&gt;friend&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The primary goal of this classes was to make students familar with our national processor boards, produced by NIISI
(research institute of systems development). Theses boards include our first MIPS R3000-compatible KOMDIV32 microprocessor with technological sizes of 35 microns, &quot;PRIME&quot; boot monitor and various peripheral devices like speaker, uarts, light diods and so on. The processor runs at 90 MHz clock.&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;KOMDIV32&quot; src=&quot;/assets/2007/12/22/mips2small.png&quot; alt=&quot;KOMDIV32 microprocessor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The board still very buggy and has a lot of features hardcoded and/or hardwired, but pretty usable. Especially interesting
looks PRIME boot monitor, that can handle almost all development task, including but not limited to downloading executables
via FTP/TFTP/NFS or Z-Modem, dumping/writing memory and working with FLASH memory. The board has two modes of operation - depending on switch setting it can either go to PRIME on boot, or start executing the code located at the start of
flash memory. This feature has shown itself to be very handy in development.&lt;/p&gt;

&lt;p&gt;&lt;img title=&quot;KOMDIV32 board&quot; src=&quot;/assets/2007/12/22/mipsboard1small.png&quot; alt=&quot;KOMDIV32 board&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The development kit was also accomplished by the proprietary OS2000 real-time operating system, which seems to be
an evil mix of FreeBSD 4.x and VxWorks source code. E.g. their second stage boot loader fully resembles VxWorks loader,
though with a lot of parsing bugs. Similary, the kernel object archives contains files like ipfw.ko with full debug info and CVS id's, although it seems to not use it:-) The operating system claims to be POSIX-compatible, though I had no enough time to
check it fully. The course was featuring work with some multiprogramming APIs like POSIX threads and message passing, but unfortunately very few studens were able to understand this fully due to lack of C programming experience in past.&lt;/p&gt;

&lt;p&gt;We were using FreeBSD as a host enviropment instead of NIISI-recommended Red Hat Linux. All the SDK software was
ported to FreeBSD with a little effort (thanks to SDK developers - the didn't used bash/gawk/etc feature much). However, we
used their proprietary GCC-based compiler (GPL violation?) under Linux emulation to compile target source code. Probably,
gcc's mips target can do that too, but I didn't tried that.&lt;/p&gt;

&lt;p&gt;One funny bug we were experiencing - the BSP we got with board was not fully compatible with it, thus it was producing a continuous high-frequency beep after startup. This way we could always say when yet one student managed to get his board running OS2000:-) Although a little room with 8 beeping boards looked slightly crazy...&lt;/p&gt;

&lt;p&gt;A good project will be to try to run FreeBSD/mips on these boards and use it as a basis of course, but the lack of documentation and OS source code makes this nearly impossible. Hopefully, they'll understand soon that distributing
a research OS without the source code in 21th century is a no-way.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2007-09-21:22</id>
    <published>2007-09-21T02:03:00Z</published>
    <updated>2007-09-21T02:03:00Z</updated>
    <category term="databases"/>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2007/9/21/mysql-weirdness" rel="alternate" type="text/html"/>
    <title>MySQL weirdness</title>
<content type="html">
            &lt;p&gt;It seems that MySQL folks began to use the same style of doing things that PHP project use. E.g. fixing one bug by introducing another one, two or more. That's a pity, though MySQL was never a high-quality project...&lt;/p&gt;

&lt;p&gt;The problem I recenltly run into at &lt;a href=&quot;http://ht-systems.ru&quot;&gt;Hosting Telesystems&lt;/a&gt; by upgrading our web hosting DBMS servers lie in the fact that the shiny new 5.0.45 version of MySQL silently ignores &quot;tmpdir&quot; value setting and put temporary tables in it's working dir. Our configuration used a memory disk for these purposes before, so this fault created a very high load on the storage disk, not speaking of increased request processing times. It's definitely not a good way of making things...&lt;/p&gt;

&lt;p&gt;Hopefully, the fix for this bug has been already committed to MySQL CVS, so I made a patch of that and send it to ale (FreeBSD port maintainer). I beleive he'll commit it soon:-)&lt;/p&gt;

&lt;p&gt;For those who is intrested, patches for mysql itself (agains 5.0.45 release) also available here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://people.FreeBSD.org/~stas/patch-sql_sql_select.cc&quot;&gt;http://people.FreeBSD.org/~stas/patch-sql_sql_select.cc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://people.FreeBSD.org/~stas/patch-sql_item.cc&quot;&gt;http://people.FreeBSD.org/~stas/patch-sql_item.cc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PS: Am I only one who thinks that putting temp tables on disk is a bad idea of memory management? Who the hell ivented this? Why not simply use a memory mapped file to put temporary data on it and let the VM system optimize things out?&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2007-05-03:6</id>
    <published>2007-05-03T22:52:00Z</published>
    <updated>2007-05-03T22:52:00Z</updated>
    <category term="FreeBSD"/>
    <category term="hardware"/>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2007/5/3/intel-critical-microcode-update" rel="alternate" type="text/html"/>
    <title>Intel Critical Microcode update</title>
<content type="html">
            &lt;p&gt;Recently Intel released microcode update for their Core 2 Duo and Core 2 Extreme processors (E6000/E4000 and Q6600/QX6700 series accordingly). This update fix a bug in TLB processing, which can cause incorrect records invalidation. That may result in upredictable system behavour/hangs/reboots/etc.&lt;/p&gt;

&lt;p&gt;For FreeBSD you can use &lt;em&gt;devcpu&lt;/em&gt; port to update your microcode. It already includes these critical updates, thus will protect you from possible failures linked with the bug. Just install it as usual and add 'devcpu_enable=&quot;YES&quot;' in the rc.conf file. Processor microcode will be updated on the next restart (or you can issue /usr/local/etc/rc.d/devcpu start by hand).&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2007-04-24:5</id>
    <published>2007-04-24T19:18:00Z</published>
    <updated>2007-04-24T19:18:19Z</updated>
    <category term="FreeBSD"/>
    <category term="misc"/>
    <link href="http://blog.springdaemons.com/2007/4/24/first-mentee" rel="alternate" type="text/html"/>
    <title>First mentee</title>
<content type="html">
            &lt;p&gt;Today I have received an approve from portmgr@ to allow Marcelo Araujo to join the developers community as a ports committer. He've done a great work of submitting new ports and fixes, so it's the time to reward him.&lt;/p&gt;

&lt;p&gt;I'll drive his first steps as ports committer and will be responsible for his possible errors (and receive pointy hats for that:-)).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Please, wish him a luck!&lt;/strong&gt;&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2007-03-17:4</id>
    <published>2007-03-17T03:43:00Z</published>
    <updated>2007-03-17T03:43:11Z</updated>
    <category term="FreeBSD"/>
    <category term="enlightenment"/>
    <category term="software"/>
    <link href="http://blog.springdaemons.com/2007/3/17/e17-ports-were-updated" rel="alternate" type="text/html"/>
    <title>e17 ports were updated</title>
<content type="html">
            &lt;p&gt;As you may noticed, the &lt;em&gt;enlightenment-devel&lt;/em&gt; port as well as other &lt;em&gt;e17&lt;/em&gt; ports were updated to the latest snapshot. Well, there's was enough time from the previous update, many things has changed and stability was generaly improved.&lt;/p&gt;

&lt;p&gt;If you have problems building enlightenment from ports, try rebuilding x11/ecore with &lt;em&gt;DBUS&lt;/em&gt; support enabled, enlightenment rely on this ecore feature in the builtin file manager. Don't worry, it doesn't depend on dbus library and adds a very few code (via loadable shared library).&lt;/p&gt;

&lt;p&gt;Also, the startup command of enlightenment was renamed to enlightenment_start, so don't forget to update your .xinitrc &lt;/p&gt;

&lt;p&gt;BTW, oleczek submitted a port for new e17 module &lt;em&gt;elucence&lt;/em&gt;, and I have finished it. This module uses xcompmgr to manage windows opacities in a beautiful way. However, it can be slow as an evil on some video adapters, and doesn't behave well with current e17 version (e.g. it has no module icon). If you interested, download it &lt;a href=&quot;http://mbsd.msk.ru/dist/e17-module-elucence.tar.bz2&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://blog.springdaemons.com/">
    <author>
      <name>stas</name>
    </author>
    <id>tag:blog.springdaemons.com,2007-02-02:3</id>
    <published>2007-02-02T01:39:00Z</published>
    <updated>2007-02-02T01:39:52Z</updated>
    <category term="FreeBSD"/>
    <category term="hardware"/>
    <link href="http://blog.springdaemons.com/2007/2/2/devcpu-port-was-updated" rel="alternate" type="text/html"/>
    <title>devcpu port was updated</title>
<content type="html">
            &lt;p&gt;Today I've updated the &lt;em&gt;devcpu&lt;/em&gt; port. One of the major things that was changed is the utility to deal with Award bios update images was added. This program allows to extract microcode updates from vendor bios updates (this especially important for AMD cpus as this company doesn't distribute cpucodes updates for end-users). Furthermore, you can take bios updates for the newer hardware and extract microcode updates from them in case if your system unsuppored by vendor anymore. A have a lot of such hardware.&lt;/p&gt;

&lt;p&gt;Another thing, that was added is the &lt;em&gt;rcNG&lt;/em&gt; startup script. It allows to enable automatic cpucode updates on startup. Just add ths string devcpu_enable=&quot;YES&quot; in your /etc/rc.conf file and cpus will be updated on each boot.&lt;/p&gt;

&lt;p&gt;I wish to think &lt;em&gt;pav@&lt;/em&gt; and &lt;em&gt;netchild@&lt;/em&gt; for their suggestions and reports.&lt;/p&gt;
          </content>  </entry>
</feed>
