vak: (Default)
[personal profile] vak
Про LiteBSD и RetroBSD пишут.

January 01, 2018 — Michael Engel

There is one quite nice thing I (re)discovered over the Christmas break. At a MIPS FPGA workshop in Munich last January, I was given a ChipKit Wi-Fire board. This board is based on a Microchip PIC32MZ microcontroller, which includes a MIPS M14k CPU core with MMU and FPU, 2 MB of flash memory, 512 kB RAM and a number of peripherals.

This board is not only capable of running typical embedded operating systems, but is probably one of the tiniest platforms capable of running real Unix - namely the last BSD Unix version from UC Berkeley, 4.4BSD-Lite2. This final version from the CSRG research group came out in 1995 after a lengthy litigation in which AT&T (back then the owner of Unix copyrights) tried to hinder the publication of the BSD source code due to allegations of illegaly copied AT&T proprietary source code - luckily, this trial resulted in only six files which had to be removed from the BSD source code base; the 4.4BSD source code without the infringing files was then published as 4.4BSD-Lite2 and formed the basis for subsequent open source BSD projects, including 386BSD, FreeBSD, NetBSD, OpenBSD and DragonFly BSD.

Serge Vakulenko has worked on liteBSD, a port of 4.4BSD-Lite2 to the PIC32MZ MIPS-based microcontrollers for a number of years and managed to get it to work with the rather puny hardware resources of that controller (the MIPS architecture itself was supported by 4.4BSD in DECstation and SONY MIPS machines).

I got it to run on the Wi-Fire board (which is one of the boards supported out of the box by LiteBSD); it is quite an impressive achievement and, despite the minimal hardware resources, feels familiar to people used to modern Unix or Linux systems.

So far, I have fixed two bugs in the litebsd kernel source.

One was missing support for the execution of so-called shebang interpreted executables, i.e. shell scripts or similar (Perl, Python, awk, etc.), which start with the character sequence "#!" followed by the name of the interpreter, such as "#!/bin/sh".

The other was a bug in the memory allocation code for ktrace, which resulted in a kernel panic during execution tracing when tracing was enabled in the kernel.

There is also RetroBSD, an even smaller version of BSD for very tiny microcontrollers, derived from the last PDP11 BSD Unix version, 2.11BSD.

Some links:
Wi-Fire board

litebsd screen shot

Date: 2018-02-06 03:45 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
512 ram, так туда можно роскошный форт всунуть, и на нем все уже и фигачить.

Солярка же была на форте внутре.

Date: 2018-02-06 05:06 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Ну как миф; не сама солярка, а что-то там стартующее ее.

Из толкового, например, был симулятор буровой установки, который я навалял за три недели (а сначала неделю посвятил форту на том, забыл какой процессор, 8080, что ли).

Date: 2018-02-06 14:39 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
На форте можно очень даже разборчиво писать.

Date: 2018-02-06 21:41 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Я никогда не понимал, чем уж так фортран населению не угодил. На нем, при определенной дисциплине, можно писать вполне приличные тексты.

Date: 2018-02-06 22:22 (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi
Так это физики. У них в голове опилки, а результат им не важен, лишь бы был похож.

Date: 2018-02-07 16:41 (UTC)
From: [personal profile] ivanrubilo
SPEC тоже написан на С, но на фортране так-то ;)

Date: 2018-02-07 23:04 (UTC)
vit_r: default (Default)
From: [personal profile] vit_r
Нужна жёсткая самодисциплина.

Нужна соответствующая культура. Она и в других вещах нужна, но там технические возможности позволяют прикрыть результаты бардака.

Форт позволяет сжать программы. Его и стоит рассматривать как метод шифрования. Причём, молодёжь, мучающая контроллеры на С++ очень радостно перескакивает на Форт, когда узнаёт об этом языке.

Фортран позволяет делать очень быстрые вычисления. Естественно, при езде на Формуле-1 нужен немного другой подход чем при езде на самокате.

Date: 2018-02-06 20:46 (UTC)
From: [personal profile] ivanrubilo
Насколько я понял речь шла про Open Firmware в котором была консоль а-ля форт, да и сам он вроде бы внутре на форте тоже.

https://github.com/openbios/openbios/tree/master/forth
Edited Date: 2018-02-06 20:49 (UTC)

Date: 2018-02-06 20:52 (UTC)
From: [personal profile] ivanrubilo
Косвенно относится тем что он (OpenBoot) был стардартным "биосом" на спарках, емнип.
Edited Date: 2018-02-06 20:52 (UTC)

Date: 2018-02-07 16:43 (UTC)
From: [personal profile] ivanrubilo
Эта штука вообще много где была где-то в середине 90х-2000х - PowerPC маки, всякие Pegasos и подобное. Там прям CLI консоль такая тоже а-ля Forth REPL :)

Date: 2018-02-07 23:00 (UTC)
vit_r: default (Default)
From: [personal profile] vit_r
Загрузчик а форте видел в 1995 году на Спарках.