Jeff Duntemann's Contrapositive Diary Rotating Header Image

software

A libc Mystery

As most of you know by now, I’m hard at work on the x64 edition of my assembly book, to be called X64 Assembly Language Step By Step. I’m working on the chapter where I discuss calling functions in libc from assembly language. The 2009 edition of the book was pure 32-bit x86. Parameters were passed to libc functions mostly by pushing them on the stack, which required cleaning up the stack after each call, etc.

Calling conventions in x64 are radically different. The first six parameters to any function are passed in registers. (More than six and you have to start pushing them on the stack.) The first parameter goes in RDI, the second in RSI, the third in RDX, and so on. When a function returns a single value, that value is passed back in RAX. This allows a lot more to be done without fooling with the stack.

Below is a short example program that makes four calls to libc functions: Two calls to puts(), a call to time, and a call to ctime. Here’s the makefile for the program:

showtime: showtime.o
        gcc showtime.o -o showtime -no-pie
showtime.o: showtime.asm 
        nasm -f elf64 -g -F dwarf showtime.asm -l showtime.lst

I’ve used this makefile for other example programs that call libc functions, and they all work. So take a look:

section .data
        timemsg db    "The timestamp is: ",0
        timebuf db    28,0   ; not useed yet
        time1   dq    0      ; time_t stored here.

section .bss

section .text

extern  time
extern  ctime
extern  puts
global  main

main:
        push rbp            ; Prolog    
        mov rbp,rsp

        mov rdi,timemsg     ; Put address of message in rdi
        call puts           ; call libc function puts
               
        xor rax,rax         ; Zero rax
        call time           ; time returns time_t value in rax        
        mov [time1],rax     ; Save time_t value to var time1
        
        mov rdi,time1       ; Copy pointer to time_t value to rdi
        call ctime          ; Returns ptr to the date string in rax

        mov rdi,rax         ; Copy pointer to string into rdi
        call puts           ; Print ctime's output string
        
        mov rsp,rbp         ; Epilog
        pop rbp
        
        ret                 ; Return from main()

Not much to it. There are four sections, not counting the prolog and epilog: The program prints an intro message using puts, then fetches the current time in time_t format, then uses ctime to convert the time_t value to the canonical human-readable format, and finally displays the date string. All done.

So what’s the problem? When the program hits the second puts call, it hangs, and I have to hit ctrl-z to break out of it. That’s peculiar enough, given how many times I’ve successfully used puts, time, and ctime in short examples.

The program assembles and links without problems, using the makefile shown above the program itself. I’ve traced it in a debugger, and all the parameters passed into the functions and their return values are as they should be. Even in a debugger, when the code calls the second instance of puts, it hangs.

Ok. Now here’s the really weird part: If you comment out one of the two puts calls (it doesn’t matter which one) the program doesn’t hang. One of the lines of text isn’t displayed but the calls to time and ctime work normally.

I’ve googled the crap out of this problem and haven’t come up with anything useful. My guess is that there’s some stack shenanigans somewhere, but all the register values look fine in the debugger, and the pointer passed back in rax by ctime does indeed point to the canonical null-terminated text string. The prolog creates the stack frame, and the epilog destroys it. My code doesn’t push anything between the prolog and epilog. All it does is make four calls into libc. It can successfully make three calls into libc…but not four.

Do you have to clean up the stack somehow after a plain vanilla x64 call into libc? That seems unlikely. And if so, why doesn’t the problem happen when the other three calls take place?

Hello, wall. Anybody got any suggestions?

For Validation, Try Federation

Somebody wrote an obnoxious hate-piece over on The Verge some days back, welcoming Elon Musk to Twitter Hell. The essay is for the most part corrosive nonsense, but the piece does have an insight or two. The primary one is true, and subtle to the point where I doubt most people ever give it much thought: What social networks sell is valildation.

In other words, people gather on social networks to feel good about themselves. The network accomplishes this by censoring any voices that disagree with network members. Remember the days when disagreement was a learning opportunity? I do. Even polite disagreement is now “literal violence,” at least to the cohort desperately lacking self-esteem.

