Working around dragons with the Lemote Yeeloong laptop and OpenBSD
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. 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.
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. 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.

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).
Unsteady evolution followed the release of Godson-2B. Godson-2C streamlined the design further in October 2004 and reportedly ran about three times as fast, but Godson-2D's planned process shrink to 130nm developed its own crippling tapeout problems and likewise failed to enter production. As the situation had become "desperate" (in Hu's words) by 2005, the team decided to leapfrog directly to 90nm for Godson-2E to keep pace and brought in STMicroelectronics as a partner and design consultant. The new chip in March 2006 swelled to 47 million transistors on a 6.8mm by 5.2mm die, but the process shrink enabled the chip to reach 1GHz for the first time while dissipating only around 5W. Die space was conserved by removing the no-execute bit logic, and additional performance came from an on-chip 512K L2 cache and an integrated DDR memory controller.
Godson-2E's advances finally made it sufficiently suitable to power a low-cost homegrown computer just as Hu and the ICT team had planned, and in June 2006 another joint venture spinoff formed, this time between ICT and new partner Jiangsu Menglan Group: Jiangsu Lemote Tech Co., Ltd. (航天龙梦, "aerospace dragon dream"), or Lemote for short. Lemote's first computer product was the small desktop Fuloong 2E 福瓏 in October, running an STMicroelectronics-fabricated CPU at 667MHz to improve yield. It was designed to be inexpensive and go on sale quickly using otherwise off-the-shelf components, shipping with 256MB of DDR SDRAM, Realtek 8139D Ethernet, a 40 or 60GB IDE hard disk, four USB 2 ports and an ATI Radeon 7000 GPU. Notably, the Fuloong ran a Chinese-localized Linux with a modified version of the open-source PMON bootloader, which we'll talk about more shortly.

