Archive for July, 2010



Some Crux ports for console clocks

My real-life commitments are more intense in summer, and so I have to apologize for the blank spot over the past couple of days. It’s not that I didn’t have anything to say, but that I didn’t have much time to myself in the first place, and couldn’t spend it typing or tweaking.

For today, I have wanted to tack up a couple more Crux ports, mostly for the console clocks that I have mentioned in recent history. If you’re not a Crux user you probably won’t find these interesting; if you’re an Arch user you might find them useful as starting points for PKGBUILDS, if they don’t already exist in AUR.

(If Pkgfiles look like primitive PKGBUILDs, that would be because in a way, they are. It’s one of the nice things about Crux: As Arch has matured PKGBUILDs have become a teeny bit more complex, whereas Crux ports are still quite simple.)

Without further delay, binclock

# Description: Displays system time in binary format.
# URL: http://www.ngolde.de/binclock.html
# Depends on: 

name=binclock
version=1.5
release=1
source=(http://www.ngolde.de/download/$name-$version.tar.gz)
build () 
{ 
    cd $name-$version
    install -d m644 $PKG/usr/man/man1/
    install -d m644 $PKG/usr/share/binclock/
    install -d m644 $PKG/etc/
    install -d m644 $PKG/usr/bin
    make PREFIX=/usr 
    make PREFIX=$PKG/usr DESTDIR=$PKG MANPATH=$PKG/usr/man/man1 CONF=$PKG/etc/ INSPATH=$PKG/usr/bin HOME=$PKG/usr/share/binclock install
}

And vtclock
# Description: 	A text-mode full-screen digital clock
# URL:		http://webonastick.com/vtclock
# Depends on:	ncurses

name=vtclock
version=2005-02-20
release=1
source=(http://webonastick.com/$name/$name-$version.tar.gz)

build() {
	cd $name
	sed -i s:/usr/local:/usr:g Makefile
	mkdir $PKG/usr/bin/ -p
	make PREFIX=/usr
	make DESTDIR=$PKG install
}

And finally ticker, which scott kindly mentioned in the wake of my note on vtclock.
# Description:	Generates vertical stock ticker style output on the console.
# URL: 		http://www.fial.com/~scott/ticker
# Depends on:	

name=ticker
version=1.0
release=1
source=(http://www.fial.com/~scott/ticker/ticker-1.0.tar.gz)
build () 
{ 
    cd $SRC/$name-$version
    make
    make DESTDIR=$PKG install
}

Ticker is fun because it does things a little differently than the run-of-the-mill console clock. With this you can stream the date and time — via the date command, or others — down the side of the screen, as opposed to planted in the center as most others do.

And ticker will allow you almost any input, so you can feed it the results of just about any command. It would be nice to be able to customize it a little more — pick a specific block character for readability, or maybe add some color — but as it is it’s unusual and fun to mess with. :)

Progress on the screen shutdown script

A few months ago I mentioned a script intended to gracefully shut down all the programs I normally run in screen, and bring the entire session to a halt. As things are now I have to step through each program and issue the native “quit” command(s), which isn’t terrible, but with only minor variations, should be easily handled through a script.

The problem of course, is that some of those programs, like mc or hnb just as examples, need control characters to quit cleanly, and through screen’s stuff command, things get a little hairy.

Boldewyn‘s post from a few days ago gets me a little closer to where I want to be. With the keypress sequences mentioned there, my script now looks like this.

#!/bin/bash
screen -p alpine -X stuff qy
screen -p centerim -X stuff ^[^[qq
screen -p elinks -X stuff Q
screen -p hnb -X stuff ^Qy
screen -p htop -X stuff q
screen -p mc -X stuff "exit ^M"
screen -p vim -X stuff :wq!
screen -p wyrd -X stuff Q

The CTRL+V keypress to “translate” the control characters to text was a big step forward. The long, backslash-preceded codes that I was using before were being sent through as straight keypresses, but this sends through a command character, which works well for things like mc or hnb.

Usually. It’s odd, but it seems like sometimes, the script works but sometimes things still get huddled up on mc’s prompt line, or hung at hnb’s save-before-closing prompt. Sometimes it seems like the script will work if it’s executed from within screen, but not if it’s cued from another tty or if screen is detached. This is definitely better and sometimes seems to get the job done, but it’s just not “there” yet — to borrow a phrase from Linux detractors. :twisted:

In any case, I will continue to pursue this, and see if I can pin down the when and the where of the why it doesn’t quite do the trick. :)

A few recommendations for network cards

I don’t make much note of my network connections on my hardware page, and that’s usually because it changes fairly frequently. Depending on its guts, its proclivities and even its location in the house, a computer can get a whole different network attachment at the spur of a moment.

I do have a couple of suggestions for die-hard, tried-and-true network connections for older machines, for the people who ask. The first two are wired, and the last is a wireless card.

What’s important isn’t really the name or the brand. It’s the chipset — the innards of the thing — that determines how useful or friendly it is with your computer. For example, I keep an IODATA-branded PCET100-CL as a dongleless network card for this Pentium.

It uses the pcnet-cs module, so its compatibility with Linux is practically guaranteed. But even better than that, it predates the shift to CardBus technology, which means machines even older than this one can probably get it going. It’s an issue of compatibility again really: An old, old card like this will work in newer PCMCIA ports and older PCMCIA ports, so that’s the one I keep. Simple as that.

If you prefer a dongle (I can’t imagine why), I also have a Planex ENW-3503-T that uses the ne2000 module — and again has support in the kernel and predates CardBus changes. So yes, it’s at least a decade old, but it requires no effort whatsoever in configuration.

Network speeds on both cards are satisfactory, with neither being a speed demon. They will both break 500kbps from a fast host, but to be honest, I don’t recall either one of them peaking much beyond that. I think they will, but I just don’t ever remember seeing it. Maybe I should try. …

For wireless, I rely on a trustworthy family heirloom — a Linksys WPC11 Wireless-B card that dates back almost to 2000. Again, it works fine in old, old machines, has kernel-complete driver support with the orinoco-cs module, and while it’s not the fastest card out there (I know for a fact it will break 1Mbps … sometimes), it does the job plenty fast and doesn’t complain.

In fact, one of the nicest things about that card is its ability to function on an open (meaning keyless) network without the omnipresent wireless-tools package. It is normally assigned as an ethX connection, and simply charging at it with dhcpcd usually works fine. Usually.

But other than that I have no real recommendations. I strongly discourage anything axnet-based because, as I mentioned even just a few days ago, I have yet to see an axnet-driven card that didn’t sputter and pop when put to work. For onboard connections, I say go with Intel; I have very good experiences with the PRO/100 cards and they too are very easy to configure.

Of course, it’s completely random and totally unpredictable that you’d be able to get your hands on any one of these cards, and then once you had it, it’s likewise a possibility that it wouldn’t satisfy you. Be that as it may, if you want a name and want my meager seal of approval, those are the ones that get it. :)

fbterm on a 150Mhz Pentium MMX, 32Mb

As a short update, I’ve been using the Mebius as my primary machine for the past few days, taking over from the Fujitsu Pentium. I’m using Arch Linux i586 still, having added quite a few things here and there to the “vanilla” setup that comes from a clean installation.

Probably one of the best things I did with this system was to build yaourt from scratch. It does behave a little strangely because of some library inconsistencies, but once it was in place I had a much easier time skimming through AUR and building things from the community repo.

abs is likewise an excellent tool on a system like this, but I mentioned that in the past so I won’t dwell on it again. Thus far I’ve been able to add hnb, a customized version of Charm, screen-vs, wyrd, alpine, fbterm, fbv and a lot of others — most of the ones I have listed here, in fact — with only a few holdouts, and they’re usually not worth mentioning.

fbterm runs great by the way, kicking up the system demands to roughly 25 percent of processor power and less than a third of memory, and that with everything I need running at the same time. It might sound like a lot, but remember this is a 150Mhz Pentium with only 32Mb to start with, so I’m still taking up only around 12Mb or so, plus a small slice of swap.

I have three small complaints though, none of which are particularly tied to any other.

  1. First, this hard drive is so slow that even most day-to-day tasks, like booting or starting up the smear of software I use normally, are suddenly huge impediments. Generally speaking the system isn’t terrifically taxed — I think the CPU usually floats between 33 and 50 percent demand, and I already mentioned where my memory is at. But it’s still taking over two minutes to boot to the login prompt, which I generally don’t tolerate even in outdated hardware.

    On the other hand, the good thing about having a 2Gb drive is that it is easy to make backups or system updates — flash the drive across USB1.1 with dd while I am at the office, then dd it to a file on another machine. Or mount that USB drive and chroot into it, and use it like a phony system. Reverse the procedure to put it back. I’ve done that three or four times now without any problems, except for the time it takes, round trip.

  2. That Trident framebuffer I mentioned a day or two ago is no more lovable for being prettier than a straight console. Yes, I get a nifty console now that I can run fbterm against it, but I have more issues that I haven’t mentioned — like the fact that the entire display appears to be wrapped around, left to right, by one pixel width. If that sounds bizarre it’s even weirder to look at: One pixel on the leftmost part of the screen is occluded, missing … while on the right side, at the same level vertically, I can see a faint, single row of pixels that appears to be what’s gone from the left.

    Add to that some discrepancies in the way it displays and captures images — I still haven’t gotten a proper framebuffer image from fbgrab or fbshot, for that matter — and it’s turning into a less-than-ideal graphics card. But something tells me it probably always was. …

  3. Running a system with so little memory appears to be causing problems for other software too. For example, I usually transport the system via USB to a host machine with more power, preferring not to waste time off my life by compiling at 150Mhz. However, for the few times when I have built things on the slower computer, xz has spat out an error so esoteric I can’t even seem to find it on the Internet: “memory usage limit is too small for the given filter setup.”

    If there’s a setting somewhere or a way to tell xz how to work at a low memory level, I’d love to find it. The man pages don’t seem to mention anything, and surprisingly this time Google doesn’t have much to offer outside of the source code or an obscure, unrelated post to a mailing list from a year or two ago. As it is I still get a compiled product so I can do something drastic, like rsync the results into my root directory, or even just build a program in the conventional configure-make-make install fashion. But it would be nice to get that one, small, last step working right.

I have other reasons for preferring the older Pentium to this newer one, but usually they’re superficial — like the keyboard layout, or the “feel” of a key press (the Mebius needs a little more “force” to depress a key, which I am not used to). In general, much this time as any other time I have downscaled to the hardware of a decade-and-a-half ago, I am surprised and delighted that I can get so much done with such a little footprint. Yes, there are faults in its personality, but I have a feeling I will be keeping this machine for a long time to come. :)

figlet and asciimo and a little irony

I love figlet. Everybody I know loves figlet. There’s nothing not to love.

Except … it would be nice if I could quickly and efficiently skim through the available fonts — both the standard and additional sets. Yes, I know there is a nifty kilometer-long page available that shows them all in alphabetical order, but it would be nice to dump some sample text and press a button to see what they look like.

Enter asciimo, which runs nicely in your standard graphical browser to let you skip through the fonts, check differences, enter unique text and even design some text art, if you’re patient. What you create you can cut-and-paste out of asciimo and into another location (like cadubi), which may or may not be easier than running the same text through figlet itself.

It’s a pretty nifty tool and if I understand right, it is rather creative example of web-focused programming. My only complaint? It doesn’t seem to work in my text-based browser. Oh, the irony. … :D

An update: Remy’s Datamini PA40

A few people have asked for an update about Remy‘s Datamini PA40, the rehabilitated 286 machine I mentioned back in April. If you think you were jealous then, you’ll be positively viridian now.

Pac-Man on a 286-era laptop computer is enough to make any geek writhe in ecstasy, but that’s not the only thing it does. Remy sent this explanation:

The Datamini PA-40 which I emailed you about earlier has found its use. It is being used as a kitchen computer. Who needs a touchscreenfridge for that?

 

My girlfriend makes the shopping lists on it, in WordPerfect. Quite handy, most of the time I need to work early (in a hospital) so when I come back home I read the list she made. I know most people do it on paper but this is just more awesome.

  

Furthermore while I’m cooking I try to update my Magic: The Gathering card database in Lotus 123. I have a main spreadsheet for it which I normally use, but it is funny to see that when an OpenOffice file is converted it still opens quite fast while fitting on a floppy. :P

I know I have too many computers as it is, but I’d be lying if I said I wasn’t looking for something to compete with that one. :twisted:

Two possible, maybe, could-be kernel bugs

Speaking of the kernel, I find I have a couple of issues that may or may not actually be problems. Errors.

Bugs! There, I said it.

First, I came across another axnet-based PCMCIA card and feeling adventurous, I gave it a try. If you remember from the past year, just about everything axnet-driven I have used in the PCMCIA category has either fallen silent when traffic peaked at a certain level, or caused lockups or metaphorical digital explosions.

But this one was free, and seeing as I had the Mebius as a completely different platform, I thought I’d give it a try.

And, as you might have predicted, I got the same unwanted results — lockups on data transfers, system-wide freezes, and so forth. Different laptop, different card, different phase of the moon, but same software and therefore … ?

The other one is likewise related to specific, out-of-date hardware, and quite possibly even more esoteric since it doesn’t have the “flexible” flavor of a PCMCIA network card. I have caught a string of problems that seem to be caused by the Trident framebuffer module, although its behavior lately has been better than even just six months ago.

In this case, issuing a halt or reboot command does neither. but spatters pixellation here and there on the screen and usually locks the system entirely. This is happening for me in both archlinux-i586, and with custom systems in Crux.

If I build a kernel and deliberately omit any and all support for that particular module, things seem to work as normal. And given the similar issues I had with that Thinkpad back in January, I am again left with the different-hardware, same-software situation.

If I can find a proper venue, I’ll probably do as much as I can to file bug reports. But I might be one of the last people on the planet using this stuff, so I don’t expect much.

Configuring an ultralight 2.6.34 kernel

My last post was a bit tongue-in-cheek, but this one is as serious as a heart attack. In the past couple of summers I have offered suggestions on how to strip down a current kernel and run it extremely light, and this summer I see no reason to break with tradition.

This year I’m going to even further back in time though. Instead of configuring it for a mid-grade Celeron, I’m going to show you the bottom-of-the-barrel, no-frills-no-thrills Pentium setup I use daily for everything except image viewing. This kernel boots in under 20 seconds from Grub to the login prompt, discounting the five or six seconds it takes the framebuffer to snap to the proper resolution.

As always, there are some disclaimers.

  • I am not an expert.
  • This is not for beginners.
  • I should mention that I use Crux, but that doesn’t mean these configurations won’t work in other distros. If you are interested in using Crux — which I recommend heartily for any machine, really — I will point you at the Crux Handbook to get you started.
  • I can guarantee with 99.9 percent certainty that if you copy and paste this, your machine won’t even boot.

This year I’m going to catch hell for making one very large change in the way I do things: Completely disabling power management structures altogether. Yes, I know, your eyeballs just popped out of their sockets. Ready your keyboards for e-mailing me to tell me how foolish I am; I am ready in return to tell you that for this machine, it makes almost no difference whatsoever. But let’s talk about that later.

First up, under General Setup, I enable only these things:

  • Support for paging of anonymous memory (swap)
  • System V IPC
  • BSD Process Accounting
  • Kernel->user space relay support (formerly relayfs)
  • Namespaces support
    • UTS namespace
    • IPC namespace

That’s all. I used to optimize for size when I was working with a machine with only 16Mb of memory, but I’ve moved up in the world, and now I have a spacious 80Mb. :roll:

Next is Enable loadable module support, under which I only enable Module unloading.

For Enable the block layer, I disable Support for large (2TB+) block devices and files and use only one IO Scheduler: CFQ.

Under Processor type and features, only these things are enabled:

  • Single-depth WCHAN output
  • Disable Bootmem code
  • Machine Check / overheating reporting
  • MTRR (Memory Type Range Register) support
  • Enable seccomp to safely compute untrusted bytecode

Timer frequency is set to 1000Hz, and High Memory Support is off. I set the Processor family to Pentium Classic.

Now comes the part that’s going to horrify you: Power management and ACPI options. Call me crazy, but for months now I have been running kernels on two different Pentium machines that have everything — and I mean everything disabled under this category. Frequency scaling, idle PM support, everything.

And no, my house has not burned down, and yes, the hardware battery management in the Mebius still works. I have seen no signs of the apocalypse, the sky has not blackened and there is no smell of sulphur (or an electrical fire) in the air. Life goes on.

My rationale? None, I have none. I turned it off once, nothing terrible happened, and now it’s off all the time. C’est la vie.

Next, for Bus options (PCI etc.), PCI Support, ISA support and PCCard (PCMCIA/CardBus) support are enabled. Under PCMCIA cards, I have CardBus yenta-compatible bridge support turned on, and both 16- and 32-bit support enabled. I have several network cards that reach way back to the last part of the 1990s, and I want to be able to use them. ;)

