Introduction
Introduction Statistics Contact Development Disclaimer Help
cambus.net.atom.xml - sfeed_tests - sfeed tests and RSS and Atom files
git clone git://git.codemadness.org/sfeed_tests
Log
Files
Refs
README
LICENSE
---
cambus.net.atom.xml (234551B)
---
1 <?xml version="1.0" encoding="utf-8"?>
2 <feed xmlns="http://www.w3.org/2005/Atom">
3 <title><![CDATA[Atom Feed - Cambus.net]]></title>
4 <subtitle><![CDATA[Personal site and technical blog of Frederic …
5
6 <link href="https://www.cambus.net/atom.xml" rel="self" />
7 <link href="https://www.cambus.net/" />
8
9 <updated>2021-10-01T23:39:34Z</updated>
10 <id>https://www.cambus.net/</id>
11
12 <author>
13 <name><![CDATA[Frederic Cambus]]></name>
14 </author>
15
16 <generator uri="https://github.com/fcambus/motyl">Motyl</generat…
17
18 <entry>
19 <title><![CDATA[Toolchains adventures - Q3 2021]]></title>
20 <link href="https://www.cambus.net/toolchains-adventures…
21 <id>https://www.cambus.net/toolchains-adventures-q3-2021…
22 <published>2021-10-01T23:16:00Z</published>
23 <updated>2021-10-01T23:16:00Z</updated>
24 <content type="html"><![CDATA[<p>I've been keeping mysel…
25 article at the beginning of June, so here is an update detailing what I'…
26 been up to during the past couple of months.</p>
27
28 <p>At the end of June, I went through the FSF copyright assignment proce…
29 both <strong>Binutils</strong> and <strong>GDB</strong>, which now allow…
30 changes to these codebases. I thus updated the <a href="https://sourcewa…
31 in GDB, and added support to readelf for <a href="https://sourceware.org…
32
33 <p>In Pkgsrc land, I packaged and imported <a href="https://github.com/r…
34 optimized for modern multi-core machines, and updated our binutils packa…
35 to the latest version.</p>
36
37 <p>At the end of August, I attended the <strong>OpenBSD k2k21 hackathon<…
38 the goals I had was to get <a href="https://clang.llvm.org/docs/SourceBa…
39 The first part of this was to find how to allow the compiler driver to
40 link against the <strong>libclang_rt.profile</strong> library when passi…
41 <strong>-fprofile-instr-generate</strong> and <strong>-fcoverage-mapping…
42 Once I figured the <a href="https://www.freshbsd.org/openbsd/src/commit/…
43 and <a href="https://reviews.llvm.org/D109244">sent it upstream</a> wher…
44 LLVM 13 branch. With this part sorted, the next step was to build and sh…
45 the library in the base system. I added <a href="https://www.freshbsd.or…
46 library in base, and <a href="https://www.freshbsd.org/openbsd/src/commi…
47 architectures where Clang is built.</p>
48
49 <p>To illustrate what we can do with the source-based code coverage, let…
50 take the following C program:</p>
51
52 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
53 </span>
54 <span class="kt">int</span>
55 <span class="nf">main</span><span class="p">()</span>
56 <span class="p">{</span>
57 <span class="n">printf</span><span class="p">(</span><span class…
58 <span class="k">return</span> <span class="mi">0</span><span cla…
59
60 <span class="n">printf</span><span class="p">(</span><span class…
61 <span class="p">}</span>
62 </code></pre></div></div>
63
64 <p>Let's build and instrument it to emit profile data:</p>
65
66 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
67 </code></pre></div></div>
68
69 <p>And we can now run it to collect and process profile data:</p>
70
71 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
72 llvm-profdata merge <span class="nt">-sparse</span> ducks.profraw <span …
73 llvm-cov show ./ducks <span class="nt">-instr-profile</span><span class=…
74 </code></pre></div></div>
75
76 <p>We can see that no ducks were harmed during this experiment:</p>
77
78 <p><img src="/content/2021/10/ducks.png" alt="Ducks profile" title="Duck…
79
80 <p>Coverage reports can also be created by llvm-cov:</p>
81
82 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
83
84 Filename Regions Missed Regions Cover Func…
85 <span class="nt">-------------------------------------------------------…
86 /home/f/ducks/ducks.c 2 1 50.00% …
87 <span class="nt">-------------------------------------------------------…
88 TOTAL 2 1 50.00% …
89 </code></pre></div></div>
90
91 <p>Using the <strong>LLVM_PROFILE_FILE</strong> environment variable, it…
92 do several runs with different options and/or input files and get a new
93 <strong>.profraw</strong> file each time. All those files can then be me…
94 <strong>llvm-profdata</strong>, which is pretty useful for doing coverag…
95 unit tests.</p>
96
97 <p>On top of the OpenBSD related changes I've been contributing upstream…
98 LLVM, I've been continuing my experiments with the build system. I've al…
99 been reading documentation about various parts of the toolchain, sending
100 diffs when encountering mistakes or things which could be improved.</p>
101
102 <p>binutils and GDB commits:</p>
103
104 <ul>
105 <li>2021-09-11 - <a href="https://sourceware.org/git/?p=binutils-gdb.g…
106 <li>2021-07-14 - <a href="https://sourceware.org/git/?p=binutils-gdb.g…
107 </ul>
108
109 <p>Pkgsrc toolchains related commits:</p>
110
111 <ul>
112 <li>2021-09-27 - <a href="https://github.com/NetBSD/pkgsrc/commit/6567…
113 <li>2021-09-11 - <a href="https://github.com/NetBSD/pkgsrc/commit/871f…
114 <li>2021-09-11 - <a href="https://github.com/NetBSD/pkgsrc/commit/053d…
115 <li>2021-07-29 - <a href="https://github.com/NetBSD/pkgsrc/commit/1b5d…
116 </ul>
117
118 <p>LLVM commits:</p>
119
120 <ul>
121 <li>2021-09-30 - <a href="https://github.com/llvm/llvm-project/commit/…
122 <li>2021-09-30 - <a href="https://github.com/llvm/llvm-project/commit/…
123 <li>2021-09-29 - <a href="https://github.com/llvm/llvm-project/commit/…
124 <li>2021-09-28 - <a href="https://github.com/llvm/llvm-project/commit/…
125 <li>2021-09-24 - <a href="https://github.com/llvm/llvm-project/commit/…
126 <li>2021-09-24 - <a href="https://github.com/llvm/llvm-project/commit/…
127 <li>2021-09-23 - <a href="https://github.com/llvm/llvm-project/commit/…
128 <li>2021-09-17 - <a href="https://github.com/llvm/llvm-project/commit/…
129 <li>2021-09-07 - <a href="https://github.com/llvm/llvm-project/commit/…
130 <li>2021-09-03 - <a href="https://github.com/llvm/llvm-project/commit/…
131 <li>2021-07-27 - <a href="https://github.com/llvm/llvm-project/commit/…
132 <li>2021-07-23 - <a href="https://github.com/llvm/llvm-project/commit/…
133 </ul>
134
135 ]]></content>
136 <summary type="html">
137 <![CDATA[My continuous journey into toolchains, …
138 </summary>
139
140 <category term="Toolchains" scheme="https://www.cambus.n…
141 </entry>
142 <entry>
143 <title><![CDATA[OpenBSD on the Vortex86DX CPU]]></title>
144 <link href="https://www.cambus.net/openbsd-on-the-vortex…
145 <id>https://www.cambus.net/openbsd-on-the-vortex86dx-cpu…
146 <published>2021-09-24T13:12:00Z</published>
147 <updated>2021-09-24T13:12:00Z</updated>
148 <content type="html"><![CDATA[<p>This is the OpenBSD cou…
149 the Vortex86DX CPU</a>, and its purpose is mostly to archive a <strong>d…
150 entry and various benchmarks for this machine. I should note that with
151 only 256MB of RAM, the machine is too constrained to do kernel and
152 libraries relinking in a timely manner, due to swapping.</p>
153
154 <p>For more information and background about the hardware, please refer …
155 my other article.</p>
156
157 <p>Here is the result of a quick <strong>md5 -t</strong> benchmark:</p>
158
159 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
160 Digest <span class="o">=</span> 52e5f9c9e6f656f3e1800dfa5579d089
161 Time <span class="o">=</span> 2.398437 seconds
162 Speed <span class="o">=</span> 41693819.766790 bytes/second
163 </code></pre></div></div>
164
165 <p>Here is the result of the <strong>sha1 -t</strong> benchmark:</p>
166
167 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
168 Digest <span class="o">=</span> 74a57b897cc581defa5b3a359fa762a1b83a60e8
169 Time <span class="o">=</span> 5.648437 seconds
170 Speed <span class="o">=</span> 17704012.632167 bytes/second
171 </code></pre></div></div>
172
173 <p>For the record, LibreSSL speed benchmark results are available <a hre…
174
175 <p>System message buffer (dmesg output):</p>
176
177 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
178 [email protected]:/usr/src/sys/arch/i386/compile/GENERIC
179 real mem <span class="o">=</span> 267927552 <span class="o">(</span>255…
180 avail mem <span class="o">=</span> 246661120 <span class="o">(</span>235…
181 random: good seed from bootblocks
182 mpath0 at root
183 scsibus0 at mpath0: 256 targets
184 mainbus0 at root
185 bios0 at mainbus0: <span class="nb">date </span>10/29/10, BIOS32 rev. 0 …
186 pcibios0 at bios0: rev 3.0 @ 0xf0000/0x10000
187 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf3a80/224 <span class="o">(<…
188 pcibios0: no compatible PCI ICU found: ICU vendor 0x17f3 product 0x6031
189 pcibios0: Warning, unable to fix up PCI interrupt routing
190 pcibios0: PCI bus <span class="c">#0 is the last bus</span>
191 bios0: ROM list: 0xc0000/0x8000 0xe9400/0x200!
192 cpu0 at mainbus0: <span class="o">(</span>uniprocessor<span class="o">)<…
193 cpu0: Vortex86 SoC <span class="o">(</span>586-class<span class="o">)</…
194 cpu0: FPU,TSC,CX8
195 pci0 at mainbus0 bus 0: configuration mode 1 <span class="o">(</span>no …
196 pchb0 at pci0 dev 0 <span class="k">function </span>0 <span class="s2">"…
197 vga1 at pci0 dev 3 <span class="k">function </span>0 <span class="s2">"X…
198 wsdisplay0 at vga1 mux 1: console <span class="o">(</span>80x25, vt100 e…
199 wsdisplay0: screen 1-5 added <span class="o">(</span>80x25, vt100 emulat…
200 pcib0 at pci0 dev 7 <span class="k">function </span>0 <span class="s2">"…
201 vte0 at pci0 dev 8 <span class="k">function </span>0 <span class="s2">"R…
202 rdcphy0 at vte0 phy 1: R6040 10/100 PHY, rev. 1
203 ohci0 at pci0 dev 10 <span class="k">function </span>0 <span class="s2">…
204 ehci0 at pci0 dev 10 <span class="k">function </span>1 <span class="s2">…
205 usb0 at ehci0: USB revision 2.0
206 uhub0 at usb0 configuration 1 interface 0 <span class="s2">"RDC EHCI roo…
207 ohci1 at pci0 dev 11 <span class="k">function </span>0 <span class="s2">…
208 ehci1 at pci0 dev 11 <span class="k">function </span>1 <span class="s2">…
209 usb1 at ehci1: USB revision 2.0
210 uhub1 at usb1 configuration 1 interface 0 <span class="s2">"RDC EHCI roo…
211 pciide0 at pci0 dev 12 <span class="k">function </span>0 <span class="s2…
212 pciide0: channel 0 ignored <span class="o">(</span>not responding<span c…
213 pciide0: channel 1 ignored <span class="o">(</span>not responding<span c…
214 isa0 at pcib0
215 isadma0 at isa0
216 pckbc0 at isa0 port 0x60/5 irq 1 irq 12
217 pckbd0 at pckbc0 <span class="o">(</span>kbd slot<span class="o">)</span>
218 wskbd0 at pckbd0: console keyboard, using wsdisplay0
219 pcppi0 at isa0 port 0x61
220 spkr0 at pcppi0
221 npx0 at isa0 port 0xf0/16: reported by CPUID<span class="p">;</span> usi…
222 usb2 at ohci0: USB revision 1.0
223 uhub2 at usb2 configuration 1 interface 0 <span class="s2">"RDC OHCI roo…
224 usb3 at ohci1: USB revision 1.0
225 uhub3 at usb3 configuration 1 interface 0 <span class="s2">"RDC OHCI roo…
226 dt: 445 probes
227 umass0 at uhub1 port 2 configuration 1 interface 0 <span class="s2">"San…
228 umass0: using SCSI over Bulk-Only
229 scsibus1 at umass0: 2 targets, initiator 0
230 sd0 at scsibus1 targ 1 lun 0: &lt;SanDisk, Cruzer Switch, 1.27&gt; remov…
231 sd0: 7633MB, 512 bytes/sector, 15633408 sectors
232 uhidev0 at uhub2 port 1 configuration 1 interface 0 <span class="s2">"Le…
233 uhidev0: iclass 3/1
234 ukbd0 at uhidev0: 8 variable keys, 6 key codes
235 wskbd1 at ukbd0 mux 1
236 wskbd1: connecting to wsdisplay0
237 uhidev1 at uhub2 port 1 configuration 1 interface 1 <span class="s2">"Le…
238 uhidev1: iclass 3/1, 22 report ids
239 ums0 at uhidev1 reportid 1: 5 buttons, Z and W <span class="nb">dir
240 </span>wsmouse0 at ums0 mux 0
241 ucc0 at uhidev1 reportid 16: 573 usages, 18 keys, array
242 wskbd2 at ucc0 mux 1
243 wskbd2: connecting to wsdisplay0
244 uhid0 at uhidev1 reportid 17: <span class="nv">input</span><span class="…
245 uhid1 at uhidev1 reportid 19: <span class="nv">input</span><span class="…
246 uhid2 at uhidev1 reportid 21: <span class="nv">input</span><span class="…
247 uhid3 at uhidev1 reportid 22: <span class="nv">input</span><span class="…
248 uaudio0 at uhub2 port 2 configuration 1 interface 1 <span class="s2">"AB…
249 uaudio0: class v1, full-speed, <span class="nb">sync</span>, channels: 2…
250 audio0 at uaudio0
251 uhidev2 at uhub2 port 2 configuration 1 interface 3 <span class="s2">"AB…
252 uhidev2: iclass 3/0
253 ucc1 at uhidev2: 11 usages, 3 keys, enum
254 wskbd3 at ucc1 mux 1
255 wskbd3: connecting to wsdisplay0
256 vscsi0 at root
257 scsibus2 at vscsi0: 256 targets
258 softraid0 at root
259 scsibus3 at softraid0: 256 targets
260 root on sd0a <span class="o">(</span>779fe8066eed6ce5.a<span class="o">)…
261 </code></pre></div></div>
262
263 <p>There are no sensors available on this machine.</p>
264
265 <p>PCI device data:</p>
266
267 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
268 Domain /dev/pci0:
269 0:0:0: RDC R6021 Host
270 0:3:0: XGI Technology Volari Z7
271 0:7:0: RDC R6031 ISA
272 0:8:0: RDC R6040 Ethernet
273 0:10:0: RDC R6060 USB
274 0:10:1: RDC R6061 USB2
275 0:11:0: RDC R6060 USB
276 0:11:1: RDC R6061 USB2
277 0:12:0: RDC R1011 IDE
278 </code></pre></div></div>
279
280 ]]></content>
281 <summary type="html">
282 <![CDATA[Running OpenBSD on the DMP EBOX 3300A-H…
283 </summary>
284
285 <category term="OpenBSD" scheme="https://www.cambus.net/…
286 </entry>
287 <entry>
288 <title><![CDATA[Diving into toolchains]]></title>
289 <link href="https://www.cambus.net/diving-into-toolchain…
290 <id>https://www.cambus.net/diving-into-toolchains/</id>
291 <published>2021-06-08T13:37:00Z</published>
292 <updated>2021-06-08T13:37:00Z</updated>
293 <content type="html"><![CDATA[<p>I've been wanting to le…
294 for a while now. In June 2016, I asked about <a href="https://twitter.co…
295 and parsers</a> on Twitter. However, I have to confess that I didn't go
296 forward with reading the Dragon Book.</p>
297
298 <p>Instead, I got involved as a developer in the <a href="https://www.op…
299 projects, and witnessing the evolution of toolchains within those systems
300 played a big role in maintaining my interest and fascination in the topi…
301 In retrospect, it now becomes apparent that the work I did on porting
302 and packaging software for those systems really helped to put in perspec…
303 how the different parts of the toolchains interact together to produce
304 binaries.</p>
305
306 <p>Approximately one year ago, I asked again on Twitter whether I knew <…
307 having worked on compilers and toolchains professionally</a> to get real
308 world advice on how to gain expertise in the field. I got several intere…
309 answers and started to collect and read more resources on the topic.
310 Some of the links I collected ended up on <a href="https://www.toolchain…
311 of toolchain resources which I put online in February.</p>
312
313 <p>But the answer that resonate the most with me was <a href="https://tw…
314 learn by doing</a>. Because I seem to be the kind of person who need to
315 see some concrete results in order to keep motivated, that's exactly what
316 I decided to do.</p>
317
318 <p>I started by doing some cleanups in the <a href="https://www.gnu.org/…
319 pkgsrc, which resulted in a <a href="https://www.freshbsd.org/?q=binutil…
320
321 <ul>
322 <li>2020-12-20 - <a href="https://github.com/NetBSD/pkgsrc/commit/ca38…
323 <li>2020-12-15 - <a href="https://github.com/NetBSD/pkgsrc/commit/7263…
324 <li>2020-12-14 - <a href="https://github.com/NetBSD/pkgsrc/commit/b163…
325 <li>2020-12-13 - <a href="https://github.com/NetBSD/pkgsrc/commit/146d…
326 <li>2020-12-12 - <a href="https://github.com/NetBSD/pkgsrc/commit/6b34…
327 <li>2020-12-11 - <a href="https://github.com/NetBSD/pkgsrc/commit/f53b…
328 <li>2020-12-10 - <a href="https://github.com/NetBSD/pkgsrc/commit/b037…
329 <li>2020-12-03 - <a href="https://github.com/NetBSD/pkgsrc/commit/75d0…
330 <li>2020-12-03 - <a href="https://github.com/NetBSD/pkgsrc/commit/adfe…
331 </ul>
332
333 <p>Meanwhile, I also got the opportunity to update our package and apply
334 security fixes:</p>
335
336 <ul>
337 <li>2021-02-11 - <a href="https://github.com/NetBSD/pkgsrc/commit/761e…
338 <li>2021-01-27 - <a href="https://github.com/NetBSD/pkgsrc/commit/ba98…
339 <li>2021-01-07 - <a href="https://github.com/NetBSD/pkgsrc/commit/7aef…
340 <li>2020-12-06 - <a href="https://github.com/NetBSD/pkgsrc/commit/99fd…
341 </ul>
342
343 <p>I eventually took <a href="https://github.com/NetBSD/pkgsrc/commit/d7…
344
345 <p>Building it repeatedly with different compilers exposed different war…
346 and I've also run builds through Clang's static analyzer.</p>
347
348 <p>All of this resulted in the opportunity to contribute to <a href="htt…
349
350 <ul>
351 <li>2021-04-14 - <a href="https://sourceware.org/git/?p=binutils-gdb.g…
352 <li>2021-04-12 - <a href="https://sourceware.org/git/?p=binutils-gdb.g…
353 <li>2021-03-12 - <a href="https://sourceware.org/git/?p=binutils-gdb.g…
354 <li>2021-01-26 - <a href="https://sourceware.org/git/?p=binutils-gdb.g…
355 </ul>
356
357 <p>Most recently, I also wrote a couple of blog posts on the topic:</p>
358
359 <ul>
360 <li><a href="https://www.cambus.net/the-state-of-toolchains-in-netbsd/…
361 <li><a href="https://www.cambus.net/speedbuilding-llvm-clang-in-5-minu…
362 <li><a href="https://www.cambus.net/speedbuilding-llvm-clang-in-2-minu…
363 <li><a href="https://www.cambus.net/the-state-of-toolchains-in-openbsd…
364 <li><a href="https://www.cambus.net/playing-with-djgpp-and-gcc-10-on-d…
365 </ul>
366
367 <p>And the journey continues. I'm following a different path from tradit…
368 compiler courses starting with lexers and parsers, and doing the opposite
369 curriculum somehow, starting from binaries instead. I will be focusing o…
370 final stages of the pipeline for now: compiling assembly to machine code
371 and producing binaries.</p>
372
373 <p>My next steps are to read the full <a href="https://refspecs.linuxfou…
374 the <a href="https://linker.iecc.com">Linkers and Loader</a> book, and t…
375 favorite course at university was the computer architecture one and
376 especially its MIPS assembly part, so I'm looking to revisit the subject
377 but with ARM64 assembly this time.</p>
378
379 ]]></content>
380 <summary type="html">
381 <![CDATA[My journey into toolchains, through rea…
382 </summary>
383
384 <category term="Toolchains" scheme="https://www.cambus.n…
385 </entry>
386 <entry>
387 <title><![CDATA[NetBSD on the Vortex86DX CPU]]></title>
388 <link href="https://www.cambus.net/netbsd-on-the-vortex8…
389 <id>https://www.cambus.net/netbsd-on-the-vortex86dx-cpu/…
390 <published>2021-06-03T18:40:00Z</published>
391 <updated>2021-06-03T18:40:00Z</updated>
392 <content type="html"><![CDATA[<p>I'm not exactly sure ho…
393 it was either when seeing the demonstration video on <a href="https://ko…
394 site showcasing the system running on a <strong>DMP EBOX</strong> machin…
395 <strong>NetBSD</strong>'s <a href="https://github.com/NetBSD/src/blob/tr…
396 me to check if the CPU would be correctly probed by the NetBSD's kernel?…
397
398 <p>For those interested, Wikipedia has an article retracing the <a href=…
399 Vortex86</a> from its birth at <strong>Rise</strong> to our days.</p>
400
401 <p>Several <strong>DMP EBOX</strong> machines are available for sale at …
402 vendors, but new devices cost several hundreds of dollars which is prohi…
403 for such low spec systems. However, I was recently able to acquire a box…
404 older model on a local auction site for about $25: the <strong>EBOX 3300…
405 a 1GHz CPU and 256MB of RAM, no less.</p>
406
407 <p>As I already mentioned, those machines are quite slow but they still …
408 a few things going for them:</p>
409
410 <ul>
411 <li>They are totally <strong>fanless</strong>, and the metal case fini…
412 <li>They are very <strong>low-power x86</strong> embedded devices, and…
413 </ul>
414
415 <p>I used a power meter to do measurements, and an idle system consumes …
416 Power consumption peaked at 6.4W when running the OpenSSL speed benchmar…
417
418 <p>There is space for a 2.5" hard drive in the enclosure, but I don't ha…
419 IDE drives anymore so I opted to use old CompactFlash cards I had laying
420 around. As a side note, it's actually exquisite to use those cards like
421 glorified floppies :-)</p>
422
423 <p>For this post, I used a <strong>1GB CompactFlash</strong> card and se…
424 installation in <strong>sysinst</strong>.</p>
425
426 <p>The installed system takes 212M:</p>
427
428 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
429 /dev/wd0a 919M 212M 661M 24% /
430 kernfs 1.0K 1.0K 0B 100% /kern
431 ptyfs 1.0K 1.0K 0B 100% /dev/pts
432 procfs 4.0K 4.0K 0B 100% /proc
433 tmpfs 64M 0B 64M 0% /var/shm
434 </code></pre></div></div>
435
436 <p>On a freshly booted system, 15 processes are running and 26M of RAM a…
437
438 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
439 16 processes: 15 sleeping, 1 on CPU
440 CPU states: 0.0% user, 0.0% <span class="nb">nice</span>, 0.0% system…
441 Memory: 26M Act, 6460K Exec, 12M File, 195M Free
442 Swap:
443
444 PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMA…
445 0 root 96 0 0K 26M usbevt 0:01 0.00% 0.00% <span…
446 795 root 43 0 6160K 1628K CPU 0:00 0.00% 0.00% top
447 555 root 85 0 12M 3472K <span class="nb">wait </span>…
448 630 postfix 85 0 13M 3220K kqueue 0:00 0.00% 0.00% qmgr
449 599 postfix 85 0 12M 3172K kqueue 0:00 0.00% 0.00% pickup
450 575 root 85 0 13M 2304K kqueue 0:00 0.00% 0.00% master
451 196 root 85 0 9780K 1960K kqueue 0:00 0.00% 0.00% syslo…
452 583 root 85 0 6788K 1824K <span class="nb">wait </span>…
453 710 root 85 0 6276K 1448K nanoslp 0:00 0.00% 0.00% cron
454 733 root 85 0 6108K 1396K ttyraw 0:00 0.00% 0.00% getty
455 730 root 85 0 5720K 1392K ttyraw 0:00 0.00% 0.00% getty
456 633 root 85 0 6104K 1388K ttyraw 0:00 0.00% 0.00% getty
457 211 root 85 0 7316K 1360K kqueue 0:00 0.00% 0.00% dhcpcd
458 1 root 85 0 6600K 1340K <span class="nb">wait </span>…
459 689 root 85 0 5700K 1184K kqueue 0:00 0.00% 0.00% inetd
460 402 root 84 0 5920K 1140K kqueue 0:00 0.00% 0.00% powerd
461 </code></pre></div></div>
462
463 <p>Here is the result of running <strong>cat /proc/cpuinfo</strong> on t…
464
465 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
466 vendor_id : Vortex86 SoC
467 cpu family : 5
468 model : 2
469 model name : Vortex86DX
470 stepping : 2
471 cpu MHz : 1000.05
472 apicid : 0
473 initial apicid : 0
474 fdiv_bug : no
475 fpu : <span class="nb">yes
476 </span>fpu_exception : <span class="nb">yes
477 </span>cpuid level : 1
478 wp : <span class="nb">yes
479 </span>flags : fpu tsc cx8
480 clflush size : 0
481 </code></pre></div></div>
482
483 <p>For the record, OpenSSL speed benchmark results are available <a href…
484
485 <p>System message buffer (dmesg output):</p>
486
487 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
488 <span class="o">[</span> 1.000000] 2006, 2007, 2008, 2009, 2010,…
489 <span class="o">[</span> 1.000000] 2018, 2019, 2020 The NetBSD F…
490 <span class="o">[</span> 1.000000] Copyright <span class="o">(</span…
491 <span class="o">[</span> 1.000000] The Regents of the University…
492
493 <span class="o">[</span> 1.000000] NetBSD 9.2 <span class="o">(</spa…
494 <span class="o">[</span> 1.000000] [email protected]…
495 <span class="o">[</span> 1.000000] total memory <span class="o">=</s…
496 <span class="o">[</span> 1.000000] avail memory <span class="o">=</s…
497 <span class="o">[</span> 1.000000] rnd: seeded with 66 bits
498 <span class="o">[</span> 1.000000] timecounter: Timecounters tick ev…
499 <span class="o">[</span> 1.000000] Kernelized RAIDframe activated
500 <span class="o">[</span> 1.000000] running cgd selftest aes-xts-256 …
501 <span class="o">[</span> 1.000000] timecounter: Timecounter <span cl…
502 <span class="o">[</span> 1.000003] Generic PC
503 <span class="o">[</span> 1.000003] mainbus0 <span class="o">(</span>…
504 <span class="o">[</span> 1.000003] Firmware Error <span class="o">(<…
505 <span class="o">[</span> 1.000003] autoconfiguration error: acpi_pro…
506 <span class="o">[</span> 1.000003] ACPI Error: Could not remove SCI …
507 <span class="o">[</span> 1.000003] cpu0 at mainbus0
508 <span class="o">[</span> 1.000003] cpu0: Vortex86DX, <span class="nb…
509 <span class="o">[</span> 1.000003] cpu0: package 0, core 0, smt 0
510 <span class="o">[</span> 1.000003] pci0 at mainbus0 bus 0: configura…
511 <span class="o">[</span> 1.000003] pci0: i/o space, memory space ena…
512 <span class="o">[</span> 1.000003] pchb0 at pci0 dev 0 <span class="…
513 <span class="o">[</span> 1.000003] vga0 at pci0 dev 3 <span class="k…
514 <span class="o">[</span> 1.000003] wsdisplay0 at vga0 kbdmux 1: cons…
515 <span class="o">[</span> 1.000003] wsmux1: connecting to wsdisplay0
516 <span class="o">[</span> 1.000003] drm at vga0 not configured
517 <span class="o">[</span> 1.000003] rdcpcib0 at pci0 dev 7 <span clas…
518 <span class="o">[</span> 1.000003] rdcpcib0: watchdog timer configur…
519 <span class="o">[</span> 1.000003] vte0 at pci0 dev 8 <span class="k…
520 <span class="o">[</span> 1.000003] vte0: Ethernet address 00:1b:eb:2…
521 <span class="o">[</span> 1.000003] vte0: interrupting at irq 10
522 <span class="o">[</span> 1.000003] rdcphy0 at vte0 phy 1: R6040 10/1…
523 <span class="o">[</span> 1.000003] rdcphy0: 10baseT, 10baseT-FDX, 10…
524 <span class="o">[</span> 1.000003] ohci0 at pci0 dev 10 <span class=…
525 <span class="o">[</span> 1.000003] ohci0: interrupting at irq 11
526 <span class="o">[</span> 1.000003] ohci0: OHCI version 1.0, legacy s…
527 <span class="o">[</span> 1.000003] usb0 at ohci0: USB revision 1.0
528 <span class="o">[</span> 1.000003] ehci0 at pci0 dev 10 <span class=…
529 <span class="o">[</span> 1.000003] ehci0: interrupting at irq 11
530 <span class="o">[</span> 1.000003] ehci0: BIOS has given up ownership
531 <span class="o">[</span> 1.000003] ehci0: EHCI version 1.0
532 <span class="o">[</span> 1.000003] ehci0: 1 companion controller, 2 …
533 <span class="o">[</span> 1.000003] usb1 at ehci0: USB revision 2.0
534 <span class="o">[</span> 1.000003] ohci1 at pci0 dev 11 <span class=…
535 <span class="o">[</span> 1.000003] ohci1: interrupting at irq 11
536 <span class="o">[</span> 1.000003] ohci1: OHCI version 1.0, legacy s…
537 <span class="o">[</span> 1.000003] usb2 at ohci1: USB revision 1.0
538 <span class="o">[</span> 1.000003] ehci1 at pci0 dev 11 <span class=…
539 <span class="o">[</span> 1.000003] ehci1: interrupting at irq 11
540 <span class="o">[</span> 1.000003] ehci1: BIOS has given up ownership
541 <span class="o">[</span> 1.000003] ehci1: EHCI version 1.0
542 <span class="o">[</span> 1.000003] ehci1: 1 companion controller, 2 …
543 <span class="o">[</span> 1.000003] usb3 at ehci1: USB revision 2.0
544 <span class="o">[</span> 1.000003] rdcide0 at pci0 dev 12 <span clas…
545 <span class="o">[</span> 1.000003] rdcide0: bus-master DMA support p…
546 <span class="o">[</span> 1.000003] rdcide0: primary channel configur…
547 <span class="o">[</span> 1.000003] rdcide0: primary channel interrup…
548 <span class="o">[</span> 1.000003] atabus0 at rdcide0 channel 0
549 <span class="o">[</span> 1.000003] rdcide0: secondary channel config…
550 <span class="o">[</span> 1.000003] rdcide0: secondary channel interr…
551 <span class="o">[</span> 1.000003] atabus1 at rdcide0 channel 1
552 <span class="o">[</span> 1.000003] isa0 at rdcpcib0
553 <span class="o">[</span> 1.000003] pckbc0 at isa0 port 0x60-0x64
554 <span class="o">[</span> 1.000003] attimer0 at isa0 port 0x40-0x43
555 <span class="o">[</span> 1.000003] pcppi0 at isa0 port 0x61
556 <span class="o">[</span> 1.000003] midi0 at pcppi0: PC speaker
557 <span class="o">[</span> 1.000003] sysbeep0 at pcppi0
558 <span class="o">[</span> 1.000003] isapnp0 at isa0 port 0x279
559 <span class="o">[</span> 1.000003] attimer0: attached to pcppi0
560 <span class="o">[</span> 1.000003] isapnp0: no ISA Plug <span class=…
561 [ 1.000003] timecounter: Timecounter "clockinterrupt" frequency 100 …
562 [ 1.064509] uhub0 at usb1: NetBSD (0000) EHCI root hub (0000), class…
563 [ 1.064509] uhub0: 2 ports with 2 removable, self powered
564 [ 1.064509] uhub1 at usb2: NetBSD (0000) OHCI root hub (0000), class…
565 [ 1.064509] uhub1: 2 ports with 2 removable, self powered
566 [ 1.064509] uhub2 at usb3: NetBSD (0000) EHCI root hub (0000), class…
567 [ 1.064509] uhub2: 2 ports with 2 removable, self powered
568 [ 1.064509] uhub3 at usb0: NetBSD (0000) OHCI root hub (0000), class…
569 [ 1.064509] uhub3: 2 ports with 2 removable, self powered
570 [ 1.064509] IPsec: Initialized Security Association Processing.
571 [ 3.914550] uaudio0 at uhub3 port 2 configuration 1 interface 0
572 [ 3.914550] uaudio0: vendor 0d8c (0xd8c) C-Media USB Audio Device (0…
573 [ 3.934546] uaudio0: audio rev 1.00
574 [ 3.934546] audio0 at uaudio0: playback, capture, full duplex, indep…
575 [ 3.934546] audio0: slinear_le:16 2ch 48000Hz, blk 11520 bytes (60ms…
576 [ 3.934546] audio0: slinear_le:16 1ch 48000Hz, blk 6000 bytes (62.5m…
577 [ 3.934546] uhidev0 at uhub3 port 2 configuration 1 interface 3
578 [ 3.934546] uhidev0: vendor 0d8c (0xd8c) C-Media USB Audio Device (0…
579 [ 3.944550] uhid0 at uhidev0: input=4, output=4, feature=0
580 [ 4.054550] wd0 at atabus1 drive 0
581 [ 4.054550] wd0: &lt;Hitachi XX.V.3.5.0.0&gt;
582 [ 4.054550] wd0: drive supports 1-sector PIO transfers, LBA addressi…
583 [ 4.054550] wd0: 977 MB, 1987 cyl, 16 head, 63 sec, 512 bytes/sect x…
584 [ 4.064551] wd0: 32-bit data port
585 [ 4.064551] wd0: drive supports PIO mode 4
586 [ 4.064551] wd0(rdcide0:1:0): using PIO mode 4
587 [ 4.084559] WARNING: 1 error while detecting hardware; check system …
588 [ 4.084559] boot device: wd0
589 [ 4.084559] root on wd0a dumps on wd0b
590 [ 4.094550] root file system type: ffs
591 [ 4.094550] kern.module.path=/stand/i386/9.2/modules
592 [ 20.764808] wsdisplay0: screen 1 added (80x25, vt100 emulation)
593 [ 20.784809] wsdisplay0: screen 2 added (80x25, vt100 emulation)
594 [ 20.794810] wsdisplay0: screen 3 added (80x25, vt100 emulation)
595 [ 20.804812] wsdisplay0: screen 4 added (80x25, vt100 emulation)
596 </span></code></pre></div></div>
597
598 ]]></content>
599 <summary type="html">
600 <![CDATA[Running NetBSD on the DMP EBOX 3300A-H …
601 </summary>
602
603 <category term="NetBSD" scheme="https://www.cambus.net/c…
604 </entry>
605 <entry>
606 <title><![CDATA[Character and color cycling effect in C on DOS]]…
607 <link href="https://www.cambus.net/character-and-color-c…
608 <id>https://www.cambus.net/character-and-color-cycling-e…
609 <published>2021-05-27T23:21:00Z</published>
610 <updated>2021-05-27T23:21:00Z</updated>
611 <content type="html"><![CDATA[<p>As mentioned in my prev…
612 mode. The original version in JavaScript can be seen <a href="https://ww…
613
614 <p><img src="/content/2021/05/cycling-effect.png" alt="Cycling effect" /…
615
616 <p>To understand why we can't access video memory directly and need to u…
617 DPMI service to create a selector to access the required real-mode segme…
618 address, please refer to <a href="https://www.delorie.com/djgpp/v2faq/fa…
619
620 <p>The effect can be downloaded <a href="/content/2021/05/cycling.exe">h…
621 large (104K stripped!), and it requires <a href="https://sandmann.dotste…
622
623 <p>Here is the code:</p>
624
625 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
626 #include &lt;dpmi.h&gt;
627 #include &lt;go32.h&gt;
628 #include &lt;pc.h&gt;
629 </span>
630 <span class="kt">void</span>
631 <span class="nf">wait_vbl</span><span class="p">()</span>
632 <span class="p">{</span>
633 <span class="k">while</span><span class="p">(</span><span class=…
634 <span class="k">while</span><span class="p">(</span><span class=…
635 <span class="p">}</span>
636
637 <span class="kt">int</span>
638 <span class="nf">main</span><span class="p">()</span>
639 <span class="p">{</span>
640 <span class="kt">short</span> <span class="n">video</span> <span…
641 <span class="kt">unsigned</span> <span class="kt">char</span> <s…
642
643 <span class="kt">int</span> <span class="n">character</span> <sp…
644
645 <span class="cm">/* Define character and color arrays */</span>
646 <span class="kt">char</span> <span class="n">characters</span><s…
647 <span class="kt">char</span> <span class="n">colors</span><span …
648
649 <span class="k">while</span> <span class="p">(</span><span class…
650 <span class="k">for</span> <span class="p">(</span><span…
651 <span class="cm">/* Write character and color da…
652 <span class="n">buffer</span><span class="p">[</…
653 <span class="n">buffer</span><span class="p">[</…
654
655 <span class="cm">/* Increment the color index */…
656 <span class="n">color</span> <span class="o">=</…
657 <span class="p">}</span>
658
659 <span class="cm">/* Increment the character index */</sp…
660 <span class="n">character</span> <span class="o">=</span…
661 <span class="n">character</span> <span class="o">+</…
662
663 <span class="cm">/* Copy the buffer into text mode video…
664 <span class="n">movedata</span><span class="p">(</span><…
665
666 <span class="cm">/* Wait for VBL */</span>
667 <span class="n">wait_vbl</span><span class="p">();</span>
668 <span class="n">wait_vbl</span><span class="p">();</span>
669 <span class="n">wait_vbl</span><span class="p">();</span>
670 <span class="n">wait_vbl</span><span class="p">();</span>
671 <span class="n">wait_vbl</span><span class="p">();</span>
672 <span class="p">}</span>
673 <span class="p">}</span>
674 </code></pre></div></div>
675
676 ]]></content>
677 <summary type="html">
678 <![CDATA[Oldschool demoscene effect in C on DOS:…
679 </summary>
680
681 <category term="C" scheme="https://www.cambus.net/catego…
682 <category term="DOS" scheme="https://www.cambus.net/cate…
683 </entry>
684 <entry>
685 <title><![CDATA[Playing with DJGPP and GCC 10 on DOS]]></title>
686 <link href="https://www.cambus.net/playing-with-djgpp-an…
687 <id>https://www.cambus.net/playing-with-djgpp-and-gcc-10…
688 <published>2021-05-23T00:36:00Z</published>
689 <updated>2021-05-23T00:36:00Z</updated>
690 <content type="html"><![CDATA[<p>I was recently amazed t…
691 and had very recent versions of GCC and binutils available. I have not b…
692 doing any C programming on DOS in a very long time now, so I think the t…
693 is right.</p>
694
695 <p>There is an installation program with an interface very similar to th…
696 old <strong>Turbo Vision</strong>, which could be helpful in case one wa…
697 full environment.</p>
698
699 <p><img src="https://www.cambus.net/content/2021/05/djgpp-01.png" alt="D…
700
701 <p><img src="https://www.cambus.net/content/2021/05/djgpp-02.png" alt="D…
702
703 <p>I'm only interested in using the <strong>C</strong> frontend for now,…
704 manual installation.</p>
705
706 <p>We need the following components:</p>
707
708 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
709 bnu2351b.zip B 6,230,009 2021-01-16 GNU Binutils 2.35.1 binaries …
710 gcc1030b.zip B 42,027,946 2021-04-18 GNU GCC C compiler 10.3.0 <sp…
711 csdpmi7b.zip B 71,339 2010-01-29 CS<span class="s1">'s DPMI Pr…
712 </span></code></pre></div></div>
713
714 <p>The development environment can be bootstrapped as follows:</p>
715
716 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
717 <span class="nb">cd</span> ~/dos/djgpp
718 wget https://www.delorie.com/pub/djgpp/current/v2/djdev205.zip
719 wget https://www.delorie.com/pub/djgpp/current/v2gnu/bnu2351b.zip
720 wget https://www.delorie.com/pub/djgpp/current/v2gnu/gcc1030b.zip
721 wget https://www.delorie.com/pub/djgpp/current/v2misc/csdpmi7b.zip
722 unzip djdev205.zip
723 unzip bnu2351b.zip
724 unzip gcc1030b.zip
725 unzip csdpmi7b.zip
726 </code></pre></div></div>
727
728 <p>When using <strong>FreeDOS</strong>, we need to add the following in …
729
730 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
731 <span class="nb">set </span><span class="nv">PATH</span><span class="o">…
732 </code></pre></div></div>
733
734 <p>Alternatively, when using <strong>DOSBox</strong> instead, we need th…
735 <em>dosbox.conf</em>:</p>
736
737 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
738 mount c ~/dos
739 <span class="nv">path</span><span class="o">=</span>c:<span class="se">\…
740 </span><span class="nb">set </span><span class="nv">DJGPP</span><span cl…
741 c:
742 </code></pre></div></div>
743
744 <p>Once we are done installing, this gives us GCC 10.3.0 and ld 2.35.1:<…
745
746 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
747 gcc.exe <span class="o">(</span>GCC<span class="o">)</span> 10.3.0
748 Copyright <span class="o">(</span>C<span class="o">)</span> 2020 Free So…
749 This is free software<span class="p">;</span> see the <span class="nb">s…
750 warranty<span class="p">;</span> not even <span class="k">for </span>MER…
751
752 C:<span class="se">\&gt;</span>ld <span class="nt">--version</span>
753 GNU ld <span class="o">(</span>GNU Binutils<span class="o">)</span> 2.35…
754 Copyright <span class="o">(</span>C<span class="o">)</span> 2020 Free So…
755 This program is free software<span class="p">;</span> you may redistribu…
756 the GNU General Public License version 3 or <span class="o">(</span>at y…
757 This program has absolutely no warranty.
758 </code></pre></div></div>
759
760 <p>To verify things are working properly, let's create a simple test pro…
761
762 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
763 </span>
764 <span class="kt">int</span>
765 <span class="nf">main</span><span class="p">()</span>
766 <span class="p">{</span>
767 <span class="n">puts</span><span class="p">(</span><span class="…
768
769 <span class="k">return</span> <span class="mi">0</span><span cla…
770 <span class="p">}</span>
771 </code></pre></div></div>
772
773 <p>We then build and run it:</p>
774
775 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
776
777 C:<span class="se">\&gt;</span>hello
778 Hello World!
779 </code></pre></div></div>
780
781 <p>Here is the output of running <strong>file</strong> on the executable…
782
783 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
784 </code></pre></div></div>
785
786 <p>Let's build only an object file:</p>
787
788 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
789 </code></pre></div></div>
790
791 <p>We can run <strong>nm</strong> on it to list symbols:</p>
792
793 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
794 00000000 b .bss
795 00000000 N .comment
796 00000000 d .data
797 00000000 t .text
798 0000000d T _main
799 U _puts
800 </code></pre></div></div>
801
802 <p>And run <strong>objdump</strong> to display its content:</p>
803
804 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
805
806 HELLO.o: file format coff-go32
807
808 Contents of section .text:
809 0000 48656c6c 6f20576f 726c6421 008d4c24 Hello World!..L<span class="e…
810 0010 0483e4f0 ff71fc55 89e55183 ec0483ec .....q.U..Q.....
811 0020 0c680000 0000e8d5 ffffff83 c410b800 .h..............
812 0030 0000008b 4dfc89ec 5d8d61fc c3909090 ....M...].a.....
813 Contents of section .comment:
814 0000 4743433a 2028474e 55292031 302e332e GCC: <span class="o">(</span>…
815 0010 30000000 0...
816 </code></pre></div></div>
817
818 <p>We can also use <strong>objdump</strong> to disassemble the object fi…
819
820 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
821
822 HELLO.o: file format coff-go32
823
824 Disassembly of section .text:
825
826 00000000 &lt;.text&gt;:
827 0: 48 dec %eax
828 1: 65 6c gs insb <span class="o">(</span>%dx…
829 3: 6c insb <span class="o">(</span>%dx<…
830 4: 6f outsl %ds:<span class="o">(</span>…
831 5: 20 57 6f and %dl,0x6f<span class="o">(</s…
832 8: 72 6c jb 76 &lt;_main+0x69&gt;
833 a: 64 21 00 and %eax,%fs:<span class="o">(</…
834
835 0000000d &lt;_main&gt;:
836 d: 8d 4c 24 04 lea 0x4<span class="o">(</span>%…
837 11: 83 e4 f0 and <span class="nv">$0xfffffff0…
838 14: ff 71 <span class="nb">fc </span>pushl <spa…
839 17: 55 push %ebp
840 18: 89 e5 mov %esp,%ebp
841 1a: 51 push %ecx
842 1b: 83 ec 04 sub <span class="nv">$0x4</span>…
843 1e: 83 ec 0c sub <span class="nv">$0xc</span>…
844 21: 68 00 00 00 00 push <span class="nv">$0x0</span>
845 26: e8 d5 ff ff ff call 0 &lt;.text&gt;
846 2b: 83 c4 10 add <span class="nv">$0x10</span…
847 2e: b8 00 00 00 00 mov <span class="nv">$0x0</span>…
848 33: 8b 4d <span class="nb">fc </span>mov <spa…
849 36: 89 ec mov %ebp,%esp
850 38: 5d pop %ebp
851 39: 8d 61 <span class="nb">fc </span>lea <spa…
852 3c: c3 ret
853 3d: 90 nop
854 3e: 90 nop
855 3f: 90 nop
856 </code></pre></div></div>
857
858 <p>Besides the C frontend, the <strong>Ada</strong>, <strong>C++</strong…
859 and <strong>Pascal</strong> frontends are also available. While I used D…
860 development environment and prepare this article, I've since moved to Fr…
861 which I'm running natively on my ASUS Eee PC. I'm currently having a lot…
862 fun redoing some small character and color cycling effects in text mode.…
863
864 ]]></content>
865 <summary type="html">
866 <![CDATA[How to install a C developement environ…
867 </summary>
868
869 <category term="DOS" scheme="https://www.cambus.net/cate…
870 <category term="Toolchains" scheme="https://www.cambus.n…
871 </entry>
872 <entry>
873 <title><![CDATA[The state of toolchains in OpenBSD]]></title>
874 <link href="https://www.cambus.net/the-state-of-toolchai…
875 <id>https://www.cambus.net/the-state-of-toolchains-in-op…
876 <published>2021-05-19T12:08:00Z</published>
877 <updated>2021-05-19T12:08:00Z</updated>
878 <content type="html"><![CDATA[<p>For most of the 2010s, …
879 It was <a href="https://gcc.gnu.org/gcc-4.2/">released</a> in July 2007,…
880 in October 2009, and became the default compiler on the amd64, i386, hpp…
881 sparc64, socppc and macppc platforms in <a href="https://www.openbsd.org…
882 2010. As specified in the commit message during import, this is the last
883 version released under the GPLv2 license.</p>
884
885 <p>OpenBSD was not the only operating system sticking to GCC 4.2.1 for l…
886 reasons, FreeBSD did the same, and Mac OS X as well.</p>
887
888 <p>As a general rule, and this is not OpenBSD specific, being stuck with…
889 compilers is problematic for several reasons:</p>
890
891 <ul>
892 <li>The main reason has to be <strong>newer C and C++ standards suppor…
893 C standards committee is conservative and the language evolves slowly, t…
894 pace at which new C++ standards appear has been accelerating, with a new
895 version emerging every 3 years.</li>
896 <li>Another major reason is <strong>new architectures support</strong>…
897 like ARMv8 and RISC-V, but also x86-64 microarchitecture updates.</li>
898 <li>They are not getting <strong>bugfixes</strong>, nor new optimizati…
899 diagnostic (better warnings) and security features.</li>
900 </ul>
901
902 <p>The latest point has been partially mitigated on OpenBSD, as several …
903 have worked on fixing OpenBSD related issues and backporting fixes, as
904 detailed in Miod's excellent "<a href="https://marc.info/?l=openbsd-misc…
905
906 <p>Regarding new architectures support, the more astute reader will know…
907 all OpenBSD supported platforms are self-hosted and releases must be bui…
908 using the base system compiler on real hardware. No cross-compilation, no
909 emulators. The ARMv8 architecture was announced in 2011, a few years aft…
910 GCC 4.2.1 was released. By the year 2016, 64-bit ARMv8 devices were gett…
911 widely available and more affordable. During the g2k16 hackathon, the
912 Castle Inn pub had become a favorite meet-up point among OpenBSD develop…
913 and the topic came up at one of the evening gatherings. I happened to be
914 sitting nearby when patrick@ discussed with deraadt@ about the possibili…
915 of importing LLVM to make a future <a href="https://www.openbsd.org/arm6…
916 and Theo said that there was nothing blocking it. The next day, pascal@
917 mentioned he already had some Makefiles to replace the LLVM build system,
918 and when someone then asked how long it would take to put them in shape …
919 import, he said he didn't know, then smiled and said: "Let's find out! :…
920 Before the end of the hackathon, he imported <a href="https://undeadly.o…
921 Patrick's <a href="https://undeadly.org/cgi?action=article;sid=201609152…
922 technical details.</p>
923
924 <p>OpenBSD/arm64 became the first platform to use Clang as base system c…
925 and LLD as the default linker. Clang then became the <a href="https://un…
926 and i386</a> in July 2017, on <a href="https://www.freshbsd.org/openbsd/…
927 July 2019, on <a href="https://www.freshbsd.org/openbsd/src/commit/VtKIf…
928 December 2020.</p>
929
930 <p>LLVM was updated regularly along the way up to the 8.0.1 version, whi…
931 was the latest version released under the NCSA license. From then all la…
932 LLVM versions have been released under the Apache 2.0 license, which cou…
933 be included in OpenBSD. The project's <a href="https://www.openbsd.org/p…
934 OpenBSD's stance on the license, and Mark Kettenis <a href="https://list…
935 llvm-dev mailing list gives more background information.</p>
936
937 <p>While staying with LLVM 8.0.1 would not have been an immediate proble…
938 the OpenBSD kernel and the base system userland which uses C99, the proj…
939 includes 3rd party C++ codebases for parts of the graphics stack and of …
940 LLVM itself. Jonathan Gray <a href="https://marc.info/?l=openbsd-misc&am…
941 mailing list, mentioning that not updating was becoming increasingly pai…
942 The effect which can be observed in the 3rd party software ecosystem
943 regarding newer C and C++ standards is that while C99 is still reigning
944 supreme in C codebases, C++ codebases maintainers have been eager to ado…
945 new C++ standards (and for good reasons). The recent RFC on cfe-dev about
946 <a href="https://lists.llvm.org/pipermail/cfe-dev/2021-April/068058.html…
947 2018) proves that LLVM is no exception. A compromise was thus inevitable,
948 and <a href="https://undeadly.org/cgi?action=article;sid=20200806001449"…
949
950 <p>At the time the OpenBSD 6.9 branch was created, the CVS tree contained
951 LLVM 10.0.1, GCC 4.2.1, and GCC 3.3.6. However, it's important to unders…
952 that not all compilers are built on all platforms:</p>
953
954 <ul>
955 <li><strong>Clang is the default compiler</strong> on amd64, arm64, ar…
956 macppc, octeon, powerpc64, and riscv64.</li>
957 <li>GCC 4.2.1 is still the default compiler on alpha, hppa, landisk, a…
958 <li>OpenBSD/luna88k is the only platform still using GCC 3.3.6, as <a …
959 was removed in GCC 3.4</a>.</li>
960 </ul>
961
962 <p>Following the OpenBSD 6.9 release, OpenBSD-current has been updated to
963 LLVM 11.1.0 and GCC 4.2.1 is <a href="https://www.freshbsd.org/openbsd/s…
964 (released in March 2020) is available in the ports collection.</p>
965
966 <p>Among the remaining platforms still using GCC 4.2.1 as the default co…
967 only sparc64 will be able to switch in the future. LLVM has a Sparc V9 b…
968 and work has been done in OpenBSD to make the switch possible. For all t…
969 other remaining ones, there are no alpha, hppa, sh4, nor m88k backends i…
970 and even if this changed in the future, the hardware is too slow to be a…
971 self-host the compiler.</p>
972
973 <p>Regarding linkers, <strong>LLD is the default linker</strong> on amd6…
974 powerpc64, and riscv64. All other platforms still use GNU ld from binuti…
975 2.17. Realistically, it should be possible to switch to LLD in the future
976 on the following platforms: loongson, macppc, octeon, and sparc64.</p>
977
978 <p>At this point, all relevant architectures have modern and up-to-date
979 toolchains, and we can look ahead in confidence on that front.</p>
980
981 ]]></content>
982 <summary type="html">
983 <![CDATA[The current state of LLVM and GNU toolc…
984 </summary>
985
986 <category term="OpenBSD" scheme="https://www.cambus.net/…
987 <category term="Toolchains" scheme="https://www.cambus.n…
988 </entry>
989 <entry>
990 <title><![CDATA[Speedbuilding LLVM/Clang in 2 minutes on ARM]]><…
991 <link href="https://www.cambus.net/speedbuilding-llvm-cl…
992 <id>https://www.cambus.net/speedbuilding-llvm-clang-in-2…
993 <published>2021-05-12T23:09:00Z</published>
994 <updated>2021-05-12T23:09:00Z</updated>
995 <content type="html"><![CDATA[<p>This post is the AArch6…
996 minutes</a>" article.</p>
997
998 <p>After publishing and sharing the previous post URL with some friends …
999 I was asked if I wanted to try doing the same on a 160 cores ARM machine.
1000 Finding out what my answer was is left as an exercise to the reader :-)<…
1001
1002 <p>The system I'm using for this experiment is a BM.Standard.A1.160 bare…
1003 machine from Oracle Cloud, which has a dual-socket motherboard with two …
1004 cores <strong>Ampere Altra CPUs</strong>, for a total <strong>160 cores<…
1005 RAM</strong>. This is to the best of my knowledge the fastest AArch64 se…
1006 machine available at this time.</p>
1007
1008 <p>The system is running Oracle Linux Server 8.3 with up-to-date packages
1009 and kernel.</p>
1010
1011 <p>The full result of <em>cat /proc/cpuinfo</em> is available <a href="/…
1012
1013 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1014 Linux benchmarks 5.4.17-2102.201.3.el8uek.aarch64 <span class="c">#2 SMP…
1015 </code></pre></div></div>
1016
1017 <p>Let's start by installing required packages:</p>
1018
1019 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1020 </code></pre></div></div>
1021
1022 <p>Unfortunately the CMake version available in the packages repository …
1023 is too old to build the main branch of the LLVM Git repository, and Ninj…
1024 not available either.</p>
1025
1026 <p>Let's bootstrap <a href="https://pkgsrc.org">Pkgsrc</a> to build and …
1027
1028 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1029 <span class="nb">cd </span>pkgsrc/bootstrap
1030 ./bootstrap <span class="nt">--make-jobs</span><span class="o">=</span>1…
1031
1032 <span class="o">===&gt;</span> bootstrap started: Wed May 12 12:23:34 GM…
1033 <span class="o">===&gt;</span> bootstrap ended: Wed May 12 12:26:08 GM…
1034 </code></pre></div></div>
1035
1036 <p>We then need to add <em>~pkg/bin</em> and <em>~pkg/sbin</em> to the p…
1037
1038 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1039 </code></pre></div></div>
1040
1041 <p>For faster Pkgsrc builds, we can edit <em>~/pkg/etc/mk.conf</em> and …
1042
1043 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1044 </code></pre></div></div>
1045
1046 <p>Let's build and install CMake and Ninja:</p>
1047
1048 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1049 bmake <span class="nb">install </span>package clean clean-depends
1050
1051 <span class="nb">cd</span> ~/pkgsrc/devel/ninja-build
1052 bmake <span class="nb">install </span>package clean clean-depends
1053 </code></pre></div></div>
1054
1055 <p>The compiler used for the builds is Clang 10.0.1:</p>
1056
1057 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1058 clang version 10.0.1 <span class="o">(</span>Red Hat 10.0.1-1.0.1.module…
1059 Target: aarch64-unknown-linux-gnu
1060 Thread model: posix
1061 InstalledDir: /bin
1062 </code></pre></div></div>
1063
1064 <p>Regarding linkers, we are using GNU ld and GNU Gold from binutils 2.3…
1065 and LLD 10.0.1.</p>
1066
1067 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1068 GNU gold <span class="o">(</span>version 2.30-79.0.1.el8<span class="o">…
1069 LLD 10.0.1 <span class="o">(</span>compatible with GNU linkers<span clas…
1070 </code></pre></div></div>
1071
1072 <p>For all the following runs, I'm building from the Git repository main…
1073 commit <a href="https://github.com/llvm/llvm-project/commit/cf4610d27bbb…
1074 of course fully erased between each run.</p>
1075
1076 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1077 Author: Victor Huang &lt;[email protected]&gt;
1078 Date: Wed May 12 10:56:54 2021 <span class="nt">-0500</span>
1079 </code></pre></div></div>
1080
1081 <p>I'm not sure what the underlying storage is, but with 1 TB of RAM the…
1082 is no reason not to use a ramdisk.</p>
1083
1084 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1085 mount <span class="nt">-t</span> tmpfs <span class="nt">-o</span> <span …
1086 <span class="nb">cd</span> /mnt/ramdisk
1087 </code></pre></div></div>
1088
1089 <p>To get a baseline, let's do a full release build on this machine:</p>
1090
1091 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1092 <span class="nb">mkdir </span>build
1093 <span class="nb">cd </span>build
1094
1095 cmake <span class="nt">-DCMAKE_C_COMPILER</span><span class="o">=</spa…
1096 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1097 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1098 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1099 ../llvm
1100
1101 <span class="nb">time </span>make <span class="nt">-j160</span>
1102 real 7m3.226s
1103 user 403m28.362s
1104 sys 6m41.331s
1105 </code></pre></div></div>
1106
1107 <p>By default, CMake generates Makefiles. As documented in the "<a href=…
1108 with the LLVM System</a>" tutorial, most LLVM developers use Ninja.</p>
1109
1110 <p>Let's switch to generating Ninja build files, and using ninja to buil…
1111
1112 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1113 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1114 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1115 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1116 <span class="nt">-GNinja</span> ../llvm
1117
1118 <span class="nb">time </span>ninja
1119 <span class="o">[</span>4182/4182] Linking CXX executable bin/c-index-te…
1120
1121 real 4m20.403s
1122 user 427m27.118s
1123 sys 7m2.320s
1124 </code></pre></div></div>
1125
1126 <p><img src="/content/2021/05/llvm-clang-htop-arm.png" alt="htop" /></p>
1127
1128 <p>By default, GNU ld is used for linking. Let's switch to using gold:</…
1129
1130 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1131 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1132 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1133 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1134 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1135 <span class="nt">-GNinja</span> ../llvm
1136
1137 <span class="nb">time </span>ninja
1138 <span class="o">[</span>4182/4182] Linking CXX executable bin/c-index-te…
1139
1140 real 4m1.062s
1141 user 427m1.648s
1142 sys 6m58.282s
1143 </code></pre></div></div>
1144
1145 <p>LLD has been a viable option for some years now. Let's use it:</p>
1146
1147 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1148 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1149 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1150 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1151 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1152 <span class="nt">-GNinja</span> ../llvm
1153
1154 <span class="nb">time </span>ninja
1155 <span class="o">[</span>4182/4182] Linking CXX executable bin/clang-scan…
1156
1157 real 3m58.476s
1158 user 428m3.807s
1159 sys 7m14.418s
1160 </code></pre></div></div>
1161
1162 <p>Using GNU gold instead of GNU ld results in noticeably faster builds,…
1163 switching to LLD shaves a few mores seconds from the build.</p>
1164
1165 <p>If we want to build faster, we can make some compromises and start st…
1166 the build by removing some components.</p>
1167
1168 <p>Let's start by disabling additional architecture support:</p>
1169
1170 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1171 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1172 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1173 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1174 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1175 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1176 <span class="nt">-GNinja</span> ../llvm
1177
1178 <span class="nb">time </span>ninja
1179 <span class="o">[</span>3195/3195] Linking CXX executable bin/c-index-te…
1180
1181 real 3m10.312s
1182 user 326m54.898s
1183 sys 5m24.770s
1184 </code></pre></div></div>
1185
1186 <p>We can verify the resulting Clang binary only supports AArch64 target…
1187
1188 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1189 Registered Targets:
1190 aarch64 - AArch64 <span class="o">(</span>little endian<span clas…
1191 aarch64_32 - AArch64 <span class="o">(</span>little endian ILP32<spa…
1192 aarch64_be - AArch64 <span class="o">(</span>big endian<span class="…
1193 arm64 - ARM64 <span class="o">(</span>little endian<span class=…
1194 arm64_32 - ARM64 <span class="o">(</span>little endian ILP32<span …
1195 </code></pre></div></div>
1196
1197 <p>Let's go further and disable the static analyzer and the ARC Migratio…
1198
1199 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1200 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1201 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1202 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1203 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1204 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1205 <span class="nt">-DCLANG_ENABLE_STATIC_ANALYZER</span><span clas…
1206 <span class="nt">-DCLANG_ENABLE_ARCMT</span><span class="o">=</s…
1207 <span class="nt">-GNinja</span> ../llvm
1208
1209 <span class="nb">time </span>ninja
1210 <span class="o">[</span>3146/3146] Creating library symlink lib/libclang…
1211
1212 real 3m6.474s
1213 user 319m25.914s
1214 sys 5m20.924s
1215 </code></pre></div></div>
1216
1217 <p>Let's disable building some LLVM tools and utils:</p>
1218
1219 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1220 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1221 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1222 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1223 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1224 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1225 <span class="nt">-DCLANG_ENABLE_STATIC_ANALYZER</span><span clas…
1226 <span class="nt">-DCLANG_ENABLE_ARCMT</span><span class="o">=</s…
1227 <span class="nt">-DLLVM_BUILD_TOOLS</span><span class="o">=</spa…
1228 <span class="nt">-DLLVM_BUILD_UTILS</span><span class="o">=</spa…
1229 <span class="nt">-GNinja</span> ../llvm
1230
1231 <span class="nb">time </span>ninja
1232 <span class="o">[</span>2879/2879] Creating library symlink lib/libclang…
1233
1234 real 2m59.659s
1235 user 298m47.482s
1236 sys 4m57.430s
1237 </code></pre></div></div>
1238
1239 <p>Compared to the previous build, the following binaries were not built:
1240 <em>FileCheck</em>, <em>count</em>, <em>lli-child-target</em>, <em>llvm-…
1241 <em>llvm-PerfectShuffle</em>, <em>not</em>, <em>obj2yaml</em>, <em>yaml2…
1242
1243 <p>We are reaching the end of our journey here. At this point, we are do…
1244 stripping out things.</p>
1245
1246 <p>Let's disable optimizations and do a last run:</p>
1247
1248 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1249 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1250 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1251 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1252 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1253 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1254 <span class="nt">-DCLANG_ENABLE_STATIC_ANALYZER</span><span clas…
1255 <span class="nt">-DCLANG_ENABLE_ARCMT</span><span class="o">=</s…
1256 <span class="nt">-DLLVM_BUILD_TOOLS</span><span class="o">=</spa…
1257 <span class="nt">-DLLVM_BUILD_UTILS</span><span class="o">=</spa…
1258 <span class="nt">-DCMAKE_CXX_FLAGS_RELEASE</span><span class="o"…
1259 <span class="nt">-GNinja</span> ../llvm
1260
1261 <span class="nb">time </span>ninja
1262 <span class="o">[</span>2879/2879] Linking CXX executable bin/c-index-te…
1263
1264 real 2m37.003s
1265 user 231m53.133s
1266 sys 4m56.675s
1267 </code></pre></div></div>
1268
1269 <p>So this is it, this machine can build a full LLVM/Clang release build…
1270 a bit less than four minutes, and a stripped down build with optimizatio…
1271 disabled in two minutes. Two minutes. This is absolutely mind-blowing…
1272 The future is now!</p>
1273
1274 ]]></content>
1275 <summary type="html">
1276 <![CDATA[Speedbuilding LLVM/Clang in 2 minutes o…
1277 </summary>
1278
1279 <category term="Toolchains" scheme="https://www.cambus.n…
1280 </entry>
1281 <entry>
1282 <title><![CDATA[Speedbuilding LLVM/Clang in 5 minutes]]></title>
1283 <link href="https://www.cambus.net/speedbuilding-llvm-cl…
1284 <id>https://www.cambus.net/speedbuilding-llvm-clang-in-5…
1285 <published>2021-05-11T21:21:00Z</published>
1286 <updated>2021-05-11T21:21:00Z</updated>
1287 <content type="html"><![CDATA[<p>This post is a spiritua…
1288 <strong>MIPS64</strong> in a RAM constrained environment.</p>
1289
1290 <p>After reading the excellent "<a href="https://www.npopov.com/2020/05/…
1291 the topic, and see how fast I could build a recent version of <strong>LL…
1292 <strong>Clang</strong> on modern x86 server hardware.</p>
1293
1294 <p>The system I'm using for this experiment is a CCX62 instance from Het…
1295 which has <strong>48 dedicated vCPUs</strong> and <strong>192 GB of RAM<…
1296 machine available in their cloud offering at the moment.</p>
1297
1298 <p>The system is running Fedora 34 with up-to-date packages and kernel.<…
1299
1300 <p>The full result of <em>cat /proc/cpuinfo</em> is available <a href="/…
1301
1302 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1303 Linux benchmarks 5.11.18-300.fc34.x86_64 <span class="c">#1 SMP Mon May …
1304 </code></pre></div></div>
1305
1306 <p>Let's start by installing required packages:</p>
1307
1308 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1309 </code></pre></div></div>
1310
1311 <p>The compiler used for the builds is Clang 12.0.0:</p>
1312
1313 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1314 clang version 12.0.0 <span class="o">(</span>Fedora 12.0.0-0.3.rc1.fc34<…
1315 Target: x86_64-unknown-linux-gnu
1316 Thread model: posix
1317 InstalledDir: /usr/bin
1318 </code></pre></div></div>
1319
1320 <p>Regarding linkers, we are using GNU ld and GNU Gold from binutils 2.3…
1321 and LLD 12.0.0.</p>
1322
1323 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1324 GNU gold <span class="o">(</span>version 2.35.1-41.fc34<span class="o">)…
1325 LLD 12.0.0 <span class="o">(</span>compatible with GNU linkers<span clas…
1326 </code></pre></div></div>
1327
1328 <p>For all the following runs, I'm building from the Git repository main…
1329 commit <a href="https://github.com/llvm/llvm-project/commit/831cf15ca689…
1330 of course fully erased between each run.</p>
1331
1332 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1333 Author: David Spickett &lt;[email protected]&gt;
1334 Date: Wed May 5 11:49:35 2021 +0100
1335 </code></pre></div></div>
1336
1337 <p>To get a baseline, let's do a full release build on this machine:</p>
1338
1339 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1340 <span class="nb">mkdir </span>build
1341 <span class="nb">cd </span>build
1342
1343 cmake <span class="nt">-DCMAKE_C_COMPILER</span><span class="o">=</spa…
1344 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1345 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1346 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1347 ../llvm
1348
1349 <span class="nb">time </span>make <span class="nt">-j48</span>
1350 real 11m19.852s
1351 user 436m30.619s
1352 sys 12m5.724s
1353 </code></pre></div></div>
1354
1355 <p>By default, CMake generates Makefiles. As documented in the "<a href=…
1356 with the LLVM System</a>" tutorial, most LLVM developers use Ninja.</p>
1357
1358 <p>Let's switch to generating Ninja build files, and using ninja to buil…
1359
1360 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1361 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1362 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1363 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1364 <span class="nt">-GNinja</span> ../llvm
1365
1366 <span class="nb">time </span>ninja
1367 <span class="o">[</span>4182/4182] Generating ../../bin/llvm-readelf
1368
1369 real 10m13.755s
1370 user 452m16.034s
1371 sys 12m7.584s
1372 </code></pre></div></div>
1373
1374 <p><img src="/content/2021/05/llvm-clang-htop.png" alt="htop" /></p>
1375
1376 <p>By default, GNU ld is used for linking. Let's switch to using gold:</…
1377
1378 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1379 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1380 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1381 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1382 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1383 <span class="nt">-GNinja</span> ../llvm
1384
1385 <span class="nb">time </span>ninja
1386 <span class="o">[</span>4182/4182] Generating ../../bin/llvm-readelf
1387
1388 real 10m13.405s
1389 user 451m35.029s
1390 sys 11m57.649s
1391 </code></pre></div></div>
1392
1393 <p>LLD has been a viable option for some years now. Let's use it:</p>
1394
1395 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1396 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1397 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1398 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1399 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1400 <span class="nt">-GNinja</span> ../llvm
1401
1402 <span class="nb">time </span>ninja
1403 <span class="o">[</span>4182/4182] Generating ../../bin/llvm-readelf
1404
1405 real 10m12.710s
1406 user 451m12.444s
1407 sys 12m12.634s
1408 </code></pre></div></div>
1409
1410 <p>During tests on smaller build machines, I had observed that using GNU…
1411 or LLD instead of GNU ld resulted in noticeably faster builds. This does…
1412 seem to be the case on this machine. We end up with a slightly faster bu…
1413 by using LLD, but not by a large margin at all.</p>
1414
1415 <p>If we want to build faster, we can make some compromises and start st…
1416 the build by removing some components.</p>
1417
1418 <p>Let's start by disabling additional architecture support:</p>
1419
1420 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1421 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1422 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1423 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1424 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1425 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1426 <span class="nt">-GNinja</span> ../llvm
1427
1428 <span class="nb">time </span>ninja
1429 <span class="o">[</span>3196/3196] Generating ../../bin/llvm-readelf
1430
1431 real 7m55.531s
1432 user 344m56.462s
1433 sys 8m53.970s
1434 </code></pre></div></div>
1435
1436 <p>We can verify the resulting Clang binary only supports x86 targets:</…
1437
1438 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1439 Registered Targets:
1440 x86 - 32-bit X86: Pentium-Pro and above
1441 x86-64 - 64-bit X86: EM64T and AMD64
1442 </code></pre></div></div>
1443
1444 <p>Let's go further and disable the static analyzer and the ARC Migratio…
1445
1446 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1447 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1448 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1449 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1450 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1451 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1452 <span class="nt">-DCLANG_ENABLE_STATIC_ANALYZER</span><span clas…
1453 <span class="nt">-DCLANG_ENABLE_ARCMT</span><span class="o">=</s…
1454 <span class="nt">-GNinja</span> ../llvm
1455
1456 <span class="nb">time </span>ninja
1457 <span class="o">[</span>3147/3147] Generating ../../bin/llvm-readelf
1458
1459 real 7m42.299s
1460 user 334m47.916s
1461 sys 8m44.704s
1462 </code></pre></div></div>
1463
1464 <p>Let's disable building some LLVM tools and utils:</p>
1465
1466 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1467 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1468 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1469 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1470 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1471 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1472 <span class="nt">-DCLANG_ENABLE_STATIC_ANALYZER</span><span clas…
1473 <span class="nt">-DCLANG_ENABLE_ARCMT</span><span class="o">=</s…
1474 <span class="nt">-DLLVM_BUILD_TOOLS</span><span class="o">=</spa…
1475 <span class="nt">-DLLVM_BUILD_UTILS</span><span class="o">=</spa…
1476 <span class="nt">-GNinja</span> ../llvm
1477
1478 <span class="nb">time </span>ninja
1479 <span class="o">[</span>2880/2880] Generating ../../bin/llvm-readelf
1480
1481 real 7m21.016s
1482 user 315m42.127s
1483 sys 8m9.377s
1484 </code></pre></div></div>
1485
1486 <p>Compared to the previous build, the following binaries were not built:
1487 <em>FileCheck</em>, <em>count</em>, <em>lli-child-target</em>, <em>llvm-…
1488 <em>llvm-PerfectShuffle</em>, <em>not</em>, <em>obj2yaml</em>, <em>yaml2…
1489
1490 <p>We are reaching the end of our journey here. At this point, we are do…
1491 stripping out things.</p>
1492
1493 <p>Let's disable optimizations and do a last run:</p>
1494
1495 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1496 <span class="nt">-DCMAKE_CXX_COMPILER</span><span class="o">=</s…
1497 <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</spa…
1498 <span class="nt">-DLLVM_ENABLE_PROJECTS</span><span class="o">=<…
1499 <span class="nt">-DLLVM_USE_LINKER</span><span class="o">=</span…
1500 <span class="nt">-DLLVM_TARGETS_TO_BUILD</span><span class="o">=…
1501 <span class="nt">-DCLANG_ENABLE_STATIC_ANALYZER</span><span clas…
1502 <span class="nt">-DCLANG_ENABLE_ARCMT</span><span class="o">=</s…
1503 <span class="nt">-DLLVM_BUILD_TOOLS</span><span class="o">=</spa…
1504 <span class="nt">-DLLVM_BUILD_UTILS</span><span class="o">=</spa…
1505 <span class="nt">-DCMAKE_CXX_FLAGS_RELEASE</span><span class="o"…
1506 <span class="nt">-GNinja</span> ../llvm
1507
1508 <span class="nb">time </span>ninja
1509 <span class="o">[</span>2880/2880] Linking CXX executable bin/c-index-te…
1510
1511 real 5m37.225s
1512 user 253m18.515s
1513 sys 9m2.413s
1514 </code></pre></div></div>
1515
1516 <p>That's it. Five minutes. Don't try this at home :-)</p>
1517
1518 ]]></content>
1519 <summary type="html">
1520 <![CDATA[Speedbuilding LLVM/Clang in 5 minutes o…
1521 </summary>
1522
1523 <category term="Toolchains" scheme="https://www.cambus.n…
1524 </entry>
1525 <entry>
1526 <title><![CDATA[The state of toolchains in NetBSD]]></title>
1527 <link href="https://www.cambus.net/the-state-of-toolchai…
1528 <id>https://www.cambus.net/the-state-of-toolchains-in-ne…
1529 <published>2021-04-09T22:42:00Z</published>
1530 <updated>2021-04-09T22:42:00Z</updated>
1531 <content type="html"><![CDATA[<p>While FreeBSD and OpenB…
1532 base system compiler, NetBSD picked a different path and remained with
1533 <strong>GCC</strong> and <strong>binutils</strong> regardless of the lic…
1534 However, it doesn't mean that the NetBSD project endorses this license,
1535 and the NetBSD Foundation's has issued a <a href="http://cvsweb.netbsd.o…
1536 on the subject.</p>
1537
1538 <p>Realistically, NetBSD is more or less tied to GCC, as it supports more
1539 architectures than the other BSDs, some of which will likely never be
1540 supported in LLVM.</p>
1541
1542 <p>As of <a href="https://www.netbsd.org/releases/formal-9/NetBSD-9.1.ht…
1543 platforms</a> have recent versions of GCC (7.5.0) and binutils (2.31.1)
1544 in the base system. Newer (and older!) versions of GCC can be installed
1545 via Pkgsrc, and the following packages are available, going all the way
1546 back to GCC 3.3.6:</p>
1547
1548 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1549 | Package | Version | Release <span class="nb">date</span> |
1550 +---------+------------+-------------------+
1551 | gcc10 | GCC 10.2.0 | July 23, 2020 |
1552 | gcc9 | GCC 9.3.0 | March 12, 2020 |
1553 | gcc8 | GCC 8.4.0 | March 4, 2020 |
1554 | gcc7 | GCC 7.5.0 | November 14, 2019 |
1555 | gcc6 | GCC 6.5.0 | October 26, 2018 |
1556 | gcc5 | GCC 5.5.0 | October 10, 2017 |
1557 | gcc49 | GCC 4.9.4 | August 3, 2016 |
1558 | gcc48 | GCC 4.8.5 | June 23, 2015 |
1559 | gcc3 | GCC 3.3.6 | May 3, 2005 |
1560 +---------+------------+-------------------+
1561 </code></pre></div></div>
1562
1563 <p>The focus on GCC doesn't mean that the GNU and LLVM toolchains cannot…
1564 within NetBSD, and work has in fact been done during the last decade to …
1565 it happen.</p>
1566
1567 <p>Despite currently not being built by default in official NetBSD relea…
1568 <a href="https://www.freshbsd.org/netbsd/src/commit/EoXArQqbzjtXf3fx">LL…
1569 are built from NetBSD-current for selected platforms (at least amd64, i3…
1570 and evbarm) with the <em>MKLLVM</em> and <em>HAVE_LLVM</em> build option…
1571 contain LLVM and Clang.</p>
1572
1573 <p>Moreover, NetBSD has invested a lot of work on LLVM during the past f…
1574 years, including funding some developer contracts for Kamil Rytarowski
1575 (kamil@) and MichaÅ‚ GĂ³rny (mgorny@), which allowed them to work on var…
1576 parts of the LLVM toolchain to add and enhance support for <strong>sanit…
1577 and to improve <strong>LLDB</strong> support.</p>
1578
1579 <p>They both published several dozen articles on the <a href="https://bl…
1580 along the way, retracing their journey. Kamil's final report about
1581 <a href="https://blog.netbsd.org/tnf/entry/the_process_of_upstreaming_su…
1582 Thanks to this work, sanitizer support on NetBSD is mature and mostly on…
1583 with Linux. As a result, because LLVM is upstream for GCC sanitizers, th…
1584 are also available in GCC on NetBSD. Similarly, MichaÅ‚'s final report …
1585 his <a href="https://blog.netbsd.org/tnf/entry/lldb_work_concluded">LLDB…
1586
1587 <p>As always, work continues towards keeping the toolchains up to date, …
1588 upstreaming local changes whenever possible.</p>
1589
1590 ]]></content>
1591 <summary type="html">
1592 <![CDATA[The current state of GNU and LLVM toolc…
1593 </summary>
1594
1595 <category term="NetBSD" scheme="https://www.cambus.net/c…
1596 <category term="Toolchains" scheme="https://www.cambus.n…
1597 </entry>
1598 <entry>
1599 <title><![CDATA[OpenBSD/loongson on the Lemote Fuloong]]></title>
1600 <link href="https://www.cambus.net/openbsd-loongson-on-t…
1601 <id>https://www.cambus.net/openbsd-loongson-on-the-lemot…
1602 <published>2021-03-04T23:10:00Z</published>
1603 <updated>2021-03-04T23:10:00Z</updated>
1604 <content type="html"><![CDATA[<p>In my article about run…
1605 in 2016, I mentioned looking for a Fuloong. All hope seemed lost until t…
1606 Summer of 2017, when a fellow OpenBSD developer was contacted by a gener…
1607 user (Thanks again, Lars!) offering to donate two <strong>Lemote Fuloong…
1608 and I was lucky enough to get one of those units.</p>
1609
1610 <p>This machine uses the same CPU as the Yeeloong, a <strong>Loongson 2F…
1611 a single-core MIPS-III 64-bit processor running at 800/900 MHz.</p>
1612
1613 <p>As hinted in my previous article, contrarily to the <strong>Yeeloong<…
1614 <strong>Fuloong</strong> is less strict with the type of RAM it accepts,…
1615 happily running with a Kingston 2GB DDR2 SO-DIMM module (ASU256X64D2S800…
1616 replacing the original 512MB module.</p>
1617
1618 <p>Here is the result of a quick <strong>md5 -t</strong> benchmark:</p>
1619
1620 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1621 Digest <span class="o">=</span> 52e5f9c9e6f656f3e1800dfa5579d089
1622 Time <span class="o">=</span> 1.726563 seconds
1623 Speed <span class="o">=</span> 57918535.263411 bytes/second
1624 </code></pre></div></div>
1625
1626 <p>For the record, LibreSSL speed benchmark results are available <a hre…
1627
1628 <p>System message buffer (dmesg output):</p>
1629
1630 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1631 The Regents of the University of California. All rights reserve…
1632 Copyright <span class="o">(</span>c<span class="o">)</span> 1995-2021 Op…
1633
1634 OpenBSD 6.9-beta <span class="o">(</span>GENERIC<span class="o">)</span>…
1635 [email protected]:/usr/src/sys/arch/loongson/compile/GENE…
1636 real mem <span class="o">=</span> 2147483648 <span class="o">(</span>204…
1637 avail mem <span class="o">=</span> 2116452352 <span class="o">(</span>20…
1638 random: boothowto does not indicate good seed
1639 mainbus0 at root: Lemote Fuloong
1640 cpu0 at mainbus0: STC Loongson2F CPU 797 MHz, STC Loongson2F FPU
1641 cpu0: cache L1-I 64KB D 64KB 4 way, L2 512KB 4 way
1642 bonito0 at mainbus0: memory and PCI-X controller, rev 1
1643 pci0 at bonito0 bus 0
1644 re0 at pci0 dev 6 <span class="k">function </span>0 <span class="s2">"Re…
1645 rgephy0 at re0 phy 7: RTL8169S/8110S/8211 PHY, rev. 2
1646 sisfb0 at pci0 dev 8 <span class="k">function </span>0 <span class="s2">…
1647 wsdisplay0 at sisfb0 mux 1: console <span class="o">(</span>std, vt100 e…
1648 glxpcib0 at pci0 dev 14 <span class="k">function </span>0 <span class="s…
1649 isa0 at glxpcib0
1650 com0 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
1651 com1 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
1652 mcclock0 at isa0 port 0x70/2: mc146818 or compatible
1653 gpio1 at glxpcib0: 32 pins
1654 iic at glxpcib0 not configured
1655 glxclk0 at glxpcib0: clock, prof
1656 pciide0 at pci0 dev 14 <span class="k">function </span>2 <span class="s2…
1657 wd0 at pciide0 channel 0 drive 0: &lt;WDC WD1600BEVS-00VAT0&gt;
1658 wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
1659 wd0<span class="o">(</span>pciide0:0:0<span class="o">)</span>: using PI…
1660 pciide0: channel 1 ignored <span class="o">(</span>disabled<span class="…
1661 auglx0 at pci0 dev 14 <span class="k">function </span>3 <span class="s2"…
1662 ac97: codec <span class="nb">id </span>0x414c4760 <span class="o">(</spa…
1663 audio0 at auglx0
1664 ohci0 at pci0 dev 14 <span class="k">function </span>4 <span class="s2">…
1665 ehci0 at pci0 dev 14 <span class="k">function </span>5 <span class="s2">…
1666 usb0 at ehci0: USB revision 2.0
1667 uhub0 at usb0 configuration 1 interface 0 <span class="s2">"AMD EHCI roo…
1668 usb1 at ohci0: USB revision 1.0
1669 uhub1 at usb1 configuration 1 interface 0 <span class="s2">"AMD OHCI roo…
1670 apm0 at mainbus0
1671 vscsi0 at root
1672 scsibus0 at vscsi0: 256 targets
1673 softraid0 at root
1674 scsibus1 at softraid0: 256 targets
1675 pmon bootpath: <span class="nv">bootduid</span><span class="o">=</span>5…
1676 root on wd0a <span class="o">(</span>53153d3cd8ddc482.a<span class="o">)…
1677 </code></pre></div></div>
1678
1679 <p>PCI device data:</p>
1680
1681 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1682 Domain /dev/pci0:
1683 0:6:0: Realtek 8169
1684 0:8:0: SiS 315 Pro VGA
1685 0:14:0: AMD CS5536 ISA
1686 0:14:2: AMD CS5536 IDE
1687 0:14:3: AMD CS5536 Audio
1688 0:14:4: AMD CS5536 USB
1689 0:14:5: AMD CS5536 USB
1690 </code></pre></div></div>
1691
1692 ]]></content>
1693 <summary type="html">
1694 <![CDATA[Running the OpenBSD/loongson port on a …
1695 </summary>
1696
1697 <category term="OpenBSD" scheme="https://www.cambus.net/…
1698 <category term="MIPS64" scheme="https://www.cambus.net/c…
1699 </entry>
1700 <entry>
1701 <title><![CDATA[NetBSD on the EdgeRouter Lite]]></title>
1702 <link href="https://www.cambus.net/netbsd-on-the-edgerou…
1703 <id>https://www.cambus.net/netbsd-on-the-edgerouter-lite…
1704 <published>2021-01-29T19:20:00Z</published>
1705 <updated>2021-01-29T19:20:00Z</updated>
1706 <content type="html"><![CDATA[<p>NetBSD-current now has …
1707 appear in NetBSD 10.0) for the <strong>evbmips</strong> port, so I decid…
1708 give it a try. I've been happily running OpenBSD/octeon on my EdgeRouter
1709 Lite for a few years now, and have previously published <a href="https:/…
1710 including more detail about the CPU.</p>
1711
1712 <p>Contrary to the <a href="https://www.openbsd.org/octeon.html">OpenBSD…
1713 kernels, things are a little less polished on the NetBSD side for this
1714 platform. The system runs an uniprocessor kernel and there are still some
1715 stability issues.</p>
1716
1717 <p><img src="/content/2017/08/edgerouter-lite.jpg" alt="EdgeRouter Lite"…
1718
1719 <p>Here is the U-Boot configuration to boot the image:</p>
1720
1721 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1722 Octeon ubnt_e100# saveenv
1723 Saving Environment to Flash...
1724 Un-Protected 1 sectors
1725 Erasing Flash...
1726 <span class="nb">.</span> <span class="k">done
1727 </span>Erased 1 sectors
1728 Writing to Flash... 4....3....2....1....done
1729 Protected 1 sectors
1730 Octeon ubnt_e100#
1731 </code></pre></div></div>
1732
1733 <p>On first boot, the system automatically expands the filesystem:</p>
1734
1735 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1736 /dev/rdk1: grow cg |<span class="k">************************************…
1737 </code></pre></div></div>
1738
1739 <p>Here is the login session, for posterity:</p>
1740
1741 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1742
1743 NetBSD/evbmips <span class="o">(</span>octeon<span class="o">)</span> <s…
1744
1745 login:
1746 </code></pre></div></div>
1747
1748 <p>Here is the output of running <em>file</em> on executables:</p>
1749
1750 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1751 linked, interpreter /libexec/ld.elf_so, <span class="k">for </span>NetBS…
1752 </code></pre></div></div>
1753
1754 <p>For the record, OpenSSL speed benchmark results are available
1755 <a href="/files/netbsd/openssl-speed-edgerouter-lite.txt">here</a>.</p>
1756
1757 <p>System message buffer (dmesg output):</p>
1758
1759 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1760 <span class="o">[</span> 1.000000] 2006, 2007, 2008, 2009, 2010,…
1761 <span class="o">[</span> 1.000000] 2018, 2019, 2020, 2021 The Ne…
1762 <span class="o">[</span> 1.000000] Copyright <span class="o">(</span…
1763 <span class="o">[</span> 1.000000] The Regents of the University…
1764
1765 <span class="o">[</span> 1.000000] NetBSD 9.99.79 <span class="o">(<…
1766 <span class="o">[</span> 1.000000] [email protected]…
1767 <span class="o">[</span> 1.000000] Cavium Octeon CN5020-500
1768 <span class="o">[</span> 1.000000] total memory <span class="o">=</s…
1769 <span class="o">[</span> 1.000000] avail memory <span class="o">=</s…
1770 <span class="o">[</span> 1.000000] timecounter: Timecounters tick ev…
1771 <span class="o">[</span> 1.000000] mainbus0 <span class="o">(</span>…
1772 <span class="o">[</span> 1.000000] cpunode0 at mainbus0: 2 cores, cr…
1773 <span class="o">[</span> 1.000000] cpu0 at cpunode0 core 0: 500.00MHz
1774 <span class="o">[</span> 1.000000] cpu0: Cavium CN5020-500 <span cla…
1775 <span class="o">[</span> 1.000000] cpu0: 64 TLB entries, 512TB <span…
1776 <span class="o">[</span> 1.000000] cpu0: 32KB/128B 4-way set-associa…
1777 <span class="o">[</span> 1.000000] cpu0: 16KB/128B 64-way set-associ…
1778 <span class="o">[</span> 1.000000] cpu0: 128KB/128B 8-way set-associ…
1779 <span class="o">[</span> 1.000000] cpu1 at cpunode0 core 1: disabled…
1780 <span class="o">[</span> 1.000000] wdog0 at cpunode0: default period…
1781 <span class="o">[</span> 1.000000] iobus0 at mainbus0
1782 <span class="o">[</span> 1.000000] iobus0: initializing POW
1783 <span class="o">[</span> 1.000000] iobus0: initializing FPA
1784 <span class="o">[</span> 1.000000] com0 at iobus0 address 0x00011800…
1785 <span class="o">[</span> 1.000000] com0: console
1786 <span class="o">[</span> 1.000000] com at iobus0 address 0x000118000…
1787 <span class="o">[</span> 1.000000] octrnm0 at iobus0 address 0x00011…
1788 <span class="o">[</span> 1.000000] entropy: ready
1789 <span class="o">[</span> 1.000000] octtwsi at iobus0 address 0x00011…
1790 <span class="o">[</span> 1.000000] octmpi at iobus0 address 0x000107…
1791 <span class="o">[</span> 1.000000] octsmi0 at iobus0 address 0x00011…
1792 <span class="o">[</span> 1.000000] octpip0 at iobus0 address 0x00011…
1793 <span class="o">[</span> 1.000000] octgmx0 at octpip0
1794 <span class="o">[</span> 1.000000] cnmac0 at octgmx0: <span class="n…
1795 <span class="o">[</span> 1.000000] cnmac0: Ethernet address 44:d9:e7…
1796 <span class="o">[</span> 1.000000] atphy0 at cnmac0 phy 7: Atheros A…
1797 <span class="o">[</span> 1.000000] atphy0: 10baseT, 10baseT-FDX, 100…
1798 <span class="o">[</span> 1.000000] cnmac1 at octgmx0: <span class="n…
1799 <span class="o">[</span> 1.000000] cnmac1: Ethernet address 44:d9:e7…
1800 <span class="o">[</span> 1.000000] atphy1 at cnmac1 phy 6: Atheros A…
1801 <span class="o">[</span> 1.000000] atphy1: 10baseT, 10baseT-FDX, 100…
1802 <span class="o">[</span> 1.000000] cnmac2 at octgmx0: <span class="n…
1803 <span class="o">[</span> 1.000000] cnmac2: Ethernet address 44:d9:e7…
1804 <span class="o">[</span> 1.000000] atphy2 at cnmac2 phy 5: Atheros A…
1805 <span class="o">[</span> 1.000000] atphy2: 10baseT, 10baseT-FDX, 100…
1806 <span class="o">[</span> 1.000000] dwctwo0 at iobus0 address 0x00011…
1807 <span class="o">[</span> 1.000000] dwctwo0: Core Release: 2.65a <spa…
1808 <span class="o">[</span> 1.000000] usb0 at dwctwo0: USB revision 2.0
1809 <span class="o">[</span> 1.000000] bootbus0 at mainbus0
1810 <span class="o">[</span> 1.000000] timecounter: Timecounter <span cl…
1811 <span class="o">[</span> 1.000003] timecounter: Timecounter <span cl…
1812 <span class="o">[</span> 1.059978] uhub0 at usb0: NetBSD <span class…
1813 <span class="o">[</span> 1.059978] uhub0: 1 port with 1 removable, s…
1814 <span class="o">[</span> 1.069975] aes: BearSSL aes_ct
1815 <span class="o">[</span> 1.069975] aes_ccm: self-test passed
1816 <span class="o">[</span> 1.069975] chacha: Portable C ChaCha
1817 <span class="o">[</span> 1.079979] blake2s: self-test passed
1818 <span class="o">[</span> 3.609971] umass0 at uhub0 port 1 configurat…
1819 <span class="o">[</span> 3.620226] umass0: vendor 13fe <span class="…
1820 <span class="o">[</span> 3.620226] umass0: using SCSI over Bulk-Only
1821 <span class="o">[</span> 3.620226] scsibus0 at umass0: 2 targets, 1 …
1822 <span class="o">[</span> 3.632383] uhub0: autoconfiguration error: i…
1823 <span class="o">[</span> 3.639974] sd0 at scsibus0 target 0 lun 0: &…
1824 <span class="o">[</span> 3.639974] sd0: 3824 MB, 959 cyl, 255 <span …
1825 <span class="o">[</span> 3.659974] sd0: GPT GUID: 6e7b1b6a-2e9f-4915…
1826 <span class="o">[</span> 3.669969] dk0 at sd0: <span class="s2">"oct…
1827 <span class="o">[</span> 3.669969] dk1 at sd0: <span class="s2">"oct…
1828 <span class="o">[</span> 3.683879] WARNING: 1 error <span class="k">…
1829 <span class="o">[</span> 3.691430] boot device: sd0
1830 <span class="o">[</span> 3.691430] root on dk1
1831 <span class="o">[</span> 3.709975] root file system <span class="nb"…
1832 <span class="o">[</span> 3.719976] kern.module.path<span class="o">=…
1833 <span class="o">[</span> 3.719976] WARNING: no TOD clock present
1834 <span class="o">[</span> 3.729990] WARNING: using filesystem <span c…
1835 <span class="o">[</span> 3.734057] WARNING: CHECK AND RESET THE DATE!
1836 </code></pre></div></div>
1837
1838 ]]></content>
1839 <summary type="html">
1840 <![CDATA[Running the NetBSD/evbmips port on Ubiq…
1841 </summary>
1842
1843 <category term="NetBSD" scheme="https://www.cambus.net/c…
1844 <category term="MIPS64" scheme="https://www.cambus.net/c…
1845 </entry>
1846 <entry>
1847 <title><![CDATA[Playing with Kore JSON API]]></title>
1848 <link href="https://www.cambus.net/playing-with-kore-jso…
1849 <id>https://www.cambus.net/playing-with-kore-json-api/</…
1850 <published>2020-09-07T15:15:00Z</published>
1851 <updated>2020-09-07T15:15:00Z</updated>
1852 <content type="html"><![CDATA[<p>Kore <a href="https://k…
1853 new <a href="https://docs.kore.io/4.0.0/api/json.html">JSON API</a> allo…
1854
1855 <p>During the last couple of years, I have been using Kore for various p…
1856 including exposing hardware sensor values over the network via very simp…
1857 APIs. In this article, I would like to present a generalization of this
1858 concept and show how easy it is to expose system information with Kore.<…
1859
1860 <p>This small API example allows identifying hosts over the network and …
1861 been tested on Linux, OpenBSD, NetBSD, and macOS (thanks Joris!).</p>
1862
1863 <p>After creating a new project:</p>
1864
1865 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1866 </code></pre></div></div>
1867
1868 <p>Populate <code>src/identify.c</code> with the following code snippet:…
1869
1870 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
1871 </span>
1872 <span class="cp">#include &lt;kore/kore.h&gt;
1873 #include &lt;kore/http.h&gt;
1874 </span>
1875 <span class="cp">#if defined(__linux__)
1876 #include &lt;kore/seccomp.h&gt;
1877 </span>
1878 <span class="n">KORE_SECCOMP_FILTER</span><span class="p">(</span><span …
1879 <span class="n">KORE_SYSCALL_ALLOW</span><span class="p">(</span…
1880 <span class="p">);</span>
1881 <span class="cp">#endif
1882 </span>
1883 <span class="kt">int</span> <span class="nf">page</span><…
1884
1885 <span class="kt">int</span>
1886 <span class="nf">page</span><span class="p">(</span><span class="k">stru…
1887 <span class="p">{</span>
1888 <span class="kt">char</span> <span class="o">*</span><span class…
1889
1890 <span class="k">struct</span> <span class="n">utsname</span> <sp…
1891
1892 <span class="k">struct</span> <span class="n">kore_buf</span> <s…
1893 <span class="k">struct</span> <span class="n">kore_json_item</sp…
1894
1895 <span class="k">if</span> <span class="p">(</span><span class="n…
1896 <span class="n">http_response</span><span class="p">(</s…
1897 <span class="k">return</span> <span class="p">(</span><s…
1898 <span class="p">}</span>
1899
1900 <span class="n">kore_buf_init</span><span class="p">(</span><spa…
1901 <span class="n">json</span> <span class="o">=</span> <span class…
1902
1903 <span class="n">kore_json_create_string</span><span class="p">(<…
1904 <span class="n">kore_json_create_string</span><span class="p">(<…
1905 <span class="n">kore_json_create_string</span><span class="p">(<…
1906 <span class="n">kore_json_create_string</span><span class="p">(<…
1907 <span class="n">kore_json_create_string</span><span class="p">(<…
1908
1909 <span class="n">kore_json_item_tobuf</span><span class="p">(</sp…
1910
1911 <span class="n">answer</span> <span class="o">=</span> <span cla…
1912 <span class="n">http_response</span><span class="p">(</span><spa…
1913
1914 <span class="n">kore_buf_cleanup</span><span class="p">(</span><…
1915 <span class="n">kore_json_item_free</span><span class="p">(</spa…
1916
1917 <span class="k">return</span> <span class="p">(</span><span clas…
1918 <span class="p">}</span>
1919 </code></pre></div></div>
1920
1921 <p>And finally launch the project:</p>
1922
1923 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
1924 </code></pre></div></div>
1925
1926 <p>The kodev tool will build and run the project, and we can now query t…
1927 API to identify hosts:</p>
1928
1929 <div class="language-javascript highlighter-rouge"><div class="highlight…
1930 <span class="dl">"</span><span class="s2">system</span><span class="dl…
1931 <span class="dl">"</span><span class="s2">hostname</span><span class="…
1932 <span class="dl">"</span><span class="s2">release</span><span class="d…
1933 <span class="dl">"</span><span class="s2">version</span><span class="d…
1934 <span class="dl">"</span><span class="s2">machine</span><span class="d…
1935 <span class="p">}</span>
1936 </code></pre></div></div>
1937
1938 ]]></content>
1939 <summary type="html">
1940 <![CDATA[A small API example allowing to identif…
1941 </summary>
1942
1943 <category term="C" scheme="https://www.cambus.net/catego…
1944 </entry>
1945 <entry>
1946 <title><![CDATA[Modernizing the OpenBSD console]]></title>
1947 <link href="https://www.cambus.net/modernizing-the-openb…
1948 <id>https://www.cambus.net/modernizing-the-openbsd-conso…
1949 <published>2020-08-31T18:30:00Z</published>
1950 <updated>2020-08-31T18:30:00Z</updated>
1951 <content type="html"><![CDATA[<p>At the beginning were t…
1952 on i386 and amd64 used text mode consoles which by default provided
1953 25 rows of 80 columns, the "80x25 mode". This mode uses an 8x16 font sto…
1954 in the VGA BIOS (which can be slightly different across vendors).</p>
1955
1956 <p>OpenBSD uses the <a href="https://man.openbsd.org/wscons.4">wscons(4)…
1957
1958 <p>CRT monitors allowed you to set the resolution you wanted, so on bigg…
1959 monitors, the 80x25 console in textmode was fairly large but not blurry.…
1960
1961 <p>Framebuffer consoles allowed taking advantage of larger monitor sizes,
1962 to fit more columns and rows. With the switch to LCD monitors, also in
1963 part driven by the decreasing costs of laptops, the fixed size panels
1964 became a problem as the text mode resolution needed to be stretched,
1965 leading to distortion and blurriness.</p>
1966
1967 <p>One thing some people might not realize is the huge discrepancy betwe…
1968 mode and framebuffer consoles regarding the amount of data you have to
1969 write to cover the whole screen. In text mode, we only need to write 2 b…
1970 per character: 1 byte for the ASCII code, and 1 byte for attributes.
1971 So in 80x25 text mode, we only need to write 80 * 25 * 2 bytes of data, …
1972 is 4000 bytes, and the VGA card itself takes care of plotting characters…
1973 the screen. In framebuffer, however, to fill a 4K UHD-1 (3840x2160) scre…
1974 32bpp mode we need to send 3840 * 2160 * 4 bytes of data, which is 33177…
1975 bytes (approximately 33 MB).</p>
1976
1977 <p>On framebuffer consoles, OpenBSD uses the <a href="https://man.openbs…
1978 operations), imported from NetBSD in <a href="https://www.freshbsd.org/c…
1979
1980 <p>While they had been used for a while on platforms without VGA cards,
1981 framebuffer consoles were only enabled on i386 and amd64 in 2013 for
1982 <a href="https://undeadly.org/cgi?action=article;sid=20130320095845">int…
1983
1984 <p>In recent years, rasops(9) itself and framebuffer drivers have seen s…
1985 improvements:</p>
1986
1987 <p>General improvements:</p>
1988
1989 <ul>
1990 <li>Add and enable efifb(4), EFI framebuffer driver (yasuoka@, <a href…
1991 <li>Implement counter-clockwise rotation (kettenis@, <a href="https://…
1992 <li>Implement scrollback in rasops(9) (jcs@, <a href="https://www.fres…
1993 </ul>
1994
1995 <p>Performance related improvements:</p>
1996
1997 <ul>
1998 <li>Make it possible to use RI_WRONLY during early boot (kettenis@, <a…
1999 <li>Introduce rasops_wronly_do_cursor() (kettenis@, <a href="https://w…
2000 <li>Remap EFI framebuffer early to use write combining (kettenis@, <a …
2001 <li>Do PAT setup earlier, so mapping the framebuffer WC actually works…
2002 <li>Fast conditional console scrolling (John Carmack, <a href="https:/…
2003 <li>Optimize character rendering in 32bpp mode (John Carmack, <a href=…
2004 </ul>
2005
2006 <p>Console fonts improvements:</p>
2007
2008 <ul>
2009 <li>Add Spleen 5x8, targeted at small OLED displays (<a href="https://…
2010 <li>Add Spleen 8x16, 12x24, 16x32 and 32x64 (<a href="https://www.fres…
2011 <li>Enable Spleen in wsfont by default (<a href="https://www.freshbsd.…
2012 <li>Add Spleen 6x12, targeted at OLED displays (<a href="https://www.f…
2013 </ul>
2014
2015 <p>There is an <a href="https://undeadly.org/cgi?action=article;sid=2019…
2016 information, notably on the font selection mechanism relative to screen
2017 resolution.</p>
2018
2019 <p>And work slowly continues to make framebuffer consoles more usable.</…
2020
2021 <p>It is interesting to note that while NetBSD has been adding a lot of
2022 features to rasops(9) over the years, OpenBSD has taken a more conservat…
2023 approach. There is however one major feature that NetBSD currently has w…
2024 would be beneficial: the capability for <a href="https://www.freshbsd.or…
2025 and subsequently resizing screens</a>.</p>
2026
2027 <p>Looking forward, the performance of various operations could likely s…
2028 improved, possibly by leveraging the new OpenBSD dynamic tracing mechani…
2029 to analyze bottlenecks.</p>
2030
2031 <p>Another open question is UTF-8 support, Miod Vallat started work in t…
2032 direction back in <a href="https://undeadly.org/cgi?action=article;sid=2…
2033 I have plans to implement sparse font files support in the future, at
2034 least so one can take advantage of box drawing and possibly block elemen…
2035 characters.</p>
2036
2037 <p>Lastly, a major pain point has been the lack of larger fonts in RAMDI…
2038 kernels, making installations and upgrades very difficult and error-prone
2039 on large DPI monitors as the text is basically unreadable. There is no
2040 technical blocker to make this happen, which ironically makes it the most
2041 difficult kind of issue to tackle.</p>
2042
2043 ]]></content>
2044 <summary type="html">
2045 <![CDATA[Facts, directions, and thoughts regardi…
2046 </summary>
2047
2048 <category term="OpenBSD" scheme="https://www.cambus.net/…
2049 </entry>
2050 <entry>
2051 <title><![CDATA[NetBSD on the NanoPi NEO2]]></title>
2052 <link href="https://www.cambus.net/netbsd-on-the-nanopi-…
2053 <id>https://www.cambus.net/netbsd-on-the-nanopi-neo2/</i…
2054 <published>2020-08-06T20:41:00Z</published>
2055 <updated>2020-08-06T20:41:00Z</updated>
2056 <content type="html"><![CDATA[<p>The <a href="https://li…
2057 being my test machine for OpenBSD/arm64 related things.</p>
2058
2059 <p>As NetBSD/evbarm finally gained support for AArch64 in NetBSD 9.0, re…
2060 back in February, I decided to give it a try on this device. The board o…
2061 has 512MB of RAM, and this is where NetBSD really shines. Things have be…
2062 a lot easier since jmcneill@ now provides <a href="https://www.armbsd.or…
2063 variety of devices, including the NanoPi NEO2.</p>
2064
2065 <p><img src="/content/2021/02/nanopi-neo2.jpg" alt="NanoPi NEO2" title="…
2066
2067 <p>On first boot, the system will resize the filesystem to automatically…
2068 to the size of the SD card.</p>
2069
2070 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2071 Growing ld0 disklabel <span class="o">(</span>1148MB -&gt; 60906MB<span …
2072 Resizing /
2073 /dev/rld0a: grow cg |<span class="k">***********************************…
2074 </code></pre></div></div>
2075
2076 <p>Once the system is up and running, we can add a regular user in the
2077 <em>wheel</em> group:</p>
2078
2079 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2080 </code></pre></div></div>
2081
2082 <p>And add a password to the newly created user:</p>
2083
2084 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2085 </code></pre></div></div>
2086
2087 <p>From there we do not need the serial console anymore and can connect …
2088 the device using SSH.</p>
2089
2090 <p>NetBSD has binary packages available for this architecture, and insta…
2091 and configuring pkgin can be done as follow:</p>
2092
2093 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2094 pkg_add pkgin
2095 <span class="nb">echo</span> <span class="nv">$PKG_PATH</span> <span cla…
2096 pkgin update
2097 </code></pre></div></div>
2098
2099 <p>The base system can be kept up to date using <a href="https://pkgsrc.…
2100 installed via <strong>pkgin</strong>:</p>
2101
2102 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2103 </code></pre></div></div>
2104
2105 <p>The following variable need to be set in <em>/usr/pkg/etc/sysupgrade.…
2106
2107 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2108 </code></pre></div></div>
2109
2110 <p>Lastly, the device has two user controllable LEDs which can be toggled
2111 on and off using <strong>sysctl</strong>.</p>
2112
2113 <p>To switch both LEDs on:</p>
2114
2115 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2116 sysctl <span class="nt">-w</span> hw.led.nanopi_blue_status<span class="…
2117 </code></pre></div></div>
2118
2119 <p>To switch off the power LED automatically at boot time:</p>
2120
2121 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2122 </code></pre></div></div>
2123
2124 <p>Here is a dmesg for reference purposes:</p>
2125
2126 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2127 <span class="o">[</span> 1.000000] 2006, 2007, 2008, 2009, 2010,…
2128 <span class="o">[</span> 1.000000] 2018, 2019, 2020 The NetBSD F…
2129 <span class="o">[</span> 1.000000] Copyright <span class="o">(</span…
2130 <span class="o">[</span> 1.000000] The Regents of the University…
2131
2132 <span class="o">[</span> 1.000000] NetBSD 9.0_STABLE <span class="o"…
2133 <span class="o">[</span> 1.000000] [email protected]…
2134 <span class="o">[</span> 1.000000] total memory <span class="o">=</s…
2135 <span class="o">[</span> 1.000000] avail memory <span class="o">=</s…
2136 <span class="o">[</span> 1.000000] timecounter: Timecounters tick ev…
2137 <span class="o">[</span> 1.000000] armfdt0 <span class="o">(</span>r…
2138 <span class="o">[</span> 1.000000] simplebus0 at armfdt0: FriendlyAR…
2139 <span class="o">[</span> 1.000000] simplebus1 at simplebus0
2140 <span class="o">[</span> 1.000000] simplebus2 at simplebus0
2141 <span class="o">[</span> 1.000000] cpus0 at simplebus0
2142 <span class="o">[</span> 1.000000] simplebus3 at simplebus0
2143 <span class="o">[</span> 1.000000] psci0 at simplebus0: PSCI 1.1
2144 <span class="o">[</span> 1.000000] cpu0 at cpus0: Cortex-A53 r0p4 <s…
2145 <span class="o">[</span> 1.000000] cpu0: package 0, core 0, smt 0
2146 <span class="o">[</span> 1.000000] cpu0: IC enabled, DC enabled, EL0…
2147 <span class="o">[</span> 1.000000] cpu0: Cache Writeback Granule 16B…
2148 <span class="o">[</span> 1.000000] cpu0: Dcache line 64, Icache line…
2149 <span class="o">[</span> 1.000000] cpu0: L1 32KB/64B 2-way read-allo…
2150 <span class="o">[</span> 1.000000] cpu0: L1 32KB/64B 4-way write-bac…
2151 <span class="o">[</span> 1.000000] cpu0: L2 512KB/64B 16-way write-b…
2152 <span class="o">[</span> 1.000000] cpu0: <span class="nv">revID</spa…
2153 <span class="o">[</span> 1.000000] cpu0: <span class="nv">auxID</spa…
2154 <span class="o">[</span> 1.000000] cpu1 at cpus0: Cortex-A53 r0p4 <s…
2155 <span class="o">[</span> 1.000000] cpu1: package 0, core 1, smt 0
2156 <span class="o">[</span> 1.000000] cpu2 at cpus0: Cortex-A53 r0p4 <s…
2157 <span class="o">[</span> 1.000000] cpu2: package 0, core 2, smt 0
2158 <span class="o">[</span> 1.000000] cpu3 at cpus0: Cortex-A53 r0p4 <s…
2159 <span class="o">[</span> 1.000000] cpu3: package 0, core 3, smt 0
2160 <span class="o">[</span> 1.000000] gic0 at simplebus1: GIC
2161 <span class="o">[</span> 1.000000] armgic0 at gic0: Generic Interrup…
2162 <span class="o">[</span> 1.000000] armgic0: 16 Priorities, 192 SPIs,…
2163 <span class="o">[</span> 1.000000] fclock0 at simplebus2: 24000000 H…
2164 <span class="o">[</span> 1.000000] sunxisramc0 at simplebus1: SRAM C…
2165 <span class="o">[</span> 1.000000] fclock1 at simplebus2: 32768 Hz f…
2166 <span class="o">[</span> 1.000000] gtmr0 at simplebus0: Generic Timer
2167 <span class="o">[</span> 1.000000] gtmr0: interrupting on GIC irq 27
2168 <span class="o">[</span> 1.000000] armgtmr0 at gtmr0: Generic Timer …
2169 <span class="o">[</span> 1.000000] timecounter: Timecounter <span cl…
2170 <span class="o">[</span> 1.000010] sun8ih3ccu0 at simplebus1: H3 CCU
2171 <span class="o">[</span> 1.000010] sun8ih3rccu0 at simplebus1: H3 PR…
2172 <span class="o">[</span> 1.000010] sunxide2ccu0 at simplebus1: DE2 C…
2173 <span class="o">[</span> 1.000010] sunxigpio0 at simplebus1: PIO
2174 <span class="o">[</span> 1.000010] gpio0 at sunxigpio0: 94 pins
2175 <span class="o">[</span> 1.000010] sunxigpio0: interrupting on GIC i…
2176 <span class="o">[</span> 1.000010] sunxigpio1 at simplebus1: PIO
2177 <span class="o">[</span> 1.000010] gpio1 at sunxigpio1: 12 pins
2178 <span class="o">[</span> 1.000010] sunxigpio1: interrupting on GIC i…
2179 <span class="o">[</span> 1.000010] fregulator0 at simplebus0: vcc3v3
2180 <span class="o">[</span> 1.000010] fregulator1 at simplebus0: usb0-v…
2181 <span class="o">[</span> 1.000010] fregulator2 at simplebus0: gmac-3…
2182 <span class="o">[</span> 1.000010] sun6idma0 at simplebus1: DMA cont…
2183 <span class="o">[</span> 1.000010] sun6idma0: interrupting on GIC ir…
2184 <span class="o">[</span> 1.000010] com0 at simplebus1: ns16550a, wor…
2185 <span class="o">[</span> 1.000010] com0: console
2186 <span class="o">[</span> 1.000010] com0: interrupting on GIC irq 32
2187 <span class="o">[</span> 1.000010] sunxiusbphy0 at simplebus1: USB P…
2188 <span class="o">[</span> 1.000010] sunxihdmiphy0 at simplebus1: HDMI…
2189 <span class="o">[</span> 1.000010] sunximixer0 at simplebus1: Displa…
2190 <span class="o">[</span> 1.000010] sunxilcdc0 at simplebus1: TCON1
2191 <span class="o">[</span> 1.000010] sunxilcdc0: interrupting on GIC i…
2192 <span class="o">[</span> 1.000010] sunxirtc0 at simplebus1: RTC
2193 <span class="o">[</span> 1.000010] emac0 at simplebus1: EMAC
2194 <span class="o">[</span> 1.000010] emac0: Ethernet address 02:01:f7:…
2195 <span class="o">[</span> 1.000010] emac0: interrupting on GIC irq 114
2196 <span class="o">[</span> 1.000010] rgephy0 at emac0 phy 7: RTL8211E …
2197 <span class="o">[</span> 1.000010] rgephy0: 10baseT, 10baseT-FDX, 10…
2198 <span class="o">[</span> 1.000010] h3codec0 at simplebus1: H3 Audio …
2199 <span class="o">[</span> 1.000010] sunximmc0 at simplebus1: SD/MMC c…
2200 <span class="o">[</span> 1.000010] sunximmc0: interrupting on GIC ir…
2201 <span class="o">[</span> 1.000010] motg0 at simplebus1: <span class=…
2202 <span class="o">[</span> 1.000010] ehci0 at simplebus1: EHCI
2203 <span class="o">[</span> 1.000010] ehci0: interrupting on GIC irq 104
2204 <span class="o">[</span> 1.000010] ehci0: EHCI version 1.0
2205 <span class="o">[</span> 1.000010] ehci0: 1 companion controller, 1 …
2206 <span class="o">[</span> 1.000010] usb0 at ehci0: USB revision 2.0
2207 <span class="o">[</span> 1.000010] ohci0 at simplebus1: OHCI
2208 <span class="o">[</span> 1.000010] ohci0: interrupting on GIC irq 105
2209 <span class="o">[</span> 1.000010] ohci0: OHCI version 1.0
2210 <span class="o">[</span> 1.000010] usb1 at ohci0: USB revision 1.0
2211 <span class="o">[</span> 1.000010] ehci1 at simplebus1: EHCI
2212 <span class="o">[</span> 1.000010] ehci1: interrupting on GIC irq 110
2213 <span class="o">[</span> 1.000010] ehci1: EHCI version 1.0
2214 <span class="o">[</span> 1.000010] ehci1: 1 companion controller, 1 …
2215 <span class="o">[</span> 1.000010] usb2 at ehci1: USB revision 2.0
2216 <span class="o">[</span> 1.000010] ohci1 at simplebus1: OHCI
2217 <span class="o">[</span> 1.000010] ohci1: interrupting on GIC irq 111
2218 <span class="o">[</span> 1.000010] ohci1: OHCI version 1.0
2219 <span class="o">[</span> 1.000010] usb3 at ohci1: USB revision 1.0
2220 <span class="o">[</span> 1.000010] sunxiwdt0 at simplebus1: Watchdog
2221 <span class="o">[</span> 1.000010] sunxiwdt0: default watchdog perio…
2222 <span class="o">[</span> 1.000010] /soc/gpu@1e80000 at simplebus1 no…
2223 <span class="o">[</span> 1.000010] gpioleds0 at simplebus0: nanopi:g…
2224 <span class="o">[</span> 1.000010] /soc/timer@1c20c00 at simplebus1 …
2225 <span class="o">[</span> 1.000010] /soc/video-codec@1c0e000 at simpl…
2226 <span class="o">[</span> 1.000010] timecounter: Timecounter <span cl…
2227 <span class="o">[</span> 1.000010] cpu2: IC enabled, DC enabled, EL0…
2228 <span class="o">[</span> 1.000010] cpu2: Cache Writeback Granule 16B…
2229 <span class="o">[</span> 1.040229] cpu2: Dcache line 64, Icache line…
2230 <span class="o">[</span> 1.040229] cpu2: L1 32KB/64B 2-way read-allo…
2231 <span class="o">[</span> 1.050220] cpu2: L1 32KB/64B 4-way write-bac…
2232 <span class="o">[</span> 1.060220] cpu2: L2 512KB/64B 16-way write-b…
2233 <span class="o">[</span> 1.070220] cpu2: <span class="nv">revID</spa…
2234 <span class="o">[</span> 1.070220] cpu2: <span class="nv">auxID</spa…
2235 <span class="o">[</span> 1.090221] cpu1: IC enabled, DC enabled, EL0…
2236 <span class="o">[</span> 1.090221] cpu1: Cache Writeback Granule 16B…
2237 <span class="o">[</span> 1.100222] cpu1: Dcache line 64, Icache line…
2238 <span class="o">[</span> 1.110221] cpu1: L1 32KB/64B 2-way read-allo…
2239 <span class="o">[</span> 1.110221] cpu1: L1 32KB/64B 4-way write-bac…
2240 <span class="o">[</span> 1.120222] cpu1: L2 512KB/64B 16-way write-b…
2241 <span class="o">[</span> 1.130222] cpu1: <span class="nv">revID</spa…
2242 <span class="o">[</span> 1.140223] cpu1: <span class="nv">auxID</spa…
2243 <span class="o">[</span> 1.150222] cpu3: IC enabled, DC enabled, EL0…
2244 <span class="o">[</span> 1.160223] cpu3: Cache Writeback Granule 16B…
2245 <span class="o">[</span> 1.160223] cpu3: Dcache line 64, Icache line…
2246 <span class="o">[</span> 1.170223] cpu3: L1 32KB/64B 2-way read-allo…
2247 <span class="o">[</span> 1.180223] cpu3: L1 32KB/64B 4-way write-bac…
2248 <span class="o">[</span> 1.180223] cpu3: L2 512KB/64B 16-way write-b…
2249 <span class="o">[</span> 1.190223] cpu3: <span class="nv">revID</spa…
2250 <span class="o">[</span> 1.200224] cpu3: <span class="nv">auxID</spa…
2251 <span class="o">[</span> 1.210224] sdmmc0 at sunximmc0
2252 <span class="o">[</span> 1.240225] uhub0 at usb0: NetBSD <span class…
2253 <span class="o">[</span> 1.240225] uhub0: 1 port with 1 removable, s…
2254 <span class="o">[</span> 1.240225] uhub1 at usb2: NetBSD <span class…
2255 <span class="o">[</span> 1.250226] uhub1: 1 port with 1 removable, s…
2256 <span class="o">[</span> 1.250226] uhub2 at usb1: NetBSD <span class…
2257 <span class="o">[</span> 1.260226] uhub2: 1 port with 1 removable, s…
2258 <span class="o">[</span> 1.260226] uhub3 at usb3: NetBSD <span class…
2259 <span class="o">[</span> 1.275641] uhub3: 1 port with 1 removable, s…
2260 <span class="o">[</span> 1.275641] IPsec: Initialized Security Assoc…
2261 <span class="o">[</span> 1.350228] sdmmc0: SD card status: 4-bit, C1…
2262 <span class="o">[</span> 1.350228] ld0 at sdmmc0: &lt;0x03:0x5344:SC…
2263 <span class="o">[</span> 1.360690] ld0: 60906 MB, 7764 cyl, 255 <spa…
2264 <span class="o">[</span> 1.370228] ld0: 4-bit width, High-Speed/SDR2…
2265 <span class="o">[</span> 1.990242] boot device: ld0
2266 <span class="o">[</span> 1.990242] root on ld0a dumps on ld0b
2267 <span class="o">[</span> 2.000243] root file system <span class="nb"…
2268 <span class="o">[</span> 2.010242] kern.module.path<span class="o">=…
2269 </code></pre></div></div>
2270
2271 ]]></content>
2272 <summary type="html">
2273 <![CDATA[Some notes on installing and running Ne…
2274 </summary>
2275
2276 <category term="NetBSD" scheme="https://www.cambus.net/c…
2277 <category term="ARM" scheme="https://www.cambus.net/cate…
2278 </entry>
2279 <entry>
2280 <title><![CDATA[Viewing ANSI art in MS-DOS virtual machines]]></…
2281 <link href="https://www.cambus.net/viewing-ansi-art-in-m…
2282 <id>https://www.cambus.net/viewing-ansi-art-in-ms-dos-vi…
2283 <published>2020-06-19T16:28:00Z</published>
2284 <updated>2020-06-19T16:28:00Z</updated>
2285 <content type="html"><![CDATA[<p>I sometimes get reports…
2286 differently than other ANSI art editors and viewers for modern platforms…
2287
2288 <p>Ansilove tries to be faithful to <a href="https://en.wikipedia.org/wi…
2289 and viewers rendering, as the vast majority of artworks were created
2290 during the DOS era. Most of the time, using <strong>ACiDDraw</strong> an…
2291 in <strong>DOSBox</strong> is enough, but when in doubt, it can be usefu…
2292 ANSI.SYS rendered a particular piece.</p>
2293
2294 <p>Once we have MS-DOS installed and working in a virtual machine, the
2295 next step is accessing files within the VM. The easiest way to do so
2296 is to create and use virtual floppy images to transfer files.</p>
2297
2298 <p>On a Linux machine, one can use <strong>mkfs.msdos</strong> to create…
2299 image:</p>
2300
2301 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2302 </code></pre></div></div>
2303
2304 <p>The image can then be mounted on the host to copy the desired content,
2305 then attached to the virtual machine.</p>
2306
2307 <p>In the MS-DOS guest, we need to enable <strong>ANSI.SYS</strong> in C…
2308
2309 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2310 </code></pre></div></div>
2311
2312 <p>We can then render the files we want to verify:</p>
2313
2314 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2315 TYPE ANSI.ANS
2316 </code></pre></div></div>
2317
2318 <p>80x50 mode can be enabled this way:</p>
2319
2320 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2321 </code></pre></div></div>
2322
2323 ]]></content>
2324 <summary type="html">
2325 <![CDATA[Some notes on creating virtual floppies…
2326 </summary>
2327
2328 <category term="Ansi Art" scheme="https://www.cambus.net…
2329 <category term="DOS" scheme="https://www.cambus.net/cate…
2330 </entry>
2331 <entry>
2332 <title><![CDATA[OpenBSD framebuffer console and custom color pal…
2333 <link href="https://www.cambus.net/openbsd-framebuffer-c…
2334 <id>https://www.cambus.net/openbsd-framebuffer-console-a…
2335 <published>2020-06-06T16:33:00Z</published>
2336 <updated>2020-06-06T16:33:00Z</updated>
2337 <content type="html"><![CDATA[<p>On framebuffer consoles…
2338 imported from NetBSD in March 2001.</p>
2339
2340 <p>The RGB values for the ANSI color palette in rasops have been chosen …
2341 match the ones in Open Firmware, and are different from those in the VGA
2342 text mode color palette.</p>
2343
2344 <p>Rasops palette:</p>
2345
2346 <p><img src="/content/2020/06/rasops-palette.png" alt="Rasops palette" /…
2347
2348 <p>VGA text mode palette:</p>
2349
2350 <p><img src="/content/2020/06/vga-palette.png" alt="VGA text mode palett…
2351
2352 <p>As one can see, the difference is quite significant, and decades of e…
2353 to MS-DOS and Linux consoles makes it quite difficult to adapt to a diff…
2354 palette.</p>
2355
2356 <p>RGB values for the ANSI color palette are defined in <strong>sys/dev/…
2357 and here are the proper ones to use to match the VGA text mode palette:<…
2358
2359 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
2360 #define NORMAL_RED 0xaa0000
2361 #define NORMAL_GREEN 0x00aa00
2362 #define NORMAL_BROWN 0xaa5500
2363 #define NORMAL_BLUE 0x0000aa
2364 #define NORMAL_MAGENTA 0xaa00aa
2365 #define NORMAL_CYAN 0x00aaaa
2366 #define NORMAL_WHITE 0xaaaaaa
2367 </span>
2368 <span class="cp">#define HILITE_BLACK 0x555555
2369 #define HILITE_RED 0xff5555
2370 #define HILITE_GREEN 0x55ff55
2371 #define HILITE_BROWN 0xffff55
2372 #define HILITE_BLUE 0x5555ff
2373 #define HILITE_MAGENTA 0xff55ff
2374 #define HILITE_CYAN 0x55ffff
2375 #define HILITE_WHITE 0xffffff
2376 </span></code></pre></div></div>
2377
2378 <p>And here is a <a href="/files/openbsd/rasops-palette.diff">diff</a> d…
2379 <a href="https://marc.info/?l=openbsd-tech&amp;m=148374502927423&amp;w=2…
2380
2381 <p><strong>EDIT:</strong> The enthusiasm around this article led me to m…
2382 which didn't fare any better.</p>
2383
2384 ]]></content>
2385 <summary type="html">
2386 <![CDATA[Some notes on how Use proper RGB values…
2387 </summary>
2388
2389 <category term="OpenBSD" scheme="https://www.cambus.net/…
2390 </entry>
2391 <entry>
2392 <title><![CDATA[OpenBSD/armv7 on the CubieBoard2]]></title>
2393 <link href="https://www.cambus.net/openbsd-armv7-on-the-…
2394 <id>https://www.cambus.net/openbsd-armv7-on-the-cubieboa…
2395 <published>2020-05-27T22:39:00Z</published>
2396 <updated>2020-05-27T22:39:00Z</updated>
2397 <content type="html"><![CDATA[<p>I bought the <a href="h…
2398 on it, but because of various reliability issues with the onboard NIC,
2399 it ended up <a href="/netbsd-on-the-cubieboard2/">running NetBSD</a> for…
2400 drawer.</p>
2401
2402 <p>Back in October, Mark Kettenis committed code to allow switching to t…
2403 framebuffer "glass" console in the bootloader on OpenBSD/armv7, making
2404 it possible to install the system without using a serial cable.</p>
2405
2406 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2407 boot&gt; <span class="nb">set tty </span>fb0
2408 switching console to fb0
2409 </code></pre></div></div>
2410
2411 <p>This prompted me to plug the board again, and having support for the
2412 framebuffer console is a game changer. It also allows running Xenocara,
2413 if that's your thing.</p>
2414
2415 <p><img src="/content/2021/03/cubieboard2.jpg" alt="Cubieboard2" title="…
2416
2417 <p>Here is the output of running <em>file</em> on executables:</p>
2418
2419 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2420 </code></pre></div></div>
2421
2422 <p>And this is the result of the <strong>md5 -t</strong> benchmark:</p>
2423
2424 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2425 Digest <span class="o">=</span> 52e5f9c9e6f656f3e1800dfa5579d089
2426 Time <span class="o">=</span> 1.340000 seconds
2427 Speed <span class="o">=</span> 74626865.671642 bytes/second
2428 </code></pre></div></div>
2429
2430 <p>For the record, LibreSSL speed benchmark results are available
2431 <a href="/files/openbsd/openssl-speed-cubieboard2.txt">here</a>.</p>
2432
2433 <p>System message buffer (dmesg output):</p>
2434
2435 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2436 [email protected]:/usr/src/sys/arch/armv7/compile/GENERIC
2437 real mem <span class="o">=</span> 964190208 <span class="o">(</span>919…
2438 avail mem <span class="o">=</span> 935088128 <span class="o">(</span>891…
2439 random: good seed from bootblocks
2440 mainbus0 at root: Cubietech Cubieboard2
2441 cpu0 at mainbus0 mpidr 0: ARM Cortex-A7 r0p4
2442 cpu0: 32KB 32b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
2443 cpu0: 256KB 64b/line 8-way L2 cache
2444 cortex0 at mainbus0
2445 psci0 at mainbus0: PSCI 0.0
2446 sxiccmu0 at mainbus0
2447 agtimer0 at mainbus0: tick rate 24000 KHz
2448 simplebus0 at mainbus0: <span class="s2">"soc"</span>
2449 sxiccmu1 at simplebus0
2450 sxipio0 at simplebus0: 175 pins
2451 sxirtc0 at simplebus0
2452 sxisid0 at simplebus0
2453 ampintc0 at simplebus0 nirq 160, ncpu 2: <span class="s2">"interrupt-con…
2454 <span class="s2">"system-control"</span> at simplebus0 not configured
2455 <span class="s2">"interrupt-controller"</span> at simplebus0 not configu…
2456 <span class="s2">"dma-controller"</span> at simplebus0 not configured
2457 <span class="s2">"lcd-controller"</span> at simplebus0 not configured
2458 <span class="s2">"lcd-controller"</span> at simplebus0 not configured
2459 <span class="s2">"video-codec"</span> at simplebus0 not configured
2460 sximmc0 at simplebus0
2461 sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
2462 <span class="s2">"usb"</span> at simplebus0 not configured
2463 <span class="s2">"phy"</span> at simplebus0 not configured
2464 ehci0 at simplebus0
2465 usb0 at ehci0: USB revision 2.0
2466 uhub0 at usb0 configuration 1 interface 0 <span class="s2">"Generic EHCI…
2467 ohci0 at simplebus0: version 1.0
2468 <span class="s2">"crypto-engine"</span> at simplebus0 not configured
2469 <span class="s2">"hdmi"</span> at simplebus0 not configured
2470 sxiahci0 at simplebus0: AHCI 1.1
2471 scsibus0 at sxiahci0: 32 targets
2472 ehci1 at simplebus0
2473 usb1 at ehci1: USB revision 2.0
2474 uhub1 at usb1 configuration 1 interface 0 <span class="s2">"Generic EHCI…
2475 ohci1 at simplebus0: version 1.0
2476 <span class="s2">"timer"</span> at simplebus0 not configured
2477 sxidog0 at simplebus0
2478 <span class="s2">"ir"</span> at simplebus0 not configured
2479 <span class="s2">"codec"</span> at simplebus0 not configured
2480 sxits0 at simplebus0
2481 com0 at simplebus0: ns16550, no working fifo
2482 sxitwi0 at simplebus0
2483 iic0 at sxitwi0
2484 axppmic0 at iic0 addr 0x34: AXP209
2485 sxitwi1 at simplebus0
2486 iic1 at sxitwi1
2487 <span class="s2">"gpu"</span> at simplebus0 not configured
2488 dwge0 at simplebus0: address 02:0a:09:03:27:08
2489 rlphy0 at dwge0 phy 1: RTL8201L 10/100 PHY, rev. 1
2490 <span class="s2">"hstimer"</span> at simplebus0 not configured
2491 <span class="s2">"display-frontend"</span> at simplebus0 not configured
2492 <span class="s2">"display-frontend"</span> at simplebus0 not configured
2493 <span class="s2">"display-backend"</span> at simplebus0 not configured
2494 <span class="s2">"display-backend"</span> at simplebus0 not configured
2495 gpio0 at sxipio0: 32 pins
2496 gpio1 at sxipio0: 32 pins
2497 gpio2 at sxipio0: 32 pins
2498 gpio3 at sxipio0: 32 pins
2499 gpio4 at sxipio0: 32 pins
2500 gpio5 at sxipio0: 32 pins
2501 gpio6 at sxipio0: 32 pins
2502 gpio7 at sxipio0: 32 pins
2503 gpio8 at sxipio0: 32 pins
2504 usb2 at ohci0: USB revision 1.0
2505 uhub2 at usb2 configuration 1 interface 0 <span class="s2">"Generic OHCI…
2506 usb3 at ohci1: USB revision 1.0
2507 uhub3 at usb3 configuration 1 interface 0 <span class="s2">"Generic OHCI…
2508 simplefb0 at mainbus0: 1920x1080, 32bpp
2509 wsdisplay0 at simplefb0 mux 1: console <span class="o">(</span>std, vt10…
2510 scsibus1 at sdmmc0: 2 targets, initiator 0
2511 sd0 at scsibus1 targ 1 lun 0: &lt;SD/MMC, SC64G, 0080&gt; removable
2512 sd0: 60906MB, 512 bytes/sector, 124735488 sectors
2513 uhidev0 at uhub2 port 1 configuration 1 interface 0 <span class="s2">"Le…
2514 uhidev0: iclass 3/1
2515 ukbd0 at uhidev0: 8 variable keys, 6 key codes
2516 wskbd0 at ukbd0: console keyboard, using wsdisplay0
2517 uhidev1 at uhub2 port 1 configuration 1 interface 1 <span class="s2">"Le…
2518 uhidev1: iclass 3/1, 22 report ids
2519 ums0 at uhidev1 reportid 1: 5 buttons, Z and W <span class="nb">dir
2520 </span>wsmouse0 at ums0 mux 0
2521 uhid0 at uhidev1 reportid 16: <span class="nv">input</span><span class="…
2522 uhid1 at uhidev1 reportid 17: <span class="nv">input</span><span class="…
2523 uhid2 at uhidev1 reportid 19: <span class="nv">input</span><span class="…
2524 uhid3 at uhidev1 reportid 21: <span class="nv">input</span><span class="…
2525 uhid4 at uhidev1 reportid 22: <span class="nv">input</span><span class="…
2526 vscsi0 at root
2527 scsibus2 at vscsi0: 256 targets
2528 softraid0 at root
2529 scsibus3 at softraid0: 256 targets
2530 bootfile: sd0a:/bsd
2531 boot device: sd0
2532 root on sd0a <span class="o">(</span>f7b555b0fa0e8c49.a<span class="o">)…
2533 </code></pre></div></div>
2534
2535 <p>Sensors output:</p>
2536
2537 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2538 hw.sensors.sxits0.temp0<span class="o">=</span>39.50 degC
2539 hw.sensors.axppmic0.temp0<span class="o">=</span>30.00 degC
2540 hw.sensors.axppmic0.volt0<span class="o">=</span>4.95 VDC <span class="o…
2541 hw.sensors.axppmic0.volt1<span class="o">=</span>0.03 VDC <span class="o…
2542 hw.sensors.axppmic0.volt2<span class="o">=</span>4.85 VDC <span class="o…
2543 hw.sensors.axppmic0.current0<span class="o">=</span>0.11 A <span class="…
2544 hw.sensors.axppmic0.current1<span class="o">=</span>0.00 A <span class="…
2545 hw.sensors.axppmic0.indicator0<span class="o">=</span>On <span class="o"…
2546 hw.sensors.axppmic0.indicator1<span class="o">=</span>Off <span class="o…
2547 </code></pre></div></div>
2548
2549 ]]></content>
2550 <summary type="html">
2551 <![CDATA[Some notes on installing and running Op…
2552 </summary>
2553
2554 <category term="OpenBSD" scheme="https://www.cambus.net/…
2555 <category term="ARM" scheme="https://www.cambus.net/cate…
2556 </entry>
2557 <entry>
2558 <title><![CDATA[Chinese BBSes and Unicode ANSi Art]]></title>
2559 <link href="https://www.cambus.net/chinese-bbses-and-uni…
2560 <id>https://www.cambus.net/chinese-bbses-and-unicode-ans…
2561 <published>2020-04-14T20:50:00Z</published>
2562 <updated>2020-04-14T20:50:00Z</updated>
2563 <content type="html"><![CDATA[<p>After doing my series o…
2564 <a href="/taiwanese-bbses-and-unicode-ansi-art-part-ii/">second part</a>…
2565 screenshots from two Chinese BBS systems, but only found those files
2566 again recently.</p>
2567
2568 <p>Those screens were captured in March 2013 and cover <strong>Lilac</st…
2569 systems. While I could not find much English information about Lilac, wh…
2570 seems to be located in Hong Kong, there is a Wikipedia page about
2571 <a href="https://en.wikipedia.org/wiki/SMTH_BBS">SMTH</a> which appears …
2572 a complicated history.</p>
2573
2574 <p>Lilac Login Screen:</p>
2575
2576 <p><img src="/content/2020/04/lilac-login.png" alt="Lilac" /></p>
2577
2578 <p>Lilac Main Menu Screens:</p>
2579
2580 <p><img src="/content/2020/04/lilac-mainmenu01.png" alt="Lilac" /></p>
2581
2582 <p><img src="/content/2020/04/lilac-mainmenu02.png" alt="Lilac" /></p>
2583
2584 <p>Lilac Goodbye Screens:</p>
2585
2586 <p><img src="/content/2020/04/lilac-goodbye01.png" alt="Lilac" /></p>
2587
2588 <p><img src="/content/2020/04/lilac-goodbye02.png" alt="Lilac" /></p>
2589
2590 <p><img src="/content/2020/04/lilac-goodbye03.png" alt="Lilac" /></p>
2591
2592 <p>NewSMTH Welcome Screens:</p>
2593
2594 <p><img src="/content/2020/04/newsmth-welcome01.png" alt="NewSMTH" /></p>
2595
2596 <p><img src="/content/2020/04/newsmth-welcome02.png" alt="NewSMTH" /></p>
2597
2598 <p>NewSMTH Login Screen:</p>
2599
2600 <p><img src="/content/2020/04/newsmth-login.png" alt="NewSMTH" /></p>
2601
2602 <p>NewSMTH Main Menu Screens:</p>
2603
2604 <p><img src="/content/2020/04/newsmth-mainmenu01.png" alt="NewSMTH" /></…
2605
2606 <p><img src="/content/2020/04/newsmth-mainmenu02.png" alt="NewSMTH" /></…
2607
2608 <p><img src="/content/2020/04/newsmth-mainmenu03.png" alt="NewSMTH" /></…
2609
2610 <p><img src="/content/2020/04/newsmth-mainmenu04.png" alt="NewSMTH" /></…
2611
2612 <p><img src="/content/2020/04/newsmth-mainmenu05.png" alt="NewSMTH" /></…
2613
2614 <p><img src="/content/2020/04/newsmth-mainmenu06.png" alt="NewSMTH" /></…
2615
2616 <p>NewSMTH Goodbye Screens:</p>
2617
2618 <p><img src="/content/2020/04/newsmth-goodbye.png" alt="NewSMTH" /></p>
2619 ]]></content>
2620 <summary type="html">
2621 <![CDATA[ANSI screens from Chinese BBSes]]>
2622 </summary>
2623
2624 <category term="Ansi Art" scheme="https://www.cambus.net…
2625 </entry>
2626 <entry>
2627 <title><![CDATA[My OpenBSD commits]]></title>
2628 <link href="https://www.cambus.net/my-openbsd-commits/"/>
2629 <id>https://www.cambus.net/my-openbsd-commits/</id>
2630 <published>2019-08-31T17:45:00Z</published>
2631 <updated>2019-08-31T17:45:00Z</updated>
2632 <content type="html"><![CDATA[<p>Today marks my three ye…
2633 commit bit on August 31th 2016 during the g2k16 hackathon in Cambridge, …
2634
2635 <p>A few months ago, I came across a Perl <a href="https://gist.github.c…
2636 commit time distribution ASCII graphs from a Git repository, and I final…
2637 have a good pretext to run it :-)</p>
2638
2639 <p>As of this day, I have done 749 commits to OpenBSD, in the following
2640 repositories: src (<a href="https://www.freshbsd.org/search?project=open…
2641
2642 <p>Commits in the src repository:</p>
2643
2644 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2645 01 - 0
2646 02 - 0
2647 03 - 0
2648 04 - 0
2649 05 - 0
2650 06 - 1 <span class="k">***</span>
2651 07 - 4 <span class="k">**************</span>
2652 08 - 8 <span class="k">****************************</span>
2653 09 - 9 <span class="k">********************************</span>
2654 10 - 13 <span class="k">**********************************************…
2655 11 - 9 <span class="k">********************************</span>
2656 12 - 10 <span class="k">***********************************</span>
2657 13 - 11 <span class="k">***************************************</span>
2658 14 - 13 <span class="k">**********************************************…
2659 15 - 4 <span class="k">**************</span>
2660 16 - 5 <span class="k">*****************</span>
2661 17 - 6 <span class="k">*********************</span>
2662 18 - 4 <span class="k">**************</span>
2663 19 - 9 <span class="k">********************************</span>
2664 20 - 14 <span class="k">**********************************************…
2665 21 - 4 <span class="k">**************</span>
2666 22 - 3 <span class="k">**********</span>
2667 23 - 0
2668 </code></pre></div></div>
2669
2670 <p>Commits in the ports repository:</p>
2671
2672 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2673 01 - 0
2674 02 - 0
2675 03 - 0
2676 04 - 0
2677 05 - 2 <span class="k">*</span>
2678 06 - 14 <span class="k">**********</span>
2679 07 - 32 <span class="k">***********************</span>
2680 08 - 34 <span class="k">*************************</span>
2681 09 - 67 <span class="k">**********************************************…
2682 10 - 46 <span class="k">**********************************</span>
2683 11 - 53 <span class="k">***************************************</span>
2684 12 - 40 <span class="k">*****************************</span>
2685 13 - 38 <span class="k">****************************</span>
2686 14 - 34 <span class="k">*************************</span>
2687 15 - 34 <span class="k">*************************</span>
2688 16 - 35 <span class="k">**************************</span>
2689 17 - 20 <span class="k">**************</span>
2690 18 - 15 <span class="k">***********</span>
2691 19 - 24 <span class="k">*****************</span>
2692 20 - 34 <span class="k">*************************</span>
2693 21 - 43 <span class="k">********************************</span>
2694 22 - 19 <span class="k">**************</span>
2695 23 - 11 <span class="k">********</span>
2696 </code></pre></div></div>
2697
2698 <p>Commits in the www repository:</p>
2699
2700 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2701 01 - 0
2702 02 - 0
2703 03 - 0
2704 04 - 0
2705 05 - 0
2706 06 - 0
2707 07 - 1 <span class="k">************</span>
2708 08 - 0
2709 09 - 3 <span class="k">*************************************</span>
2710 10 - 2 <span class="k">*************************</span>
2711 11 - 4 <span class="k">**********************************************…
2712 12 - 0
2713 13 - 2 <span class="k">*************************</span>
2714 14 - 1 <span class="k">************</span>
2715 15 - 1 <span class="k">************</span>
2716 16 - 1 <span class="k">************</span>
2717 17 - 1 <span class="k">************</span>
2718 18 - 1 <span class="k">************</span>
2719 19 - 3 <span class="k">*************************************</span>
2720 20 - 3 <span class="k">*************************************</span>
2721 21 - 1 <span class="k">************</span>
2722 22 - 0
2723 23 - 0
2724 </code></pre></div></div>
2725
2726 <p>Commits in the xenocara repository:</p>
2727
2728 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2729 01 - 0
2730 02 - 0
2731 03 - 0
2732 04 - 0
2733 05 - 0
2734 06 - 0
2735 07 - 0
2736 08 - 0
2737 09 - 0
2738 10 - 0
2739 11 - 0
2740 12 - 0
2741 13 - 0
2742 14 - 1 <span class="k">**********************************************…
2743 15 - 0
2744 16 - 0
2745 17 - 0
2746 18 - 0
2747 19 - 0
2748 20 - 0
2749 21 - 1 <span class="k">**********************************************…
2750 22 - 0
2751 23 - 0
2752 </code></pre></div></div>
2753
2754 ]]></content>
2755 <summary type="html">
2756 <![CDATA[My OpenBSD commits time distribution AS…
2757 </summary>
2758
2759 <category term="OpenBSD" scheme="https://www.cambus.net/…
2760 </entry>
2761 <entry>
2762 <title><![CDATA[Fuzzing DNS zone parsers]]></title>
2763 <link href="https://www.cambus.net/fuzzing-dns-zone-pars…
2764 <id>https://www.cambus.net/fuzzing-dns-zone-parsers/</id>
2765 <published>2019-07-11T13:00:00Z</published>
2766 <updated>2019-07-11T13:00:00Z</updated>
2767 <content type="html"><![CDATA[<p>In my never-ending ques…
2768 using AFL to fuzz <a href="https://github.com/fcambus/statzone">statzone…
2769 statistics on <a href="https://www.statdns.com">StatDNS</a>. It helped m…
2770 dereference.</p>
2771
2772 <p>I initially used the <strong>.arpa</strong> zone file as input, but t…
2773 OpenDNSSEC bundles a <a href="https://raw.githubusercontent.com/opendnss…
2774 lot of seldom used resource records types, and decided to use this one t…
2775
2776 <p>Out of curiosity, I decided to try fuzzing other DNS zone parsers. I …
2777 with validns 0.8, and within seconds the fuzzer found <a href="https://g…
2778 dereferences</a>.</p>
2779
2780 <p><img src="/content/2019/07/validns.png" alt="validns" /></p>
2781
2782 <p>The first occurrence happens in the name2findable_name() function, an…
2783 triggered with the following input:</p>
2784
2785 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2786 arpa. 86400 IN RRSIG SOA 8 1 86400 2019022800…
2787 </code></pre></div></div>
2788
2789 <p>With the above input, the following call to strlen(3) in rr.c results…
2790 NULL pointer dereference because 's' ends up being NULL:</p>
2791
2792 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
2793 <span class="p">{</span>
2794 <span class="kt">int</span> <span class="n">l</span> <span class="o"…
2795 </code></pre></div></div>
2796
2797 <p>The second occurrence happens in the nsec_validate_pass2() function, …
2798 be triggered with the following input:</p>
2799
2800 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2801 arpa. 86400 IN NSEC a
2802 </code></pre></div></div>
2803
2804 <p>With the above input, the following call to strcasecmp(3) in rr.c res…
2805 in a NULL pointer dereference because 'rr-&gt;next_domain' ends up being…
2806
2807 <div class="language-c highlighter-rouge"><div class="highlight"><pre cl…
2808 </code></pre></div></div>
2809
2810 <p>Given those encouraging results, I went on to fuzz BIND, NSD and Knot
2811 zone parsers, using their zone validation tools <strong>named-checkzone<…
2812 <strong>nsd-checkzone</strong>, and <strong>kzonecheck</strong> respecti…
2813
2814 <p>While the fuzzers didn't produce any crash for BIND and Knot after ru…
2815 for 3 days and 11 hours, they did produce some valid ones for NSD, and I
2816 decided to continue on <strong>nsd-checkzone</strong> and stop the other…
2817
2818 <p><img src="/content/2019/07/nsd-checkzone01.png" alt="nsd-checkzone" /…
2819
2820 <p>I let AFL complete one cycle, and as I didn't need the box for anythi…
2821 at this time, I decided to let it run for a few more days. I ended the p…
2822 after 16 days and 19 hours, completing 2 cycles with 167 unique crashes.…
2823
2824 <p><img src="/content/2019/07/nsd-checkzone02.png" alt="nsd-checkzone" /…
2825
2826 <p>After sorting and analyzing the crashes, I had two valid issues to re…
2827
2828 <p>The first one is an <a href="https://github.com/NLnetLabs/nsd/issues/…
2829 of array index, in the rdata_maximum_wireformat_size() function, in rdat…
2830
2831 <p>The second one is a <a href="https://github.com/NLnetLabs/nsd/issues/…
2832 function in dname.c, which got assigned <a href="https://cve.mitre.org/c…
2833
2834 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2835 <span class="o">==</span><span class="nv">7395</span><span class="o">==<…
2836 WRITE of size 8 at 0x7ffcd6a9763f thread T0
2837 <span class="c">#0 0x4dadbb in __asan_memcpy (/home/fcambus/nsd/nsd-…
2838 <span class="c">#1 0x534251 in dname_concatenate /home/fcambus/nsd/d…
2839 <span class="c">#2 0x69e61f in yyparse /home/fcambus/nsd/./zparser.y…
2840 <span class="c">#3 0x689fd1 in zonec_read /home/fcambus/nsd/zonec.c:…
2841 <span class="c">#4 0x6aedd1 in check_zone /home/fcambus/nsd/nsd-chec…
2842 <span class="c">#5 0x6aea07 in main /home/fcambus/nsd/nsd-checkzone.…
2843 <span class="c">#6 0x7fa60ece6b96 in __libc_start_main /build/glibc-…
2844 <span class="c">#7 0x41c1d9 in _start (/home/fcambus/nsd/nsd-checkzo…
2845
2846 Address 0x7ffcd6a9763f is located <span class="k">in </span>stack of thr…
2847 <span class="c">#0 0x533f8f in dname_concatenate /home/fcambus/nsd/d…
2848
2849 This frame has 1 object<span class="o">(</span>s<span class="o">)</spa…
2850 <span class="o">[</span>32, 287<span class="o">)</span> <span class=…
2851 HINT: this may be a <span class="nb">false </span>positive <span class="…
2852 <span class="o">(</span>longjmp and C++ exceptions <span class="k"…
2853 SUMMARY: AddressSanitizer: stack-buffer-overflow <span class="o">(</span…
2854 Shadow bytes around the buggy address:
2855 0x10001ad4ae70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2856 0x10001ad4ae80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2857 0x10001ad4ae90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2858 0x10001ad4aea0: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00
2859 0x10001ad4aeb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2860 <span class="o">=&gt;</span>0x10001ad4aec0: 00 00 00 00 00 00 00[07]f3 f…
2861 0x10001ad4aed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2862 0x10001ad4aee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2863 0x10001ad4aef0: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00
2864 0x10001ad4af00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2865 0x10001ad4af10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2866 Shadow byte legend <span class="o">(</span>one shadow byte represents 8 …
2867 Addressable: 00
2868 Partially addressable: 01 02 03 04 05 06 07
2869 Heap left redzone: fa
2870 Freed heap region: fd
2871 Stack left redzone: f1
2872 Stack mid redzone: f2
2873 Stack right redzone: f3
2874 Stack after <span class="k">return</span>: f5
2875 Stack use after scope: f8
2876 Global redzone: f9
2877 Global init order: f6
2878 Poisoned by user: f7
2879 Container overflow: <span class="nb">fc
2880 </span>Array cookie: ac
2881 Intra object redzone: bb
2882 ASan internal: fe
2883 Left alloca redzone: ca
2884 Right alloca redzone: cb
2885 <span class="o">==</span><span class="nv">7395</span><span class="o">==<…
2886 </code></pre></div></div>
2887
2888 <p>Both issues have been fixed and will be part of the <a href="https://…
2889
2890 <p>I also fuzzed ldns using <strong>ldns-read-zone</strong> for 12 days …
2891 the only crashes it produced were in fact only triggering assertions.</p>
2892
2893 <p>It's been an interesting journey so far, and while finding issues is …
2894 relatively easy, time required to sort crashes and distinguish between v…
2895 duplicates, and false positives takes a lot of time. Nonetheless, readin…
2896 party source code and analyzing what is going on and why the program cra…
2897 is both very instructing and rewarding.</p>
2898
2899 <p>For the time being, I plan to continue fuzzing stuff and will write m…
2900 about my findings.</p>
2901
2902 ]]></content>
2903 <summary type="html">
2904 <![CDATA[Reflections on fuzzing several DNS zone…
2905 </summary>
2906
2907 <category term="DNS" scheme="https://www.cambus.net/cate…
2908 <category term="Security" scheme="https://www.cambus.net…
2909 </entry>
2910 <entry>
2911 <title><![CDATA[Running a free public API, a post-mortem]]></tit…
2912 <link href="https://www.cambus.net/running-a-free-public…
2913 <id>https://www.cambus.net/running-a-free-public-api-a-p…
2914 <published>2018-11-30T22:29:00Z</published>
2915 <updated>2018-11-30T22:29:00Z</updated>
2916 <content type="html"><![CDATA[<p>It's been a little bit …
2917 permanently shut down on November 15th, 2015. I have previously written
2918 about the <a href="https://www.cambus.net/adventures-in-running-a-free-p…
2919 the API.</p>
2920
2921 <p>Before shutting down the public API of <a href="https://www.telize.co…
2922 launched on Mashape to ease the transition for those who couldn't host t…
2923 own instances. The Mashape API Marketplace became a part of RapidAPI last
2924 year, the service is still running and will keep doing so for the forese…
2925 future. You can support my work on Telize by <a href="https://rapidapi.c…
2926
2927 <p>While a small fraction of the userbase switched to the paid API, the …
2928 majority didn't, and the number of requests exploded due to retries, as
2929 detailed in the article about the API decommission. One thing I wondered
2930 at the time was how long it would take for the traffic to become negligi…
2931 The Internet is a very strange place and things can go unnoticed for a v…
2932 long time, years sometimes. Of course, Telize case is no exception.</p>
2933
2934 <p>Every year since the public API was closed down, I've been logging re…
2935 for a few days in a row to get a glimpse of how many of them were still …
2936 made. While the number of unique IP addresses querying the API kept decr…
2937 the amount of requests themselves went up again compared to last year.</…
2938
2939 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2940 2016-11-07 - Requests: 56,427,258 - Unique IPs: 2,756,065
2941 2016-11-08 - Requests: 53,641,121 - Unique IPs: 2,746,005
2942 2016-11-09 - Requests: 53,704,140 - Unique IPs: 2,536,632
2943 2016-11-10 - Requests: 53,194,946 - Unique IPs: 2,525,167
2944 2016-11-11 - Requests: 50,444,003 - Unique IPs: 2,652,730
2945 2016-11-12 - Requests: 49,224,863 - Unique IPs: 2,670,926
2946 2016-11-13 - Requests: 48,526,303 - Unique IPs: 2,492,765
2947 2017-11-10 - Requests: 35,325,037 - Unique IPs: 1,736,815
2948 2017-11-11 - Requests: 33,582,167 - Unique IPs: 1,613,161
2949 2017-11-12 - Requests: 33,334,836 - Unique IPs: 1,587,549
2950 2017-11-13 - Requests: 36,131,909 - Unique IPs: 1,593,255
2951 2017-11-14 - Requests: 34,457,433 - Unique IPs: 1,571,144
2952 2017-11-15 - Requests: 33,225,149 - Unique IPs: 1,563,845
2953 2018-11-12 - Requests: 50,612,559 - Unique IPs: 611,302
2954 2018-11-13 - Requests: 50,858,236 - Unique IPs: 640,836
2955 2018-11-14 - Requests: 51,991,454 - Unique IPs: 661,410
2956 2018-11-15 - Requests: 53,008,712 - Unique IPs: 689,646
2957 2018-11-16 - Requests: 51,651,814 - Unique IPs: 686,646
2958 2018-11-17 - Requests: 49,236,779 - Unique IPs: 662,717
2959 2018-11-18 - Requests: 47,237,596 - Unique IPs: 692,718
2960 2018-11-19 - Requests: 51,679,888 - Unique IPs: 735,396
2961 2018-11-20 - Requests: 50,245,134 - Unique IPs: 755,177
2962 2018-11-21 - Requests: 50,745,725 - Unique IPs: 773,949
2963 2018-11-22 - Requests: 50,609,750 - Unique IPs: 786,963
2964 2018-11-23 - Requests: 49,991,775 - Unique IPs: 687,652
2965 2018-11-24 - Requests: 47,479,703 - Unique IPs: 584,058
2966 2018-11-25 - Requests: 47,346,829 - Unique IPs: 597,153
2967 </code></pre></div></div>
2968
2969 <p>Bandwidth usage, measured with nload:</p>
2970
2971 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
2972
2973
2974
2975
2976
2977
2978 Curr…
2979 Avg:…
2980 <span class="nb">.</span> .... ... <span class="nb">.</span> …
2981 <span class="c">#########################|######################|#######…
2982 <span class="c">########################################################…
2983 Outgoing:
2984
2985
2986
2987
2988
2989
2990 Curr…
2991 Avg:…
2992 Min:…
2993 .... .. <span c…
2994 <span class="c">################################################|#######…
2995 </code></pre></div></div>
2996
2997 <p>So more than 3 years after the decommission, I'm still getting around…
2998 millions daily requests. I'm honestly quite astonished to notice that the
2999 numbers went up again significantly this year.</p>
3000
3001 <p>Below is a report of user agents which performed more than 1M daily r…
3002 on November 12th 2018, top offenders being Android applications and Word…
3003 sites… How surprising.</p>
3004
3005 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3006 Dalvik/2.1.0 1,113,530
3007 WordPress/4.2.21 3,200,750
3008 WordPress/4.1.24 2,223,350
3009 WordPress/4.3.17 1,212,849
3010 </code></pre></div></div>
3011
3012 <p>On a more positive note, those are recent Wordpress releases, which m…
3013 it might be possible to identify the plugins performing those requests
3014 and contact their authors.</p>
3015
3016 <p>Regarding the open source project itself, I released <a href="https:/…
3017 which is now using GeoIP2/GeoLite2 databases, as GeoIP/GeoLite databases…
3018 been <a href="https://support.maxmind.com/geolite-legacy-discontinuation…
3019 using <a href="https://kore.io">Kore</a>, which will bring in a couple o…
3020 the current version. I will write about the new iteration in a following…
3021
3022 ]]></content>
3023 <summary type="html">
3024 <![CDATA[Deprecating Telize free public API, an …
3025 </summary>
3026
3027 <category term="Miscellaneous" scheme="https://www.cambu…
3028 </entry>
3029 <entry>
3030 <title><![CDATA[OpenBSD/arm64 on the NanoPi NEO2]]></title>
3031 <link href="https://www.cambus.net/openbsd-arm64-on-the-…
3032 <id>https://www.cambus.net/openbsd-arm64-on-the-nanopi-n…
3033 <published>2018-11-13T11:20:00Z</published>
3034 <updated>2018-11-13T11:20:00Z</updated>
3035 <content type="html"><![CDATA[<p>I bought the <a href="h…
3036 been disappointed. It's a cute little board (40*40mm), which is to the b…
3037 of my knowledge the smallest possible device one can run OpenBSD on.</p>
3038
3039 <p><img src="/content/2021/02/nanopi-neo2.jpg" alt="NanoPi NEO2" title="…
3040
3041 <p>The CPU is a quad-core <strong>ARM Cortex-A53</strong> which is quite…
3042 GENERIC.MP kernel build taking 15 minutes. On the downside, the board on…
3043 has 512MB of RAM.</p>
3044
3045 <p>An USB to TTL serial cable is required to <a href="http://wiki.friend…
3046 perform installation. The system doesn't have a supported miniroot so
3047 the preparation steps detailed in the <strong>INSTALL.arm64</strong> fil…
3048 performed to get a working installation image.</p>
3049
3050 <p>The following packages need to be installed:</p>
3051
3052 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3053 </code></pre></div></div>
3054
3055 <p>After writing the miniroot image to an SD card, the correct <strong>D…
3056 should be copied:</p>
3057
3058 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3059 <span class="nb">mkdir</span> /mnt/allwinner
3060 <span class="nb">cp</span> /usr/local/share/dtb/arm64/allwinner/sun50i-h…
3061 umount /mnt
3062 </code></pre></div></div>
3063
3064 <p>Lastly, the correct <strong>U-Boot image</strong> should be written:<…
3065
3066 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3067 </code></pre></div></div>
3068
3069 <p>After performing the installation process, the DTB should be copied a…
3070 to the SD card before attempting to boot the system.</p>
3071
3072 <p>Here is the output of running <em>file</em> on executables:</p>
3073
3074 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3075 </code></pre></div></div>
3076
3077 <p>And this is the result of the <strong>md5 -t</strong> benchmark:</p>
3078
3079 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3080 Digest <span class="o">=</span> 52e5f9c9e6f656f3e1800dfa5579d089
3081 Time <span class="o">=</span> 1.070000 seconds
3082 Speed <span class="o">=</span> 93457943.925234 bytes/second
3083 </code></pre></div></div>
3084
3085 <p>For the record, LibreSSL speed benchmark results are available
3086 <a href="/files/openbsd/openssl-speed-nanopi-neo2.txt">here</a>.</p>
3087
3088 <p>System message buffer (dmesg output):</p>
3089
3090 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3091 [email protected]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
3092 real mem <span class="o">=</span> 407707648 <span class="o">(</span>388…
3093 avail mem <span class="o">=</span> 367030272 <span class="o">(</span>350…
3094 mainbus0 at root: FriendlyARM NanoPi NEO 2
3095 cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
3096 cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
3097 cpu0: 512KB 64b/line 16-way L2 cache
3098 efi0 at mainbus0: UEFI 2.7
3099 efi0: Das U-Boot rev 0x0
3100 sxiccmu0 at mainbus0
3101 psci0 at mainbus0: PSCI 0.2
3102 simplebus0 at mainbus0: <span class="s2">"soc"</span>
3103 syscon0 at simplebus0: <span class="s2">"syscon"</span>
3104 sxiccmu1 at simplebus0
3105 sxipio0 at simplebus0: 94 pins
3106 ampintc0 at simplebus0 nirq 224, ncpu 4 ipi: 0, 1: <span class="s2">"int…
3107 sxiccmu2 at simplebus0
3108 sxipio1 at simplebus0: 12 pins
3109 sximmc0 at simplebus0
3110 sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
3111 ehci0 at simplebus0
3112 usb0 at ehci0: USB revision 2.0
3113 uhub0 at usb0 configuration 1 interface 0 <span class="s2">"Generic EHCI…
3114 ehci1 at simplebus0
3115 usb1 at ehci1: USB revision 2.0
3116 uhub1 at usb1 configuration 1 interface 0 <span class="s2">"Generic EHCI…
3117 dwxe0 at simplebus0: address 02:01:f7:f9:2f:67
3118 rgephy0 at dwxe0 phy 7: RTL8169S/8110S/8211 PHY, rev. 5
3119 com0 at simplebus0: ns16550, no working fifo
3120 com0: console
3121 sxirtc0 at simplebus0
3122 gpio0 at sxipio0: 32 pins
3123 gpio1 at sxipio0: 32 pins
3124 gpio2 at sxipio0: 32 pins
3125 gpio3 at sxipio0: 32 pins
3126 gpio4 at sxipio0: 32 pins
3127 gpio5 at sxipio0: 32 pins
3128 gpio6 at sxipio0: 32 pins
3129 gpio7 at sxipio1: 32 pins
3130 agtimer0 at mainbus0: tick rate 24000 KHz
3131 cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4
3132 cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
3133 cpu1: 512KB 64b/line 16-way L2 cache
3134 cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4
3135 cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
3136 cpu2: 512KB 64b/line 16-way L2 cache
3137 cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4
3138 cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
3139 cpu3: 512KB 64b/line 16-way L2 cache
3140 scsibus0 at sdmmc0: 2 targets, initiator 0
3141 sd0 at scsibus0 targ 1 lun 0: &lt;SD/MMC, SC64G, 0080&gt; SCSI2 0/direct…
3142 sd0: 60906MB, 512 bytes/sector, 124735488 sectors
3143 vscsi0 at root
3144 scsibus1 at vscsi0: 256 targets
3145 softraid0 at root
3146 scsibus2 at softraid0: 256 targets
3147 bootfile: sd0a:/bsd
3148 boot device: sd0
3149 root on sd0a <span class="o">(</span>1fbfe51d132e41c0.a<span class="o">)…
3150 </code></pre></div></div>
3151
3152 ]]></content>
3153 <summary type="html">
3154 <![CDATA[Running the OpenBSD/arm64 port on the N…
3155 </summary>
3156
3157 <category term="OpenBSD" scheme="https://www.cambus.net/…
3158 <category term="ARM" scheme="https://www.cambus.net/cate…
3159 </entry>
3160 <entry>
3161 <title><![CDATA[Spleen - Monospaced bitmap fonts]]></title>
3162 <link href="https://www.cambus.net/spleen-monospaced-bit…
3163 <id>https://www.cambus.net/spleen-monospaced-bitmap-font…
3164 <published>2018-09-19T15:45:00Z</published>
3165 <updated>2018-09-19T15:45:00Z</updated>
3166 <content type="html"><![CDATA[<p>Spleen started as a per…
3167 imported <strong>ssdfb(4)</strong>, a driver for small <strong>OLED disp…
3168 needed a 5x8 font to be able to squeeze more columns and rows on those
3169 devices.</p>
3170
3171 <p>As someone spending most of his time in a terminal, I have been think…
3172 drawing my own font for a while, and this was the perfect opportunity.</…
3173
3174 <p>To be able to test character spacing and alignment, I started to use …
3175 in <strong>xterm</strong>, then a zoomed version, and one thing leading …
3176 started creating a 8x16 version, and then bigger versions based on it. S…
3177 is now available in 5 sizes: 5x8, 8x16, 12x24, 16x32, and 32x64.</p>
3178
3179 <p>Fonts are provided in the Glyph Bitmap Distribution Format (<strong>B…
3180 the <strong>.dfont</strong> format for Macintosh users. All sizes contai…
3181 characters, except for the 5x8 version which only contains printable ASC…
3182 characters.</p>
3183
3184 <p>The fonts are available on <a href="https://github.com/fcambus/spleen…
3185 to install and use them.</p>
3186
3187 <p>Here is a screenshot showing the 16x32 version displaying code:</p>
3188
3189 <p><img src="https://www.cambus.net/content/2018/09/spleen-hello.png" al…
3190
3191 <p>And again the 16x32 version showing prose:</p>
3192
3193 <p><img src="https://www.cambus.net/content/2018/09/spleen-etranger.png"…
3194
3195 <p>Looking ahead, my immediate plans are to continue improving glyphs th…
3196 as well as characters spacing and alignment. This comes through extensive
3197 everyday use of the various font sizes. Another short term goal is to add
3198 support for Central European languages, with Polish being the immediate
3199 priority.</p>
3200
3201 <p>Meanwhile, I'm working on getting packages created for operating syst…
3202 I just imported the OpenBSD port for Spleen this morning.</p>
3203
3204 ]]></content>
3205 <summary type="html">
3206 <![CDATA[Introducing Spleen, a monospaced bitmap…
3207 </summary>
3208
3209 <category term="Type Design" scheme="https://www.cambus.…
3210 </entry>
3211 <entry>
3212 <title><![CDATA[The future of VIA x86 processors]]></title>
3213 <link href="https://www.cambus.net/the-future-of-via-x86…
3214 <id>https://www.cambus.net/the-future-of-via-x86-process…
3215 <published>2018-07-30T18:08:00Z</published>
3216 <updated>2018-07-30T18:08:00Z</updated>
3217 <content type="html"><![CDATA[<p>I've been interested in…
3218 up with the <strong>Mini-ITX</strong> standard in the very early 2000s. …
3219 of bringing fanless and power-efficient designs to the x86 market was
3220 groundbreaking at the time.</p>
3221
3222 <p>VIA processors are designed by <strong>Centaur Technology</strong>, a…
3223 excellent documentary entitled "<a href="https://vimeo.com/ondemand/rise…
3224 history, which I really enjoyed watching.</p>
3225
3226 <p>It's unfortunately very difficult to find information about recent VI…
3227 CPUs. The VIA QuadCore, their latest one, was <a href="https://www.viate…
3228 and it remains an open question whether there will be newer ones or not,
3229 as the company seems to be focusing on the ARM architecture.</p>
3230
3231 <p>In fact, the status of VIA's x86 licensing agreement is quite unclear…
3232 was an <a href="https://www.ftc.gov/news-events/press-releases/2010/08/f…
3233 extension should be offered to VIA once the ongoing agreement would expi…
3234 in 2013, and that the agreement should be modified to allow VIA (among o…
3235 companies) to consider mergers or joint ventures. The latter being the w…
3236 VIA apparently took, which gave birth to <a href="http://www.zhaoxin.com…
3237
3238 <p>Some information in English about <strong>Zhaoxin x86 CPUs</strong> i…
3239 <a href="https://en.wikichip.org/wiki/zhaoxin">WikiChip</a>. However, th…
3240 For now?</p>
3241
3242 <p>Given the current state of affairs on the x86 market (Intel ME, AMD S…
3243 Technology, Meltdown, Spectre) and upcoming vulnerabilities announcements
3244 lurking on the horizon, there is definitely a spot for alternative x86
3245 processors.</p>
3246
3247 ]]></content>
3248 <summary type="html">
3249 <![CDATA[Past, present, and future of VIA x86 pr…
3250 </summary>
3251
3252 <category term="Hardware" scheme="https://www.cambus.net…
3253 </entry>
3254 <entry>
3255 <title><![CDATA[Oldest domains in the .com, .net, and .org TLDs]…
3256 <link href="https://www.cambus.net/oldest-domains-in-the…
3257 <id>https://www.cambus.net/oldest-domains-in-the-com-net…
3258 <published>2018-06-26T15:57:00Z</published>
3259 <updated>2018-06-26T15:57:00Z</updated>
3260 <content type="html"><![CDATA[<p>As someone interested i…
3261 enjoying facts and articles about early registered domain names. Wikiped…
3262 has a <a href="https://en.wikipedia.org/wiki/List_of_the_oldest_currentl…
3263 and .org domains.</p>
3264
3265 <p>Using the <strong>DDN NIC domain summaries</strong>, it shouldn't be …
3266 extract a list of domains, <strong>perform whois queries</strong> to get…
3267 dates, and sort the results. Let's find out.</p>
3268
3269 <p>For the record, the oldest issue I could find, dating from December 1…
3270 doesn't list nordu.net, the first .net domain ever registered. So I opted
3271 for the <a href="https://www.statdns.com/files/domain-info-19950813.txt"…
3272 find an issue from 1996, there are a lot more domains listed so the whois
3273 lookups would take a lot more time, for no evident benefit.</p>
3274
3275 <h3 id="preparing-the-domain-lists">Preparing the domain lists</h3>
3276
3277 <p>After manually splitting the file to get rid of the TLDs we are not i…
3278 in, we save them in a distinct file for each TLD.</p>
3279
3280 <p>Then, we need to process the lists so that each domain is on its own …
3281 we strip the eventual subdomains with rev using a neat trick:</p>
3282
3283 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3284 rev | <span class="nb">cut</span> <span class="nt">-d</span> <span c…
3285
3286 <span class="nb">tr</span> <span class="nt">-s</span> <span class="s2">"…
3287 rev | <span class="nb">cut</span> <span class="nt">-d</span> <span c…
3288
3289 <span class="nb">tr</span> <span class="nt">-s</span> <span class="s2">"…
3290 rev | <span class="nb">cut</span> <span class="nt">-d</span> <span c…
3291 </code></pre></div></div>
3292
3293 <h3 id="performing-whois-requests">Performing whois requests</h3>
3294
3295 <p>Internic whois server allows to query domains in the .com and .net TL…
3296 imposing any drastic rate limit, albeit slowly. As our corpus is rather …
3297 this isn't an issue.</p>
3298
3299 <p>Whois script for .com and .net domains:</p>
3300
3301 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3302 <span class="k">while </span><span class="nb">read </span>domain
3303 <span class="k">do
3304 </span><span class="nv">creation_date</span><span class="o">=</s…
3305 <span class="nb">grep</span> <span class="s2">" Creation D…
3306
3307 <span class="k">if</span> <span class="o">[</span> <span class="…
3308 </span><span class="nb">date</span><span class="o">=</sp…
3309 <span class="nb">echo</span> <span class="nv">$date</spa…
3310 <span class="k">fi</span>
3311
3312 <span class="c"># Wait one second to avoid triggering rate-limit…
3313 <span class="nb">sleep </span>1
3314 <span class="k">done</span> &lt; <span class="nv">$1</span>
3315 </code></pre></div></div>
3316
3317 <p>On the other hand, the Public Interest Registry whois server only all…
3318 queries per minute, so we have to sleep for a little while between each
3319 request.</p>
3320
3321 <p>Whois script for .org domains:</p>
3322
3323 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3324 <span class="k">while </span><span class="nb">read </span>domain
3325 <span class="k">do
3326 </span><span class="nv">creation_date</span><span class="o">=</s…
3327 <span class="nb">uniq</span> | <span class="nb">sed</span> <…
3328
3329 <span class="k">if</span> <span class="o">[</span> <span class="…
3330 </span><span class="nb">date</span><span class="o">=</sp…
3331 <span class="nb">echo</span> <span class="nv">$date</spa…
3332 <span class="k">fi</span>
3333
3334 <span class="c"># Wait thirty seconds to avoid triggering rate-l…
3335 <span class="nb">sleep </span>30
3336 <span class="k">done</span> &lt; <span class="nv">$1</span>
3337 </code></pre></div></div>
3338
3339 <p>We can now launch the scripts to perform whois requests:</p>
3340
3341 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3342 sh internic.sh net.txt <span class="o">&gt;</span> net.dates.txt
3343 sh pir.sh org.txt <span class="o">&gt;</span> org.dates.txt
3344 </code></pre></div></div>
3345
3346 <p>And finally sort results and keep the 100 oldest domains for each TLD…
3347
3348 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3349 <span class="nb">sort </span>net.dates.txt | <span class="nb">head</span…
3350 <span class="nb">sort </span>org.dates.txt | <span class="nb">head</span…
3351 </code></pre></div></div>
3352
3353 <h3 id="results">Results</h3>
3354
3355 <p>Oldest registered <strong>.com</strong> domains:</p>
3356
3357 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3358 1985-04-24 bbn.com
3359 1985-05-24 think.com
3360 1985-07-11 mcc.com
3361 1985-09-30 dec.com
3362 1985-11-07 northrop.com
3363 1986-01-09 xerox.com
3364 1986-01-17 sri.com
3365 1986-03-03 hp.com
3366 1986-03-05 bellcore.com
3367 1986-03-19 ibm.com
3368 1986-03-19 sun.com
3369 1986-03-25 intel.com
3370 1986-03-25 ti.com
3371 1986-04-25 att.com
3372 1986-05-08 gmr.com
3373 1986-05-08 tek.com
3374 1986-07-10 fmc.com
3375 1986-07-10 ub.com
3376 1986-08-05 bell-atl.com
3377 1986-08-05 ge.com
3378 1986-08-05 grebyn.com
3379 1986-08-05 isc.com
3380 1986-08-05 nsc.com
3381 1986-08-05 stargate.com
3382 1986-09-02 boeing.com
3383 1986-09-18 itcorp.com
3384 1986-09-29 siemens.com
3385 1986-10-18 pyramid.com
3386 1986-10-27 alphacdc.com
3387 1986-10-27 bdm.com
3388 1986-10-27 fluke.com
3389 1986-10-27 inmet.com
3390 1986-10-27 kesmai.com
3391 1986-10-27 mentor.com
3392 1986-10-27 nec.com
3393 1986-10-27 ray.com
3394 1986-10-27 rosemount.com
3395 1986-10-27 vortex.com
3396 1986-11-05 alcoa.com
3397 1986-11-05 gte.com
3398 1986-11-17 adobe.com
3399 1986-11-17 amd.com
3400 1986-11-17 das.com
3401 1986-11-17 data-io.com
3402 1986-11-17 octopus.com
3403 1986-11-17 portal.com
3404 1986-11-17 teltone.com
3405 1986-12-11 3com.com
3406 1986-12-11 amdahl.com
3407 1986-12-11 ccur.com
3408 1986-12-11 ci.com
3409 1986-12-11 convergent.com
3410 1986-12-11 dg.com
3411 1986-12-11 peregrine.com
3412 1986-12-11 quad.com
3413 1986-12-11 sq.com
3414 1986-12-11 tandy.com
3415 1986-12-11 tti.com
3416 1986-12-11 unisys.com
3417 1987-01-19 cgi.com
3418 1987-01-19 cts.com
3419 1987-01-19 spdcc.com
3420 1987-02-19 apple.com
3421 1987-03-04 nma.com
3422 1987-03-04 prime.com
3423 1987-04-04 philips.com
3424 1987-04-23 datacube.com
3425 1987-04-23 kai.com
3426 1987-04-23 tic.com
3427 1987-04-23 vine.com
3428 1987-04-30 ncr.com
3429 1987-05-14 cisco.com
3430 1987-05-14 rdl.com
3431 1987-05-20 slb.com
3432 1987-05-27 parcplace.com
3433 1987-05-27 utc.com
3434 1987-06-26 ide.com
3435 1987-07-09 trw.com
3436 1987-07-13 unipress.com
3437 1987-07-27 dupont.com
3438 1987-07-27 lockheed.com
3439 1987-07-28 rosetta.com
3440 1987-08-18 toad.com
3441 1987-08-31 quick.com
3442 1987-09-03 allied.com
3443 1987-09-03 dsc.com
3444 1987-09-03 sco.com
3445 1987-09-22 gene.com
3446 1987-09-22 kccs.com
3447 1987-09-22 spectra.com
3448 1987-09-22 wlk.com
3449 1987-09-30 mentat.com
3450 1987-10-14 wyse.com
3451 1987-11-02 cfg.com
3452 1987-11-09 marble.com
3453 1987-11-16 cayman.com
3454 1987-11-16 entity.com
3455 1987-11-24 ksr.com
3456 1987-11-30 nynexst.com
3457 </code></pre></div></div>
3458
3459 <p>Oldest registered <strong>.net</strong> domains:</p>
3460
3461 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3462 1986-04-01 broken.net
3463 1986-11-05 nsf.net
3464 1987-01-27 nyser.net
3465 1987-05-20 uu.net
3466 1987-07-21 sesqui.net
3467 1988-05-25 mr.net
3468 1988-06-09 oar.net
3469 1988-07-08 sura.net
3470 1988-09-07 the.net
3471 1988-09-16 nwnet.net
3472 1988-10-21 es.net
3473 1988-10-25 mid.net
3474 1989-01-04 barrnet.net
3475 1989-01-05 cic.net
3476 1989-01-27 hawaii.net
3477 1989-03-07 psi.net
3478 1989-03-27 near.net
3479 1989-04-11 eu.net
3480 1989-06-29 ln.net
3481 1989-09-12 sub.net
3482 1989-09-14 westnet.net
3483 1989-11-06 cypress.net
3484 1989-11-15 cerf.net
3485 1989-11-17 risq.net
3486 1990-02-09 ca.net
3487 1990-05-21 wiscnet.net
3488 1990-07-25 cent.net
3489 1990-07-26 alter.net
3490 1990-09-27 ans.net
3491 1990-11-07 mich.net
3492 1991-02-26 hk.net
3493 1991-04-10 cix.net
3494 1991-04-11 team.net
3495 1991-05-07 five-colleges.net
3496 1991-05-17 ja.net
3497 1991-06-03 illinois.net
3498 1991-06-20 more.net
3499 1991-06-24 ohio-dmz.net
3500 1991-07-08 icp.net
3501 1991-08-07 swip.net
3502 1991-08-15 michnet.net
3503 1991-11-29 notes.net
3504 1991-12-10 merit.net
3505 1991-12-31 mu.net
3506 1992-01-17 first.net
3507 1992-02-17 ebone.net
3508 1992-02-19 holonet.net
3509 1992-02-25 ripe.net
3510 1992-03-24 csn.net
3511 1992-04-06 mcast.net
3512 1992-04-08 life.net
3513 1992-04-20 rahul.net
3514 1992-04-21 cyber.net
3515 1992-05-11 sprintlink.net
3516 1992-05-18 ids.net
3517 1992-05-21 q.net
3518 1992-06-01 netconnect.net
3519 1992-07-07 use.net
3520 1992-07-16 tip.net
3521 1992-07-27 capcon.net
3522 1992-07-27 nexsys.net
3523 1992-07-29 umass.net
3524 1992-07-31 solinet.net
3525 1992-08-06 fish.net
3526 1992-08-18 ps.net
3527 1992-09-10 eds.net
3528 1992-09-18 lig.net
3529 1992-10-01 ix.net
3530 1992-10-19 aol.net
3531 1992-10-30 win.net
3532 1992-11-02 cren.net
3533 1992-11-03 path.net
3534 1992-11-04 quake.net
3535 1992-11-20 access.net
3536 1992-11-20 tsoft.net
3537 1992-11-23 inter.net
3538 1992-11-30 individual.net
3539 1992-12-04 raider.net
3540 1992-12-09 europa.net
3541 1992-12-21 demon.net
3542 1992-12-22 press.net
3543 1992-12-23 bc.net
3544 1993-01-01 internic.net
3545 1993-01-04 cls.net
3546 1993-01-20 sam.net
3547 1993-02-09 kanren.net
3548 1993-02-11 ubs.net
3549 1993-02-15 digex.net
3550 1993-02-15 mobilecomm.net
3551 1993-02-17 xlink.net
3552 1993-02-18 fr.net
3553 1993-03-03 onenet.net
3554 1993-03-08 aco.net
3555 1993-03-24 clark.net
3556 1993-03-24 olympus.net
3557 1993-03-24 satlink.net
3558 1993-04-02 netcom.net
3559 1993-04-07 nl.net
3560 1993-04-13 ins.net
3561 </code></pre></div></div>
3562
3563 <p>Oldest registered <strong>.org</strong> domains:</p>
3564
3565 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3566 1986-03-25 src.org
3567 1986-07-10 super.org
3568 1987-01-07 aero.org
3569 1987-01-15 mcnc.org
3570 1987-04-02 rand.org
3571 1987-04-04 mn.org
3572 1987-05-01 rti.org
3573 1987-07-14 usenix.org
3574 1987-09-03 software.org
3575 1988-02-25 fidonet.org
3576 1988-04-27 ampr.org
3577 1988-08-04 osf.org
3578 1988-08-11 ida.org
3579 1988-09-09 cactus.org
3580 1988-09-09 nm.org
3581 1988-09-22 ccf.org
3582 1988-10-21 erim.org
3583 1988-11-11 ski.org
3584 1988-11-30 iti.org
3585 1989-01-11 jax.org
3586 1989-01-13 ncsc.org
3587 1989-02-09 aaai.org
3588 1989-02-24 ie.org
3589 1989-03-29 stjude.org
3590 1989-04-11 mbari.org
3591 1989-05-24 castle.org
3592 1989-06-07 carl.org
3593 1989-06-27 msri.org
3594 1989-07-15 agi.org
3595 1989-07-17 sf-bay.org
3596 1989-07-31 mef.org
3597 1989-08-11 oclc.org
3598 1989-08-23 ei.org
3599 1989-09-05 cas.org
3600 1989-09-11 battelle.org
3601 1989-09-12 sub.org
3602 1989-09-21 aip.org
3603 1989-09-28 sdpa.org
3604 1989-11-08 lonestar.org
3605 1989-12-01 ieee.org
3606 1990-01-10 cit.org
3607 1990-01-22 sematech.org
3608 1990-02-07 omg.org
3609 1990-02-12 decus.org
3610 1990-03-13 sublink.org
3611 1990-03-16 cam.org
3612 1990-03-20 cpl.org
3613 1990-04-10 ori.org
3614 1990-04-13 fhcrc.org
3615 1990-05-16 nwf.org
3616 1990-05-18 mskcc.org
3617 1990-05-23 boystown.org
3618 1990-05-24 bwc.org
3619 1990-05-31 topsail.org
3620 1990-06-28 ciit.org
3621 1990-07-17 central.org
3622 1990-07-27 mind.org
3623 1990-08-03 stonemarche.org
3624 1990-08-28 cshl.org
3625 1990-08-30 fstrf.org
3626 1990-09-12 dorsai.org
3627 1990-09-14 elf.org
3628 1990-09-18 siggraph.org
3629 1990-09-21 sjh.org
3630 1990-09-27 igc.org
3631 1990-10-10 cotdazr.org
3632 1990-10-10 eff.org
3633 1990-10-10 sfn.org
3634 1990-10-31 csn.org
3635 1990-11-01 sfbr.org
3636 1990-11-07 ais.org
3637 1990-11-07 hjf.org
3638 1991-01-04 uniforum.org
3639 1991-01-04 wgbh.org
3640 1991-02-01 fsf.org
3641 1991-02-06 eso.org
3642 1991-02-06 tiaa.org
3643 1991-02-13 nysernet.org
3644 1991-02-20 acr.org
3645 1991-02-26 nybc.org
3646 1991-02-26 nypl.org
3647 1991-04-10 cnytdo.org
3648 1991-04-10 htr.org
3649 1991-04-10 hvtdc.org
3650 1991-04-10 nycp.org
3651 1991-04-11 bpl.org
3652 1991-04-11 scra.org
3653 1991-04-12 amnh.org
3654 1991-04-15 hellnet.org
3655 1991-04-15 sil.org
3656 1991-04-18 apc.org
3657 1991-04-22 mobot.org
3658 1991-04-25 cni.org
3659 1991-05-01 gumption.org
3660 1991-05-02 hslc.org
3661 1991-05-13 guild.org
3662 1991-05-22 acs.org
3663 1991-05-22 lpl.org
3664 1991-05-22 rsage.org
3665 </code></pre></div></div>
3666
3667 ]]></content>
3668 <summary type="html">
3669 <![CDATA[Oldest registered domain names in the .…
3670 </summary>
3671
3672 <category term="DNS" scheme="https://www.cambus.net/cate…
3673 </entry>
3674 <entry>
3675 <title><![CDATA[Booting OpenBSD kernels in EFI mode with QEMU]]>…
3676 <link href="https://www.cambus.net/booting-openbsd-kerne…
3677 <id>https://www.cambus.net/booting-openbsd-kernels-in-ef…
3678 <published>2018-06-24T11:50:00Z</published>
3679 <updated>2018-06-24T11:50:00Z</updated>
3680 <content type="html"><![CDATA[<p>I've been working on st…
3681 way to quickly test kernels without having to reboot my development mach…
3682 each and every time.</p>
3683
3684 <p>As it turns out, it's possible to achieve using <strong>OVMF</strong>…
3685 Firmware), a BSD licensed <strong>UEFI firmware implementation</strong> …
3686 machines. A prebuilt image can be downloaded <a href="https://sourceforg…
3687
3688 <p>We will need to create two drives:</p>
3689
3690 <ul>
3691 <li>One drive using a FAT filesystem to store the EFI payload (the Ope…
3692 bootloader)</li>
3693 <li>Another drive using a FFS filesystem containing the OpenBSD kernel…
3694 </ul>
3695
3696 <p>Thankfully, QEMU allows to create virtual drives with FAT filesystems…
3697 local directories, and we can easily create an FFS filesystem image using
3698 <strong>makefs(8)</strong>.</p>
3699
3700 <p>We will start by creating a directory structure:</p>
3701
3702 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3703 <span class="nb">mkdir</span> <span class="nt">-p</span> kernel/etc
3704 </code></pre></div></div>
3705
3706 <p>We then copy the OpenBSD <strong>EFI bootloader</strong>:</p>
3707
3708 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3709 </code></pre></div></div>
3710
3711 <p>Alternatively, an OpenBSD EFI bootloader can be downloaded <a href="h…
3712
3713 <p>Then, we need to place the EFI firmware image at the root of our dire…
3714 the OpenBSD kernel we want to boot in the kernel directory.</p>
3715
3716 <p>The directory structure should look as follow:</p>
3717
3718 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3719 bootloader
3720 bootloader/efi
3721 bootloader/efi/boot
3722 bootloader/efi/boot/BOOTX64.EFI
3723 kernel
3724 kernel/etc
3725 kernel/bsd
3726 </code></pre></div></div>
3727
3728 <p>We can now create the <strong>random.seed</strong> file and build the…
3729
3730 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3731 makefs <span class="nt">-t</span> ffs kernel.img kernel
3732 </code></pre></div></div>
3733
3734 <p>Finally, let's start QEMU:</p>
3735
3736 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3737 <span class="nt">-drive</span> <span class="nv">format</span><sp…
3738 <span class="nt">-drive</span> <span class="nv">format</span><sp…
3739 </code></pre></div></div>
3740
3741 <p>And boot our kernel:</p>
3742
3743 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3744 </code></pre></div></div>
3745 ]]></content>
3746 <summary type="html">
3747 <![CDATA[Some notes on booting an OpenBSD kernel…
3748 </summary>
3749
3750 <category term="OpenBSD" scheme="https://www.cambus.net/…
3751 </entry>
3752 <entry>
3753 <title><![CDATA[The journey back to C]]></title>
3754 <link href="https://www.cambus.net/the-journey-back-to-c…
3755 <id>https://www.cambus.net/the-journey-back-to-c/</id>
3756 <published>2018-02-21T13:10:00Z</published>
3757 <updated>2018-02-21T13:10:00Z</updated>
3758 <content type="html"><![CDATA[<p>A few months ago, I rea…
3759 programming this February. Although I had several few years of hiatuses …
3760 and then, that's still a very long period for a single language.</p>
3761
3762 <p>My journey back to C started in the spring of 2015, out of envy to sc…
3763 a long time itch and write a Web log analyzer. I found <a href="http://c…
3764 be a great refresher, which got me motivated and <a href="https://www.lo…
3765
3766 <p>Fast forward to the fall of 2017, when I decided to finally tackle the
3767 pile of material I collected and printed over the year. This started with
3768 <a href="http://www.literateprogramming.com/ctraps.pdf">C Traps and Pitf…
3769 from TAOSSA, and I'm currently reading and enjoying <a href="https://gfo…
3770
3771 <p>Meanwhile, I've been reading <a href="https://greenteapress.com/think…
3772 with <a href="http://www.apuebook.com/">Advanced Programming in the Unix…
3773 to more material about operating systems.</p>
3774
3775 <p>Languages come and go, but C is forever.</p>
3776
3777 ]]></content>
3778 <summary type="html">
3779 <![CDATA[My journey back to C, through reading a…
3780 </summary>
3781
3782 <category term="C" scheme="https://www.cambus.net/catego…
3783 </entry>
3784 <entry>
3785 <title><![CDATA[OpenBSD/octeon on the EdgeRouter Lite]]></title>
3786 <link href="https://www.cambus.net/openbsd-octeon-on-the…
3787 <id>https://www.cambus.net/openbsd-octeon-on-the-edgerou…
3788 <published>2017-08-24T22:45:00Z</published>
3789 <updated>2017-08-24T22:45:00Z</updated>
3790 <content type="html"><![CDATA[<p>I've had the EdgeRouter…
3791 year now, and it's a nice and affordable little fanless device to run
3792 <a href="https://www.openbsd.org/octeon.html">OpenBSD/octeon</a> on.</p>
3793
3794 <p>The CPU on this machine is a dual-core Cavium Octeon CN50xx (MIPS64 I…
3795 which can run in both BE and LE modes. OpenBSD runs in big-endian mode on
3796 this architecture.</p>
3797
3798 <p>On the minus side, there is no internal clock and no FPU.</p>
3799
3800 <p><img src="/content/2017/08/edgerouter-lite.jpg" alt="OpenBSD on the E…
3801
3802 <p>Here is the output of running <em>file</em> on executables:</p>
3803
3804 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3805 </code></pre></div></div>
3806
3807 <p>And this is the result of the <strong>md5 -t</strong> benchmark:</p>
3808
3809 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3810 Digest <span class="o">=</span> 52e5f9c9e6f656f3e1800dfa5579d089
3811 Time <span class="o">=</span> 2.183314 seconds
3812 Speed <span class="o">=</span> 45801932.291920 bytes/second
3813 </code></pre></div></div>
3814
3815 <p>For the record, LibreSSL speed benchmark results are available
3816 <a href="/files/openbsd/openssl-speed-edgerouter-lite.txt">here</a>.</p>
3817
3818 <p>System message buffer (dmesg output):</p>
3819
3820 <div class="language-shell highlighter-rouge"><div class="highlight"><pr…
3821 The Regents of the University of California. All rights reserve…
3822 Copyright <span class="o">(</span>c<span class="o">)</span> 1995-2017 Op…
3823
3824 OpenBSD 6.2-beta <span class="o">(</span>GENERIC.MP<span class="o">)</sp…
3825 visa@octeon:/usr/src/sys/arch/octeon/compile/GENERIC.MP
3826 real mem <span class="o">=</span> 536870912 <span class="o">(</span>512M…
3827 avail mem <span class="o">=</span> 523943936 <span class="o">(</span>499…
3828 mainbus0 at root
3829 cpu0 at mainbus0: CN50xx CPU rev 0.1 500 MHz, Software FP emulation
3830 cpu0: cache L1-I 32KB 4 way D 8KB 64 way, L2 128KB 8 way
3831 cpu1 at mainbus0: CN50xx CPU rev 0.1 500 MHz, Software FP emulation
3832 cpu1: cache L1-I 32KB 4 way D 8KB 64 way, L2 128KB 8 way
3833 clock0 at mainbus0: int 5
3834 iobus0 at mainbus0
3835 simplebus0 at iobus0: <span class="s2">"soc"</span>
3836 octciu0 at simplebus0
3837 cn30xxsmi0 at simplebus0
3838 com0 at simplebus0: ns16550a, 64 byte fifo
3839 com0: console
3840 dwctwo0 at iobus0 base 0x1180068000000 irq 56
3841 usb0 at dwctwo0: USB revision 2.0
3842 uhub0 at usb0 configuration 1 interface 0 <span class="s2">"Octeon DWC2 …
3843 octrng0 at iobus0 base 0x1400000000000 irq 0
3844 cn30xxgmx0 at iobus0 base 0x1180008000000
3845 cnmac0 at cn30xxgmx0: RGMII, address 44:d9:e7:9e:f5:9e
3846 atphy0 at cnmac0 phy 7: AR8035 10/100/1000 PHY, rev. 2
3847 cnmac1 at cn30xxgmx0: RGMII, address 44:d9:e7:9e:f5:9f
3848 atphy1 at cnmac1 phy 6: AR8035 10/100/1000 PHY, rev. 2
3849 cnmac2 at cn30xxgmx0: RGMII, address 44:d9:e7:9e:f5:a0
3850 atphy2 at cnmac2 phy 5: AR8035 10/100/1000 PHY, rev. 2
3851 /dev/ksyms: Symbol table not valid.
3852 umass0 at uhub0 port 1 configuration 1 interface 0 <span class="s2">"ven…
3853 umass0: using SCSI over Bulk-Only
3854 scsibus0 at umass0: 2 targets, initiator 0
3855 sd0 at scsibus0 targ 1 lun 0: &lt;, USB DISK 2.0, PMAP&gt; SCSI4 0/direc…
3856 sd0: 3824MB, 512 bytes/sector, 7831552 sectors
3857 vscsi0 at root
3858 scsibus1 at vscsi0: 256 targets
3859 softraid0 at root
3860 scsibus2 at softraid0: 256 targets
3861 boot device: sd0
3862 root on sd0a <span class="o">(</span>cf2da3d2e43090ca.a<span class="o">)…
3863 cpu1 launched
3864 </code></pre></div></div>
3865 ]]></content>
3866 <summary type="html">
3867 <![CDATA[Running the OpenBSD/octeon port on Ubiq…
3868 </summary>
3869
3870 <category term="OpenBSD" scheme="https://www.cambus.net/…
3871 <category term="MIPS64" scheme="https://www.cambus.net/c…
3872 </entry>
3873 <entry>
3874 <title><![CDATA[OpenBSD g2k16 hackathon]]></title>
3875 <link href="https://www.cambus.net/openbsd-g2k16-hackath…
3876 <id>https://www.cambus.net/openbsd-g2k16-hackathon/</id>
3877 <published>2016-12-24T19:39:00Z</published>
3878 <updated>2016-12-24T19:39:00Z</updated>
3879 <content type="html"><![CDATA[<p>First hackathon. Things…
3880 to the airport under heavy rain while a thunderstorm was ongoing. The re…
3881 though, allowing me to reach Cambridge without issues.</p>
3882
3883 <p>I came to the hackathon with plans to work on audio, emulators, and g…
3884 Porting is a strange addiction. Trying to make sense of custom build sys…
3885 ports I imported were previous failed attempts, but knowledge gained por…
3886 me to overcome blocking issues. It's a never-ending challenge, but a rew…
3887 opportunity to attempt upstreaming changes and get in touch with develop…
3888 are helpful and happy to see their program being packaged.</p>
3889
3890 <p>On the second day, I got my commit bit and managed to import a few th…
3891 I found out that CVS, which is a frequent source of complaints and quest…
3892
3893 <p>Overall, the most important part of the hackathon was the human aspec…
3894 lists, and finding out that the crowd is both cheerful and welcoming. Ha…
3895 I left Cambridge very inspired and determined to start a foray into src,…
3896
3897 <p>Thanks to Anil, Gemma, and the OpenBSD foundation for organizing such…
3898 to publish it.</p>
3899
3900 ]]></content>
3901 <summary type="html">
3902 <![CDATA[My OpenBSD g2k16 hackathon report]]>
3903 </summary>
3904
3905 <category term="OpenBSD" scheme="https://www.cambus.net/…
3906 </entry>
3907 </feed>
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.