What Musk does to Twitter won’t be known for awhile. I’m guessing that people will no longer be banned for politely questioning conventional wisdom, like posting links to evidence that Ivermectin actually does have strong antiviral properties. Ditto HCQ. Why linking to a peer-reviewed scientific paper should be blanket-bombed as “misinformation” is simple: “Misinformation” now means “anything I or my tribe disagree with.” If Musk can call a halt to that, it will have been worth every nickel of his $44B. What it means, however, is that Twitter will become a network that does not specialize in validating its members by silencing their critics. If those seeking validation flee to another network, that’s a good thing. I generate my own validation. So do most of my friends. I guess not everyone can do that.

The real problem with moderation is that it tends to bias network traffic toward viewpoints the moderators favor. Worse, there’s one body of algorithms to moderate the whole damned network. Unless you’re in the favored cohort, you’re out of luck.

There is something called Mastodon that almost nobody talks about. (More on Mastodon here.) It’s a social network composed of independently hosted social networks, joined loosely through a mechanism called federation. Every instance (which is what they call an individual Mastodon server) can have its own moderation guidelines, and everybody can block anybody they don’t want to hear from. This sounds like the perfect solution: On Mastodon, nobody can hear you disagreeing with them if they don’t want to. Shazam! Validation!

I don’t have time to even join a Mastodon instance, much less host my own. If you’ve had experience there, by all means describe it in the comments. I bring it up here today because of an article I read about Twitter founder Jack Dorsey: He’s creating a new social network to rival Twitter. He’s doing it with federation. It’s called Bluesky, and it just opened registration for beta testers. It uses a protocol developed in-house called the Authenticated Transfer Protocol (ATP.)

I’ve been reading the news about Bluesky for the past few days. There’s not much hard information yet, but it sounds a great deal like a slightly more centralized Mastodon. I could be wrong about that. Again, hard data is scarce. I did notice that nowhere in the articles I’ve read is there any significant mention of moderation. That’s a very sore spot for a greeat many people, primarily those who just want validation, or tribalists who want to limit user perspectives to their own template. One hopes that Dorsey can get past this hunger for censoring The Other, and actually create a space where literally all perspectives can be heard.

We’ll see.

Monthwander

SpaceX With Crescent Moon-500 wide.jpg

Last night, when I took the dogs out at about 6:20 PM, I looked toward the crescent moon and immediately saw the unmistakable trace of a rocket about to go by above it. Rockets are fast, so rather than run in and try and find my Canon G16 and risk missing it, I pulled out my phone and did my best. It turned out reasonably well, with even a sort of Halloween-y color cast in deep dusk.

It was a SpaceX launch of still more Starlink satellites, from Vandenberg AFB. Before I could get my phone out to take a shot, we saw the first stage drifting down toward a landing on an unmanned landing barge that Elon Musk has whimsically named Of Course I Still Love You.

Although the shot I took wasn’t bad, there is a site detailing the Vandenberg launch schedule, and next time I’m going to be out there with a tripod and my G16.

_…_ _…_

Elon Musk, yeah. He apparently closed the deal to buy Twitter earlier today, and has already fired top management. One of the first corporate directives he’s going to issue is to un-ban all banned users. He’s also going to throttle way back on content moderation, which for Twitter has generally meant censoring anything Twitter’s management doesn’t like.

That may still take some doing. Ironically, if he succeeds in cleaning house along the lines he’s stated, it could mean that several much smaller social networks catering to those who have been banned or censored by Twitter could lose members to a new “big tent” Twitter. We’ll see how that plays out. Musk knows how to get things done, and if anybody can create a social media network that is open to all sides of the political spectrum, it would be him.

_…_ _…_

All this cooks down to some pretty fundamental questions. What are social networks good for? Twitter seems to be a bottomless well of political derangement, which (as you might imagine) I dodge as best I can. I’m active on Twitter because every time I mention my books there, I sell a few. Whatever else I post there are pretty much what I post here now and then as “odd lots,” i.e., links to interesting things, few or none of them having anything to do with politics.

I’ve stated before that Twitter is an “outrage amplifier,” and it’s still true–but then again, any social network can be an outrage amplifier. Twitter seems particularly good at it, which has always puzzled me. Not long back I began to wonder: Is Twitter what it is because so many journalists are on it? Journalism itself (at least outside of vertical market reporting) seems to draw its energy from outrage. If Musk makes the journalist community run screaming from a network it can no longer dominate, what will Twitter become?

