10 Aug 2002 goingware   » (Master)

Why Web Browsers are a Poor Application Development Platform

I had written out most of the diary entry that I'm now going to repeat below, when I brought up another browser window to look up another web page. Then I clicked its close box, accidentally clicked twice, and my second click hit the close box of my diary entry window.

This would actually be a simple thing to fix, maybe I'll try submitting a patch to mozilla (I built it once, it's pretty huge). Just check if the text in any of the form fields has changed and ask the user if they want to submit the form before closing.

How long have we had forms on the web? How easy would it be for every browser to make that change?

Now back to our regularly scheduled broadcast:

My Honey's Coming Home

My wife Bonita's been away at an art retreat in southwestern vermont for the week. It seems to have done her a lot of good - life has been hard on us since we've been married, largely because of the dot-com crash, and there hasn't been much of real quality in her life. I'm glad she's had this.

I'm leaving at 5 am for the six-hour drive to pick her up. Tonight I'm cleaning the house as I promised her it would be spotless upon her return so she wouldn't worry about me trashing the place in her absence. I even mowed the lawn.

The workshop certainly seems to have done her a lot of good. They had her doing a lot of work that's quite different from what she usually does, and she has painted quite a few paintings. She actually had to buy ink, paint and paper during her stay there even though she arrived with what she thought would be plenty.

486DX2 Laptop Packed with 8 MB RAM, 350 MB Hard Drive, 640 by 480 Passive Matrix Color Screen and Two (count 'em: two) PCMCIA Slots!

A while back I did some volunteer work to set up the office computers for the Lincoln Street Center for the Arts in Rockland. It's the former Rockland High School which was purchased by a non-profit foundation and now used for performing arts in its rather well-equipped theater, as well as gallery and studio space.

The grateful director offerred to give me a bunch of antiquated hardware and of course I eagerly accepted.

I got the laptop with the above specs, a Toshiba Satellite T2100CS. Once I plugged it in it booted right up into Windows 3.1 and seems to work flawlessly. I ran Windows Scandisk on it and tested it at length with Memtest86 and it didn't seem to have any problems. It's also built rather more ruggedly (and heavier) than is the current practice of laptop manufacture. They just don't build them like they used to.

I plan to use it as a firewall and NAT server to share my 56k modem connection among several other machines in the house. I used to have a Pentium II box to do that, but I took it to Newfoundland in June to get my mother-in-law online.

I know there are a number of distros that would probably be more optimized for this purpose, like The Linux Router Project (which can be installed on a single floppy, so you don't even need a hard drive) but I want to go through the trouble of building a firewall myself so I learn all about how it's done. I wasn't really firewalling before, just using NAT.

I just took it as a challenge when the Debian Woody r0 boot floppies wouldn't boot - they use up more RAM than the 8 MB the machine has to offer. The kernel includes a lot of options I don't need and the root disk includes a lot of stuff so that the ramdisk is too big.

The solution will be to make a boot disk that will allow me to partition and create filesystems that can boot in such small memory constraints, and then copy the contents of the woody root disk into what will later become /home, and then use that as root when I boot to do the initial install, rather than using the ramdisk at all. I found this in the 4mb Laptop HOWTO.

I didn't have a lot of luck with making a disk for muLinux with all the weird hardware I have (SCSI hard drives and IDE floppy on my laptop) so later I tried using the GNU Parted disk set.

But parted has a kernel packed with drivers for all kinds of RAID controllers and stuff, and a 7 MB ramdisk that's full of handy disk repair tools, so that didn't even come close to booting.

Then I figured out how to resize a ramdisk image. The wrong way is to give the "ramdisk_size=" parameter to the kernel. You can boot this way but only part of your ramdisk gets loaded into memory. At some point you will get a message like "attempt to seek beyond end of block device" at which point you are likely to crash.

The real way to resize a ramdisk image is to uncompress it under Linux with gunzip and mount it using the loopback device:

mv partroot.img partroot.gz

gunzip partroot.gz

mount -o loop partroot /mnt

Then you go through the filesystem you've mounted merrily deleting files you think you won't need. Note that all the /dev special files take up a significant amount of space because there are so many of them and the inodes take up invisible space in the filesystem. There are something like 3000 special files in the /dev directory of the parted root floppy so deleting most of them actually saves a significant amount of space.

Finally there is a couple megabytes of free space in the ramdisk to allow you to save scratch files that you just can leave out.

Now you create the new ramdisk image. Suppose I'm going to make it three megabytes:

dd if=/dev/zero of=newimage bs=1024 count=3000

mke2fs -b 1024 -i 2048 newimage

(press "Y" when it asks you if it is OK to make a filesystem in a file that is not a special file).

mkdir ~/newfs

mount newimage ~/newfs

cd /mnt

tar cvf - | (cd ~/newfs ; tar xf - )


umount newfs

gzip newimage

dd if=newimage.gz of=/dev/fd0h1440 bs=10240

If you want to create an image that can be put on a floppy with rawrite2.exe under DOS, use the following command line to append the appropriate number of bytes of zeros so it is the same size as the kind of floppy you want to use.

dd if=/dev/zero of=newimage.gz bs=1 count=XXXXXX

(where XXXXX is the right number of bytes)

Unfortunately that only almost booted. It would come all the way up, run out of ram, find no processes it could kill to free ram, and reboot.

So what I'm going to do is compile a custom kernel to boot off a floppy, that only has what the Toshiba Satellite needs to boot. Then I'm going to make a ramdisk image from scratch that only has cp, parted, and gunzip on it. I think it may actually save space to statically link the binaries, because the standard C library (if used as a shared library) will have a lot of subroutines that I don't use. So likely I can make a ramdisk that is only a few hundred k.

I'll write up a mini-HOWTO when I'm done.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!