|
Linux, the Wireless Internet, and MeIt
doesn’t work. I believe here in 2/10, at least a few linices will
connect through your wireless hardware, but many still won’t. If
you’re
thinking of installing Linux and expect your wireless to work, try and
look it
up on the web somewhere somehow. It doesn’t work because wireless hardware is the cutting-edge feature today, and it’s designed to work on Windows. Once that works, the technical knowledge spills onto the floor and the table scraps are picked-up over the months and years by the Linux guys. ... And it doesn’t work also because the Linux guys spend their hours at wonderful geeky places like universities and tech companies where ethernet sockets are everywhere so anyone can plug in — and where the companies at least loathe the uncontrolled proliferation of wireless. ... So the privileged treats of the Linux class are reflected in their wireless neglect. ... And at 1/16, I read yet again, in the technical Q&A of some German Linux magazine, of the endless monstrous delvings a pilgrim was supposed to go through to get his Linux wireless working. Still.... The Broader, More Meaningless Issue: Why Are These Linux Guys Such Mendacious Weenies?I had a revelation, a vision — doubtless one of the 17,000 symptoms of onrushing Alzheimer’s — of all the Linuxoids bonding to their command-line operating system around the same time I was discovering that one could do useful work in Windows 98.... We just went in different ways, us Windows-using guys — accountants, word processors, and even assembly-language programmers — because Windows made those things easier, mostly because it was popular! ... And the Linux guys refined their favorite OS, until today it’s a substantial part of the server market. ... Which servers do not use wireless connections to shoot-out gazillions of bytes. Or heart-breakingly gorgeous GUIs for that matter — the Linux desktop was always an afterthought. ... So give it up guys; stop lying in your magazines and web sites, and admit that Real Men use Linux on the command-line and spit on GUIs. ... Which is the way servers work; the only reason Windows servers include a GUI is because they’re stupid! ... It’s that simple! ... Of course having the odd spare billion bucks makes Microsoft a threat in the server biz, and the race goes not always to the swift and sometimes to the weirdly-incompetent wealthy — but stop the nonsense about your Linux desktop already!!! ... Having ranted all that, it is entirely possible some Google cell phone or tablet computer will take over the world any day now, and then there will be a Linux desktop everywhere. ... But heck, there’s already a BSD distribution everywhere, aka The Macintosh! ... If Google scores, it’ll be just like that — except Linux! —
the often-coherent programmer 1. The 2015 “Mint” Linux did connect without much fuss — but inside VirtualBox. That’s because I used a Vbox “appliance” which was presumably set-up by some kindly geek to work — presumably by supplying a working virtual wireless connection. They can’t afford to do that with actual hardware, which is why it probably won’t work on your computer. Unless you do it inside VirtualBox. So the obvious Linux wireless solution is to only use it inside a working-wireless Windows virtual box.... |
Newbigin’s Harmless Windows/Linux Utilities: Explore2fs and Rawwritewin Rawwritewin
reads/write a diskette to/from a file image. This used to be an almost
essential part of getting a Linux system running, particularly a
dual-boot shared Linux/Windows system, but is pretty-much buried in the
fading dust, since there are basically no diskette drives anymore. (~
1/2
megabyte.) — Wednesday, January 10, 2007 5:31 pm 2/18. I recently rediscovered this charming software in a truly-pointless effort to deal with a silly Olympus diskette-stupidmedia scam and a windows 98 laptop with diskette drive.... |
Wild card expansion in UnixThis section used to be called “Linux Recursive Grep: Insanity or Depravity” or something like that, but then after the passing years, a thoughtful correspondent wandered along and enlightened me. ... This is the Unix recursive grep: ![]() ![]()
|
Tick times: Windows GetTickCount() and Linux times()In ancient days, when assembly language programmers roamed the earth, we were advised to stop using timing loops in our programs — do-nothing waste-time loops like (z80 assembler) ;WAIT
A
MILLISECONDS. These were bad bad bad, because whenever the program moved to a different computer, all the timings would be wrong — your Kaypro and your Osborne (prehistoric CP/M machines) would play different! ... But in those dark days, we didn’t actually have any way to fix this1. ... When we graduated to the wonderful new MSDOS world, IBM-compatible PCs had a timer interrupt, and with some fairly hairy programming one could derive useful timing functions. ... Things toddled-along nicely until Windows95 and Win32, whereupon Microsoft introduced GetTickCount(), and all was made anew. GetTickCount()The Win32 GetTickCount() function returns a 32-bit unsigned number representing the number of milliseconds since the machine was turned-on. It isn’t necessarily accurate to the millisecond, but that’s never been a requirement in our innocent endeavors. ... As for using it, when I googled for GetTickCount() recently, the first thing I found was a Microsoft page with this (correct) example: DWORD
dwStart = GetTickCount(); So What Happens When You Run Out of Ticks?1. Well, that’ll never happen! ... At least it certainly never happened in the fledgling years of GetTickCount(), since the ticks last for 49.7 days — and nobody had PCs that stayed-up 50 hours, much less 50 days.... 2. Ok, stupid answer. ... Here’s a better one: if you follow the style shown in the example, your timing will survive the 50 day limit with impunity. ... Amazing, eh? How does that work? ... Well I think we’ve reached the appropriate point in the discussion for an incomprehensible chart:
|
4,294,967,295
+ 1
0 |
... or, to put it another way, they don’t understand “2s complement arithmetic” — which is how integer arithmetic works down there in the real computer (well, in most of our real computers; 2s complement, like everything, was young and new once) — which is the kind of thing all us assembly language programmers are born knowing. ... Maybe this makes more sense (less?) in hex
FFFF,FFFF
+ 1 0 |
— the idea being that if you increment a 32-bit register containing FFFF,FFFF the result is 0. This leads to all the additional 2s complement magic like
3
- 4,294,967,295 4 |
and so much more — that’s what the computers are really doing down there!2
This informative diatribe used to be known as “GetTickCount() versus Linux times(): The Rollover Smackdown!” because http://www.die.net/doc/linux/man/man2/times.2.html (among others) says of the Linux times() function
RETURN VALUEThe function times() returns the number of clock ticks that have elapsed since an arbitrary point in the past. For Linux this point is the moment the system was booted. This return value may overflow the possible range of type clock_t. On error, (clock_t) -1 is returned, and errno is set appropriately.
and I foolishly believed that the last two sentences — about “overflow” and “-1 is returned” — were connected — and the times() function was essentially broken after 497 days or less. ... Then, at the instigation in an email from one of the very few people who have actually seen this site and doubtless wishes to remain anonymous and unassociated with my diversions, it’s occurred to me that I was probably wrong.
... My guess now, recollected in tranquility, is the Linux times() function probably never returns -1 for an error; that was just a fairly obvious effort to obfuscate things, probably thrown-in years ago by some well-meaning type who thought it might want to do that, perhaps, someday, and people should be warned....
And indeed I was warned; and concluded, probably erroneously, that the obvious error it was talking about was the overflow mentioned in the previous sentence.3
But I’m going to change my world-famous OwenShow so it assumes Linux times() never returns a -1 error, because that now seems most likely to me, and because it concerns something that’ll happen in 497 days and I just don’t care.5 ... Which, of course, is at least partly why the Linux so-called documentation was so free and easy about it — because, for goodness sakes, that’ll never happen!
I couldn’t decently advise you to go and do likewise; and this is a classic demonstration of what’s wrong with bad documentation. ... My guess is times() works, and never returns -1 (except of course when that’s the tick count); but any program that assumes that could, some bright shiny morning, be wrong! ... Someone somewhere may rewrite the function and, reading some version of the documentation, assume that times() should return -1; maybe early and often!
... So you might start programming defensively by clearing errno before each times() call, and discarding the result if it’s -1 and errno isn’t zero. ... But what if our industrious rewriter concludes that times() should continue returning -1 if an error condition persists? Which, presumably, it would, if any of the counts overflow; that is, he would want to make sure the caller did not act on an erroneous timer value, and so he returns -1....
I hope he doesn’t do that; I’m guessing times() doesn’t do that now. If Linux were actually documented, on the other hand, we’d know under what conditions times() was supposed to return -1 or — preferably — that times() never returned -1. ... But instead, the function might return -1, for any reason whatever, according to the existing description (at least existing whenever I wrote this senseless screed).
But what the heck. ... It’ll only happen after 497 days (which I typoed throughout the “smackdown” version of this diatribe as 479!).
And then there is a Linux library function clock(), of which http://www.die.net/doc/linux/man/man3/clock.3.html says
The clock() function returns an approximation of processor time used by the program. ... If the processor time used is not available or its value cannot be represented, the function returns the value (clock_t)-1.
which pretty-much guarantees the return value can be -1 on odd-numbered Tuesdays — and no nonsense about errno! ... Since the clock() and times() functions are sort-of in the same bailiwick, I take this as an argument against my recently new-found faith in the times() function’s likely behavior. On the other hand, the same document carefully notes “the time can wrap around”. ... My guess is clock() never returns -1 either, but its story is more ambiguously wrong, compared to times(). ... (Incidentally, blame not www.die.net; they present the documentation in a handy format, but the same stuff appears at many places on the web with practically the same words.)
And it’s all just guessology — also known as the Linux documentation science! ...
Well really what the Linuxoids think, is that real programmers’ll go to the source to find-out how things work; that is, the source is the documentation. ... This is one of those extremely stupid ideas that demonstrate that even really smart people like kernel hackers can be idiots. ... (Indeed later I got hold of the source and couldn’t find the times function — in the standard OwenLabs several-hours stupid documentation maximum allowed period.)
I mustn’t leave this topic without noting that after reading the Crenshaw column, I vaguely recalled I had been bad somehow on this — and checked into my very own OwenShow: the sin I found there was not, of course, misusing GetTickCount(). ... No, since there’s no GetTickCount() in Linux, I used DateTimeToTimeStamp(now), a Delphi thing that supplies the current date/time with a high degree of (apparent) precision in Windows or Linux.
Unfortunately, I used it wrong. ... But whatever, it’s a bad solution no matter how I used it: instead of waiting for 49.7 days or 497 days to exhibit my incompetence, OwenShow could’ve hiccuped whenever the user set the date/time! ... And this is no idle menace; judging by some kernelish chit-chat on the web, some guy’s Linux MP3 player was unhappy because of this situation! ... So I “fixed” the next version of OwenShow by using GetTickCount() in Windows and times() in Linux — correctly, or at least as correctly as I know how, so it’ll never fail....
— Monday, April 24, 2006 10:09 am
__________________
NOTES
1. Actually I recall using a spare UART to ingeniously provide timing; you’d set it up just right, send a meaningless character, and check for TXEMPTY. To be sure, this was hardly portable either.
2. Floating point numbers are handled with entirely different mechanisms. ... I should also note that this undoubtedly makes even more mysterious sense in binary notation, i.e.,
1111,1111,1111,1111,1111,1111,1111,1111
+ 0000,0000,0000,0000,0000,0000,0000,0001 0000,0000,0000,0000,0000,0000,0000,0000 |
See, the 1 provokes a carry in all the bits. ... This is like the old mechanical adding machines and comptometers, where you could fill the thing with 9s, add 1, and produce zero; same trick. Indeed, old comptometers have 10s-complement markings on them, for doing subtraction.
3. The other times() returned (in a structure passed to the function) might be more vulnerable because they might count faster — so they could be the source of error also, and this is noted on the web somewhere I forget. ... Without, you understand, explaining anything about what times() might return....
4. I fully expect my insightful thoughts to be lambasted by some Linux know-it-all. Actually, so far that’s the only way I’ve found of eliciting information from the caring feeling cooperative Linux community, q.v. ... And, of course, that’s what happened here! ... Owen still scores, in a perverse way....
5. Actually I chickened-out; I have OwenShow zero errno before the call to times(), and if the return value is -1 and errno is non-zero, allow the user to ignore the error, and mention that if he sticks a file with a particular name in the OwenShow program directory, it’ll never happen again. ... Of course if Linux ever actually does this, OwenShow and anyone who uses times() is probably sunk.
Linux Docker?I’ve been vaguely following this from afar, and then Linux Format had an interview with “Mr. Docker”, which I found utterly unintelligible. But I think I’ve guessed the secret.
Historic & Modern FictionFor years the Linux puffsters — i.e. ever single living thing and many dead anywhere on the web or in print, excluding me — “solved” the problem by denying it existed. ... Then, it turned-out a wonderful thing called a “package manager” could install programs that didn’t come with the distro — if you got them from the distro’s web “repository”. ... And I do not speak in idle disparagement; I’ve tried installing programs in Linux, and almost always encountered something which the insider experts used to playfully refer to as “dependency hell”, where the install would complain that important libraries were missing, and I’d download the important libraries, and then it’d say something else was missing, etc. And very likely by the time I was through, numbers of other applications wouldn’t work anymore, if not the entire crate. And the package manager system did alleviate that somewhat — each specific to its distro of course — the only problem being that independent software guys didn’t necessarily package their treasures in appropriate package managers for all the wandering Linices.... Docker MurkI believe this supernatural “Docker” product is a virtual application container thingey that lets an innocent Linux user install Docker-prepared programs into any Linux system without the distro having to compile it ahead of time — assuming it’s a recent-enough Linux. ... The murk surrounding the subject is, of course, because they can’t admit Linux program installation doesn’t work. ... Tangled web, you know. ... And shockingly, there’s more than one thing with this functionality! So they’ll have to fight.... — the cynical but
good-hearted programmer |
|
![]() ![]() ![]() ![]() |