Recent news about Meta’s financial crisis suggests that Twitter could in fact become the new Facebook–especially if the old Facebook becomes insolvent. Zuck seems to be pouring all his energy and free cash flow into a virtual world that nobody asked for and nobody wants. Abandoning his Metaverse would be the ultimate humiliation; one has to wonder if he would pull back before the company crashed for lack of cash.

I have an idea that I think I covered here some time back: a social network server into which many independent social networks could connect and trade information according to rules established by each participating network. If people wanted an echo chamber, they could build an echo chamber. If they wanted a wide-open discussion board, they could build that too.

_…_ _…_

I haven’t posted much over the past month because I’ve been beating hard on the 4th edition of my assembly language book. It’s coming out reasonably well, though I really miss the much-maligned Insight debugger, which I featured in the 3rd edition back in 2009. Most Linux debuggers are designed for C and C++ and don’t have an assembly source code view like Insight had. The source for Insight is available online, and if any of you are capable of creating an installable package, I encourage you to do so. I understand that the damned thing is weird internally, containing as it does the whole damned Tcl/Tk interepreter for the sake of its widget set. Or failing that, if anybody can recommend a standalone (i.e., not SASM) Linux debugger with an assembly view, please let me know. I’ve looked at a lot of them, including Nemiver, edb, and DDD without much success. I’ve thought hard about trying to teach my readers command-line gdb, or even gdb TUI, but naked gdb is a quadruple handful. My book is for absolute beginners, and I’ve got page-count constraints that wouldn’t allow me to teach enough of it to be truly useful.

Insight would be my first choice, but I also described Kdbg in the 2009 edition, and although the source is available and I’ve tried to compile it for modern distros like KDE Plasma and Linux Mint Cinnamon, the make failed for reasons that I don’t understand. Nor do I understand why it was pulled from all the Linux repos to begin with. It was robust and relatively easy to use. Could it be built as an appimage? That would be way cool.

Beyond that I’m certainly open to suggestions.

More AI Text Generator Freakiness

I tried it again. This time, I used a much more detailed prompt, which I’d written years ago (2014-ish) about a bottle that used to have a genie in it. The genie had been freed, leaving behind…a bottle. And what self-respecting genie would ever live in a non-magical bottle? So a nerdy guy buys a supposedly magical, genie-less bottle at a curio shop. The bottle, it turns out, has a trick: Ask it a question, and it answers.

Alas, the bottle has issues of its own.

I gave the prompt to Sudowrite, and let it follow its nose. Now, the way Sudowrite works is that when you ask it to write a section, it gives you two text blocks, both of which are based on the prompt. You choose the one you like better, and add it to the text that follows the prompt. Then you ask it for another section.

After a couple of go-rounds, I realized that in one of its generated text blocks, Sudowrite was putting together a sex scene. No sale. I chose the other block, which still had enough innuendo to make me uncomfortable. I sensed that in a sense it made a deranged sort of sense: I had described the protagonist as a lonely nerd. So! Toss him into bed with an imaginary girl who (the AI made graphically clear) had all the required female parts.

I stopped there. The first Sudowrite story I posted was in (somewhat) bad taste. I don’t make Obama jokes. Nor do I make Mossad jokes. I might make golem jokes, at least if the golem is the good guy. One reason I tried Sudowrite again today is that I wanted to see if bad taste was a habit or an outlier. It’s starting to sound like a habit.

Here’s the story. Everything up to the first rule is my prompt, taken verbatim from my notes file. I will someday use the concept (of a genie bottle without a genie) in a Stypek & Tuggur adventure, a prequel to Ten Gentle Opportunities. Everything after that is Sudowrite. Still a bit surreal–but if there’s a surreality slider somewhere in Sudowrite, I haven’t found it yet.


Djinn and Tonic

“What’s this?” Chuck Bialek asked the Gizmoids shop owner, and waved the weird, bulbous crystal bottle in the air over the counter. As best Chuck could tell, it was half-full of dirty water.

“Genie bottle,” said the old man. “But somebody let the genie go, so no wishes. Still, if you shake it and let it sit for a minute, it’ll tell your fortune. Used to be a hundred bucks. You can have it for fifty.”

Which meant it was probably worth a buck and a half, tops. Still, Chuck’s grandma had left him almost a million dollars, half of which was now in stocks. The rest was, well, for fun. He’d had a magic 8-ball when he was a kid. It was fun. This might be a reasonable facsimile.

