Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: My 486 Server (dy.fi)
255 points by smoppi on Jan 16, 2022 | hide | past | favorite | 115 comments
Hello. I wrote a multitasking 16-bit real mode "operating system" that works on every IBM PC compatible computer, and a TCP/IP stack for it. Then I wrote an HTTP server for it.



You Finns and your "(free) operating system[s] (just a hobby, won't be big and professional like gnu) for 386(486) AT clones." :D


This "Linus" guy won't go anywhere. No one wants a half-done kernel that is just a hobby.


Plus the future is microkernels anyway, and there's strong competition between Minix and HURD


It kind of blew my mind when I learned an evolution of Minix ended up in every Intel computer anyway. You don't even get a choice.

Professor Tanenbaum strikes back...


Not only do you not get a choice, it benefits no one but Intel & the three letter agencies they are in bed with. Tanenbaum himself has expressed regret for the way it ended up being used:

"Many people (including me) don't like the idea of an all-powerful management engine in there at all (since it is a possible security hole and a dangerous idea in the first place), but that is Intel's business decision..."


I do recall him snarkily remarking that MINIX was thus "used on more PC's than Linux (or Windows!)"

30 years on and he was still upset I suppose


He could have avoided the choice Intel had by not using MIT license.


Isn't it BSD [1]? Anyway it became BSD only in 2000. It was $69 before that year. Of course everybody started using Linux because it cost zero. Linux didn't end into Intel's CPUs probably because its GPL.

[1] https://en.m.wikipedia.org/wiki/Minix


You're right, I said that from memory and mixed up BSD license with MIT license. The point still stands though.


And because of the license he chose, they didn't even notify him of the fact. Resulting in this open letter.

https://cs.vu.nl/~ast/intel/


I came across this analysis of that incident: https://lukesmith.xyz/articles/why-i-use-the-gpl-and-not-cuc...

I'm not sure how I feel about it yet.


I skimmed the article which I don't hold in high regard for its word choice.

I think license choices will bite people, because they have to be made in advance, but nobody's certain of the future. Maybe my thing would not have been popular anyways, but it have been useful for some, so it wasn't a great idea to make it proprietary. Maybe my thing turns out to be beyond useful, so many profit from it, and I still live a modest life while fixing its bugs. The BSD wasn't a great choice then.

So I think, with license choice, a big thing is regret. And each license is also a political statement, especially the case with GPL I feel, with its strong ties to the ideologically driven FSF. These people want to build a world on those foundations, so they think that if people take but also give back, that'll be sustainable.

At the end of the day, Tanenbaum was both fooled and he wasn't. I absolutely empathize with him as a human. But he explicitly allowed for this kind of incident with his license choice.


For those who are interested in retrocomputing, you can download the actual software from there: http://sininenankka.dy.fi/~sami/fdshell/

I recommend downloading the bootable floppy image, unless you want to see the source code.



Thank you, thank you, thank you.


This currently looks like a poor 486 fighting for dear life.

Edit: This also looks like a fairly Finnish thing to do. Thinking not only of Linux and hacking, but also their general demoscene culture and such things. See also: https://www.gamesindustry.biz/articles/2020-04-16-finland-re...


> ... fairly Finnish thing to do ...

+1 for this lovely metaphor. I'm Estonian, but I absolutely love Finns for their peculiar between-the-lines humor, and their tendency to go really deep into fringe stuff.

A Finnish guy once demonstrated a retro bicycle he was restoring, stating that it's going to take him two years to finish it. "This needs to be done properly," he said with a barely noticeable smirk.

Re: Finns, demoscene, and frugal computing: see also Viznut and his insightful essays: http://viznut.fi/en/


Inner Spain (read: non-coast) it's like that. If they need months to repair something well, they'll fight for it for long.


Didn't take long to overload it given it is a 486


Jan 2001 was the first month I hit $1mil in revenue from our website. It was served from a Pentium P5 beige desktop box colocated in PAIX.