For Executable file formats / Emulations, I just leave it however it is at default. I don’t think I’ve ever tinkered with those settings, and something tells me it wouldn’t matter if I did.

Under Networking support > Networking options, I enable:

  • Packet socket
  • Unix domain sockets
  • TCP/IP networking

But everything under TCP/IP networking is disabled. And yes, I can still reach the Internet and my home network.

Under Networking support > Wireless I enable:

  • cfg80211 – wireless configuration API

    • enable powersave by default
    • cfg80211 wireless extensions compatibility
  • Wireless extensions sysfs files
  • Generic IEEE 802.11 Networking Stack (mac80211)
  • Enable LED triggers

All that gives me working wireless cards for the few that I have, when I use them. Note that I turned off anything related to debugging; debugging is Linus’s job, not mine. :roll:

This is the hairy part: Device drivers. First, Connector – unified userspace <-> kernelspace linker and its children are enabled.

Next, under Plug and Play support, I enable ISA Plug and Play support.

For Block devices, I build Normal floppy disk support as a module. Loopback device support is enabled. I don’t bother with RAM block device support.

I know this is defeating the purpose in running a newer kernel, but I use the deprecated ATA/ATAPI/MFM/RLL support. The few kernels I have built with the newer Serial ATA and Parallel ATA drivers have not behaved well, and I usually end up rebooting into my old kernel rather than the newer one. It’s possible there is some sort of code change in that section that my hardware doesn’t like, but in any case I use what works (and no more than that, if I can help it :twisted: ).

