Skip to content
HN On Hacker News ↗

Working around dragons with the Lemote Yeeloong laptop and OpenBSD

▲ 141 points 42 comments by zdw 2w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

2 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 5 of 5
SEGMENTS · AI 0 of 5
WORD COUNT 1,698
PEAK AI % 3% · §4
Analyzed
Jun 28
backend: pangram/v3.3
Segments scanned
5 windows
avg 340 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 1,698 words · 5 segments analyzed

Human AI-generated
§1 Human · 2%

Behold: the Guru of GNU! (Photo by Habib Mhenni, Wikimedia Commons, CC BY-SA 3.0.) True enlightment only comes from a truly free computing experience, probably! And while there is no nerd who lacks an opinion on Richard Stallman personally, likewise let none claim he does not practice what he preaches. Why, the very laptop in front of him was selected deliberately because it can operate with no binary blobs and no firmware you couldn't examine or replace with your own, and runs his choice of fully libre operating systems. The fact it has a Chinese MIPS64 derivative in it was undoubtedly just more compound on the heat spreader. Now, in my case, the fact that it is a MIPS-family system meant I certainly needed one in my unusual laptop collection. And since it can run OpenBSD ... ... it seemed like a good way to get nerdsniped in two ways by one computer: since I mostly run NetBSD as my BSD and server operating system of choice, I figured this was also a good way to learn OpenBSD on a highly portable netbook using an unusual platform. As usual, of course, the whole shooting match turned out to be a much longer journey than I'd anticipated, and my typical insistence on deviating from the beaten path (such as forcing it to run from the SD card slot and trying to build a browser from source) made it more so. But before we embark upon it, let's talk about why there's a Chinese MIPS derivative in this thing in the first place. This is, of course, not the first MIPS laptop we've played with; a perennially popular article is on IBM's MIPS not-a-ThinkPad, and MIPS was also used for a couple of our Sun Ray laptops, including one you can easily get root on. But it is the first 64-bit MIPS laptop we've had here at Floodgap Orbiting HQ and certainly the smallest, and the provenance of its processor gets even more interesting. I should mention that while later chips in the series are relatively well-documented in English, its earlier entries are largely only discussed in Standard Chinese, and my ability to translate Chinese is even worse than my capacity for Japanese. These early chips are where we'll find the "why," however, so I'll do my best.

§2 Human · 3%

Where there is disagreement between Chinese primary sources and Western secondary reporting (and there are many discrepancies), for obvious reasons I have generally favoured the former's accounts. Please forgive any inaccuracies that result. 谢谢. The People's Republic of China had long prioritised indigenous technology as a means of securing independence from foreign interests, though early efforts in electronics primarily concentrated on defense. This dramatically changed after the Chinese government realized it was being left behind by new developments in the 1980s such as the U.S. Strategic Defense Initiative, which apart from zapping nukes in the sky pumped substantial funding through the SDI Organization into basic science research, and parallel similar efforts in the Soviet Union, Japan and Europe. Paramount leader Deng Xiaoping responded with the 863 Program, named for the date of its establishment in March 1986, when it was officially proposed to the Chinese government by multiple scientists and engineers with his explicit endorsement. "The matter must be decided quickly without delay," he allegedly scribbled on the report. Officially dubbed the National High Technology Research and Development Program (国家高技术研究发展计划), the 863 Program focused on general science and technology applications in multiple domains, including biotech, space, lasers, automation, energy, new materials and information technology, with a fifteen-year timeframe. It became state policy as part of the Seventh Five-Year Plan and subsequent Five-Year Plans thereafter, and by 1988 was the country's premier industrial research and development initiative. Despite leadership's strong interest in semiconductors, foreign processor designs nevertheless dominated in China throughout the 1990s; the lack of cutting-edge fabrication and design capacity made early industry leads insurmountable, and by the beginning of the second millenium established players like ARM and Intel held commanding market shares on the mainland as well. As a result, although more limited native microprocessor designs and clones had previously existed, a Chinese-developed CPU that was in any sense competitive with market leaders took decades to emerge. In 2001 the Institute of Computing Technology (ICT) at the Chinese Academy of Sciences (CAS) under chief architect Hu Weiwu began work on a new higher-performance chip as their own attempt, funded by the Tenth Five-Year Plan and the continuation of the 863 Program, now transformed into a long-term R&D pipeline under Jiang Zemin.

§3 Human · 2%