Actually, there were 3 of them. 1 running Apache and Perl FastCGI, one running MySQL, and a third which mostly ran backups, but could be used as failover for either the web server or database if required. I used to fly from Sydney to San Francisco 3 or 4 times a year with half a dozen hard drives in my carryon, because that was the most reliable way to do major upgrades - we had three identical boxes in the office in Sydney, and would install/configure/test major software and dependancy upgrades in house, then go to the data centre and swap in the new drives one machine at a time with zero downtime - usually. I was rarely the only one in my datacenter aisle with a screwdriver and a PAIX guy looking over my shoulder, but most other people were swapping out whole rack mount servers, not opening them up to replace or upgrade components.


"'PAIX, the 'Palo Alto Internet eXchange' was a neutral Internet exchange point."

https://en.wikipedia.org/wiki/PAIX


1 mil from what?


Hotel, car hire, and tour bookings.

32-33% margin after credit card fees. We were doing great, and totally full of ourselves. We turned down a buyout aisle we thought we were worth 10 or 20 times what they offered. Then Sept 11 happened and our revenue crashed 90% overnight. :sigh:


I believe its "Turn down for what"


Good. Second Reality 4ever.


I (fairly) recently installed modern Gentoo onto my 486DX2-66 box. I think it has 32MB of RAM in there. Boots and works fine for the most part. Compiled tools and utilities work fine for the most part, but trying to run any interpreted code takes ages. I should put up a webserver on there and see if it can serve something!

Here is me using it to log onto my webserver, it loads the SSH key from a 5.25" floppy: https://twitter.com/vkoskiv/status/1370116376166273025?s=20


I did the same thing with an AM5x86-133 based industrial computer (the SoC is an AMD Elan SC520) with 32 MiB of RAM. I found it actually quite painful to get a kernel config together that wouldn't OOM the system at boot (for the current upstream kernel). I just barely squeaked by with all of the cgroup and netfilter options OpenRC requires, the ethernet driver, and the legacy ISA IDE driver. I should probably change the optimization settings to -Os rather than -O2 though. I ended up starting with tinyconfig and working forward from there.

I actually have two of them (from different vendors) with the same SoC. One has 32 MiB of RAM soldered on that I can't upgrade (a Kontron board), the other has a SO-DIMM slot (a WinSystems board). So $5 and some eBay sleuthing brought it to 128 MiB. As for the former, I don't have schematics, so I'm a little uncomfortable just soldering another SDRAM chip to it and seeing what happens.

Only thing I was a bit sad about was that I spent the time figuring out how to change the CHOST on Gentoo to i586, only to discover that the AM5x86 is a 486 based core...


I remember when I had an AMD 5x86-133 (branded like a AM486-DX5 133) as my computer... these times playing DooM 2 and the demo of Star Fleet Academy at slow motion...


OpenWRT for 486 would be a faster choice. Just crosscompile pkgs from another machine.

You'll have http and gopher support granted. If libressl compile and run, place it under /opt, and maybe you'll be able to compile a gemini client.


I should give that a go, yeah. The gentoo attempt was mostly to see how a modern desktop class linux distro would work on a system that old. Answer: Not very fast!


OpenWRT with musl would run much faster. Try to build a slim kernel with the OpenWRT toolchain.


Always funny to compare the amount of RAM in these machines to modern L3 cache sizes. You can get an AMD chip with 8X as much!


Same with storage. This laptop has a few times more RAM than my first PC had disk space. And in turn, I've used servers that had more RAM than my laptop today has SSD space.


As you get older, the differences just becomes larger and larger. At some point it just gets ridiculous. My current laptop has almost 1 million times more RAM than my first computer (40 GB vs. 64 kB).

It's just impossible to compare the numbers when the differences are that large.

And of course, a post like this is not complete without me noting that the response times when pressing a button on the keyboard was vastly faster on my C64 than my modern machine.


> And of course, a post like this is not complete without me noting that the response times when pressing a button on the keyboard was vastly faster on my C64 than my modern machine.

Related - the analysis on input latencies by Dan Luu https://danluu.com/input-lag/

No numbers are given for the C64, but the timing for the CBM4016 (with quite similar firmware/BASIC) should be similar. The Apple 2 input latency is even lower. Perhaps this is related to the fact that the Apple 2 firmware didn't use interrupts and polling might have been more efficient in this case.