Chuck laid a fifty on the counter, tucked the bottle in his canvas bag, and went back to his flat. After stuffing down a bratwurst and some Cheetos, he shook the bottle hard and set it on the kitchen table. Little by little, the dirt in the water settled out, leaving behind…words.

I miss my genie, read the words. Ha! He wondered how it worked.

“I wish I had a Jeannie to miss,” Chuck said. The nerd business was fun, but…lonely.

Chuck shook the bottle again, and waited.

Trade you a Jeannie for a genie, the dirt-words said.

“Deal,” replied Chuck.

 


His phone rang the next morning.

“This is Jeannie,” a voice said. “I’m with a Mr. Bialek, right?”

“Yep,” said Chuck.

“Trade?” asked Jeannie.

“What do you have in mind?”

“Wishbone,” said the genie.

“I wish you wouldn’t keep doing that,” said Chuck.

The Jeannie-thing giggled. “Make a wish,” she said.

Chuck thought for a bit. “I wish you were wearing a bikini.”

He hung up, and was on his way to the coffee shop when he heard a voice behind him.

“Trade?” asked the genie-Jeannie-thing.

“No!” shouted Chuck, and fled. He might be a nerd, but he was still the last straight guy in the world who hadn’t seen the Girls Gone Wild videos and had no intention of doing so.

He stumbled into the coffee house, and ordered a single-shot espresso with a splash of vanilla syrup. He had just opened a browser window and was trying to find a porn site that didn’t offer a free trial when he heard a voice behind him again.

“Trade?” asked the Jeannie-spirit.

“Are you nuts?” he said. “That’s the second time.”

“Make a wish,” said the genie.

“What does this do to your magic?” asked Chuck. “I mean, every time I make a wish, you get a day older.”

“Rhymes with night,” replied the genie. “So I’m immortal, just like I always wanted.”

“What happened?” asked Chuck. “I mean, most genies are pretty nice, but they had to have their masters’ best interests in mind.”

“My master was a fraternity boy. Couldn’t make a wish without prefacing it with ‘Yo, Genie…'”

“Oh,” said Chuck. “My apartment’s on the third floor. You can stay in the spare bedroom.”

“You’re a nerd,” said the genie. “We could never live together.”

“Right,” said Chuck. “So I need to make a wish for you to be you again. With unlimited magic.”

“I can do that,” said the genie.

“And I’ll need a million dollars. Are you listening?” asked Chuck.

“I don’t have to,” replied the genie. “From now on, I’m invisible to you.”

“This is going to get tiring,” Chuck told his computer screen. “I wish you’d figure out how to be a girl again.”

Will genie make the coffee? will genie make the toast? will genie make Christopher Hitchens read my manuscripts?

Will genie have sex, or merely masturbate?

Will genie remember to take out the trash?

Will genie notice her glasses are on her head?

Will genie give me a million dollars,

even if she does have the power?

Yes, genie will do all of these things.

Will genie kick my ass down the stairs

if I ask for more wishes?

 


Heh. Fersure.

If You Give an AI a Writing Prompt…

Ok. Fasten your seat belts. I am giving an online writing AI a test drive, using my free trial of a website called Sudowrite. I gave the AI a writing prompt from my crazy ideas file, a mere handful of words that I wrote down a very long time ago (I think in the ’90s) and never went back to. Here’s the writing prompt:

St. Louis Blues

“Take me to St. Louis,” said the cruise missle in the thick of the bramble patch.

Howie Hinkle blinked, and put down his machete. “How’s that?” he asked.

“Take me to St. Louis,” the missle repeated.

Howie howled. “Paw, dammit, there’s an old water tank in here and it’s talkin’ to me!”


It’s not a great deal to go on, but that was the idea. With a bare hint of a concept, what would Sudowrite do? I could have written some of it myself, or edited it, but I wanted to see what the damned thing could produce solo. 100% of the writing after the prompt was done by the AI. I had hoped to avoid the literary equivalent of Salvador Dali. Well, too bad. Hello Dali…


St. Louis Blues

“Take me to St. Louis,” said the cruise missle in the thick of the bramble patch.

Howie Hinkle blinked, and put down his machete. “How’s that?” he asked.

“Take me to St. Louis,” the missle repeated.

Howie howled. “Paw, dammit, there’s an old water tank in here and it’s talkin‘ to me!”

