User avatar
YuGiOhJCJ
Posts: 8
Joined: Wed Apr 26, 2017 6:21 pm

Why the Raspberry Pi 3 Model B does not use upstream Linux?

Thu May 18, 2017 12:07 pm

Hello,

As you know, there is a Raspberry Pi specific Linux kernel at https://github.com/raspberrypi/linux.
It means that this is not Linux.
Indeed, it is a modified version of Linux.
The official Linux kernel is at https://github.com/torvalds/linux.

If you try to build the Raspberry Pi specific Linux kernel on the Raspberry Pi 3 Model B, you will have no problem:
https://www.raspberrypi.org/documentati ... uilding.md

But if you try to build the official Linux kernel on the Raspberry Pi 3 Model B, you will have a problem:

Code: Select all

$ make bcm2709_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
***
*** Can't find default configuration "arch/arm/configs/bcm2709_defconfig"!
***
scripts/kconfig/Makefile:112: recipe for target 'bcm2709_defconfig' failed
make[1]: *** [bcm2709_defconfig] Error 1
Makefile:546: recipe for target 'bcm2709_defconfig' failed
make: *** [bcm2709_defconfig] Error 2
Indeed, the above command does not work because the Raspberry Pi specific file "arch/arm/configs/bcm2709_defconfig" is not available in the official Linux kernel.

So, why the Raspberry Pi 3 Model B does not use Linux?
Is there any plan to move to Linux?

Thank you.
Best regards.
Last edited by YuGiOhJCJ on Thu May 18, 2017 8:05 pm, edited 1 time in total.

User avatar
PeterO
Posts: 6208
Joined: Sun Jul 22, 2012 4:14 pm

Re: Why the Raspberry Pi 3 Model B does not use Linux?

Thu May 18, 2017 12:45 pm

Of course it uses Linux !
See... it say so :

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux
You need to choose your words more carefully !
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PICO,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

MarkR
Posts: 156
Joined: Fri Jan 25, 2013 1:55 pm

Re: Why the Raspberry Pi 3 Model B does not use Linux?

Thu May 18, 2017 12:49 pm

Probably because the RP foundation's developers cannot wait for their platform drivers to be merged upstream.

But also because they want to run an older kernel than the latest one.

All the drivers enter the "Linus" kernel eventually, I imagine it's possible to boot on such a kernel, but you won't necessarily get the latest fixes.

runboy93
Posts: 352
Joined: Tue Feb 28, 2017 1:17 pm

Re: Why the Raspberry Pi 3 Model B does not use Linux?

Thu May 18, 2017 12:54 pm

Based on Linux kernel.

W. H. Heydt
Posts: 16342
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Why the Raspberry Pi 3 Model B does not use Linux?

Thu May 18, 2017 1:22 pm

YuGiOhJCJ wrote:Hello,

As you know, there is a Raspberry Pi specific Linux kernel at https://github.com/raspberrypi/linux.
It means that this is not Linux.
Indeed, it is a modified version of Linux.
The official Linux kernel is at https://github.com/torvalds/linux.
If one uses your logic, then because you are a modified primate, you are not a primate. Doesn't work that way. Just because a kernel has been modified for specific hardware doesn't mean that it--somehow--isn't the OS it is based on. Every OS for the Pi that I have ever heard of, except RISC OS, *is* Linux, despite each version being "based on" and modified from the standard Linux kernel.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 15269
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 1:38 pm

Drivers and configs for the Pi are being merged upstream. Slowly.
Upstream have adopted the bcm2835 chip name, rather than the bcm2708/2709/2710 IP block names (long story, but basically Broadcom have different numbers for the pacakged silicon vs the underlying silicon design).

If you felt like building the upstream kernel, then https://blogs.s-osg.org/use-v4l2-camera ... am-kernel/ is one of the Linux media developer's write ups of how to build with the latest linux-media tree. Ignore the bit about pulling in linux-media and you'll have a vanilla Linux kernel.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Heater
Posts: 19672
Joined: Tue Jul 17, 2012 3:02 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 1:41 pm

YuGiOhJCJ,
As you know, there is a Raspberry Pi specific Linux kernel at https://github.com/raspberrypi/linux.
It means that this is not Linux.
That does not follow.

Typically a Linux distributions do not use the upstream kernel as is. Things like Red Hat, Ubuntu, etc, will have their own patches.

Given the huge percentage of the code in those kernels that is the same as the upstream kernel it wold be silly to say they are not Linux. Besides often much of the work such distributions make on a their kernel will find it's way up to the mainline kernel.

