345 karma · joined November 10, 2021
(Thanks in advance!)
While it's common, it was still a terrible practice. If whatever was filling in that buffer changed, they could be blasting more code than they intended. (As indicated in what I wrote, I know it was common if they wanted to reuse the space. Device drivers do something similar when they are done with their init code.)
I'm still puzzled by the jump on the segment register values. I need to trace through the entire path.
On a more serious note, the web server is the problem here. I've tried to run long periods of time before but eventually it would crash. I finally found a 10+ year old parsing bug that wasn't handling quoting correctly, and it was some sort of crypto coin mining JSON request that tripped the bug. So even what I thought was bullet proof years ago turned out to be broken by changes in the user traffic.
On the plus side, when I finally do get around to building a cluster of these and a load balancer I'll know what to do. ;)
I'm just happy it's been surviving the hug of death for 12+ hours now. Given the age and software that might be the true accomplishment.
(This machine has not been altered to speed the clock.)
I have more open space in this machine because I am using a 3.5" drive instead. I also replaced the original fan with a quieter Noctua. The jrIDE is running naked on the side of the machine because I think it was having heat issues.
In a later iteration of this machine it will get more direct cooling; the slots in the case are kind of restrictive.
I've turned down the logging level a little bit and turned off the beeper. On this machine, a 50ms beep on the motherboard buzzer is 50ms of delay. :)
(That was featured earlier this year on HN.)
Although there are people are using Apache in front of their vintage computers to terminate SSL for them while still having the vintage computer handle the request.
This should tide you over: http://www.brutman.com/PCjr/pcjr_web_server.html
The main page is the best link. You might want to try back later after the initial rush; the machine is getting pounded.
Performance measurements here: https://www.brutman.com/mTCP/mTCP_Performance.html
* It's getting hammered. I didn't expect it to be this bad.
* If it can't process things fast enough packets might be dropped. So the TCP/IP error rates are probably pretty high right now.
* It's logging all of this crap too ...
Normally it can do the handshake in tens of milliseconds. Right now the load on it is basically "crush." But it's queuing and answering as best as it can.I have a love/hate relationship with the Xircom adapter. It's portable and great for machines without ISA slots, but the max throughput is about 40KB/sec. A nice, real ISA card like a WD8003 can do over 100KB/sec on the same machine.
Besides, who needs 32 bits when 16 will do ...
(Not serious.)
Remember, this is a home computer from the mid 1980s. This thing is way outside of it's duty cycle. And the software is holding up pretty well too, even during what is effectively a DoS attack on a DOS machine.
For the next iteration I've got to put a better Ethernet card on it. The Xircom PE3-10BT device is nice because it's convenient, but the bandwidth would be 2x higher with a real Ethernet card on the bus.
And normally this machine is idle so the speed and bandwidth are not a problem. Right now it's very popular. :)
It can serve 8 concurrent connections but that slows it down. It will queue a few more too; be patient and you will be rewarded.
** 2023-07-14 18:38 PDT The DOS machine is getting DoSed. It's still beeping and happy but it's busy. **
This website is hosted on a 39 year old PCjr running at 4.77Mhz and it has been running over 2,500 hours continuously now. No reboots or program restarts ... you can see the current runtime stats by visiting http://brutmanlabs.org/status .The machine specs are:
- IBM PCjr w/ NEC V20 CPU (the V20 gives a small speed bump compared to the original 8088)
- jrIDE sidecar providing expansion RAM to bring the system up to 736KB and an IDE port
- Kingston SSD w/ a Startech SATA-IDE bridge
- Parallel printer sidecar, modified to be bi-directional
- Xircom PE3-10BT Ethernet adapter hanging off of the parallel port
- IBM PC DOS 5.02 and mTCP HTTPServ
- APC UPS (45 watt power draw with networking equipment)
- Dynamic DNS is being handled by my home router, which forwards port 80 to the machine.
All of the upgrade parts are there for performance or convenience; you could use period correct parts and everything would work the same. (The IDE adapter would be a homebrew MFM adapter and you'd have to use something like a 3Com 3C503 on a bus adapter, but all of that existed in the mid 1980s when the machine was new.)The web server is my own work, part of the mTCP project. Here are some of the features:
- serves HTTP 0.9, 1.0 and 1.1 requests to be friendly to vintage browsers
- Maps "normal" looking paths and resources to DOS 8.3 file format
- HTTP 1.1 requests can be pipelined.
- can serve up to 8 concurrent connections
- logging to local disk and over UDP
- can serve pre-compressed content
- basic auth
- runs on DOS 2.1 and up
- built in SNTP client for time syncing
Besides the UPS it needs the SNTP client to achieve long run times, otherwise dropped interrupts cause the machine to lose time. Without the SNTP client it was losing up to a few minutes per day depending on the system load. The SNTP client also helped it transition through the daylight savings time change in March.The limiting factor is going to be disk space for logging; it is generating logs and eventually that disk partition will fill up. (I need to add log rotating and compression.) This machine was running when the ChatGPT client for DOS was announced, and it was hosting the mTCP networking pages at the time, so it got quite a bit of traffic. I learned after that to leave a lot of space for logs.
It beeps when somebody visits - enjoy!
The machine is a 4.77Mhz IBM PCjr probably made in 1984 running IBM PC DOS 5.02. A Xircom PE3-10BT Ethernet adapter (originally designed for laptops) on the parallel port allows it to connect to network. It has a modern-ish IDE controller and an SSD but those are only needed because of the amount of content; the machine could happily serve pages from RAM indefinitely. (Serving from the floppy disk would be painful, and probably short lived for the floppy disk.) I am cheating slightly and sending large, multi-megabyte requests for PDFs to another machine because I don't want those to tie up the machine for so long.
The software is my the mTCP HTTPServ web server. It runs on everything from DOS 2.1 up, supports up to 8 concurrent users at a time, supports filename and path mapping so you don't have to look at horrible DOS 8.3 paths and files, supports BASIC auth, logging, and a few other fun features. I've been working on it for nine years now. (mTCP is even older at 14 or 15 year now.)
The tricks to keep it running this long are a small UPS system and an SNTP client so that it can keep the clock synced with the rest of the world. The UPS protects the machine, router, and fiber ONT for a total load of 45 watts. The machine loses a few seconds here and there due to lost interrupts for the SNTP client is a necessity for longer runs. The SNTP client also helped it transition through the daylight savings time change in March.
The limiting factor is going to be disk space for logging; it is generating logs and eventually that disk partition will fill up. (I need to add log rotating and compression.) This machine was running when the ChatGPT client for DOS was announced, and it was hosting the mTCP networking pages at the time, so it got quite a bit of traffic. I learned after that to leave a lot of space for logs.
It beeps when somebody visits - enjoy!
Read the manual ... It's all explained.
On this platform you have the burden of ensuring that the C runtime is thread safe, or putting locks around it. The same with BIOS calls. And DOS function calls too; you can't have those other CPU cores just blundering in on something that is not reentrant.
And besides, I target this at 16 bit DOS on vintage machines. I've never seen a PCjr or an AT class machine with multiple cores. There were some super expensive 386s at the time that were multi-processors, but those are a fairly rare item.