Build FreeBSD on Linux for Alternative architecture.

Traditionally, all compiling of FreeBSD has been done on FreeBSD; for new architectures, that's done with a cross-compile. So in that traditional world, the first things needs to be to set up the compiler so it can output the desired instruction set. Today, FreeBSD uses the CLANG compiler on non-obsolete platforms, so you'll have to set that up. See the comments in "man arch" about compilers.

Only recently has it become possible to cross-compile FreeBSD from Linux. And if you look at that project, it still has open issues. One of the prerequisites is recent version of the CLANG compiler. So you will have to set up CLANG to generate code for you architecture either way.

So I can see at least the following necessary steps:
1. Add support for your architecture to CLANG.
2. Modify the kernel itself for architecture-specifics (paging, protection, memory model, ...)
3. Port whatever device drivers you need.
4. Work out the booting mechanism.

Compared to all these steps, trying to do the initial compile on Linux versus FreeBSD is a minor change. I would probably set up a FreeBSD cluster first (using whatever supported hardware you have available, typically Intel or AMD), and use that as a cross-compiling host. It's just easier this way, then you are doing things the traditional and well-tested way.
 
ralphbsz, llvm and clang are currently not working. There is only a completely custom compiler, which is presented to the system as GCC. I believe that there is no point in trying without clang.
 
ralphbsz, llvm and clang are currently not working. There is only a completely custom compiler, which is presented to the system as GCC. I believe that there is no point in trying without clang.
A compiler that works really well is pretty much the most important thing for supporting hardware. And with VLIW, having compilers that generate efficient code is exceedingly hard. Look at the history of the Itanium, and its predecessors (the Multiflow and Hewlett-Packard VLIW efforts, booth led by Josh Fisher). So if you have a GCC that works within the Linux ecosystem, that pretty much tells you what OS to run on the machine.

The other thing is this: As far as I can see, these VLIW chips are mostly used in supercomputers (of local russian manufacture and use). For a supercomputer, the OS itself is not all that important; the throughput and efficiency are. Those are in turn determined by the details of the compiler, and of communication libraries (where I include IO and storage as special cases of communication). Putting effort into changing the OS doesn't seem to be a good investment, compared to other things that could be optimized.
 
Is this architecture endorsed by KGB FSB? Otherwise is not worth the effort to port FreeBSD on it. :D
The other thing is this: As far as I can see, these VLIW chips are mostly used in supercomputers (of local russian manufacture and use).

IDK a lot of about the Elbrus but as far I know that is used/intended to "everything", from space/defense (weapons systems etc. I think the S-400 for instance use those processors) to public offices (hence the x86 compatibility), but apparently that is also quite used by large companies looking for maximum possible security.

[EDIT] I suppose they can also be found in the upcoming Irkut МС-21 (transliteration: MS-21), or if not they are likely to appear now since the Western and Japanese vendors of some microelectronics just popup (as soon they learned the PD-14 engine is ready) to tell they will not delivery anything anymore, including the existing contracts and the import substitution program entered in place.

The only more thing I am aware, but this is formation may be imprecise, is the team who designed the early Elbrus later were contracted by Intel to design the "Pentium III" and possibly (I don't remember the details) were also involved with IA-64/Itanium design. I remember some guy on the internet (who supposedly had worked at MCST) commenting that at that time Intel managed to hire the processor designers but failed to convince the compiler guys to join...
 
I had no idea that Russia had its own homegrown microprocessor CPU line with its own instruction set. I knew about the east German "Robotron" machines, but they used only western microprocessors (mostly Zilog and Intel copies). The eastern IBM mainframe and VAX clones were famous, but they used western computer architecture. And then of all things, cloning VLIW ... which (in retrospect) was, to say it politely, a dead end in CPU architecture.

I remember some guy on the internet (who supposedly had worked at MCST) commenting that at that time Intel managed to hire the processor designers but failed to convince the compiler guys to join...
On a VLIW design, forgetting the compiler guys ... that's just insane. But Intel tends to be insane. I was peripherally observing the Hewlett-Packard/Intel VLIW - Itanium operation (I worked in the same building as many of them), and even back then it seemed like ... a bad idea.
 
More realistic is the idea of porting FreeBSD to another Russian processor with a standard architecture.
It is called Baikal-M BE-M1000

BE-M1000 is a feature-rich system-on-a-chip with eight ARM Cortex-A57 cores,
an 8-core Mali-T628 GPU, and a set of high-speed interfaces including HDMI,
PCI Express, 10Gb Ethernet and SATA. This SoC can be used in desktops,
microservers, and embedded applications.

It seems to me quite a doable task :).
Moreover, there is information that FreeBSD is already running on this processor