These things are enabled under ATA/ATAPI/MFM/RLL …

  • generic ATA/ATAPI disk support

    • ATA disk support
    • ATAPI floppy support
  • legacy /proc/ide/ support
  • generic/default IDE chipset support
  • CMD640 chipset bugfix/support
  • Probe IDE PCI devices in the PCI bus order
  • CMD64{3|6|8|9} chipset support

Some of those are hardware-specific, but others are just for peace of mind. The one thing I dislike more than anything is to go through the whole rigamarole of transplanting the drive, building the kernel, installing it, moving the drive back, and then finding out that the thing won’t boot. So it’s possible that even more of those could be safely omitted, but I just leave them on because I’m satisified with the way they are now.

Network device support is also fun. I usually have enough various and sundry network cards to warrant keeping this category flexible and open. All the same, only Wireless LAN and PCMCIA network device support are enabled. Under wireless, these are modules where possible:

  • Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)

    • Cache Hermes firmware on driver initialisation
    • Hermes PCMCIA card support

And PCMCIA both of these are modules:

  • NE2000 compatible PCMCIA support
  • Xircom 16-bit PCMCIA support

That might look a little sparse, but remember two things: First, this machine has no USB ports, which means no USB support is needed.Second, the PCMCIA hardware predates CardBus technology, so a lot of “newer” PCMCIA cards don’t work in it. Other machines get support at those levels of course, just be aware of what your machine can do, as well as what you want it to do.

