30 Aug 2005
I've put together a couple downloads for the NWR04B. The first is the
whole tarball of source code -- BusyBox, uClinux, plus some glue. You
can use this to compile your own images. It's about 29MB. The second
is just the bare minimum: the firmware image, the root directory for
the router, and some instructions. It's about 685KB. You can find both
of them here: http://saintaardvarkthecarpeted.com/nwr04b/download
The downloads have been signed with key 0x4705C9C7 and
checksummed with SHA1.
Tags:
nwr04b
28 Aug 2005
I've had a few questions about what I actually plan to do with this
thing now that I can get a shell running. I've been thinking about
this for a while, and here, in no particular order, is what I want to
do:
Network access: It'd be cool if SSH (preferred) or telnet
would work on this. And hey, it'd be handy (okay, for certain values
of "handy") to have a web server you could just plug in anywhere,
especially if it was combined with a USB flash drive (see
below).
Get a filesystem embedded in flash: I went with NFS
mounting the filesystem because I had no idea how to embed one in
flash. I still don't, plus I'm unsure how this all interacts with the
bootloader that's on there...my memory is a bit hazy at this point,
but I think that the BL crapped out with a sufficiently large kernel
at one point (maybe one I'd compiled with debugging?). The image I'm
uploading now is 513KB, which leaves about 1.5MB of flash left for the
filesystem. Since NFS works right now and has tons of room, I figure I
can experiment 'til I figure out what I'm doing, then make an entirely
self-contained image.
Provide an image for other people to upload to
their own routers: 'cos what good is doing all this if I can't
share? There are a few other people with this router who have (I
think) been following this, so there ought to be some small amount of
interest in this. I'd like to do the same with the devel stuff -- at
least have a nice tarball for Busybox, the kernel and an NFS
filesystem, say. (If you're impatient, email me.)
Make the world's
first Beowulf cluster of wireless routers: 'cos I'd like my 15
minutes of fame, please. Slashdot, here I come!
Turn it into a
firewall/wireless access poing: This thing is small, doesn't consume
much power, and is silent. It's got five ethernet ports and a wireless
card with a GPL'd driver. How cool is that? A Linux firewall'd be nice
and flexible, and it'd be nice to (say) only allow SSH/SSL on the
wireless card. I'm curious to see how much additional memory firewall
rules will take up, and if I can get something like tarpitting working
on it without sucking up all the RAM.
More hacks: This chip has 2
UARTS and USB. It'd be cool to, say, add a USB flash drive to this
thing; I've got a 64MB one lying around that I used to get my XBox
running Linux, and a 64MB filesystem would be huge compared to what
I can fit in 1.5MB. What about breaking out the second UART to a
serial port? Can we add more RAM? And the CPU can run at different
clock speeds -- what happens if we play around with that?
Tags:
nwr04b
28 Aug 2005
After getting the CFLAGS
fixed up, the last step before a working
shell was getting init going -- either just saying something like
init=/bin/sh
in the kernel command line, or else getting init
proper working. The first didn't work, so on to the second. First I
looked at /etc/inittab
on the filesystem. This message
suggested that a very simple inittab should work just fine:
However, it wasn't working: the last message I got during the boot
process was the BusyBox banner, and then nothing. I could ping it, but
it wasn't responding to anything on the keyboard. I turned on
debugging in init/init.c
(#define DEBUG_INIT 1
up at the top),
then started throwing in messageD(LOG|CONSOLE, "FIXME: Made it
here")
at various spots. I could see that init was running, and it
was parsing /etc/inittab
-- good. (Oh, should also mention that
since the router is currently mounting its filesystem by NFS, running
tcpdump host [ip address] | awk '/"/ {print $NF}'
showed me the
files it was trying to get -- which also showed inittab
.) Okay, so
move on to actually running the damn programs. That takes us through
init_main()
and run_actions()
...yep, messageD
shows we're
getting there, too. From run_actions()
we go to run()
...and here's
where we run into problems. run()
basically blocks signals then runs
fork()
like so:
if ((pid = fork()) == 0) {
/* run the damn program */
}
return pid;
A few more messageD
s showed we were reaching the other side of the
if block w/o any problems, but didn't seem to be actually going
inside. init
kept trying, about once a second, to start up the
programs in inittab
but it was failing each time. And then I
remembered: uClibc does not implement fork()
; instead, it uses
vfork()
, which blocks the parent until the child exits, or calls
execve()
. (Here's a good explanation.) So what if we do:
if ((pid = vfork()) == 0) {
Well, hot damn -- it works!
Tags:
nwr04b
27 Aug 2005
Just under eight months:
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
device=eth0, addr=192.168.23.12, mask=255.255.255.0, gw=255.255.255.255,
host=test, domain=, nis-domain=(none),
bootserver=192.168.23.254, rootserver=192.168.23.254, rootpath=
Looking up port of RPC 100003/2 on 192.168.23.254
Looking up port of RPC 100005/1 on 192.168.23.254
VFS: Mounted root (nfs filesystem).
Freeing init memory: 52K
Using fallback suid method
init: Bummer, can't write to log on /dev/tty5!
console=/dev/console
init started: BusyBox v1.00 (2005.08.27-16:28+0000) multi-call binary
command='-/bin/sh' action='4' terminal='/dev/console'
init: Bummer, can't write to log on /dev/tty5!
Starting pid 9, console /dev/console: '/bin/sh'
Using fallback suid method
BusyBox v1.00 (2005.08.27-16:28+0000) Built-in shell (lash)
Enter 'help' for a list of built-in commands.
/ # busybox
NFS: giant filename in readdir (len 0x80000001)!
Using fallback suid method
BusyBox v1.00 (2005.08.27-16:28+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, busybox, cat, cp, date, dd, dmesg, du, echo, egrep, false,
fgrep, find, free, getty, grep, hexdump, ifconfig, init, kill,
lash, linuxrc, login, ls, mkdir, mknod, more, mount, mv, netstat,
passwd, ping, ps, pwd, rm, rmdir, route, sed, sh, strings, stty,
su, tail, tee, test, time, top, touch, true, tty, umount, uname,
uptime, vi, whoami, xargs
/ # ping -c 5 192.168.23.254
Using fallback suid method
PING 192.168.23.254 (192.168.23.254): 56 data bytes
64 bytes from 192.168.23.254: icmp_seq=0 ttl=64 time=0.0 ms
64 bytes from 192.168.23.254: icmp_seq=1 ttl=64 time=0.0 ms
64 bytes from 192.168.23.254: icmp_seq=2 ttl=64 time=0.0 ms
64 bytes from 192.168.23.254: icmp_seq=3 ttl=64 time=0.0 ms
64 bytes from 192.168.23.254: icmp_seq=4 ttl=64 time=0.0 ms
- 192.168.23.254 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms
--/ # ls -l
Using fallback suid method
drwxr-xr-x 2 1000 1000 1304 Aug 27 2005 bin
drwxr-xr-x 2 1000 1000 312 Aug 27 2005 dev
drwxr-xr-x 3 1000 1000 176 Aug 27 2005 etc
drwxr-xr-x 2 1000 1000 48 Jul 5 2005 lib
lrwxrwxrwx 1 1000 1000 11 Aug 27 2005 linuxrc -> bin/busybox
drwx------ 2 1000 1000 48 Jul 5 2005 lost+found
drwxr-xr-x 2 1000 1000 48 Jul 5 2005 mnt
drwxr-xr-x 2 1000 1000 48 Jul 5 2005 proc
drwxr-xr-x 2 1000 1000 48 Jul 5 2005 root
drwxr-xr-x 2 1000 1000 344 Aug 27 2005 sbin
drwxr-xr-x 2 1000 1000 48 Jul 5 2005 tmp
drwxr-xr-x 4 1000 1000 96 Jul 9 2005 usr
drwxr-xr-x 2 1000 1000 48 Jul 5 2005 var
I am the greatest man IN THE ENTIRE WORLD.
Tags:
nwr04b
26 Aug 2005
Okay, so the solution appears to have been there all along:
CFLAGS_PIC="-msingle-pic-base -fpic"
CFLAGS="-O2 ${CFLAGS_PIC}"
LDFLAGS="-Wl,-elf2flt ${CFLAGS_PIC}"
Compile busybox with that and the HRI/Snapgear toolchain, and I get this when it boots:
IP-Config: Complete:
device=eth0, addr=192.168.23.12, mask=255.255.255.0, gw=255.255.255.255,
host=test, domain=, nis-domain=(none),
bootserver=192.168.23.254, rootserver=192.168.23.254, rootpath=
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
Looking up port of RPC 100003/2 on 192.168.23.254
Looking up port of RPC 100005/1 on 192.168.23.254
VFS: Mounted root (nfs filesystem).
Freeing init memory: 48K
Using fallback suid method
init started: BusyBox v1.00 (2005.08.27-07:03+0000) multi-call binary
...and there it hangs -- gotta get the console right. Still, this is a
fuck of a lot better than the various errors I was getting. Can't
believe I missed what was right in front of my face. This is with,
notice, no softfloat options for GCC. The trick appears to be using
-msingle-pic-base -fpic
in LDFLAGS -- I'd had those earlier in
CFLAGS
alone, and it wasn't working then.
Tags:
nwr04b!
26 Aug 2005
I love cfengine. If you haven't checked it out yet, do so. You can do really neat stuff like this:
editfiles::
{ /etc/Xprint/C/print/attributes/document
BeginGroupIfNoLineMatching "^\*default-printer-resolution: 300"
CommentLinesMatching "^\*default-printer-resolution: 600"
LocateLineMatching "^# \*default-printer-resolution: 600"
InsertLine "*default-printer-resolution: 300"
DefineInGroup restart_xprint
EndGroup
}
shell::
debian.restart_xprint::
"/etc/init.d/xprint restart"
(Which, by the way, totally fixes the problem of Debian printing 'way
huge stuff. Bug number 262958. You should totally look it up.)
Look at that. It's lovely. It's obvious what it's looking for, what
it'll do if it can't find it, and what'll happen after that. And it
does it automagically. At night. From cron. The way God intended all
system administration to be done. However -- and I cannot emphasize
how important it is to keep this in mind -- it is absolutely NFG
reading the documentation for an hour trying to figure out why the
DefineInGroup
statement just does not work if:
- you're reading the docs for cfengine v2, and
- you're working with cfengine v1.
It's my own fault for printing out v2 docs and not thinking much about
it. However, in my own defense it would be nice if cfengine would
complain about something it appears not to recognize. Not even with
-d2
(which produces output along the lines of
CheckingDateForSolarEclipseToday [no]
) did it whisper a word about
this.
Tags:
cfengine
17 Aug 2005
When installing openldap22-server on FreeBSD from ports, I got this error when starting slapd:
error loading ucdata (error -127)
This is a permission problem with the directory /usr/local/share/openldap/ucdata
; changing the group ownership cleared it up.
Tags:
ldap
16 Aug 2005
From dmesg(8)
:
-nlevel
Set the level at which logging of messages is done to the con-
sole. For example, -n 1 prevents all messages, expect panic
messages, from appearing on the console. All levels of messages
are still written to /proc/kmsg, so syslogd(8) can still be used
to control exactly where kernel messages appear. When the -n
option is used, dmesg will not print or clear the kernel ring
buffer.
Tags:
toptip
14 Aug 2005
Now this is interesting.
Guy comes up to me at work and sez, "Hey, that new Linux machine is
really slow." How can that be? It's an umpty-GHz processor with a gig
of RAM, a nice hard drive and the same 100Mb/s connection to the
network that the FreeBSD machine beside it has. "It's just slow." Slow
how? Doing what? "It's just slow -- all the time."
Eventually we got it down to a working demonstration: log in. The
developers've got a fairly intricate set of .cshrc files, so they echo
some progress reports: Setting FOO...setting BAR...setting
LD_LIBRARY_PATH...only it's taking for-freaking-ever -- well,
relatively speaking: 8 seconds sez /usr/bin/time. cf. ~2 s. on the (if
anything, slower) FreeBSD machine right beside it. WTF?
At first I started looking at the rc scripts. By deking out various
bits, I could see where the 8 seconds was coming from -- half a second
there, two and a half seconds there...but then I came to my senses and
realized that looping over half a dozen items should not be causing
this kind of nonsense.
I checked DMA on the hard drives. Aha, they're off! But all the home
directory access is over NFS, so it's probably not much of an
issue. And hdparm -d /dev/hda 1
just came back with permission
denied
(even as root...I seem to remember something about newer Intel
chipsets having DMA built in), so I left that out.
Out of desperation more than anything else, I tried running strace
/bin/csh /bin/echo foo
-- and hot damn if we're not trying to open
209 different directories to find libncurses! Holy hell!
And what is this happy crappy? It's checking out a crapload of
directories we haven't even told it about. For example, check out
what it does for this one element in LD_LIBRARY_PATH,
/home/foo/lib/bling
:
open("/home/foo/lib/bling/tls/i686/mmv/cmov/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/tls/i686/mmv/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/tls/i686/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/tls/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/i686/mmv/cmov/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/i686/mmv/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/i686/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/mmv/cmov/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/mmv/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
open("/home/foo/lib/bling/cmov/libncurses.so.5", O_RDONLY) = -1 ENOENT (no such file or directory)
That's right, folks, the preloader has taken it upon itself to do some
kinda combinatoric search for hardware-optimized libraries, and as a
result a measly thirteen entries in LD_LIBRARY_PATH
turn into two
hundred and nine. Add to that the aggravation of all these entries
being in people's home directories which are NFS-mounted from
elsewhere, and it's not too hard to see why the hell it's slow.
To be fair, this is meant to do something good: you can have
libraries compiled for different hardware capabilities (HWCAP is
the term to search for), which I imagine would be handy if you want
one disk image for a bunch of different hardware. The trouble, of
course, is that you get into these ridiculously long lists of
directories that might exist...at least, if you're not using Alpha
CPUs.
Fortunately, the folks at Debian have anticipated my whining and have
done something about it.
Unfortunately, it's SOOPERSEKRIT.
Fortunately, I dug it out of a very cranky email to debian-devel:
# touch /etc/ld.so.nohwcap
With that in place, the formerly-plodding test that took 8 seconds to
finish now runs in 1.5. And that is one hell of a performance gain
from just touching one file.
Tags:
warstory
08 Aug 2005
- July 9th: arm-elf-tools-20030314.sh from uClinux.org. Busybox fails
when run as init with "undefined instruction" and "unknown data abort
code."
- July 10th: toolchain from hri.sourceforge.net. BB fails with
"undefined instruction".
- July 11: uClibc buildroot script. No copy of elf2flt. Tried latest
snapshot, which does have elf2flt, but it failed to install.
- July 24th: uClinux toolchain again. BB fails with "bad data abort",
"unknown data abort code" and "obsolete system call". Possibly
including different versions of unistd.h?
- July 26th: ptxdist. uClibc appears to be built with for CPU with
MMU/FPU, ignoring values set in original menuconfig.
- July 30th: 3.4 toolchain from uClinux site (hidden!). Tried
compiling the kernel with this toolchain, but far too many errors
relating to change in behaviour from 2.95.3. BB failed with
"relocation outside program". STL failed to build. God, this is
pissing me off.
Tags:
nwr04b
04 Aug 2005
Problem: Outlook 2003 User gets a message from System Administrator
saying that his message to a coworker is undeliverable -- something
about relaying denied -- and asks me why this happens.
Pretty simple, right? Just get him to forward the message and then
check the logs. Only no, it's not simple: despite twiddling all the
bits you're supposed to, I keep getting the message attachments in MS'
TNEF format. I use Mutt. I give up and decide to look at Outlook
itself. (Yes, I know about the decoder scripts you can get, but I was
being bullheaded.)
Now we have the problem of getting the proper Internet headers in the
email. (I've given up trying to persuade Outlook that I am ritually
pure enough to look upon the shining glory that is The Message Source
without melting like some kind of Nazi-collaborating French
archaeologist; it doesn't work.)
A quick Google turns up three suggestions: a $24.95 VB plugin, giving
up entirely, or right-clicking and selecting Options, then looking at
the box that sez Internet Headers. I'm game, so I try right-clicking
and choosing Options. There's the Internet Headers box, all right, but
it's empty. WTF? I look around, but there's nowhere else to
clickyclick.
I try right-clicking on another message, and sure enough it shows the
headers. I try selecting the From address in the problem message
(helpfully labelled as "System Administrator", which I'm pretty sure
is a bald-faced lie), then Properties. It just says it's from System
Administrator, and shows no actual, real email address. You
remember...email, one of the things Outlook is meant to do?
Then it dawns on me: the mentioned-in-passing comment from the user
that the message is probably from Outlook itself is true. I'd thought
this was just a friendly gloss on an unfriendly message, but it
wasn't. This fucking message is from Outlook. And it's not until I
skip ahead and tell you the exciting conclusion -- it was our mail
server refusing to relay and saying so, something never not once
mentioned in the offending message -- that you're going to realize the
full horror of the situation.
For Outlook does not only mangle email, and hide attachments in weird
files called "winmail.dat", and shake its baloney all over the place
like a drugged-out Hula girl in the "Before" picture in all those
rehab clinic advertisements. No. That is not all.
Outlook -- the mail client -- also takes error messages from mail
servers and disguises them as email messages that have just arrived,
rather than showing the user the fucking error as an error when
and as it occurs! It hides the origin of the error by pretending to
be some non-existant sysadmin when it sends this message! And it does
nothing to indicate that this false email is any different from the
other messages from Bill and Bob and Ted littering your inbox about
horizontal opportunity mission statements, complete with an animated
surfing guy for Bob shouting "Whoah!" to differentiate his mangling
of the English language from Ted's, leaving me to wonder what the
fuck kind of congenital brain damage must've been at work to make
this seem like a good idea to anyone.
Fuck me, I hate Outlook.
Tags:
rant
outlook
windows
03 Aug 2005
/dev/da0s1e: phase 2: dir 700529 of 808563 (86%)
- I hate fscks that don't provide a progress report.
- When you're fscking, don't fucking touch the keyboard. Especially don't hit the up arrow or the enter key so that the forty-minute fsck is repeated; you'll have to kill it and the disk will be marked dirty.
- Make sure power cords can't be removed from servers.
- "Server" means, among other things, "redundant power supplies". Yes, it does.
- Non-journaled filesystems are for the fucking birds.
- Make sure that your SCSI cables are firmly fastened.
Tags:
rant
03 Aug 2005
A while back a friend of mine moved out of town, and gave me some
of his old computers. He's a Mac guy, so they were a bit different
from all the x86 stuff I've got around me. One of them was a Umax
c500/180, one of the few (so I understand) Apple clones. It's got
a 180MHz 603e processor, I think 92 MB of RAM, 2 PCI slots, and a 2GB
hard drive -- which is currently split between OS8 and an old version
of Yellow Dog Linux. Being the perverse bastard I am, I've decided to
try and get Gentoo going on it (from Stage 1, baby! yeah!) and turning
into a firewall machine.
I'm picking up the Apple terminology slowly. It's taken a
good month to bang into my head that this is an Old World machine --
which means you can't just throw in a CD and boot from it. Oh no. You
need to use BootX, an Apple extension that, early in the boot process,
asks if you want to keep running the Mac OS or switch to Linux. To add
a new kernel -- like, say, your install CD kernel -- you need to copy
important files into the right folder in Mac OS. Not only that,
but because the machine is old and funky enough, you need to
download certain non-schedule kernels to get it to
work...but then it works great. My kernel args were a little
different:
cdroot root=/dev/ram0 rw init=linuxrc loop=livecd.squashfs looptype=squashfs console=tty0 nodevfs udev video=imsttfb
But hey! Worked! At least, until I started getting SIG11
errors...time to rip out some memory, I guess.
Update: Huh...reseating the RAM and the CPU seems to have done the
trick. Currently compiling binutils with no problem.
Tags:
30 Jul 2005
I thought I'd give PTXDist (latest version: 0.7.5) a try in my
continuing attempts to get a proper toolchain going. I'm running into
problems, though, when it comes time to compile uClibc:
make[5]: Entering directory
`/home/aardvark/bin/ptxdist-0.7.5/build/crosstool-0.32/build/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/build-libc/libc/sysdeps/linux/arm'
arm-uclibc-linux-gnu-gcc -Wall -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing -fstrict-aliasing -Os -funit-at-a-time
-mlittle-endian -fno-builtin -nostdinc -D_LIBC -I../../../../include
-I. -isystem
/home/aardvark/bin/ptxdist-0.7.5/local/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/lib/gcc/arm-uclibc-linux-gnu/3.4.2/include
-DNDEBUG -fPIC -c __longjmp.S -o __longjmp.o
__longjmp.S: Assembler messages:
__longjmp.S:36: Error: selected processor does not support `lfmfd
f4,4,[ip]!'
make[5]: *** [__longjmp.o] Error 1
make[5]: Leaving directory
`/home/aardvark/bin/ptxdist-0.7.5/build/crosstool-0.32/build/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/build-libc/libc/sysdeps/linux/arm'
make[4]: *** [arm] Error 2
make[4]: Leaving directory
`/home/aardvark/bin/ptxdist-0.7.5/build/crosstool-0.32/build/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/build-libc/libc/sysdeps/linux'
make[3]: *** [_dir_linux] Error 2
make[3]: Leaving directory
`/home/aardvark/bin/ptxdist-0.7.5/build/crosstool-0.32/build/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/build-libc/libc/sysdeps'
make[2]: *** [_dir_sysdeps] Error 2
make[2]: Leaving directory
`/home/aardvark/bin/ptxdist-0.7.5/build/crosstool-0.32/build/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/build-libc/libc'
make[1]: *** [_dir_libc] Error 2
make[1]: Leaving directory
`/home/aardvark/bin/ptxdist-0.7.5/build/crosstool-0.32/build/arm-uclibc-linux-gnu/gcc-3.4.2-uClibc-0.9.27/build-libc'
make: *** [/home/aardvark/bin/ptxdist-0.7.5/state/crosstool.install]
Error 2
Googling didn't turn up much, but what I found suggested that uClibc
was being compilied for the wrong processor, and/or for a processor
that had an FPU -- which I don't believe the ADM5106 in this thing
does. When configuring PTXDist at the beginning, I'd certainly told it
to use softfloat, and GCC appeared to be compiled with that in mind
(thus the error). Sure enough, when I took a look at the .config
file in the uClibc build directory, it was pretty wrong:
ARCH_LITTLE_ENDIAN=y
# ARCH_BIG_ENDIAN is not set
# ARCH_HAS_NO_MMU is not set
ARCH_HAS_MMU=y
UCLIBC_HAS_FLOATS=y
HAS_FPU=y
I'm not sure why the configuration details make it to GCC and not
uClibc; I imagine it's a bug, though it could also be that I'm
pointing PTXDist at my uClinux source tree...I wouldn't think that'd
be a problem, but it's not supported. I'm not sure I have the patience
to follow this through, though, so I may just leave it rather than
file a bug (I'm a bad person, I know).
One annoying thing about PTXDist is that make world
, the do-it-all
command, cleans everything out before starting, and there does not
appear to be a make continue
target to just keep going; it makes
debugging things very difficult. I've been looking around at other
scripts, and it's hard to find one that supports uClinux
explicitly. I'm probably being superstitious, but I've had enough
problems with toolchains that I'm reluctant to assume it'll work if I
just drop in the uClinux sources. I may end up compiling my own ('cos
that'll be easier...).
Tags:
nwr04b
29 Jul 2005
If your W2K Pro computer hangs during boot with the message "Applying
security policy..." but eventually (5-25 minutes later) boots, you may
want to look at this link...worked for me today. One little bit
of clarification: I found no .chk
file in the Security folder. This
doesn't appear to have hurt anything.
Tags:
windows
28 Jul 2005
Somebody PLEASE explain to me why the W2K shell does not include a
Windows equivalent of chmod by default, and why its closes equivalent,
cacls
, only comes with the $x00 resource kit. Here's what happened:
- Need to install OpenOffice as regular user...
- but the user had no permission to write in Program Files...
- so runas /user:Administrator explorer didn't work...
- so runas /user:Administrator cmd did work...
- but no cacls...
- so as Administrator, run cygwin.bat...
- and do mkdir /cygdrive/c/Program Files/OpenOffice.org...
- and do chmod 777 !$...
- and install and then set the permissions back.
Thank God for Cygwin.
Tags:
windows
26 Jul 2005
An hour playing around with Xine and MythTV, and what do I get? A DVD
player that exits without any visible error at the menu screen two
times out of three. And if that wasn't enough, pressing the menu
button once will get you the Xine menu -- pressing it twice will get
the MythTV splash screen, but the movie is still playing: the sound is
there, but the video isn't. Holy crap.
The last time this was happening, I'd rented Hero. All was going
well, when I accidentally hit the Back button on the XBox remote; this
dumped me back into MythTV. Annoying but no problem, right? Just start
up Xine again, and...it crapped out after all the warnings about how
copying DVDs makes Baby Jesus cry. Well, I was skipping those, so how
about if I try sitting through them? Same thing.
My memories are clouded by the red cloud of rage, but I believe I
tried running Xine on my desktop machine with X forwarding on. I
managed to get an error message about how this was an encrypted DVD,
and I should look at getting libdvdcss (assuming it's legal in my
jurisdiction). I already had this, of course.
I tried removing the .libdvdcss
files with the cached keys -- that
took a while to track down -- but nope, same thing. I tried other
players, too. gxine did the same thing, natch. mplayer dumped core
(this was the Debian package, which I'd never tried using before; I
didn't want to bother compiling it from source).
Ogle was the only damned thing that worked, but I couldn't figure out
how to make it do fullscreen. I didn't have these problems with the
older version of Xine that was installed before I upgraded
Xebian. Teach me to upgrade...
On the plus side, though, I've figured out that (for Napoleon
Dynamite at least) it does work with some persistance. It's a
damned good thing I love Linux so much.
Tags:
rant
26 Jul 2005
title: New version of QEMU
date: 2005-07-26 04:19:09
Woohoo! There's a new version of QEMU out, and look what's there:
* Windows 2000 install disk full hack (original idea from Vladimir N. Oleynik)
Just trying it out now. With any luck, this'll let me run W2K at work
w/o needing VMWare. (People have claimed they can get W2K installed on
QEMU, but I've never been able to make it run.) I'll let all y'all
know how it turns out.
Tags:
21 Jul 2005
title: Compiling NDISwrapper on Mandrake 9.1
date: 2005-07-21 20:29:00
While compiling NDISwrapper on Mandrake 9.1, I ran into this error:
# ./configure -auto
checking for running kernel version...2.4.21
checking for ptserial...ptserial-2.4.7.c
checking for gcc...3.2.2
searching for kernel includes...found at /usr/src/linux/include
checking for modversions.h.../usr/src/linux/include/linux/modversions.h
checking for kernel_version...In file included from t.c:2:
/usr/src/linux/include/linux/version.h:1:28: linux/rhconfig.h: No such file or directory
./configure: line 1: ./t: No such file or directory
rm: cannot remove `./t': No such file or directory
** error
could not determine a proper UTS_RELEASE
This is how I got around it:
[root@localhost src]# ln -s /usr/src/linux/include/linux/rhconfig.h /usr/include/linux/
[root@localhost src]# ./configure -auto
checking for running kernel version...2.4.21
checking for ptserial...ptserial-2.4.7.c
checking for gcc...3.2.2
searching for kernel includes...found at /usr/src/linux/include
checking for modversions.h.../usr/src/linux/include/linux/modversions.h
checking for kernel_version...UTS_RELEASE is 2.4.21-0.13mdk
detecting your modem...found. Your modem is a i8xx type modem.
Tags:
10 Jul 2005
Well, I'm getting further along.
First off, I've managed to get the kernel mounting its root directory
from my desktop machine. The trick to this was turning off the initrd
option in the kernel config; if you don't, it doesn't matter what
options you put in the kernel command line -- it'll try to read the
ramdisk and then fail because it's not in JFFS2 format (though I'm
sure that error could be got around somehow; I'm just not bothering
right now 'cos NFS is more flexible).
So now this kernel command line works:
root=/dev/nfs nfsroot=192.168.23.254:/home/aardvark/nwr04b/nfsroot ip=192.168.23.12:192.168.23.254:::test:eth0:off
...and I can ping the thing, which is good. Now I just need to
populate it, which means just compiling busybox. Easy, right?
Ha! Another big-ass set of problems is what it is. First, I tried a
copy of Busybox I had lying around that I think I'd compiled as part
of a previous toolchain attempt. Yeah, I know -- "Let's throw in
random binaries and they'll work!" -- but I figured it was worth a
try. file
seemed hopeful:
ELF 32-bit LSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, statically linked
but when I tried it I got this error:
BINFMT_FLAT: Bad magic/rev (0x1010161, need 0x4)
God bless Free software; here's the comment from fs/binfmt_flat.c
:
because a lot of people do not manage to produce good flat
binaries, we leave this printk to help them realise the problem.
We only print the rror if it's not a script file
Flat binary? Wha? And then came this FAQ from the excellent uCdot:
What causes 'BINFMT_FLAT: bad magic/rev (0xZZ, need 0xYY)' errors?
A lot of people encounter this error the first time they try to run a
program on a uClinux system. Usually this is caused by trying to run an
ELF or COFF executable rather than a "flat" executable. uClinux does not
support anything but the "flat" executable format. ELF/COFF programs
are converted to "flat" format using elf2flt/coff2flt respectively.
To fix this problem with the ELF toolchain add -Wl,-elf2flt to the final
link line of your build and it will create a flat executable.
And why do we need that? Well, because this CPU has no MMU; the ELF
format for executables won't work because (and I'm fuzzy on the
details here) this means that the binary has to deal with being run
from any memory address, rather than being lied to and told that it's
at 0x0. Thus the special arguments to the compiler and linker, and the
invocation of elf2flt afterward. So: to compile busybox I had to
change the CFLAGS argument in make menuconfig
to -D__PIC__ -fpic
-msingle-pic-base
, then run:
make dep
LDFLAGS=-Wl,-elf2flt make
I still got this error:
arm-elf-strip --remove-section=.note --remove-section=.comment busybox
arm-elf-strip: busybox: File format not recognized
make: *** [busybox] Error 1
but the strip command is the very last one in compiling the binary,
and file busybox
gave "busybox: BFLT executable - version 4
gotpic". I copied it into place, booted and got:
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
device=eth0, addr=192.168.23.12, mask=255.255.255.0, gw=255.255.255.255,
host=test, domain=, nis-domain=(none),
bootserver=192.168.23.254, rootserver=192.168.23.254, rootpath=
Looking up port of RPC 100003/2 on 192.168.23.254
Looking up port of RPC 100005/1 on 192.168.23.254
VFS: Mounted root (nfs filesystem).
Freeing init memory: 52K
Unhandled fault: external abort on linefetch (F4) at 0x00000001
fault-common.c(97): start_code=0x700040, start_stack=0x67ffbc)
[1] sh: bad data abort: code 33554432 instr 0x32005500
Code: 495f5fdf 0e97f38e (c9a303b1) 3ea3a3ad b294aa7c
fault-common.c(97): start_code=0x700040, start_stack=0x67ffbc)
Internal error: unknown data abort code: 32005500
CPU: 0
pc : [<0000ffff>] lr : [<0000ffff>] Not tainted
sp : 0000ffff ip : 0000ffff fp : 0000ffff
r10: 0004d04c r9 : 00050e40 r8 : 001fa000
r7 : 00000000 r6 : 0000005b r5 : 00169884 r4 : 0019a904
r3 : 001722c0 r2 : ffffffff r1 : 20000010 r0 : 20010016
Flags: nzcv IRQs off FIQs off Mode SYS_32 Segment kernel
Control: 0
Process sh (pid: 1, stackpage=001f9000)
Stack:
Backtrace: frame pointer underflow
Function entered at [<b1c9a2f3>] from [&lt;8e0e97f3&gt;]
Unhandled fault: alignment exception (93) at 0x00000001
fault-common.c(97): start_code=0x700040, start_stack=0x67ffbc)
Internal error: Oops: 0
CPU: 0
pc : [&lt;0012cccc&gt;] lr : [&lt;00058850&gt;] Not tainted
sp : 001f9e94 ip : 001f9e40 fp : 001f9ec8
r10: 00640004 r9 : 00000000 r8 : 00000010
r7 : 00000000 r6 : b1c9a2f3 r5 : 9c63fdbd r4 : 0000ffff
r3 : 0014b478 r2 : 00000001 r1 : 00000001 r0 : 0000ffef
Flags: nZCv IRQs off FIQs on Mode SVC_32 Segment kernel
Control: 0
Process sh (pid: 1, stackpage=001f9000)
Stack:
001f9e80: 00058850 0012cccc 60000093 ffffffff 0000ffff 001f8000 00000001
001f9ea0: 001f9fd4 0067ffc8 00053a08 001f8000 001f9fd4 0000ffff 32005500 001f9ee0
001f9ec0: 001f9ecc 00053b00 00053984 001f8000 001f9fd4 001f9ef0 001f9ee4 00053b50
001f9ee0: 00053a60 001f9f94 001f9ef4 00054080 00053b44 32005500 00000004 00000000
001f9f00: 00030001 0000ffff 00050cc8 001f9f2c 001f9f1c 000567a8 000551b4 00000000
001f9f20: 001f9f7c 001f9f30 000576f8 0005675c 0068a000 001f9f98 00000000 001f9f98
001f9f40: 0067ff78 20000013 000480a0 001f8000 0068a000 0014b1f8 00148000 0014a040
001f9f60: 00170a40 001f9f94 00055710 00000000 00000000 0067ffd0 32005500 00000000
001f9f80: 0067ffd0 00000001 00000000 001f9f98 00054ed8 00053ff8 00000009 00000000
001f9fa0: 00000009 0004d03c 00000000 00000000 0067ffd0 00000001 0067ffc8 00000000
001f9fc0: 00640004 00000000 00000000 0067ff88 0004d020 20010016 20000010 ffffffff
001f9fe0: 001722c0 0019a904 00169884 0000005b 00000000 001fa000 00050e40 0004d04c
Backtrace:
Function entered at [&lt;00053974&gt;] from [&lt;00053b00&gt;]
r7 = 32005500 r6 = 0000FFFF r5 = 001F9FD4 r4 = 001F8000
Function entered at [&lt;00053a50&gt;] from [&lt;00053b50&gt;]
r5 = 001F9FD4 r4 = 001F8000
Function entered at [&lt;00053b34&gt;] from [&lt;00054080&gt;]
Function entered at [&lt;00053fe8&gt;] from [&lt;00054ed8&gt;]
r7 = 00000001 r6 = 0067FFD0 r5 = 00000000 r4 = 32005500
Code: ebfcae37 e2440010 (e5961004) e1a03521 e59f20cc
Kernel panic: Attempted to kill init!
The punchline is that that's the best result I've got in a lot of
experimentation I'm not writing down here. The one common thread, once
I got the binary format figured out, is this:
Unhandled fault: external abort on linefetch (F4) at 0x00000001
fault-common.c(97): start_code=0x700040, start_stack=0x67ffbc)
The 0x00000001
is the same throughout. I tried this suggestion
and ran flthdr -s 65535 busybox
to increase the stack size from
0x1000
to 0xffff
-- same result. Then I came across this
message, which says that there's something wrong, F4 is the
message from the CPU's fault register, and I need to figure out what
it is. However, I've also come across (and lost the links to) another
post which suggested it was a paroblem with a particular version of
uClibc. So that means paying proper attention to a toolchain, which
I'd skipped over earlier. I'm currently trying to get the HRI
toolchain going, so we'll see how that turns out.
Tags:
nwr04b