I am looking for those who have this equipment for testing
 
I was peripherally observing the Hewlett-Packard/Intel VLIW - Itanium operation (I worked in the same building as many of them), and even back then it seemed like ... a bad idea.

It is a bad idea. It does away with out of order execution, register renaming, speculative execution and branch prediction - so you loose the entire spectre support.
 
Well, I'm a helpful guy, you know... so, if people really insinst to run their head against a wall, I might be willing to give them a push to become faster.

Here, I was mostly just quoting Boris Babayan, who, in 2001(!), wrote:
E2K architecture advantages
Besides the high speed this approach has many out
standing advantages.
1. Simplicity.
As a result of removing from the hardware such compli
cated mechanisms as out of order execution, register re
naming, speculative execution and branch prediction, a
computer becomes conceptually as simple as
presuperscalar RISCs.

Now if these terms don't ring a bell today, I don't know.

But what had happened: In 2004 Intel bought this guy and apparently his whole team of 600 people - only to stop this from going further?
 
Oops, disregard my note on Baikal - it turns out that the developer board I mentioned has BE-T1000, which is not ARM, but MIPS.
 
Wow. Just WOW.
I am very interested to see Elbrus (maybe try something via ssh). I am Russian too, I was born in the USSR but now I don't live in Russia.
Unfortunately, I don't have enough time now to read the thread thoroughly but I will be interested to help in porting FreeBSD when I have time.

I didn't know Elbrus isn't SPARC. Just FYI: I have two SUN machines and now running FreeBSD on one of them. But there is a SPARC64 port.
 
  • Thanks
Reactions: a6h
Wow. Just WOW.
I am very interested to see Elbrus (maybe try something via ssh). I am Russian too, I was born in the USSR but now I don't live in Russia.
Unfortunately, I don't have enough time now to read the thread thoroughly but I will be interested to help in porting FreeBSD when I have time.

I didn't know Elbrus isn't SPARC. Just FYI: I have two SUN machines and now running FreeBSD on one of them. But there is a SPARC64 port.
AFIW just the Elbrus-90micro use SPARC instructions.
 
Wow. Just WOW.
I am very interested to see Elbrus (maybe try something via ssh). I am Russian too, I was born in the USSR but now I don't live in Russia.
Unfortunately, I don't have enough time now to read the thread thoroughly but I will be interested to help in porting FreeBSD when I have time.

I didn't know Elbrus isn't SPARC. Just FYI: I have two SUN machines and now running FreeBSD on one of them. But there is a SPARC64 port.
Write me an email djs500@mail.ru In Russian, I will tell you about the plans. When I can get the cross-compiler, we can start working. I think there will be a lot of work.
 
In case anyone's interested, I got my hands on Elbrus QEmu emulator and managed to execute a simple assembly-written Hello World executable on qemu-bsd-user. This is not much, but at least some movement in this direction.
 
Neither Linux OS (nor linux kernel build scripts these days) nor FreeBSD are suitable tools for Cross Compiling. If they were then doing certain cross compiles "would be an option" yet there is no option.

I'm not allowed to discuss it (Sir Dice? or who? would IP block me). But I've tried cross-compile linux - it's ability is destroyed for "typical hobbyists" (i'm not allowed to say how) and similar new management has put "CLANG" as the only compiler in FreeBSD which itself admits "it has no way to compile itself without the system it was compiled upon running it - and there again it can only compile the same version" (without massive difficulties) - which i've also tried. (more than one BIG TECH company is involved and at least one of makes cross compilers "that work with one click, and must be bought" - hopefully i've not said too much to swallow)

My advice is don't. By the time you finish BIG TECH will have made everything altered and irrelevant as it does in (let's say a planned manner).
 
Back
Top