They are contributors to the Linux development.

As far as Raspbian is concerned I think there is great value in all versions of the Pi and their users using the same version of software. Having everybody on the same page make support by the Pi Foundation, this forum and elsewhere much easier.
Slava Ukrayini.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 32794
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 1:45 pm

By the OP's definition, Linux distro's like Ubuntu, any based on SBC's, any running on mobile phones are not actually Linux. Which is clearly wrong.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

plugwash
Forum Moderator
Forum Moderator
Posts: 3845
Joined: Wed Dec 28, 2011 11:45 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 1:48 pm

What happens with kernels for all too many arm boards is that a SoC vendor takes a copy of Linux and ports it to their SoC but they don't involve the upstream Linux developers in the porting process at all and they hack together support as quickly as possible. Frequently they also fail to keep their kernel tree up to date with new upstream kernel versions.

For SoCs that are popular in the community the community often try and work on pushing support upstream, but it's an uphill battle. For better or worse the upstream Linux kernel community won't just take a dump of code that was designed without their input and merge it. I understand why they won't, accepting vendor code as-is would almost certainly result in an unmaintainable mess but it does mean that upstreaming vendor code often means significantly refactoring or even outright rewriting it.

The Pi has been better than most, the rpf have been reasonably good keeping their kernel up to date with new upstream versions and as code has been upstreamed by the community they have worked to make their kernels use that upstreamed code rather than duplicating everything.

We are now at the point where it is possible to use an upstream kernel on the pi but there is still some functionality missing. IIRC mostly the driver for talking to the GPU blob and some interrupt hacks to make USB work better.

posting.php?mode=reply&f=63&t=183990

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 1:50 pm

It is an interesting question whether or not Android is Linux.

I tend to agree with those who maintain that the strongest claim that can legitimately be made is that Android is "based on the Linux kernel".
If this post appears in the wrong forums category, my apologies.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 32794
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 2:00 pm

Martin Frezman wrote:It is an interesting question whether or not Android is Linux.

I tend to agree with those who maintain that the strongest claim that can legitimately be made is that Android is "based on the Linux kernel".
Well, you were the first person to mention Android, but..

From Wikipedia.
"Android is a Linux distribution according to the Linux Foundation,[168] Google's open-source chief Chris DiBona,[169] and several journalists.[170][171] Others, such as Google engineer Patrick Brady, say that Android is not Linux in the traditional Unix-like Linux distribution sense; Android does not include the GNU C Library (it uses Bionic as an alternative C library) and some of other components typically found in Linux distributions.[172]"
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

User avatar
CarlRJ
Posts: 598
Joined: Thu Feb 20, 2014 4:00 am
Location: San Diego, California

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 6:35 pm

YuGiOhJCJ wrote:As you know, there is a Raspberry Pi specific Linux kernel at https://github.com/raspberrypi/linux.
It means that this is not Linux.
...
So, why the Raspberry Pi 3 Model B does not use Linux?
Is there any plan to move to Linux?
This is entirely preposterous. Of course the Pi uses Linux. If your view of things were true, there would be one true Linux distribution and there would be no CentOS, Debian, Fedora, Gentoo, Ubuntu, RHEL, or other distributions. One of the cornerstones of Linux is that people are free to make new variants if they have sufficient motivation and resources. Raspbian uses a modified variant of Debian and a modified kernel. As do lots of other devices. It's still Linux. If the question you meant to ask is, "why doesn't Raspbian use the stock Linux kernel?", that's because the stock Linux kernet doesn't fully/properly support the Pi, as others have pointed out.

User avatar
YuGiOhJCJ
Posts: 8
Joined: Wed Apr 26, 2017 6:21 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 7:56 pm

Ahah I see that my topic has been renamed from "Why the Raspberry Pi 3 Model B does not use Linux?" to "Why the Raspberry Pi 3 Model B does not use upstream Linux?".
I agree with this new topic name because I was trolling a bit by using these words.

To understand my point of view, here is an example: When I am compiling my Linux kernel for Slackware, Slackware64 and other distributions I am using the official/upstream Linux kernel and it is not patched at all!
So, there is a real difference between the Linux kernel I use on my Raspberry Pi 3 Model B and the one I use on my other computers.
Indeed, I will not download the source code from the same location and the source code is not the same.
Do you see the difference?

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 8:05 pm

It is not that we don't understand the difference.

We just are aware of the old adage that:

A difference that makes no difference is no difference.

I.e., you haven't explained why you care.

Note: It sounds like this is a PHB problem. Is it?
If this post appears in the wrong forums category, my apologies.