With the new product and the new company also came a new commercial brand for the chip family — _Loongson_, written with the same Chinese characters, but hewing more closely to the canonical transliteration and overtly embracing the dragon theme for common marketing. Indeed, the characters used to write Fuloong in Chinese suggest a meaning like "dragon blessing" (again, whiteboy alert, don't take anything I translate too seriously). The Godson name remained as its academic designation.
STMicroelectronics formally bought out the chip in December, investing CN¥30 million with ICT and BLX plus per-unit royalties for a five year exclusive deal. The contract terms allowed them to produce both the Loongson-2E and the forthcoming Loongson-2F, though the 2E's FPGA-based Bonito northbridge became expensive to manufacture in quantity and only the Fuloong 2E actually used the processor. The Loongson-2F solved this problem by incorporating a modified Bonito northbridge and 133MHz PCI-X controller on-die, yielding a 51 million transistor chip that ICT called the GS464 core; it was taped out for mass production on July 31, 2007. As part of an agreement between MIPS Technologies and ICT, STMicroelectronics bought a MIPS license explicitly for their Loongson parts, allowing it to be officially promoted as "MIPS-compatible" for the very first time. The company made two forms of the 2F, the early STLS2F01 and the much more common STLS2F02 with slight differences, both using the same 27x27x2.9mm heat spreader over a 416-pin flip-chip ball grid array.
Lemote wasted little time getting the 2F in shipping products, starting with an upgraded Fuloong 2F in June 2008. Using a 1GHz Loongson-2F, it came with 512MB of DDR2 SDRAM, a 120GB hard disk, four USB 2 ports, XGI V2 graphics, Realtek 8110SC Gigabit Ethernet and AMD CS5536 as southbridge providing IDE, USB and the AC'97 codec, selling at an attractive CN¥1800 (about $257 at the spot rate and a bit under $400 in 2026 dollars). At the same time, however, a much smaller system was already in development, and the low power usage of the Loongson-2F now made it plausible.

Announced in October 2008, the Lemote Yeeloong 逸珑 (something like "escaped dragon") was the first Loongson-based laptop and the front of the box even says so, reading "The world's first laptop to use a Loongson processor" on the left. Manufactured under contract by Quanta, it was intended to directly compete with the 2007 Asus Eee PC, strongly patterning itself after its popular netbook form factor and even using a 1024x600 LCD of the same size as the Eee 900 series then available. The slogan on the right, "Innovation makes [the] dragon's dream come true," appears multiple places on the packaging.

This unit was an eBay purchase, nearly complete (as far as I could tell) in the original box. The original Yeeloong came in at least two major models and multiple subconfigurations. The 8089 series, in black or white, had a 8.9" TFT 1024x600 LCD, SiliconMotion SM712 graphics with 4MB of VRAM, Realtek 8139D 10/100 Ethernet and 8187B 802.11b/g Wi-Fi, plus an SD (SDHC) card slot, speaker and microphone, audio in/out ports, VGA out, and the AMD CS5536 southbridge. These weren't fabulous creature comforts for the time, but as with the Fuloong it had to be cheap, as it was more important to its commercial backers — to say nothing of its _political_ backers — that the machine should be accessible to the average Chinese buyer (and, hopefully, an international one as well).
The base model appears to have been this 8089A running an underclocked 800MHz STLS2F02 and its standard 512K of L2 cache, with two USB 2.0 ports, plus a 2GB SSD and 512MB of RAM as the label indicates; the 8089D is the same as the 8089A but with an 8GB SSD and 1GB of RAM. On the other hand, the 8089B is the deluxe-ish subconfig, adding a 160GB hard disk, a third USB port, the same 1GB of RAM and a 300Kpixel internal webcam. Confusingly they are all labeled on the bottom as "8089_C" with an underscore; only the box would tell you the actual subconfiguration. The highest-end and much rarer 8101B model uses a 10.1" TFT, but the LCD is the same resolution, and is otherwise the same loadout as the 8089B. (Although there is a later version of the Yeeloong with a different CPU, we'll get to that one at the end.)

On the box's underside is a stock photo and more marketing. The handwritten script at the top left reads something like "Simple use, exquisite form" and also appears multiple places. The bullets in the list (under another "Innovation" slogan) read, approximately:
- "Loongson 2F high-performance processor"
- "Mobile [and] portable, green energy-saving, sophisticated [and] elegant"
- "Independently designed, immune to viruses, safe [and] worry-free"
- "Open architecture, full-featured, excellent performance"

And on the bottom: "We constantly strive to make high-quality domestic products!"

Unboxing Shenzhen-style, or something.

The box also included all of the literature, including its original sales receipt and a business card for a Loongson Technology system software engineer, ICT and BLX's rather incestuous new spinoff from 2008. I don't know if he was the original purchaser or just a technical contact. The book in grey is the user's manual; the pamphlet in black is the warranty.
This unit was bought on January 11, 2009 for CN¥2110, about $309 spot price, or around $480 in 2026 dollars. However, by this time the Eee PC 900A was reportedly selling for around $280 in 2008 dollars, so that price was not nearly as competitive as it should have been. The product name is given as BCSIL2A and was a direct purchase from Zhongke Longmeng (now renamed Aerospace Longmeng) with their sales stamp on the paper; they were a ICT licensee who developed their own Longmeng-1 SoC using a Godson-1 core.

The seller also kindly included the original battery and what looks like a NOS spare. These are off-the-shelf Simplo 916T7980F 2200mAh packs and were reputed to last around two hours and change under average usage, which for the time was acceptable (though for the record the 4400mAh battery in the Eee PC 900 could get about four). However, I don't think this was the original power supply, and pretty much any 20V laptop barrel jack brick should do. This particular unit generates 20V at 3A; the unit requires at least 2A.

One last brag about being the first Loongson laptop on the other side before we plunk it on the desk.

Its shiny surface has been a bit scuffed but still looks very nice in black, though I quibble with the metrics of the "Lemote" font. The Parker pen gives you a rough relative idea of how small it is; its footprint is less than an American letter size piece of paper (8.5"x11"), albeit about an inch (25mm) thick. On my kitchen scale it weighs 958g without its battery and 1126g with (2 lbs 1.8 oz and 2 lbs 7.7 oz), a pleasingly portable figure.

The underside of the unit indicates the model number as "8089_C," but this designation appears to be an integral part of the sticker and not secondarily silkscreened or etched. I suspect it actually refers to the bottom _case_ assembly because all 8089s use the same one (proof shortly). Notice that it has FCC clearance — Lemote clearly meant to sell this in the United States if they could, though availability was limited, and most units still operating States-side (this one as well) are probably imports from elsewhere. Due to some additional perforated layers between them and the logic board, the cooling vents, though prominent, actually admit much less air than they appear to. We'll get to that when we turn it on.

Removing the two screws for the bottom door gives you access to the RAM SO-DIMM (minimum DDR2-667, i.e., PC5300) and the storage bay. Both Yeeloong and Fuloong have only a single RAM slot; this unit was secondarily upgraded to 1GB of RAM, though the SSD is stock. It is allegedly possible to get up to 2GB of RAM in the Yeeloong but reports indicate it is very picky about the RAM it will accept: while it's known RAM must be single-rank for the 2F, single-rank SO-DIMMs successfully used in other related systems haven't worked in the Yeeloong, even though the machines should all have the same on-chip northbridge.

On the left side (oriented with the laptop lid opening away from you) is a pathetic cooling vent, the barrel power jack, the VGA out, one of the USB ports and the SD card slot.

On the other side is a nearly worthless cooling vent, Ethernet, a pop-out for where the 8089B's third port goes (i.e., it uses the same bottom case), the second USB port, and the audio jacks.

Here you can see the interior and the front-firing speakers, which are "fine." Being dark plastic and previously owned, the matte finish on the keyboard and trackpad can be seen to have worn smooth in various high-traffic places, though the amount suggests this machine did get a fair amount of use.

And that person should probably get a medal, because both are unpleasant in different ways (even considering their unavoidably small size). The trackpad is overly sensitive except when you want it to be, not helped by the generally poor state of open-source drivers, and further undermined by a scroll strip you have to be frustratingly ultradeliberate about. On the other hand, the keyboard was less mushy than I expected and actually has decent travel. Instead, _its_ problem is the wacky layout, moving the tilde/backtick next to the Esc key and shifting the numbers over, plus a small spacebar and a ridiculously tiny Tab. The lights and power button at the back are actually on the logic board and shine/push through.

Plugged in and turned on yields this cheery splash screen in both English and Chinese. At least initially, the machine was impressively silent. The LCD is also better than I would have expected for a machine of this class — it's TFT, so the viewing angles are crap, but it's sharp with maybe one or two dud pixels and surprisingly serviceable otherwise. While some users have complained the backlight flickers when turned down, I've never experienced anything like that with this unit.

Holding down Del as directed drops you into the PROM, or in this case PMON, prompt. This is where we will spend some time initially, but a few minutes into me messing around with the unit, the cooling fan suddenly came on at a moderately high RPM and wouldn't stop. The side vents were unobstructed and all four rubber feet were in, so the bottom vents weren't being blocked by the table. It happened consistently enough that I was concerned something inside was blocking airflow despite other user reports of similar phenomena. We'll crack it open to check.

I don't have a service manual for this unit and I suspect I wouldn't be able to easily follow it anyway, so I very carefully disassembled the Yeeloong based on guesses I've made disassembling other laptops. The initial part to come off is the trackpad assembly. This is released by unscrewing the two door screws and removing that, then taking the other six screws out on the bottom. There are no screws under any of the labels, feet or appliques (I checked). A little nylon spudger action (not metal!) should free it, but be careful not to avulse the trackpad's ribbon connector or the microphone's wires. You don't need to disconnect them as long as you carefully get the assembly out of the way.

As with most laptops you'll have to free the keyboard next before you can do much else. Moving the trackpad assembly out of the way reveals two screws. Remove these and carefully lever the keyboard up with the spudger. Make sure you're prying up under the keyboard, not under the keyboard _tray_ (we'll do that next). You can remove the keyboard from its own ribbon connector or not at your option.

I was initially stymied by the bottom case bezel until I realized it was all one part with the keyboard tray. Remove the four marked screws and then the bezel and tray can be taken out as a single piece. The bezel-tray is held in by snaps you'll need to pry free with the spudger. It extends up to the inner top quarters of the display hinges which will come off with the bezel-tray as you release it. You don't need to remove the screws in the hinges.

With the tray out, we can now see the laptop's single overworked fan and understand what's going on with the cooling system. There are no visible heat pipes and the plastic case obviously won't conduct heat well, so all cooling must be by air movement, and Lemote chose to put the CPU and most of the major hardware on the bottom of the logic board (possibly to make it more comfortable to type on). Since that would ordinarily trap heat underneath, the fan is intended to pull heated air from below and expel it on the side using the bottom vents for intake. However, the fan is small and not well suited to the task, the bottom vents don't admit much air and and only the left side vent is connected to the fan exhaust, all of which practically demands the fan run at a high RPM to be effective. As the fan race is clear and nothing is in the way, we'll just have to live with the fan whine for now, though at least it's constant and can be mentally edited out. I reassembled the laptop at this point.
To document what we're doing, it would be nice to make regular screen captures using the onboard VGA out port, which strictly mirrors the internal display. Obnoxiously it turns out my Inogeni USB capture box doesn't like 1024x600 WSVGA even though the SM712 did appear to emit a 60Hz signal, and it even confused the Samsung widescreen monitor which thought it was 1360x768 WXGA. The Hall scan converter _sort of_ fixed this and was able to reformat the display into a letterboxed 4:3 rendering the Inogeni could grab, but the letterboxed portion is not centered and I couldn't fully compensate for this with phase and clock adjustments, so a bit of the right hand side gets cut off. Most of the time this fortunately isn't noticeable and thus it's what we'll use for the remainder of this article. Finally, I should also note for full transparency that a couple images have been altered to remove sensitive information and/or to clean up artifacts or misfires.
We'll start by doing some low-level digging around in PMON, its internal bootloader.

At the time there was no standardized bootloader for small MIPS-based systems (arguably there still isn't, though RedBoot did support it,
and many now run modern Das U-Boot). To support the various MIPS evaluation boards available in the mid-1990s, specifically LSI Logic's but also others, longtime MIPS programmer Phil Bunce developed a simple onboard ROM-based debugging monitor he dubbed PMON (PROM MONitor) to manipulate memory, load and run binary objects, and debug them with breakpoints. Bunce's code was freely available and straightforward to cross-compile, and it became widely ported to many MIPS-based devices (even the Agenda VR3 PDA).
Lemote's fork of PMON is descended from a prior PMON fork called PMON2000, itself based on an even earlier fork of PMON by MIPS vendor Algorithmics UK, the developers of the Bonito northbridge. PMON2000 was built and maintained by Swedish open source consultants Opsycon AB, now defunct, who offered commercial support and porting work under contract; until it was discontinued around 2013, it directly competed with U-Boot in the early 2000s as an alternative near-universal ROM bootloader. Being a PMON descendant, PMON2000 inherited Bunce's excellent MIPS support and Algorithmics' hardware updates, making it attractive to Lemote as an available and easy-to-port option. However, their resulting implementation on the Fuloong and Yeeloong was intended purely to boot a Linux kernel, leaving or adding various other irregularities, and is consequently regarded in some quarters as poor quality.
Although Lemote didn't contribute their modifications for the Fuloong 2E port back to the PMON2000 mainline, they nevertheless published their complete source code under its original BSD license and thus attracted the notice of Richard Stallman during the Yeeloong's development. Because the STLS2F01 and STLS2F02 have no rewriteable microcode and Lemote's PMON2000 fork was open source, it is possible to bring up a Loongson-2F system to a bootloader prompt without any binary blobs, and of course much of the Fuloong's and Yeeloong's onboard hardware had libre drivers in the Linux kernel already. Stallman had previously been using a One Laptop Per Child XO-1 with its own Open Firmware-based ROM, but Nicholas Negroponte's announcement that Windows XP was coming to the XO-1 caused him to end his public support for the project. Lemote provided him with a prototype Yeeloong, a machine he considered acceptable paired with a fully libre Linux rather than the custom spin it shipped with, in his view. Today frozen in time, the Lemote PMON2000 fork remains preserved on Github.

Indeed, this laptop's PMON was separately updated, but we'll look at everything it can do first. The
h command lists out several pages of commands, some essential, most not particularly useful for general usage, and even a few that are outright buggy (the 'gui' command in particular is nearly useless).

Besides the usual debugging and memory control commands, there is also primitive networking and filesystem access. PMON is able to read an ext2 filesystem and display or load files from it.

Lemote also seems to have added specific commands for controlling the Realtek 8139 and AMD CS5536.

The version of PMON installed on this laptop is 1.4.9a, descended from PMON2000 2.1. Note the build date of August 31, 2010. The OpenBSD port to Loongson had very recently emerged by this time — it even appears in the info blurb — and I'll have more to say about that when we actually go to install it.

We can enumerate devices from PMON. A single OHCI USB root hub is visible with nothing connected to the USB ports; the keyboard and trackpad are internally PS/2. When we scan the PCI bus, we see the Realtek 8139, the SiliconMotion SM712 ...

... the multiple PCI devices provided by the AMD CS5536 southbridge, including its ISA bridge (not used), IDE (used by the SSD), AC'97 audio codec, ...

... and its USB components, the OHCI and EHCI, the USB device controller (UDC), and the USB option controller (UOC). The host controller interfaces support the two (or three) physical ports as host ports, while the UOC controls whether a fourth port is used as a host port or a device port. This would seem useful for something like a USB disk target feature, but the firmware doesn't appear to support that.
You may have noticed that the Wi-Fi and SD card reader didn't turn up on the USB _or_ PCI buses, and there are also two phantom USB ports apparently unaccounted for. More about that a little later.

A set of screens more like a regular PC BIOS are available with the
main
command, suggesting they were intended to be the system's standard interface at some point, though my overall impression is that this work was unfinished. These screens are tabbed. The main tab gives the time (wrong, because it was stored with the battery out), plus the CPU and RAM statistics. The CPU is listed as "796MHz" (note from the future: this is apparently accurate; it's not quite 800MHz) with the 64K I+D caches and the 512K L2, and 1GB of RAM.

Under the boot tab you can do a manual boot from a device and path. The PMON command
devls will give you the bootable devices, but there are by default only two:
rtl0 , i.e., the onboard Ethernet, a