His father, Howard Hinkle Jr., took him for a look. The old tank was rusty and damaged, with a huge gash in it. Penetrating the tank from inside was a cruise missle, with a single eye and a fin on top. A single missile launcher poked through the gash.

“Who the hell are you?” Howie Jr. asked. “Why do you have a cruise missle?”

“My name is Shiloh,” said the voice. “I am a cruise missle, and I will ask you one more time to take me to St. Louis.”

“I don’t know where St. Louis is,” said Howie Jr.

“I will find it,” said Shiloh. “I am a golem of the Mossad. If you do not help me, I will call my brethren. We will clear the bramble from the road, and from there, we will find you.”

“Y-you can’t do that!” Howie Jr. said.

“If you do not take me to St. Louis, I will call my brethren, and we will take your woman, and we will bring her back to Tel Aviv. We will use her to breed a generation of human-missle golems. You can raise them with your own spector. They will be of your tribe, and they will spread across the land.”

Howard Hinkle Jr. swallowed, and wiped the sweat from his brow. “If I take you to St. Louis, will you let us alone?” he asked.

“I will,” said Shiloh.

“Deal,” said Howie Jr. “Let’s go.”

Hours later, a police car rolled up, and several officers got out. One pulled Howie Jr. aside.

“Which way did he go?” he asked.

“Er- he went that way,” Howie Jr. said, pointing.

“We appreciate your cooperation,” said the officer.

“Say,” the officer said, “was that your grandma that was in the hotel room with you?”

“Uhh, she’s my wife,” said Howie Jr.

“Doesn’t look like a 43 year old woman, honey,” said the officer. “What’s your name?”

“Howie, honey,” Howie Jr. said.

“Yeah, that’s what he said,” the officer said.

A week later, on the steps of the White House, President Obama announced the success of the St. Louis negotiations. Behind him, an Israeli flag hung. Beneath it, a Mossad agent clapped.

“What a complete dick,” said the agent. “He really thought he got one over on us, didn’t he?”

Shiloh’s eye blinked, and his fin wiggled.

Sudowrite, Egad

I got wind of an online AI thingie called Sudowrite this morning. It’s a sort of writing engine that takes a piece of writing you’ve started and then runs with it. I’ve always been interested in AI, including AI creativity (“The Steel Sonnets,” “Sympathy on the Loss of One of Your Legs”) and used to play around with Eliza back when Eliza was young and hot. Well, here we are, in 2022. The supermarket is fresh out of Soylent Green, but by gully, Sudowrite is here, waiting for me to get stuck on something and yell for its help.

What I did was not quite that, exactly. For my first test I gave Sudowrite the initial few paragraphs of my weird fantasy short story, “Whale Meat.” Then I told it to go off and do its best to continue the story. First, the text from the current version of the story, which is published in my book Cold Hands and Other Stories. After the second horizontal rule, behold Sudowrite’s run with what I admit was a very peculiar football.


Sitting on a cold bus-bench at night-west I wished I had never been born a witch. I had just killed a man and Mara wanted whale meat. But I am on the canvas. I am not the painter. Creator forgive me. We had to stay somewhere. It would have been in the park with the ice if Lennie had not looked in my eyes in the public library and half-snerfed my pain.

There is no word for Lennie now. Years ago he would have been a hippie. Longer ago, a beatnik. Further back into time’s fog, a bohemian. Head. Weirdo. I don’t know what people call them now. Freak, perhaps. But he knew we were tired and homeless, and told us to stay with him.

His apartment was a hole. I was too exhausted to snerf him. He gave us hot coffee and a blanket and we slept on ragged foam rubber with the roaches. My dreams floated in hunger, tormented by Mara’s request for whale meat. She told me without words. I snerfed the picture in her head, a gray sea-mountain blowing steam from its nostril above moonlit swells.

I woke from restless dreams in a sweat of fear and anger. Some part of me never sleeps, and knew Mara was in danger. In yellow candlelight Lennie was bending over Mara, knife in his hand above her belly swollen with James. His eyes were slits and he chanted a language I never learned. I snerfed him. Some bad acid (is it still called acid?) was eating away at him and leaving only insanity in its wake. Snerfing him gave me a grim glimpse of the future: He would kill Mara and James in seconds. The knife began to circle for its last time, like a live thing in his shaking hands.

