News for hackers. Stuff that matters.
Re:NetBSD on a JavaStation by markus_zhang on Tuesday March 04, 2025 @11:17PM (#43262709)
> Sun’s bootloader environment from that period was called OpenBoot, and consisted of a FORTH interpreter, from which you can interrogate the device tree and pretty much do whatever you want.

This sounds interesting. I have read quite a few FORTH posts on HN but never gave the thing a look. It is really different than anything I have looked at. For example, for functional languages I never got pass Scheme's ' symbol, but at least I get most of the syntax. FORTH really is another level.

Re:NetBSD on a JavaStation by eschaton on Wednesday March 05, 2025 @01:12AM (#43263446)
This was the basis for IEEE-1275 Open Firmware, which nobody uses any more but was the standard for SPARC, PowerPC, and post-PowerPC POWER. It’s where device trees came from and frankly is how everything should be booting these days, not u-boot or UEFI or custom secure boot chains (which are entirely possible with Open Firmware too).

There are BSD, GPL, and other Open Source variants of Open Firmware you can get and fool around with today and if you’re building a new product you should still consider whether an Open Firmware would work for you versus one of its inferior successors.

Re:NetBSD on a JavaStation by DonHopkins on Wednesday March 05, 2025 @09:19AM (#43266724)
https://news.ycombinator.com/item?id=33681531

I've frequently written about Mitch Bradley's Forthmacs / Sun Forth / CForth / OpenBoot / OpenFirmware on HN. I was his summer intern at Sun in 1987, and used his Forth systems in many projects!

[...]

https://news.ycombinator.com/item?id=29261810

Speaking of Forth experts -- there's Mitch Bradley, who created OpenFirmware:

[...]

Here's the interview with Mitch Bradley saved on archive.org:

https://web.archive.org/web/20120118132847/http://howsoftwar...

I've previously posted some stuff about Mitch Bradley -- I have used various versions of his ForthMacs / CForth / OpenFirmware systems, and I was his summer intern at Sun in '87!

Mitch is an EXTREMELY productive FORTH programmer! He explains that FORTH is a "Glass Box": you just have to memorize its relatively simple set of standard words, and then you can have a complete understanding and full visibility into exactly how every part of the system works: there is no mysterious "magic", you can grok and extend every part of the system all the way down to the metal. It's especially nice when you have a good decompiler / dissassembler ("SEE") like ForthMacs, CForth, and OpenFirmware do.

https://news.ycombinator.com/item?id=9271644

[...]

https://news.ycombinator.com/item?id=38689282

Mitch Bradley came up with a nice way to refactor the Forth compiler/interpreter and control structures, so that you could use them immediately at top level! Traditional FORTHs only let you use IF, DO, WHILE, etc in : definitions, but they work fine at top level in Mitch's Forths (including CForth and Open Firmware).

[...]

https://github.com/MitchBradley/openfirmware

https://github.com/MitchBradley/cforth

Re:NetBSD on a JavaStation by markus_zhang on Wednesday March 05, 2025 @04:10PM (#43272467)
Thanks man, this is a treasure trove. Diving straight into it when on bus.
Re:NetBSD on a JavaStation by DonHopkins on Wednesday March 05, 2025 @07:01PM (#43274484)
I love to occasionally just recreationally read over the OpenFirmware source code as fine literature, especially the kernel and metacompiler, since it's just such elegant beautifully polished and refined code, the results of so many decades of meticulous work on so many platforms and devices.

metacompile.fth: https://github.com/MitchBradley/openfirmware/blob/master/for...

kernel.fth: https://github.com/MitchBradley/openfirmware/blob/master/for...

arm64: https://github.com/MitchBradley/openfirmware/tree/master/cpu...

emacs: https://github.com/MitchBradley/openfirmware/tree/master/cli...

olpc: https://github.com/MitchBradley/openfirmware/tree/master/dev...

video: https://github.com/MitchBradley/openfirmware/tree/master/dev...

amd7990: https://github.com/MitchBradley/openfirmware/tree/master/dev...

pci: https://github.com/MitchBradley/openfirmware/tree/master/dev...

fcode: https://github.com/MitchBradley/openfirmware/tree/master/ofw...

gui: https://github.com/MitchBradley/openfirmware/tree/master/ofw...

inet: https://github.com/MitchBradley/openfirmware/tree/master/ofw...

Forth is really a transparent "glass box" where you can see through and understand it all from top to bottom, and OpenFirmware includes a museum of drivers and modules and extensions for everywhere it's ever been and all of its missions, like Superman's Crystal Fortress of Solitude!

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

>The Fortress contained an alien zoo, a giant steel diary in which Superman wrote his memoirs (using either his invulnerable finger, twin hand touch pads that record thoughts instantly, or heat vision to engrave entries into its pages), a chess-playing robot, specialized exercise equipment, a laboratory where Superman worked on various projects such as developing defenses to kryptonite, a room-sized computer, communications equipment, and rooms dedicated to all of his friends, including one for Clark Kent to fool visitors. As the stories continued, it was revealed that the Fortress was where Superman's robot duplicates were stored. It also contained the Phantom Zone projector, various pieces of alien technology he had acquired on visits to other worlds, and, much like the Batcave, trophies of his past adventures. Indeed, the Batcave and Batman himself made an appearance in the first Fortress story. The Fortress also became the home of the bottle city of Kandor (until it was enlarged), and an apartment in the Fortress was set aside for Supergirl.

Re:NetBSD on a JavaStation by luke8086 on Wednesday March 05, 2025 @03:19PM (#43271764)
Bootloader developers used to be particularly fond of Forth.

For example, for many years the FreeBSD's 3rd-stage loader used FICL (Forth Inspired Command Language) for scripting [1]. It's still supported, although in the recent years it was deprecated in favor of Lua [2].

[1] https://github.com/freebsd/freebsd-src/tree/main/stand/forth

[2] https://github.com/freebsd/freebsd-src/tree/main/stand/lua

Re:NetBSD on a JavaStation by markus_zhang on Wednesday March 05, 2025 @03:57PM (#43272288)
Interesting. I know that embedded developers used it a lot too back then, for satellites. Not sure how popular it is now.