Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Wednesday June 10 2020, @02:57AM   Printer-friendly
from the a-new-OS-is-forth-coming dept.

It appears the leadership of Collapse OS have decided to switch from Z-80 to Forth. In this article, they explain their reasoning.

Collapse OS' first incarnation was written in Z80 assembler. One of the first feedbacks I had after it went viral was "why not Forth?". I briefly looked at it and it didn't seem such a great choice at first, so I first dismissed it. Then, I had what alcoholics refer to as a "Moment of clarity".

[...] The Z80 asm version of Collapse OS self-hosts on a RC2014 with a 5K shell on ROM, a 5K assembler binary loaded in RAM from SD card (but that could be in ROM, that's why I count it as ROM in my project's feature highlights) and 8K of RAM. That is, it can assemble itself from source within those resources.

[...] If I wanted to re-implement that assembler feature-for-feature in Forth, it would probably require much more resources to build. Even though higher level words are more compact, the base of the pyramid to get there couldn't compete with the straight assembler version. This was under this reasoning that I first dismissed Forth.

So, again, what makes Forth more compact than assembler? Simplicity. The particularity of Forth is that it begins "walking by itself", that is, implementing its own words from its base set, very, very early. This means that only a tiny part of it needs to be assembled into native code. This tiny part of native code requires much less tooling, and thus an assembler with much less features. This assembler requires less RAM.

What is more compact than something that doesn't exist? Even Z80 assembler can't beat the void.

That's how although Forth is not more compact that native code (duh!), a Forth Collapse OS achieves self-hosting with as much resources than its Z80 counterpart.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 0) by Anonymous Coward on Wednesday June 10 2020, @01:45PM (3 children)

    by Anonymous Coward on Wednesday June 10 2020, @01:45PM (#1005789)

    If you read https://collapseos.org/why.html [collapseos.org] it states:

    Therefore, Collapse OS won't be actually useful before you and I are both long dead. However, communities with good foresight will immediately start to work on creating post-collapse computers because a lot of work will have to be poured on their own local copy of it before it runs smoothly on the hardware they manage to scavenge and retrofit. They also have to become proficient in maintaining it. Their children also have to.

    That's the perspective we have to keep in mind in this project. Collapse OS doesn't have to run smoothly, but it has to be easy to grok in its entirety and, most importantly, gather vital knowledge about as many components as possible in one self-contained place.

    So the author is assuming a collapse that takes the world's manufacturing to a 19th century level of technology. For the first 30 years or so, leftover computer parts from the modern era will still work. But eventually those will all wear out, even fanless and rugged designs, and humanity will have to start rebuilding their manufacturing tech. Reaching the sophistication required to make a new Z80 is far less effort than reaching the sophistication required to make a new Raspberry Pi Zero, so that's the target the author selected.

    I think it makes sense, if you believe there will be a collapse. I don't think there will be, not on the scale described.

  • (Score: 0) by Anonymous Coward on Wednesday June 10 2020, @04:30PM (1 child)

    by Anonymous Coward on Wednesday June 10 2020, @04:30PM (#1005859)

    It makes a certain kind of sense, but not much. Most of the consumer-grade equipment will be unusable due to age, EMP, or failed infrastructure, so you could see the knowledge disappear entirely in areas within a generation. Hydro and wind should be mostly unaffected, although installations could be targeted in whatever apocalyptic war caused the collapse. Solar would be unreliable in a nuclear winter situation, if it works at all. Hand-crank and crystal radios, but I've you'll need batteries at least for transmission. I imagine there will be relatively unaffected areas, with stable electrical generation capabilities, but manufacturing may have to be practically bootstrapped from nothing - any area with significant manufacturing capability will be a strategic target.

    • (Score: 1, Interesting) by Anonymous Coward on Wednesday June 10 2020, @09:36PM

      by Anonymous Coward on Wednesday June 10 2020, @09:36PM (#1006003)

      I think the more interesting task for someone preparing for a collapse would be writing a textbook on how to go from smelters and iron ore to Apollo-mission level computers.

      I also think the fact that so much can be done with 8k RAM is an indictment of 21st century society. Capitalism, to its credit, has pushed humanity to make mind-blowing advances in computing technology. But capitalism, to its condemnation, has pushed humanity to a disgracefully low focus on efficiency. I'm not blaming individual engineers, managers, teams, companies, or countries, the problem is just the whole system. Any team that's trying to make a nice application that runs quickly and securely with low resource utilization on twenty year old hardware will be crushed by competitors getting to market ten times as fast with something less than 1% as efficient.

  • (Score: 0) by Anonymous Coward on Tuesday June 16 2020, @06:47AM

    by Anonymous Coward on Tuesday June 16 2020, @06:47AM (#1008503)

    The four threat areas for old hardware are capacitors, corrosion, heat, and voltage irregularities. If you can scavenge the equipment to keep those all operating within specifications your hardware should last indefinitely (unless it had a manufacturing flaw that causes degradation after a while, like those Intel SATA controllers. Most of the 90s era Intel hardware, and even most clone hardware is solid however. Sparcs, MIPS, PA-RISCs, PPCs, and Alphas as well.

    Assuming most of it hasn't gotten recycled by now, finding any of this hardware to pilfer from older businesses after the collapse will be a major priority, as would certain museum's pieces. Given that a kid was able to produce his own... 6 junction IC/transitor, I think the time to regain transistor manufacturing will not be that long, so long as the requisite precursor metals can be mined and transported to wherever the fab will be. Precision machining will be the true crux, followed by high purity smelting. If equipment can be scavenged for those two aspects, and power supplied, the rest of civilization should be easy to bootstrap, given archives of old world knowledge. The loss of the knowledge on the other hand would be a hugely crippling blow.

    Having said all this: flash will be the most critical weak point in current hardware. If you're lucky you've got a maximum of 100 years before it's discharged completely. Modern hardware has signing keys that without the proper signed firmware will make it impossible to reinitialize even if you have code snippets that would work, and given Intel hardware with efused bioses (as well as game consoles), and AMD hardware with AGESA signing, none of the hardware past 2009/2012 will be usable without archived copies of the proper bios initialization. The others may be difficult or impossible, but as coreboot shows, it was possible to use information from one board to generalize and help port to a lot of other boards, meaning certain generations of hardware will be far more likely to survive and be useful for bootstrapping the 'recovered generation', if flash chips can be stockpiled in the proper formfactors/sizes (DIP28/32 parallel, DIP32/QFP FWH/LPC, DIP-8 SPI Flash, SOIC-8 SPI (Either with adapters for DIP8, or alternatively sockets for soldered down boards to be reworked.)

    There will be a lot of non-reusable junk thanks to our modern locked-in society, much of it without parts that can act as spares for what will function, unless you get luck with some of the passive components.

    For people who are serious prepping, make sure you buy 1000+ units (scaled based on your hardware's makeup of capacitors/resistors) in all the major through hole and surface mount sizes. The through hole caps are the most probable to fail over the course of their life, and they do have some chemical lifetime to them, which you might reach before technology is recovered.) But that is how you will get that few extra years out of the tech you have. For Intel/AMD, anything LGA775/AM3+ or below is the best hardware you can get that will boot without signing. GPUs may be a different matter and you may want PCI VGA cards, pre-3d for maximum chance of operation, although later cards MAY work, up to kepler on the nvidia side and anywhere from the HD2400 on up on the AMD side (some components in the vbios had signing prior to going all-in with the RX590/Vega+ hardware.)