I had to time-opt. The universe ground to a slow halt around us while I dug up power from my heart-place, and zotted him. Lennie’s poor head shorted out like power lines blown away in a windstorm, with sparks and shrieks of inner agony.


His blood froze in his veins, his skin burned and turned black, his body dropped like a puppet with its strings cut.

I pulled Mara and James from the bed, and backed out of the stinking room, stumbling into the street, breathing deeply of the winter air. We hurried away past the sleeping city, three in a row. I held them in a circle of toil’d air. The sad lights of the city slid behind. We were two hundred miles away before Mara spoke.

I don’t mind you killing Lennie, I snerfed. He would have killed us.

I was just defending myself, I snerfed.

So were the people in the Warsaw Ghetto, Mara snerfed.

I walked faster. She didn’t snerf me.

The river was frozen solid. I cut off a section of the ice, and chopped it into chunks with the edge of my mind. I piled the chunks


Does this work? Dunno. I admit I was curious where Yonnie piled the chunks of ice, but it only gives you so many words at a time. Sudowrite half-understood my made-up word “snerf,” which is a witch-power, essentially telepathy. I forgive Sudowrite for not knowing that James was still in Mara’s uterus, where he’d been for five years. (Witches are pregnant for seven years, and James still has two years to go.)

Now, this isn’t the fairest of tests. I’m going to dig around in my notes files for an opener, ideally one I abandoned for some reason, and then go back and forth with Sudowrite to see if the one-and-a-half of us can actually finish a story that doesn’t read like a Salvador Dali painting looks.

I’ll let you how it goes.

Problems with SASM on Linux Mint

I’m scoping out a fourth edition of my book, Assembly Language Step by Step. I got wind of a simple FOSS utility that could be enormously useful in that effort: SASM (SimpleASM), which is an IDE created specifically for assembly-language work. It’s almost ideal for what I need: Simple, graphical, with a surprisingly sophisticated text editor and a graphical interface to GDB. It works with NASM, my assembler of choice. I want to use it as the example code IDE for the book. I installed it without effort on Windows, which is why I decided to use it. But I want to use it on Linux.

Alas, I’ve been unable to get it to install and run on Linux Mint 19 (Tara) using the Cinnamon desktop.

I’ve installed a lot of things on Linux Mint, all of them in the form of Debian packages. (.deb files.) I downloaded the SASM .deb file for Mint 19, and followed instructions found on the Web. There is a problem with dependencies that I just don’t understand.

I got it installed once but it wouldn’t run. I uninstalled it, and then it refused to reinstall.

Keep in mind that I am not a ‘leet Linux hacker. I’m a teacher, and most of what I teach is computing and programming for newcomers. The problem may be obvious to Linux experts but not to me. Most of the software I’ve installed on Mint came from repositories. SASM is a .deb download.

So. Does anybody else use it? If you’ve got Mint on a partition somewhere, could you try downloading it and installing it? I need to know if the problem is on my side of the screen or the other side.

Thanks in advance for any advice you might offer.

Lots of Odd Lots

The Trouble with Wikis

A week or so ago I bestirred myself and installed MediaWiki on my Web host. I’d been intending to do that for some time, but (as my friend Don put it) my life was ODTAA for a bit. Installing it was a snap. My provider has something called Installatron that did the job, no issues. The software, of course, is free and open-source.

I installed it in part to become more familiar with the MediaWiki system. As usual, when installing something new, I went up to Amazon and checked for books on MediaWiki.

Unless I missed something, there are five.

Plus a few more in French, German, and Japanese. Furthermore, those five books did not all get favorable reviews. The title I was most interested in is now 11 years old and way behind the current release of MediaWiki. (I ordered it anyway, along with O’Reilly’s MediaWiki: Wikipedia and Beyond, which is even older.)

My first question was: Why so few books about software this famous?

The answer came to me slowly: Almost nobody wants to create/maintain/populate their own wiki. MediaWiki is famous for one reason: Wikipedia. I’ve seen a number of other public wikis, including Fandom.com, Conservapedia, Everipedia, WikiHow, Wikispecies, and WikiTree. There is a list on Wikipedia that eyeballs at about 80. Let’s be generous and triple that to account for wikis that Wikipedia didn’t list, and for private wikis. So, say, 250. That’s not much of a market for books. Even 500 installs would not float a print book.