Moving on, here’s Input device support, where only Event interface is enabled, aside from what is fixed in place. That includes Hardware I/O ports and everything underneath it. Remember that a lot of these items are locked “on,” until you disable USB and/or HID support, later on.

Under Character devices:

  • /dev/kmem virtual device support
  • Unix98 PTY support
  • /dev/nvram support

Everything under Serial devices is off.

I2C support is also off, but that might require you to disable some parts lower in the list before it will be released.

Graphics support can also be a real hairball. For my own part, I enable only

  • VGA Arbitration
  • Support for frame buffer devices
    • Enable firmware EDID
    • Enable Video Mode Handling Helpers
    • Enable Tile Blitting Support
  • VGA 16-color graphics support
  • Userspace VESA VGA graphics support
  • VESA VGA graphics support
    • Backlight & LCD device support
    • Lowlevel Backlight controls
      • Generic (aka Sharp Corgi) Backlight Driver
    • Bootup logo
      • Standard 224-color Linux logo

That gives me a snap-to 800×600 framebuffer with a super-cool Tux logo on an ancient C&T graphics card. I would love to figure out how to turn off the backlight properly, but for now it’s just on my to-do list.

Sound card support is another tricky one. For myself, I need ISA support and I build everything as a module, because I need to pass parameters to the module in order to get it to work. So …

  • Advanced Linux Sound Architecture

    • Support old ALSA API
    • Verbose procfs contents
    • ISA sound devices
      • Sound Blaster 1.0/2.0/Pro (8-bit)

