9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] startboot signature
Date: Thu, 18 Feb 2016 12:28:45 +0000	[thread overview]
Message-ID: <CAOw7k5iTf5y3qv5BDx6C_LVC1vOurqvDQkhs+Vcc-LFyVR2pBA@mail.gmail.com> (raw)
In-Reply-To: <CAHL7psFYf3ApZtkpn7vwVGzDfkKC1fMpJzwQ8_G=YFWHPD7j7Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

On 17 February 2016 at 08:19, Giacomo Tesio <giacomo@tesio.it> wrote:

> Out of curiosity, why the startboot function in port/initcode.c is `void
> startboot(char *argv0, char **argv)` given the argv0 is ignored?
>
> I see that this simplify various main() in init9.s but I wonder why not
> simply use `void startboot(char **argv)`
>

There's possibly some historic reason for having argv0 instead of argc (ie,
possibly a time when argv0 was used),
but it also makes things a little easier on platforms (all but 386) where
the first parameter is passed in a register.
Since the setup code is machine dependent, it could get that right by
setting r0, r3 or bp in the saved Ureg,
but it probably isn't worthwhile changing all that now.

[-- Attachment #2: Type: text/html, Size: 1139 bytes --]

      reply	other threads:[~2016-02-18 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17  8:19 Giacomo Tesio
2016-02-18 12:28 ` Charles Forsyth [this message]

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=CAOw7k5iTf5y3qv5BDx6C_LVC1vOurqvDQkhs+Vcc-LFyVR2pBA@mail.gmail.com \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).