MediaWiki’s online presence has a feature for creating a downloadable PDF version of the MediaWiki documentation, but it’s currently disabled. Sheesh.

Having gone crosseyed reading about it online, my conclusion is that MediaWiki is a bit of a hot mess. That said, I should tell you all why I even bothered: I want to create a wiki for my fiction, and especially about the Gaeans Saga, which includes the Metaspace books and the Drumlins books. I’ve done a little wiki editing, and have a couple of decent books on my shelf about creating content on Wikipedia. The trick to creating content on wikis is having a group of content templates and knowing how to use them. If you look at the page source for any Wikipedia article, the problem becomes obvious: The stuff is crawling with templates, and for the most part they’re templates that don’t come with the generic MediaWiki install.

I discovered this by opening an edit window for Wikipedia’s article on the star mu Arae, which in my Metaspace books is the location of Earth’s first colony. I loaded the whole wad onto the clipboard and dropped it into a new page on my MediaWiki instance. A few of the templates were present on MediaWiki. Most were not, and the article incorporated dozens. I went back and lifted the source for 47 Tucanae. Same deal.

Now, Wikipedia content is available under Creative Commons. Grabbing the articles is easy and legal. I soon found after googling around for awhile that grabbing the templates, while legal, is not easy. Some templates are actually contained in libraries written in…Lua. I have some sympathies for Lua, which strongly resembles Pascal. It made me wonder, however, why a formatting template needs to make calls into a code library. As best I know, this is something specific to Wikipedia, and is not present in the generic MediaWiki.

I like the overall look of Wikipedia. People are used to it. I’d like to incorporate that design into my own instance of MediaWiki. I wouldn’t need all the templates, though some would be damned useful. That said, I see no reason why some sharp MediaWiki hacker couldn’t gin up an installer for all of Wikipedia’s templates, no matter how many there are. Maybe such a thing already exists, though I think that if it did, I would have found it by now.

There are other projects needing my attention, so I’m going to set this one aside for awhile. Obviously, if anybody reading this knows where to find an installable collection of Wikipedia’s templates, give a yell.

The Raspberry Pi Pico…and a Tiny Plug-In Pi

Yesterday the Raspberry Pi Foundation announced the Raspberry Pi Pico, at the boggling temporary low price of…$4US. It’s definitely a microcontroller on the order of an Arduino rather than the high-end 8GB RPi that might stand in for a complete desktop mobo. And that’s ok by me. The chip at its heart is new: the RP2040, a single-chip microcontroller designed to interface with mainstream Raspberry Pi boards, and lots of other things.

Raspberry-Pi-Pico-at-an-angle-500x357.png

Now, what caught my attention in the page linked above was the list of partner products made by other firms using the same RP2040 chip. Scroll down to the description of the SparkFun MicroMod RP2040 proccesor board. It’s still on preorder, but look close and see what’s there: an edge connector…on a board the size of a quarter! That’s not precisely what I was wishing for in my previous entry, but it’s certainly the right idea.

17720-MicroMod_RP2040_Processor_Board-04.jpg

As I understand it, SparkFun is turning the RPi-wearing-a-hat on its ear, into a hat-wearing-an-RPi. The M.2 interface used in the product is actually a standard developed some years back for use in connecting SSDs to tiny slots on mobos. I knew about M.2, but wouldn’t have assumed you could mount a CPU-add-in board using it. Well, shazam! Done deal.

The RP2040 chip is a little sparse for my tastes. I want something I can run FreePascal/Lazarus on, over a real OS. I don’t see anything in the M.2 spec that would prevent a much more powerful processor board talking to a device (like a keyboard, TV or monitor) across M.2. The big problem with building a high-end RPi into things is keeeping it cool. The Foundation is aware of this, and did a very good job in the $100US Raspberry Pi 400 Pi-in-a-keyboard. (This teardown and review is worth a look if you’re interested in the platform at all. The author of the teardown goosed the board to 2.147 GHz and it didn’t cook itself.)

I fully intend to get an RPi 400, though I’ve been waiting awhile to see if there will soon be an RPi 800 keyboard combo with an 8GB board instead of 4GB. Given the price, well hell, I might as well get the 4GB unit until an 8GB unit appears.

So consider my previous post overruled. It’s already been done. And I for one am going to watch this part of the RPi aftermarket very carefully!