My first Linux install was a big pile of 3.5" floppies downloaded over my (well, my parents) 9600 bps modem containing Slackware that I installed to a 486dx2-66 with 8 MB RAM. With that 8 MB I was even able to run Xfree86 and an xterm before it started swapping!

That was the time before PnP ISA and kernel modules, so to get the sound blaster card to work one had to specify the IRQ (and I/O port address?) in the kernel config and recompile the kernel. Good times!


Urxvt would haven been (and it's still is) much lighter than XTerm.


Looks like the server is asleep since no one requested for a page recently. I'm constantly refreshing the page until I receive a response, just to prime it for my fellow HNers in case this reaches top of HN.


My OOM handler killed the HTTP server process. Now I restarted it - the HTTPD process, not the computer.


Are you still working on this? I fired up my spider on ultra aggressive retry mode because that will help the DNS get cached for people in my isp. (They have funky cache settings). This should help thee Ed time to first byte for fellow HN neighbors.


Can't connect but the OP put a video[1] up of the system ~4 months back. Looks like it might be serving content direct from 3.5 and 5 1/4 floppies which might explain the lag :D

[1] https://www.youtube.com/watch?v=Be01GLFP-bQ


Actually I upgraded the storage and the website is now served from a hard disk. I'm uploading a video to Youtube atm.


Not sure how big your site is, since it is down right now, but consider setting up a small RAM drive.


Honestly, I prefer the floppy drives!


Me too, and that's why the BBS service is still on a floppy.


of course i go look at the finnish person's other videos and they're about building a sauna


What is the lowest specs required to handle the HN effect anyways?

What is the most retro computer that ever served traffic from HN's top page without going down?


Considering that it has to be able to handle about 100 new sockets per second, one socket requires about 1 kB ... 2048 kB (?) of memory depending of the size of the buffers and how the congestion window is implemented[1], I'd say that it would need at least dozens of megabytes of memory and fast I/O. Maybe more depending of the size of the content in the server.

Also not all TCP/IP stacks close the socket properly, so the socket cannot just be removed from the memory immediately after sending the page. There will always be sockets that are just waiting for a timeout.

[1]my 486 server does not have any TCP congestion control at all - it just sends one TCP frame and waits for ACK before sending the next frame.


It doesn’t really take a powerful server to sustain HN traffic (tens of thousands of requests over a few hours). The problem is that most web server software is really inefficient. A 486 theoretically is capable of handling HN request load, it’s just not being used well.


Someone did a TI something and it seemed to basically work fine as far as I remember.


Oh yes I remember now, 6 months ago there was a Casio graphing calculator Fx-9750GII hosting a website https://news.ycombinator.com/item?id=27814080

CPU SH3/SH4a, Frequency of CPU 29MHz, RAM 64 Kilobytes

Unfortunately it didn't survive HN effect


My guess is that memory is probably the big thing. Serving a static file from a buffer cache shouldn't be that taxing on a cpu.


Can you share how it's doing cpu/memory wise and his it's holding up in general under what I assume I heavy load from HN?


Right now I cannot even access it locally from my lan, but it does answer to some of my pings. The HDD led is also blinking, which means that it is in fact answering to some HTTP requests. The TCP/IP stack is compiled for 64 simultaneous sockets.


Please paste an image up on Archive.org, so at least we can stare at the 'pre-meltdown' server.

P.s. I used a 486 as a router for years, and even upgraded it when I found a Pentium Overdrive... which of course was vulnerable to the F00F bug...



Next iteration: Caching HTTP server


I can't access it either. It looks like it's just timing out. We did it, guys! :D


Video: https://www.youtube.com/watch?v=erM0K0oXk4M

In the end I minimized the HTTPSERV.APP window so that scrolling down the text would not consume too much CPU time.


Not holding up great it seems :)


Loaded now. This is what's there:

"Tämä palvelin käyttää graafista 16-bittistä lEEt/OS-käyttöliittymää. Järjestelmä on yhdellä 1,44 megatavun 3,5 tuuman levykkeellä. Tämä sivusto on kiintolevyllä. BBS on 360 kilotavun 5,25 tuuman levykkeellä. Vieraile myös BBS-purkissa portissa 486 (telnet)."