Officially called 龙芯, which would usually be transliterated in Pinyin as Lóngxīn and translated as "dragon core," the developers gave it the similar-sounding transliteration of Gǒdsón, which comes out something like "dog food" or "food fit for dogs" — however, I note there are many puns in Chinese, and this pasty white boy with a dictionary and a linguistics degree is probably not doing this one justice. Assuming this meaning, the intentional dysphemism likely came from the old superstition of giving bad names to children so that evil spirits would be disinclined to harm them, such that the new chip could survive its own infancy, but also fits neatly with the idea of eating your own dog food. As a means of getting Godson off the ground quickly, the ICT designers evaluated existing architectures and selected 32-bit MIPS II: it was well-known and generally unencumbered, still had software support, and didn't (or at least not at first) require them to fight in the crowded x86 space. However, because it was always intended to commercialise the chip, it was important to project managers that the design yield defensible IP; as a result the MIPS Load/Store Left/Right Word unaligned memory access instructions, then still under their own patent, were thus dropped as part of the specification. Using this spec the team was then able to develop a simulator and boot Linux for the first time on August 19, 2001 (its "birthday"). The initial paper, from which the pictures above titled "Research and development of the Godson-1 general-purpose CPU chip" are taken, described "bold innovations in the microarchitecture" (their words) such as a dynamic pipeline and hardware mitigation for buffer overflows through an early form of the no-execute bit, a first for any MIPS-architecture CPU. The design progressed stepwise from Verilog simulation to a low-speed FPGA prototype, which was itself further refined for tapeout, and then into early hardware you can see at the lower right corner (a prototype logic board, chip, and minitower full system). The resulting Godson-1 was officially launched on September 28, 2002 by BLX IC Design Corporation Ltd., a fabless joint venture between ICT and Jiangsu Zhongyi Group.

§4 Human · 3%

It contained four million transistors on a 4mm square die, fabricated by Shanghai-based Semiconductor Manufacturing International Corporation on a 180nm process with six layers of metal; it ran its seven-stage pipeline at up to 266MHz with a power consumption of under a watt (0.4W at 200MHz) by doubling the clock signal from its custom motherboard. Carrying 8K of L1 cache each for instruction and data, it supported register renaming (but integer only from an extra set of eight), branch prediction, dynamic scheduling and out-of-order execution with a single memory access unit, two fixed-point units, and two floating-point units that supported a limited form of SIMD. Unlike SGI MIPS, Godson-1 exclusively ran little-endian, and ports of Red Hat Linux 7.1 and VXWorks were made available. The designers estimated that performance at 200MHz was comparable to a (then) five-year-old SGI O2 with a 180MHz R5000, impaired by its lack of L2 cache support, the larger node size and its relatively unsophisticated circuit design, but it really existed, it was really being manufactured, and it ran real code. Godson-1's successful introduction naturally delighted its mainland backers and the Chinese government, though one company that wasn't smiling was MIPS Technologies, previously spun off in March 1998 by former owner Silicon Graphics for the embedded market. MTI's profound displeasure came from BLX billing Godson-1 as "MIPS-like," despite having no license to the ISA or authorization to use the brand, nor being directly compatible. Nevertheless, their objections didn't prevent AMD from opening a joint Beijing development centre with BLX in December 2003 to produce thin clients based on both Godson-1 and the (MIPS licensed) Alchemy Au1500, the primary chip in our Sun Ray 2 laptops. While Godson-1 itself saw limited use as a network computer, its GS232 core subsequently became the basis of numerous later embedded cores alongside heat-tolerant and radiation-hardened variants.

§5 Human · 2%

In the meantime, ICT had commenced development on a 64-bit version as early as 2002 that was more appropriate for personal computers, advancing to MIPS III with a design not unlike 1995's R10000. In a 2005 interview with Microprocessor Reports, chief architect Hu cited its intended purpose as a CPU for "very low-cost PC" machines affordable to most Chinese, running "high-end embedded applications and low-end desktop applications." The new Godson-2 was 4-way superscalar with out-of-order execution and a longer nine-stage pipeline for higher clock speeds, plus 64K four-way-associative I- and D-caches, a 64-entry translation lookaside buffer (up from 48), 64 GPRs and FPRs each for more effective register renaming, and external L2 cache support up to 8MB while also maintaining Godson-1's no-execute bit per page. Expanded branch prediction hardware compensated for greater pipeline latency with a 4K-entry branch history table, a 9-bit global history register, a four-entry return address stack and a 16-entry branch target buffer, but the same single memory access unit and twin integer and FPU units remained, with additional custom SIMD instructions that unfortunately conflicted with the base MIPS ISA. Godson-2's first iteration (retroactively the Godson-2A) failed during tapeout due to issues with its register file implementation, necessitating replacement with a custom one which launched as Godson-2B in 2003. Godson-2B was fabricated by SMIC on the same 180nm process with six layers of metal, though ICT's continued (albeit lessened) use of standard cells required it to use more transistors than a more parsimonious design might have, and the 13.5 million transistor die correspondingly enlarged to 6.7mm by 6.2mm. It could run up to 500MHz using around 4W of power (2-3W at 400MHz).