Build FreeBSD on Linux for Alternative architecture.

ralphbsz

Son of Beastie

Reaction score: 1,789
Messages: 2,789

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.
 
OP
DJs3000

DJs3000

New Member

Reaction score: 5
Messages: 17

[USER=30524]ralphbsz[/USER], 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.
 

Minbari

Aspiring Daemon

Reaction score: 265
Messages: 512

Is this architecture endorsed by KGB FSB? Otherwise is not worth the effort to port FreeBSD on it. :D
 

ralphbsz

Son of Beastie

Reaction score: 1,789
Messages: 2,789

[USER=30524]ralphbsz[/USER], 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.
 

rigoletto@

Daemon
Developer

Reaction score: 1,196
Messages: 2,245

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...
 

ralphbsz

Son of Beastie

Reaction score: 1,789
Messages: 2,789

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.
 

Jose

Aspiring Daemon

Reaction score: 395
Messages: 551

...And then of all things, cloning VLIW ... which (in retrospect) was, to say it politely, a dead end in CPU architecture.
Maybe the Russians can make it work? Not that I would know. Still glad they're trying, though.
 

SleepWalker

Member

Reaction score: 27
Messages: 27

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
 

PMc

Aspiring Daemon

Reaction score: 421
Messages: 975

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.
 

Jose

Aspiring Daemon

Reaction score: 395
Messages: 551

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.
Do I detect sarcasm?
 

PMc

Aspiring Daemon

Reaction score: 421
Messages: 975

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?
 

arrowd

New Member
Developer

Reaction score: 2
Messages: 3

Oops, disregard my note on Baikal - it turns out that the developer board I mentioned has BE-T1000, which is not ARM, but MIPS.
 

mercurius

New Member

Reaction score: 2
Messages: 19

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.
 

rigoletto@

Daemon
Developer

Reaction score: 1,196
Messages: 2,245

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.
 
OP
DJs3000

DJs3000

New Member

Reaction score: 5
Messages: 17

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.
 
Top