Commodore PET ... web server?Now geeks of a certain age (those old enough to have used a computer in 1979 or 1980) will certainly recall the Commodore PET. It's a 6502-based all-in-one computer. The model 4032 (pictured) tempted me back then, as it was relatively inexpensive, decently constructed, and had a lot of software available. But the business I had back then was more or less locked into the Z-80 processor and CP/M “operating system”, so I never did take the plunge.
Back when the PET was made, there was no such thing as the Internet, web sites, TCP/IP (at least, not outside of ARPA), or even networks. So how on earth could there be a web server on a PET?
It turns out there is still a very active PET community, though these days it's more like a group of antique tinkerers. But to my surprise, there are still companies (tiny ones, I suspect) making new hardware for PETs – such as this internet modem. That's a bit like retrofitting a J-5 rocket engine onto a horse-drawn carriage – I'm sure the processor running that modem is many thousands of times more powerful than the PET's puny little 6502. The modem is running all the networking, including the protocol stack all the way up to HTTP. That means the Basic code to implement the “web server” is pretty simple:
10 open2,7,2,"listen:80"
20 open7,7,15
30 print#7,"n-s:2"
40 input#7,a,b$,c,d
60 if d=0 goto 30
70 print#7,"c-i:2"
80 input#7,a,b$,c,d
90 printb$
100 print#2,"<html>"
110 print#2,"<head>"
120 print#2,"welcome to a commodore pet 4032 web server!"
130 print#2,"</head>"
140 print#2,"<b>welcome to the"
150 print#2,"world's first"
160 print#2,"web server running"
170 print#2,"on a commodore pet 4032!"</b></html>
No comments:
Post a Comment