Apple II Web Server Written In BASIC

The Apple II was the machine that many say launched Apple as a company. As with many popular computers of the 1980s, the Apple II maintains a steady following to this day who continue to develop new hardware and software to keep the platform alive.

[deater] had scored an Uthernet II Ethernet interface for his Apple IIe, based off the venerable W5100 chipset. He decided to have some fun and wrote a webserver for the Apple II in BASIC. The program sets up the Ethernet card with a series of PEEKs and POKEs, and then listens out for incoming packets before responding with the requisite data loaded from floppy disk.

The server can deal with HTML, text, and even JPEG and PNG images. It’s even compliant with RFC 2324. It does suffer from some limitations however — the disk format used can only hold 140 kB, it can only serve an 8kB file at a time, and due to using a lot of string manipulation in the code, is painstakingly slow.

Before you get too excited, the machine is running on a local network only, so you can’t check it out from here. However, [deater] has kindly released the source code if you wish to run it for yourself.

If you’re thirsty for more 8-bit action, check out this Apple II playing animated GIFs.

17 thoughts on “Apple II Web Server Written In BASIC

  1. I’d be more impressed if they used one of the actual modems(Apple Cat II etc..) from that era. I also used peek and poke for modem stuff with a 286. It was mostly around a FOSSIL system though.

    1. Use a modem as in just connecting to some other machine (a rasp-pi for example) and kicking out webpages over a serial port? That’s a lot simpler than programming an ethernet card.

      Using a modem and implementing PPP or SLIP would be more impressive, but I’m not sure if I’d want to tackle that in BASIC.

          1. The anachronisms here are tricky. By the time the WWW was invented the Apple II line had more or less reached end-of-life.

            I think the traditional way of doing this in a “what they could have done at the time” way would be getting a contemporary 8-bit ISA Ethernet card for the PC and then remapping the pins so it could interface with the Apple II expansion slot. You’d also then have to do the entire TCP/IP stack in software, which people have done on the Apple II, but in assembly language not in BASIC.

            The wiznet 5100 chip used on the Uthernet II is 10 years old as is though, so that’s even getting retro depending on how young the crowd you hang out with is.

          2. Near the end of the line, a Platinum IIe like in the photo, or a IIgs, owned by a typical enthusiast would have a 4 or 8 MHz (some were 10) accelerator, RAMDisk and 1M extended RAM, and hard disk that was seen as a collection of Profile drives by ProDOS. Basically the speed of an Arduino Uno if it had 64K of RAM, and rather zippy with the software of the day.

            For the last 10 or 15 years, Rich Dreher has been selling a card that takes an external drive or an SD card or CF card and appears as a collection of Profile partitions IIRC (with some firmware help by Dave Lyons, who was in the Apple II DTS group at Apple). Instant booting on an Apple II. An Apple IIe filled out to match a typical nit of the time, would serve the pages up over 10 times faster and anything bound by disk access, 100 times faster or more I would think. This device uses DMA. http://dreher.net/?s=projects/CFforAppleII&c=projects/CFforAppleII/main.php

          3. “The anachronisms here are tricky. By the time the WWW was invented the Apple II line had more or less reached end-of-life.” is a pretty accurate statement. In 1993-1995 I still used my Apple //gs to connect by modem to Atlantis multi-line BBS in Charlotte from my apartment near UNCC. On campus, I used Sun workstations running NCSA Mosaic web browser to view web pages. I set up a web server on SunOS.. I remember people at UNCC musing “wouldn’t it be nice if there were a version of Mosaic that would run on a PC”. and people on the BBS learning how to hop to other BBS’s running similar software across the country once the sysop added a modem dedicated to connect to a network of BBS’s. I was using Unix at school and GSOS or really just a terminal program on PRODOS at home. When I moved to California January 1996 I still had my GS until I finally broke down in late 1996 and went to one of the dark sides and bought a PowerPC Mac. I ran Netscape with a modem over an Apple approved dial up service. In 1998 I was one of the first customers to get DSL in Palo Alto. I remember the google beta screen. At work I of coarse used HP Unix. I had co-workers who were among the first to have cable modem and noted they could view files on the computers of any neighbor nearby who didn’t have a firewall which was all of them. In 2000 I moved to Boise and had to go back to dial up being too far from downtown to get DSL. I got AOL (gag) and met my wife in an AOL chat room in 2000. She was 18 and gave me her address to pick her up for a date. Tell that to a 2016 18 year old who has been hearing about the evils of chat rooms their entire live and they will fall off their chair. :-0

      1. PPP and SLIP actually aren’t hard you just need to learn interrupt models(unless you have drivers) and work with Bell 202, Hayes etc..

        You can abstract things and make it a lot easier.

  2. This sounds like something pretty hard to achieve in BASIC. I know I couldn’t do it, and BASIC’s about all I know…

    …mine’s a little more up to date though, I think… Microsoft QuickBASIC PDS 7.1… my excuse is that I learned it on a 386 when I was a lot younger. Never really finished, tho.

  3. The cool part about this setup is that all the heavy lifting— the TCP/IP stack— is on the Uthernet II card. So the Applesoft BASIC interface is fairly simple. It’s just opening the equivalent to a Berkeley socket and then reading or sending its payload.

    Check out the A2RetroSystems web site to learn more about the Uthernet II card. This thing is still not being used to its full potential… yet!

  4. “The Apple II was the machine that many say launched Apple as a company. “ Yes if ‘many’ == ‘everyone who’s ever talked about it’. The Apple I got them some attention, but it was a crude kit.

    The Apple II was a bona-fide commercially produced computer you could buy in a store.

    If you want to know what ‘launched apple as a company’ you have to look past hardware.

    It was VisiCalc.

    VisiCalc was the thing that essentially launched the entire personal computer industry. I know a number of people who bought Apple II’s as ‘VisiCalc’ machines, they never ran anything else, to the point that the top row and first column were permanently etched into the monitor screens.

  5. *shrug*
    Been there, had a SX64, done that, ran Contiki on it and used a RR-Net network adapter, serving files to the pulic at a blistering 300 bytes per second because the floppy ran at its default speed.
    And yes, here the little 6510 had to do everything on its own.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.