Again, less complicated than it sounded. I am not sure about Old ALSA API or Verbose procfs, I suppose it’s possible to turn off those things and still work. I’ll try that sometime soon. Of course, sound on this thing is not so fantastic to start with, so I don’t stress myself with it.

And that’s all for device drivers. Everything else is turned off — USB, HID, real time clock, and so forth. And yes, everything runs fine.

We’re on the home stretch now. Here’s File systems:

  • Second extended fs support
  • Dnotify support
  • Inotify file change notification support
  • Inotify support for userspace
  • Native Language Support
    • Japanese charsets (Shift-JIS, EUC-JP)

I used to disable both dnotify and inotify, but these days udev wants one, and something else wants the other (I forget what it is). Also I sometimes set up the kernel to use NFS (under Network File Systems), but since 2.6.32 or something, NFS hasn’t worked quite right for me. Again, that’s something else I’ll have to test. In the mean time I turn it off, because I think the issue is related to changes since 2.6.31 or so. And I don’t need it that bad.

For Kernel hacking:

  • Show timing information on printks
  • Enable __must_check logic
  • Magic SysRq key
  • Sysctl checks
  • Enable verbose x86 bootup info messages
  • Early printk

That’s all. I turn off anything related to debugging, and anything that involves hardware I don’t have.

Under Security options, everything is off. Yeah, and you thought turning off power management was daring. …

I leave Cryptographic API pretty much as it is by default, except for disabling Hardware crypto devices.

And Virtualization is disabled, while Library routines is left as-is.

And we’re done. Remember to adjust this as you like, for the hardware you want and the purpose of the machine. After the break, the .config file you might want. :)

Continue reading ‘Configuring an ultralight 2.6.34 kernel’

« Previous Page


Welcome!



Visit the Wiki!

Some recent desktops


May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF
 


May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games


Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 144 other followers

License

This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,164,314 hits

Archives


Follow

Get every new post delivered to your Inbox.

Join 144 other followers