Translated:

"Server uses a graphic lEEt/OS-user interface. The system is on a single 1.44 MB 3.5 floppy disk. This site is on a hard drive and the BBS is on a 360 KB 5.25 inch floppy disk. Visit the BBS on port 486 (telnet)."


We used to serve serious traffic off 486 machines, so if anything it's probably a software issue. Perhaps FreeBSD/i386 would be an appropriate choice?

If you weren't there you probably don't realize that the 486 was a huge leap over the 386. We don't get 100% generational improvements these days. The 486 enjoyed a long life and its later incarnations were giving contemporaneous Pentium models a run for the money, and I'm not even counting socket-compatible upgrades from AMD and so forth. You could put 64MB RAM and big L2 caches and there were PCI motherboards in the later 486 years.

Consider that the AMD Geode was basically the last 486 standing, and it was (is) more than adequate for routing between or firewalling fast ethernet links, serving HTTP etc.


My system is 100% 16-bit code and cannot access more than 640 kB of memory, and that's why it is so limited. I could probably increase the maximum amount of sockets and file handles to give it more capacity, but it still has its limits.


The least you could do is EMS/XMS. Quick, somebody give this person a copy of DesqView/386! :)


Firing up EMM386/JEMM386 underneath this environment, or writing 32-bit code, may go against the 8088 spirit of the project. A physical EMS card is an expensive pain to obtain, and you'd probably want to speak to its hardware directly rather than loading a DOS device driver, but it would be period-accurate :) There's old ones on eBay and modern replicas like https://texelec.com/product/lo-tech-ems-2-mb/

You can do virtual memory above the 256kb mark with the most advanced 80s cards but they're even rarer (I think DESQview worked best with this setup, and its what the 386+ software EMM implementations give you). For regular EMS which only works in a single 64kb region, disk caching and RAMdisk were common use cases, which didn't require rearchitecting the OS or applications to understand a new addressing scheme.

On 286+ you can also call a BIOS function to copy to/from extended memory, using only 8088 instructions in your own code, but of course the BIOS code will rely on newer processor instructions to make it happen. http://www.ctyme.com/intr/rb-1527.htm

Aside: cool project! I wrote a protected mode bootloader for old PCs recently and that was quite enough work!


They probably rolled there own, omitting all the edge cases pertaining to a coagulated mess of spaghetti code.


Yep this! People would regularly run windows 95 on a 486 with 8-16mb of ram. This was their daily driver which did word, dial up/aol/prodigy, messaging, games, etc. I think the reaction here that someone is able to run a little web server off of it is perhaps a bit overdone. Yes, its impressive he wrote his own stack, but the hardware itself is still beefy.


Yeah, a 486 is not a slow CPU - not even the 25 MHz SX version that the server has. But Windows 95 is a 32-bit protected mode OS. My OS also works on a 8088, but I don't have a 8088 computer that I could use as a server.


I paid $8700 for a tower 25MHz 486 back in the day. Sheesh!


Yeah, I remember the times where 486 servers were quite normal. On the other hand, most users were on dialup and unlikely to cause serious trouble.


Unrelated 486 story: I used a 486 66 dx2 as my computer until 2001 when I went to college and used my grad money for an actual computer. Get to school and they limit the internet to 1 gig per day. Discovered it’s by MAC address. Not by LAN port. So thanksgiving break grab that bad boy and drag it to school. It ran FreeBSD and I made a SOCKS proxy that just changes it’s MAC after about 1 gig of usage. Have it out to everyone on our floor and we destroyed Kazaa and Limewire. Good times.


Also unrelated 486 story - around this time i have similar machine (486 Overdrive) with two LANs that works as router.

OS - FloppyFW: https://www.zelow.no/floppyfw/

Because ISP used PPTP as way to providing internet and i need to share internet on few machines.


I did too, but that pesky F00F bug, knocked out our router once a week, until we traced who was owning us.


