From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBD56C433EF for ; Tue, 2 Nov 2021 22:00:01 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A42260E9C for ; Tue, 2 Nov 2021 22:00:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3A42260E9C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mi1oi-0003TN-A2; Tue, 02 Nov 2021 17:59:40 -0400 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mi1og-0003TD-9v for kernelnewbies@kernelnewbies.org; Tue, 02 Nov 2021 17:59:38 -0400 Received: by mail-qv1-xf2b.google.com with SMTP id j9so404844qvm.10 for ; Tue, 02 Nov 2021 14:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vt-edu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:in-reply-to:references:mime-version :content-transfer-encoding:date:message-id; bh=3h9sO1mhagX366kgPvyKhBbswmuzTjDQk/mAKUO1YOs=; b=HqE0Xp4eV5QjBiaIsfsUfaTwlJs565ldU0Cz7ztgX5tlXLWOKqh57cpARz0IkEt6aw wGEdI9pXINx+No49lHyH413oeQe/o1R1BRfMLYC+LdSJhEpxCvC+RpatYaSq+rIv2pwx nN4L2ngAJQNorYGz2znqRlwcvCX6aknqCGtcn+HjtjOVpE40rngtKGGfvnzv2Q14wwr6 wnjyPZORjSgFMR2tHrlSlqkRHWzLmTl9zM+EAUty4YVPCWhZS7BwTfOMIoI0jOlhjwlC AA1XYRkgGVBfpZ4JPA4xgRfu1PFBrOjibOgm8hKcdpSLYls7luPuV4B68qzA6eErktLn 6reA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=3h9sO1mhagX366kgPvyKhBbswmuzTjDQk/mAKUO1YOs=; b=rtlxkQxqf5qqMPMP1a93ZMtBaHEXQBJnUEtI/NipiRcBJD3H3kNg2H9qAo4JheNJDI bxufZNxcLywYWbdixt/X47sEeBpE8THEiADwLYQFYZC7po3k3x1PXeew6UvVxRJ+zA5b /Yimp0iX6WZr7gn7rfjttcwdqoGab6cCIbftXtMtfeKaUtgpq9novM9ZiNs/pEMyPjq3 hOZZK2ip9DSy99kJLJDXf9fHIMaIaNpi+HpD+xqdkqMITX1T0FQynEY9bTCpwmKdt/ZB 7OvCb6eYGwvanvpU1759hQJnWnyi64dM4oi/ss58QqsDEAcrTOPU72DaMQxTGWt9EMT1 jeSA== X-Gm-Message-State: AOAM532azY+KmWxw0vTutYcftxHtUED6XKif2x+SHd+uNZ3atZ5myIH/ p2plH9Ho9le+YmHX7MpoPRfiLgTyPWaPMQ== X-Google-Smtp-Source: ABdhPJyXjVDiRKfFalF48b3Syt+p7zhwUcZbNYY14CMa1dy9oYjsQfX6g/8NClrd1bEDcNs0bky3zA== X-Received: by 2002:a05:622a:493:: with SMTP id p19mr33469720qtx.97.1635890376328; Tue, 02 Nov 2021 14:59:36 -0700 (PDT) Received: from turing-police ([2601:5c0:c380:d61::359]) by smtp.gmail.com with ESMTPSA id u11sm208289qko.33.2021.11.02.14.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 14:59:35 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.10.0-pre 07/05/2021 with nmh-1.7+dev To: Mushahid Hussain Subject: Re: Loading a simple "kernel" at the address other than default on Raspberry Pi 4 In-Reply-To: References: Mime-Version: 1.0 Date: Tue, 02 Nov 2021 17:59:34 -0400 Message-ID: <282088.1635890374@turing-police> Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============8568162471487623332==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============8568162471487623332== Content-Type: multipart/signed; boundary="==_Exmh_1635890374_111409P"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1635890374_111409P Content-Type: text/plain; charset=us-ascii 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. --==_Exmh_1635890374_111409P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQEcBAEBCAAGBQJhgbTGAAoJEI0DS38y7CIcChYH/jVVSnPv3qt3aIl2EKBogfaT XUtrhXfWE/iEaSzyOzWmyBslEoLg6D75sJIJh56tQGYXkm6c+37n7kUqyn0Dc9bF RaNaAUTy76pOLb/GADjY+JRYU2GiXIQXg2ku1yBCB0BYdP5mHKgy66TvFs+5lxzc 8gsLF3HXijerxIYI57EuRtrPQPsp6TILi14A6/dshpvM+Dlia7yXa0l7umC4B5oE QGeYCCBEt/V5fIRXWUiHouWb5DqGmIUivckp9eHeMJ3e8e0kvYN8v6yXnHttWcHO XPgnQwBBVGNLi68VbSDtdX/LOUjBMoCdSfAzV8fn4G0pSgKxgzjtCNTlsZcAjdE= =c3lY -----END PGP SIGNATURE----- --==_Exmh_1635890374_111409P-- --===============8568162471487623332== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============8568162471487623332==--