User avatar
PeterO
Posts: 6208
Joined: Sun Jul 22, 2012 4:14 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 8:06 pm

The difference in practical terms or in some "I'm trolling for a reply" terms ? :evil:
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PICO,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 32794
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 9:18 pm

YuGiOhJCJ wrote:Ahah I see that my topic has been renamed from "Why the Raspberry Pi 3 Model B does not use Linux?" to "Why the Raspberry Pi 3 Model B does not use upstream Linux?".
I agree with this new topic name because I was trolling a bit by using these words.

To understand my point of view, here is an example: When I am compiling my Linux kernel for Slackware, Slackware64 and other distributions I am using the official/upstream Linux kernel and it is not patched at all!
So, there is a real difference between the Linux kernel I use on my Raspberry Pi 3 Model B and the one I use on my other computers.
Indeed, I will not download the source code from the same location and the source code is not the same.
Do you see the difference?
There is a real difference between almost all distros, not just between Raspbian and all the others. It's​ an utterly pointless point though.

I've not worked it out accurately​, but I suspect that the pi kernel is at least 99.999% the same as mainline. That's probably a closer match than your DNA is to your parents.

And so you know, I really don't like trolling posts.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Heater
Posts: 19672
Joined: Tue Jul 17, 2012 3:02 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Thu May 18, 2017 11:04 pm

YuGiOhJCJ,
When I am compiling my Linux kernel for Slackware, Slackware64 and other distributions I am using the official/upstream Linux kernel and it is not patched at all!
Admittedly I know little of Slackware but I don't think that statement is true in general. My experience, having used Linux since 1998 and many distros along the way, is that distros often have a bunch of their own patches in the kernels they use. Could be drivers that are not in the mainline, or new features or bug fixes or security patches or architecture support, etc.

If Linux came from a single source, a company say, then we might ask "Why are we not using the latest and greatest from the vendor?". But the Linux kernel is not like that. It's a world wide distributed development. Everyone hacks on "their" Linux and hopefully the good stuff makes it's way to Linus' mainline kernel from whence it can be shared to all.

So, I could turn your question around: How come the work of the Pi Foundation in tailoring Linux for the Pi has not made it into the mainline yet? I'm sure that will come to pass in time.
Slava Ukrayini.

mfa298
Posts: 1386
Joined: Tue Apr 22, 2014 11:18 am

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Fri May 19, 2017 9:23 am

YuGiOhJCJ wrote: So, why the Raspberry Pi 3 Model B does not use Linux?
Is there any plan to move to Linux?
To turn this troll/rant around the other way, which scenario would you prefer:
1) We would all have bought Pis over the last few years but wouldn't be able to use them until RPF had got all the relevant support into mainline. So in other words our choices would be to run RiscOS or some other non Linux OS, become a kernel developer (presumably in your model of things they can run something that isn't quite mainline yet) or just look at our Raspberry Pi's but not power them up yet

2) Have a vendor supported (and maintained) kernel that's being actively worked upon, updated and pushed to mainline as parts are ready.

Personally I'd prefer the current situation (2).

Also I believe there are parts in the Raspberry Pi kernel that may struggle to get into mainline (something about interrupts in the usb drivers ?) as it's a major change to how lots of things work with no benefit for the majority of users. This is the same with a few other things where adding support means major changes for a vast array of drivers (zfs I think is another example as it would need some big changes in the vfs layer affecting all filesytems).

User avatar
procount
Posts: 2818
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Fri May 19, 2017 12:13 pm

YuGiOhJCJ wrote:When I am compiling my Linux kernel for Slackware, Slackware64 and other distributions I am using the official/upstream Linux kernel and it is not patched at all!
Forgive my ignorance, but doesn't "upstreaming" just mean that the patches for a specific feature/hardware/board are included in the mainline code as conditional compilation options and henceforth maintained by the mainline kernel developers for a wider audience? A conditional compilation is just like an "internal patch". So is this more of a confidence issue in the code? If we didn't have patches, the kernel would never evolve.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 32794
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why the Raspberry Pi 3 Model B does not use upstream Lin

Fri May 19, 2017 12:35 pm

I think I have had enough of this nonsensical thread.

Clearly the OP hasn't really got much of an idea how this all works, it's been thoroughly explained, the OP hasn't recently replied. So I am going to lock it. Life is too short to be trying to explain this stuff. I've got some kernel debugging to do. Interestingly, I recently had some patches accepted to fix issues in mainline. That were found on a Raspberry Pi...and I have never even used mainline....
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Return to “General discussion”