I miss floppy distros such as Basic Linux or NeHaBoDi, nethack 3.4.3 under a floppy.


Did you use Links and Pine too? Because reading web pages over Links/Lynx was still possible in 2001. FVWM, Urxvt, Lynx and ImageMagick for images would fly as a daily machine.


I did when I was home on that box. Even though Netscape ran fairly well with FreeBSD’s Linux compat layer.

I applied for my university using lynx on that 486. Worked ok(ish).


This sounds like something a madman would do, and certainly 16-bit real mode is insane, but back in the mid-late 90s I would think a large number of Internet servers were 486s.

I know I ran a major "topsite" for most of the core warez groups in around 1996 from a 486 and it handled a ridiculous number of connections. It was probably running BSD rather than Linux in those days though as I remember BSD being more stable/better performing at the time.


I had a P3 450MHz that ran as a server for almost a decade. Opened it up to swap a drive and noticed the CPU fan had stopped spinning. Running in a room with no A/C. That was a hardy machine.

Finally sold it to someone else who intended it as a server as well. No clue how long it ran for in total...


I'm very interested in the network stack, having explored it for a while for https://github.com/akkartik/mu before giving up. What sort of network card do you support?


Everything in my "operating system" is 16-bit x86 code. It uses regular DOS packet drivers. I have also started writing my own DOS kernel, but it is not ready yet. The server uses FreeDOS kernel. That's why I write the "operating system" in quotation marks.

And because my TCP/IP stack is 16-bit code, it probably won't work for your system. It's just a DOS program that has an interrupt service routine that the other programs can call.


I set up a DNS server on a 486DX2/66 w/4MB RAM running Linux 1.2.x for a university back in 1995. It had run without problems for years.


From what I understand, you also wrote a mouse driver for it[0][1], OP?

[0]: https://www.youtube.com/watch?v=RlDi2Ncfb9Q

[1]: http://sininenankka.dy.fi/~sami/keymouse.zip


Yes. I wrote a special mouse driver that hooks to the keyboard interrupt and makes it possible to use the numpad keys as a "mouse". Sadly most DOS programs seem to replace the BIOS's keyboard interrupt handler with their own, so my driver does not work with them.


I have an idea of how to keep control of interrupts without needing all the complexity of V86 mode: relocate the IVT!

On 286 and above, the interrupt vectors always start at the address in the IDTR (interrupt descriptor table register), even in real mode. Intel did of course not document that :)

If you do this, you can handle any interrupts you want directly, or "reflect" them to the handler installed by the DOS program. A fast technique for doing this takes advantage of segment:offset alias addresses to use the CS register as a pointer to the old interrupt vector:

    reflect_int:
     ; come from our IVT with CS bits 10..2 = interrupt number
     ; flags, CS and IP on stack and will remain there
     sub  sp,2       ;reserve space for return segment
     push bx         ;will become return offset
     mov  bx,cs
     and  bh,3       ;clear high bits, BX now offset into IVT
     push bp
     push ds
     xor  bp,bp
     mov  ds,bp      ;DS:BX => vector
     lds  bx,[bx]    ;fetch vector
     mov  bp,sp
     mov  [bp+6],ds  ;store segment
     xchg [bp+4],bx  ;store offset / load old BX
     pop  ds
     pop  bp
     retf            ;return to actual handler


How is the power bill for this device going to be? Because my SGI Octane which I used back early 00s was drawing a lot (as did the AlphaServer DS10L), and also was a nice heater in the winter (not in the summer...). Which is why I avoid old hardware these days. Especially worth considering given current EU gas and electricity prices.


Cheap Atom boards seem probably the best solution that doesn't cost a fortune to set up small servers without resorting to very old hardware. My home (Xigma) NAS employs a D410 CPU on a used Supermicro X7SPA-L board and does its job nicely with two RAID 1 sets. The CPU TDP is 10 Watts, plus chipset and disks; being single core doesn't seem to be an hindrance to its functionality. Hopefully ARM boards will bring even lower power figures, but they're still a bit expensive if one needs many SATA ports. The Helios64 platform looked very promising, but sadly it tanked.


How did the Helios64 Tank? I own one and it's fine?


