LdB
Posts: 1281
Joined: Wed Dec 07, 2016 2:29 pm

Re: Raspberry Pi 4

Thu Aug 01, 2019 11:23 pm

Nice rst I missed your post back there.
However that still means you can't have 32bit and 64bit on the same SD card because the config.sys entry needs to change which is still different to the situation up to the Pi3.

MODS I think we probably need a Pi4 sticky to stop this happening as important information is going to be in lots of different posts.

rst
Posts: 410
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: Raspberry Pi 4

Fri Aug 02, 2019 10:16 am

LdB wrote:
Thu Aug 01, 2019 11:23 pm
However that still means you can't have 32bit and 64bit on the same SD card because the config.sys entry needs to change which is still different to the situation up to the Pi3.
In fact this was the situation with the RPi 3 before. You cannot have a kernel8.img on the SD card there and start in AArch32 without config.txt. You have to decide, if you want to start AArch32 or 64 on the RPi 3 when preparing your SD card.

What is bad IMHO is, that a kernel8.img is by default started in AArch32 on the RPi 4. I did a lot tests before I realized, why my 64-bit kernel was not running on the RPi 4. It was simply named kernel8.img (without config.txt) and started in AArch32. That was confusing.

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

Re: Raspberry Pi 4

Fri Aug 02, 2019 10:26 am

rst wrote:
Fri Aug 02, 2019 10:16 am
LdB wrote:
Thu Aug 01, 2019 11:23 pm
However that still means you can't have 32bit and 64bit on the same SD card because the config.sys entry needs to change which is still different to the situation up to the Pi3.
In fact this was the situation with the RPi 3 before. You cannot have a kernel8.img on the SD card there and start in AArch32 without config.txt. You have to decide, if you want to start AArch32 or 64 on the RPi 3 when preparing your SD card.

What is bad IMHO is, that a kernel8.img is by default started in AArch32 on the RPi 4. I did a lot tests before I realized, why my 64-bit kernel was not running on the RPi 4. It was simply named kernel8.img (without config.txt) and started in AArch32. That was confusing.
Worth remembering that we do not supply a 64bit kernel, but when we do, we will be sorting out any boot issues like these. But right now, it's not a priority.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

LdB
Posts: 1281
Joined: Wed Dec 07, 2016 2:29 pm

Re: Raspberry Pi 4

Fri Aug 02, 2019 1:08 pm

rst wrote:
Fri Aug 02, 2019 10:16 am
In fact this was the situation with the RPi 3 before. You cannot have a kernel8.img on the SD card there and start in AArch32 without config.txt. You have to decide, if you want to start AArch32 or 64 on the RPi 3 when preparing your SD card.
You are wrong the 32bit file for the Pi3 was never called kernel8.img it was specifically called kernel8-32.img, you had the wrong name which was creating your problem and surprised you never worked that out as you did a lot of baremetal.

That is you could have an SD-Card with 4 files and it boots correctly on every Pi without any config.sys change because the VC4 order was
Pi3 look for kernel8.img if found boot in ARM8 64 bit mode
Pi3 look for kernel8-32.img if found boot in ARM8 32 bit mode
Pi3 or Pi2 look for kernel7.img if found boot in ARM7 32 bit mode
Any model Pi look for kernel.img if found boot in ARM6 32 bit mode

It is documented in the Pi boot sequence documentation, so you created the problem by naming error change the name and try it.

All I am saying is the Pi4 should look for kernel9 or perhaps kernel11 file to top of search sequence to restore things as it was.
Last edited by LdB on Fri Aug 02, 2019 1:16 pm, edited 1 time in total.

rst
Posts: 410
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: Raspberry Pi 4

Fri Aug 02, 2019 1:16 pm

jamesh wrote:
Fri Aug 02, 2019 10:26 am
Worth remembering that we do not supply a 64bit kernel, but when we do, we will be sorting out any boot issues like these. But right now, it's not a priority.
Understood. If you know, how it works, it is easy to handle it.

rst
Posts: 410
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: Raspberry Pi 4

Fri Aug 02, 2019 1:25 pm

LdB wrote:
Fri Aug 02, 2019 1:08 pm
You are wrong the 32bit file for the Pi3 was never called kernel8.img it was specifically called kernel8-32.img, you had the wrong name which was creating your problem and surprised you never worked that out as you did a lot of baremetal.
I knew this. But normally I'm building kernel7.img images, which run on both RPi 2 and 3 in AArch32. It creates less test effort.

But I don't understand, how it would helped me, to create a kernel8-32.img on the SD card, because I wanted to enter AArch64. For my first AArch64 tests on the RPi 4 I copied a kernel8.img image to the SD card and it was started in AArch32 mode, how I realized later.
All I am saying is the Pi4 should look for kernel9 or perhaps kernel11 file to top of search sequence to restore things as it was.
Maybe a new name for RPi4 AArch64 operation would be good, but as read, it is not priority.

LdB
Posts: 1281
Joined: Wed Dec 07, 2016 2:29 pm

Re: Raspberry Pi 4

Fri Aug 02, 2019 3:40 pm

rst wrote:
Fri Aug 02, 2019 1:25 pm
I knew this. But normally I'm building kernel7.img images, which run on both RPi 2 and 3 in AArch32. It creates less test effort.
But a lot slower than it would otherwise because it doesn't use the optimized opcodes and your MMU is ARM7 format.

Watch the priority shift when they have 4Gb Pi4 and the linux distros want to be able to have a common 64 and 32 bit boot sequence for the Pi4 and Pi3 ... just stating the obvious :-)

rst
Posts: 410
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: Raspberry Pi 4

Fri Aug 02, 2019 5:28 pm

LdB wrote:
Fri Aug 02, 2019 3:40 pm
rst wrote:
Fri Aug 02, 2019 1:25 pm
I knew this. But normally I'm building kernel7.img images, which run on both RPi 2 and 3 in AArch32. It creates less test effort.
But a lot slower than it would otherwise because it doesn't use the optimized opcodes and your MMU is ARM7 format.
A kernel8-32.img can be build from my sources, if wanted. The VMSAv8-32 virtual memory system architecture is generally equivalent to VMSAv7.

xihan94
Posts: 21
Joined: Sat Jul 23, 2016 5:31 pm

Re: Raspberry Pi 4

Fri Aug 02, 2019 7:31 pm

rst wrote:
Fri Aug 02, 2019 10:16 am
LdB wrote:
Thu Aug 01, 2019 11:23 pm
However that still means you can't have 32bit and 64bit on the same SD card because the config.sys entry needs to change which is still different to the situation up to the Pi3.
In fact this was the situation with the RPi 3 before. You cannot have a kernel8.img on the SD card there and start in AArch32 without config.txt. You have to decide, if you want to start AArch32 or 64 on the RPi 3 when preparing your SD card.

What is bad IMHO is, that a kernel8.img is by default started in AArch32 on the RPi 4. I did a lot tests before I realized, why my 64-bit kernel was not running on the RPi 4. It was simply named kernel8.img (without config.txt) and started in AArch32. That was confusing.
You can add

Code: Select all

arm_64bit=1
to let it start in aarch64 mode. It confused me, too. I have had some notes when I'm learning bare metal and exploring this board. I'm going to update it as I go.

https://xihan94.gitbook.io/raspberry-pi ... -4-bringup

rst
Posts: 410
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: Raspberry Pi 4

Sun Aug 04, 2019 6:54 am

xihan94 wrote:
Fri Aug 02, 2019 7:31 pm
rst wrote:
Fri Aug 02, 2019 10:16 am
What is bad IMHO is, that a kernel8.img is by default started in AArch32 on the RPi 4. I did a lot tests before I realized, why my 64-bit kernel was not running on the RPi 4. It was simply named kernel8.img (without config.txt) and started in AArch32. That was confusing.
You can add

Code: Select all

arm_64bit=1
to let it start in aarch64 mode. It confused me, too. I have had some notes when I'm learning bare metal and exploring this board. I'm going to update it as I go.

https://xihan94.gitbook.io/raspberry-pi ... -4-bringup
Thanks, but yes, I did only describe, how I learned this already. Interesting notes. Keep pluggin away.

Return to “Bare metal, Assembly language”