All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: Mushahid Hussain <mushi.shar@gmail.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Loading a simple "kernel" at the address other than default on Raspberry Pi 4
Date: Tue, 02 Nov 2021 17:59:34 -0400	[thread overview]
Message-ID: <282088.1635890374@turing-police> (raw)
In-Reply-To: <CADaYRJve0AxzvoOQ0pbO_VSwnhsq_zxN+U+JrUd0vG500M1XNQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1076 bytes --]

On Tue, 02 Nov 2021 17:13:16 +0500, Mushahid Hussain said:

> I have written a simple kernel which prints Hello World to UART. The simple
> kernel works successfully and prints Hello World to UART, if I load it at
> 0x80000, which is the default load address for the 64-bit kernel.
>
> There's a configuration(config.txt)[1] kernel_address on Raspberry Pi 4 but
> whenever I change the load address by even 1 byte, the simple kernel would
> not run. It is only able to run at 0x80000.

The config.txt value is for the boot loader, to tell it where the kernel should
be loaded.  There's another number, set during the kernel build, that tells the
kernel what address it should expect to be loaded at.

So if your micro-kernel is build to load at 0x80000 and then you tell the boot
loader to load at 0x80001, or vice versa, things will go badly.

You need to find some way to ensure that the boot loader and the initial part
of the kernel (the one that proceeds to unpack the rest of the kernel, set up
KASLR, and relocation if neded) agree on what address things start off at.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 494 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  parent reply	other threads:[~2021-11-02 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 12:13 Loading a simple "kernel" at the address other than default on Raspberry Pi 4 Mushahid Hussain
2021-11-02 20:24 ` Paulo Miguel Almeida
2021-11-02 21:59 ` Valdis Klētnieks [this message]
2021-11-04 15:28   ` Mushahid Hussain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=282088.1635890374@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=mushi.shar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.