The manufacturer stopped production and support last summer.

https://blog.kobol.io/2021/08/25/we-are-pulling-the-plug/

Very sad as it was a really interesting device.

https://kobol.io/


It consumes about 30 watts.


Very cool. How many of us did it take to DDOS the server? It doesn't load for me either :)


The TCP/IP stack is compiled for 64 sockets. If the socket table is full, it just drops all new SYN packets and does not answer to them.


Just curious and totally not being critical, what was your thinking about dropping SYN vs responding with RST?


I think the user will most probably keep pressing the F5/Refresh button anyway if the site is not working at the first try, so responding with a RST packet would just use more bandwidth and resources.


iptraf on another computer, connected to the same hub: https://www.youtube.com/watch?v=0CeK1TnGhIs

Assuming that one "TCP entry" means one socket, that's a lot of SYN packets...

Video from what it looks like on the server: https://www.youtube.com/watch?v=BVKjVyM53sg


Something close. In the end of 80's I had preemptive multithreading and scheduling right inside my old DOS program. Had to switch timer interrupt frequency to 4kHz for that.


After the OOM handler had halted everything the 10:th time, I finally decided to do something (at least the kernel and the TCP/IP stack seem to be very stable, because it still did not crash!)

I set the maximum amount of sockets to 32, the maximum amount of file handles of the DOS kernel to 40, and the maximum amount of file descriptors per one VPU process to 40. Now it should (maybe) be able to do its work without randomly running out of memory.


It's slashdotted.


Awww. I think the little guy might be struggling.


Out of interest, how many requests does the hn-effect generate? Have any ‘show-hn’ participants ever provided this?


This video answers to your question: https://www.youtube.com/watch?v=0CeK1TnGhIs


Not a whole lot of context or detail in that, it could be at the peak of the effect or at some other point in time (even just bau, or an unrelated dos)


I recorded that video from a computer that is connected to the same ethernet hub as the 486 server.


From memory as a rough estimate: When I had traffic influx from Reddit and HN it peaked at around 10 page views / second. Maybe 50k views in total including long tail?


Related: Low Tech Magazine https://solar.lowtechmagazine.com/

-Bisqwit's channel: https://www.youtube.com/c/Bisqwit


I used to run freenas on an old IBM/Cyrix chip desktop maybe as late as 2008 or 2009..

Believe it was something like 133mhz but it might have been 3 or 400mhz I just can’t remember. Also forget how much ram it had..

Amazingly freenas performed admirably for basic smb and nfs for all the time I used it..


I had a 486 server once. It was Novell NetWare 3.x running a LAN for a small nonprofit. Word Perfect, email, listserv, accounting and web access. Pretty sure I would never have exposed it to HN though (had it existed)...


Novell was actually quite efficient and responsive. Everything ran in ring 0, right next to the hardware. Which is also why you never applied any patch other than one from Novell...


Hah, I was running my webserver on a 286 (I think, a bit fuzzy memory there, was a while ago). Now get off my lawn. :-)


I remember seeing a website years ago that supposedly ran on Minix on a 286. Someone had fired that up because... well, because.

I don't think it was fast, nor did it probably serve any purpose apart from existing and possibly serving some information about the software it was running.


There’s a web server out there that runs (or ran on at this point) a 68k Macintosh. I visited it years ago but sadly cannot find it.


Once upon a time there was the matchbox server at Stanford University Wearable Computing Laboratory:

https://news.stanford.edu/news/1999/february10/webserver210....

https://web.archive.org/web/19991128033948/http://wearables....

>The Matchbox Webserver, which is serving this and the other web pages to you, is a single-board AMD 486-SX computer with a 66 MHz CPU, 16 MB RAM, and 16 MB flash ROM, big enough to hold a useful amount of RedHat 5.2 Linux including the HTTP daemon that runs the web server.


I believe you're thinking of one of the NetBSD mirrors


You sir, are my hero. I keep telling myself when I retire I'll have time for such things. I think I'm kidding myself...


Make sure to build a dos emulator so that you can play Prince Of Persia on it.


[deleted]


she's dead jim




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: