Rob's Blog rss feed old livejournal twitter

2020 2019 2018 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2002

January 14, 2021

Good news: we have a fourth vaccine, this one from Johnson and Johnson. Similar to the Oxford vaccine, it's a conventional "store below 8 degrees celsius in a normal refrigerator, lasts up to 3 months, only needs one injection" type. Not the fancy new MRNA nonsense that decomposes instantly upon exposure to brightly colored wallpaper or in the presence or large flowers. And remember that CEO who took a pay cut so he could raise his minimum employee salary to $70k/year? His company has survived the pandemic just fine.

A bit concerned about an ongoing thread on linux-kernel where they're tacitly acknowleding that since the Linux Foundation finished the corporate-friendly purge of all hobbyists, their development community is not just aging but shrinking (obituaries aren't quite a section at Linux Weekly news yet, but they're definitely increasing in number), and the response is to throw hardware support overboard.

Unfortunately arch/sh looks a lot like #1 on that thread's list: it started renesas-only, they abandoned it, now it's SEI/Coresemi only because we haven't built a proper community and we vanish for months at a time... Not an _immediate_ threat, but despite repeated poking Rich hasn't sent patches upstream in months.

Speaking of which, the post in the thread I linked to is by the guy who broke qemu on m68k, I should poke him about that...

Also, now that qemu-system-arm has -M emcraft-sf2 support, I'm trying to find the kernel .config for smartfusion2. This is the board I used at innoflight, it's a nommu cortex-m3 system (with a large currently irrelevant FPGA attached) and would be great to add to mkroot's list of test systems as my cortex-m boot. (Arm thumb2 nommu: check.) Alas, I last used this 3 years ago (in one of the holes in my blog, I should check my USB backups to see if I can find the files I wrote but never published during that period) and I can't find the kernel config for it. The emcraft website (a company headquartered in Moscow) wants you to register to download half their stuff. (It's the same problem Renesas had with qemu-system-sh4, the idea that anyone other than paying customers exists is confusing to them.)

Emcraft has their own kernel fork on github, and the guy who submitted support to qemu also has a github but I'm not finding an obvious defconfig there either. So I emailed him. (I VAGUELY recall it's an stm32? I think? But I built stm32_defconfig with the musl-cross-make cortex-m toolchain I build toybox release binaries with, and -kernel vmlinux died with "can't escalate 3 to HardFault" whatever that means, and qemu couldn't load -kernel arch/arm/boot/xipImage at all. And when you google a LOT to follow obscure links to archived pages it just boils down to "cd into our magic tarball and type make", and the page ends with a note effectively saying "buy the .config from us, no questions answered without money".)

In toysh land, run_function() is now run_lines(), and call_function() has been broken out into its own thing, and I got rid of the pl local variable to just use it out of TT.ff->pl each time. (Which is verbose, but means there's a single location for it. Having a local variable cache a global variable is what the optimizer is for. Keeping said cache in sync by hand and flushing it back as appropriate is a brittle pain.)

This is a much longer slog than I'm happy with before I can get the pieces back together compiling and running the test suite again. I'd _really_ like to get a release out before getting on the plane back to tokyo...

January 13, 2021

When the electoral college vote reconvened after the coup in the capital, the GOP continued to object to Biden winning, and now they're calling for unity. That's not how unity works.

The coup was an inside job. There was nothing spontaneous about it, it was planned and supported by the entire republican party. People trained for it. Then right after the insurrection the GOP reps still voted against certifying the election, and now they object to impeachment. They still side with the treasonous dementia patient, even now. That's what their votes mean. It's ok when we do it, only what YOU do can ever be wrong. The GOP wants "conservative" judges who can outlaw abortion and so on, and are happy to murder people to do it, and scream victimization at minor personal inconvenience, all while mishandling a pandemic.

The problem is rich white people. They're who caused the civil war, they're why we haven't got medicare for all or Universal Basic Income, they've been driving up the price of rent and real estate, and now they're trying to violently undo a democratic election.

Another report just came out about the Catholic Church's Magdalene Laundries where pregnant women were kidnapped, forced to give birth, and the results either given up for adoption or interred in mass graves (15% mortality rate because they gave basically no medical care due to "sin"). On this side of the atlantic evangelicals trying to take down the US government are a more immediate concern. After all, Ireland shut down the church's pregnant woman kidnapping operation in 1998, and voted to legalize abortion two years ago.

Defund the police and give the entire department's budget to this guy and let him sort it out.

Seriously, the whigs ended, the GOP can too.

January 12, 2021

Sheldon Adelson died today. He was the largest political donor in the USA, all of it going to GOP loons. I know it's bad form to speak ill of the dead but he earned it. Despite everything, it is a good day.

The toysh function() plumbing has a design contradiction: after the set of design changes I'm making, it won't actually be called to run shell functions.

I don't want to recursively call run_function() because nommu has limited stack depth (both because it cann't do on-demand allocation without page faults so it has to consume the entire maximum amount of physical memory up-front, and because the stack has to be a physically contiguous memory allocation which is often the limiting factor on a busy nommu system; so while most linux stacks are 8 megs/thread, nommu stacks are usually in the 8k-128k range).

So I moved the blockstack list from a run_function() local variable into a new function call linked list in the globals() block, which I kind of need anyway to show the function call stack for debugging purposes. I still have pl and blk cacheing data out of the new struct sh_fcall (largely because I don't want to change everything to TT.ff->blk and TT.ff->pl yet which makes me have to re-wordwrap a bunch of lines), and pplist is still a local because a function call in the middle of a pipeline has to run in a subprocess for the same reason loops do (which boils down to "the halting problem"; there's no guarantee any loop will actually terminate but piping the output to something that consumes finite input and then closes the pipe should usually terminate the earlier process, so they MUST go in parallel to not hang). That means each pipeline stays within the same function context, with a short lifetime appropriate for a local variable.

But if the function call stack is a linked list in globals, then calling a function is logically a builtin or "break" style inline that adds a new entry onto the function list and updates the two local cache pointers. (Flushing the old ones into the old struct because it has to know what pl position to return to when this function ends, and this function has a new if/else/while block stack.)

I suspect all the local variable cached entries should just move into TT.ff and be dereferenced every time they're used, I've already moved a few of them (like the TT.ff->urd pipeline unredirect list for recovering redirections; remember I dup/close file descriptors to high filehandes and then dup/close them back down after the vfork() because nommu support), which means the list can never be empty. (Unlike the blk list, when is checked for emptiness ala !blk in several places.) Right now it run_function() adds a TT.ff entry to the list when it's called, but that's the same "call run_function() recursively to call a shell function" logic I'm trying to avoid here. So I need to split that out into a separate function that's called before run_function(), and then rename run_function() to something else. (My sleep deprivation suggests repeat_until_spanked() which is a reference to Matt Groening's "life in hell" comic from before he started The Simpsons. It's probably run_lines() to go with parse_line().)

The difference between the new struct sh_fcall and the old struct sh_function is that the first is runtime (argv[] and such the shell function was called with) and the second is parse time (list of commands in pipelines and blocks). Possibly the new one should be sh_function and the old one sh_parse (or some such) but renaming a bunch of things at once is hard to keep track of. (My problem here is this change is naturally very big, and doing it in stages is tricksy.) So sh_fcall is the runtime function call stack, and sh_function is a parsed block of input data with a lifetime, which again gets strange when "if true; then blah() { echo hello;}; fi" starts with the if, but the if has already run and you have a pointer to the echo at the start of blah and the whole parsed block has to stick around until that function gets undefined. The fact function definitions can live in other function definitions... As I said, reference counting.

January 11, 2021

The GOP can go the way of the Whigs and Federalists before it. In reality, it's going the way of the confederacy. Here's a thread on how white supremacy defends itself by lynching white people who step out of line.

The party has switched all its efforts to defending itself. The I was only following orders defense from the Neuremberg trials breaks down when you make the laws, and keep doing the behavior that got you in trouble. Numerous GOP lawmakers were directing the coup.

January 10, 2021

I'm trying to write a regression test for the behavior difference between

function() { stuff; }


function() ( stuff; )

And although the PID constantly varies I went "I'll just curly bracket collate it and pipe the result to sort -u | wc -l and expect a 1 or a 2 to distinguish the behavior" and then bash does:

$ { echo $$; chicken() { echo $BASHPID;}; chicken;}
$ { echo $$; chicken() { echo $BASHPID;}; chicken;} | cat

Why? Ah! If that first $$ is $BASHPID then they match, the pipeline is doing a subshell for each segment and $$ is the root shell. The important part is that all the elements of the outer { } are executing in the same process.

January 9, 2021

I'm hoping that Boomer pathologically abusive misogynistic racism is coming to a head and the fever's breaking, but there's so much clean up to do. The Boomers' cultural history of racism and domestic abuse isn't exactly new, but it is ongoing. And their whole society is bent to protect their racism and sexism: a man who drove his car into BLM protestors pled guilty and is not going to prison, will in fact have the incident erased from his record in 3 years, because he's a white male.

As always, follow the money, the insurgents are useful idiots for billionaires. Let's explain how stupid these clowns are: one of the guys photographed on the floor of congress during the riot, in full tactical gear, talking to a guy in a maga hat, holding plastic flex cuffs (often misidentified as zip-ties but these were disposable handcuffs), who made a bee-line for Nancy Pelosi's office as soon as he got in the building, now claims he found the flex cuffs on the floor and was just holding them, was wearing the tactical gear to protect himself from Antifa and BLM, and thought he was allowed in the building.

Don't let escalation distract you from what they've already done. One purpose the terrorist riot at the hill served was to distract from the georgia call, which wasn't even the only call. (Of course not merely distract, just like domestic abusers escalate from passive aggressive insults to shouting to hitting they double down until you bust out, and are backed by billionaires...) And yes, the invasion was organized and carried out with the full unwavering support of their party, it was entirely predictable and was racist on every level.

Their attempts to rehabilitate hitler continue: apparently nazis haven't had a bad enough reputation? (And yes, these clowns are full nazi, with zero loyalty even to each other. They're throwing each other under every bus.

And now that this iteration of coup has failed (they're trying again this weekend) they're trying to laugh it off, which I fully expect the Boomercrats to fall for.

January 8, 2021

There is good news today. And people doing excellent forensic work. (We still need to defund the police.)

Trying to focus on toysh stuff despite everything. Not doing a great job. Over in bash, pipelines are running just about everything in subprocesses:

$ chicken() { echo $$ $BASHPID; }; echo $$ $BASHPID>&2  | chicken
5109 5165
5109 5166

Note how neither is under the $$ parent PID. I'm not currently doing this, but I suspect I have to if things like:

$ while X=$(($X+1)); do echo $X; done | \
> while read i; do echo $i; done | head -n 5

Are ever going to work properly. Otherwise, the first while loop never exits so it doesn't move on to the second while loop (which also never exits) so it can't feed data into head. They pretty much have to be separate processes (or something truly horrible with select: no).

January 7, 2021

Of course the GOP can spend years investigating benghazi and and immediately excuse the capitol invasion. They were never about truth, or law, or rights. They're about naked power over everyone else, and nothing else. And they're getting worse, not just because of the "southern strategy" but because gerrymandering causes radicalization. People in those "safe seats" only have to worry about being primaried by a more extreme loon, not about winning the general, so the candidates get ever more extreme (and detached from reality).

Meanwhile, defund the police and a fine is a price.

January 6, 2021

Hands up everybody who's surprised by the coup. Didn't think so. Yeah, it's an even numbered day, I didn't get a lot of programming done.

After losing the senate last night, they're panicing. Thanks to the rules changes they made to fillibuster-proof judges and cabinet nominees so a simple majority can push through any nominee, EVERYTHING is going to be investigated and prosecuted now. They can't survive that. If Biden doesn't pardon them, half the GOP senators are going to wind up in jail.

The literally nazi terrorist mob in Washington DC today isn't the only attack on democracy the GOP is currently performing. (People wonder why I'm not surprised. I'm hoping that the timeline gives us long enough for the Boomers to die.) And of course the police have waffled between useless and actively collaborating, despite people pointing out their much larger racist crackdowns on non-nazis. (Plus how surprised were the capitol police supposed to be when the other side was selling shirts about it with the date on it? Are they now going to ignore the footage?)

I still expect Biden to pardon them all if the lame duck doesn't first. As hilarious a pick Merrick Garland is as attourney general (you wouldn't put this center-right Rockefeller republican on the supreme court? How do you like him NOW!), he's also a terrible choice for AG for significant reasons. Boomers just want things to be quiet for their remaining decade, they don't care who dies in service of Boomer comfort.

Meanwhile, there's still a pandemic. Austin is once again threatening to turn the convention center into overflow hospital beds which doesn't help because the limiting factor is staff (each nurse can supervise at most 2 ventilated covid patients, it's worse in that regard than many other diseases) and we're burning through staff darn fast.

January 5, 2021

Of course they're still lying. They always do. Republicans (and Tories) are fractally evil, example du jour: they prevented regulation of dietary supplements by the FDA (and oppose food labeling in general) so of course dietary supplements have become a major cause of liver failure, even in otherwise healthy people. (Which the pandemic is leaving in short supply.)

The intersection of "do unto others" and "judge not lest ye be judged" is "turnabout is fair play".

January 4, 2021

Monday! Start of a new year, end of the holiday time off. Time to start shouldering the $DAYJOB work again.

The price of batteries went down 89% over the past 10 years, from $1110/kwh to $137/kwh. (Except 137/1110 is 12.33? 100-12.33, or 87.66876 percent which rounds up to 88, not 89?)

Either way, that's almost exactly 3 doublings: 100%/2 = 50%, half of that is 25%, half of that is 12.5%. For a doubling time of 3 years and 4 months. Which means if it keeps going by mid-2024 we can expect batteries under $70/kwh and at the start of 2028 under $35/kwh. (And of course the analysts in that article are expecting it to go down 1/3 of 89% over the next 3 years, I.E. about 30%. That's... not how math works. Seriously, you covered Moore's Law for 30 years and don't understand exponential curves?) And then the analyst talking about how it would take over a decade to replace all the cars on the road, when:

The main reason I haven't put solar panels all over the roof of my house yet is I want about 3 days of battery storage, and while I can afford the panels (and the installation), I can't afford as much battery storage as I want yet. (Sending power from my house back to the grid isn't really something the grid _wants_. Much better to be self-sufficient.)

January 3, 2021

While we're all waiting for Biden to pardon Nixon again (the entire purpose of the DNC at this point is to block AOC), here's a Lovely thread about how most of the online ad industry is demonstrably a big scam that does nothing for the people paying money into it, and how ad buyers are improving their metrics to actually notice.

January 2, 2021

I need to make changes to the existing toysh code in stages, and figuring out a functional and coherent trail of breadcrumbs is tough. The data structures are a house of cards, I move one thing everything wants to switch over to an obvious new organization, but redoing the code to USE that is a giant tangled flag day change that's hard to debug. And I am not at my best right now.


January 1, 2021

I kind of want to start the new year by NOT talking about bad things on odd numbered days, even though late stage capitalism has not let up. (Twitter has now locked my account 13 times for expressing the obvious sentiment resulting from this.)

That said, there is good news. The Boomers get older and more infirm every day and have to give way eventually. Here's an explanatory thread on the structural problems in the DNC that lead to gerontocracy over there, and here's Cory Doctorow recommending another excellent explanatory thread on where money comes from these days. (Reminder, twitter sucks at being twitter and threads randomly end abruptly with a tiny "show this thread" link you have to click to see the rest of the thread. That's why their authors often copy threads they wrote into blog entries which read awkwardly because of the original tweet length constraints they were composed within.)

Ok, I'm up to four shell contexts:

Switching to this requires rather a lot of reshuffling. I've come up with a set of structure definitions in GLOBALS() that I'm reasonably happy with for the moment, but changing all the code to USE them is a big deal and probably has to be done in stages. Global vars are just the top level of local vars, so the shell has to start with an "empty" function call.

The lifetime for sh_parse_context is just outright FIDDLY (see "reference counting", above): the common case is "you're typing at a command prompt" and commands are executed and freed right after, which means parsing shell scripts should work that way too: it remembers stuff it needs to and frees it as soon as it can.

Back to 2020