9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] startboot signature
@ 2016-02-17  8:19 Giacomo Tesio
  2016-02-18 12:28 ` Charles Forsyth
  0 siblings, 1 reply; 2+ messages in thread
From: Giacomo Tesio @ 2016-02-17  8:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

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)`


Giacomo

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] startboot signature
  2016-02-17  8:19 [9fans] startboot signature Giacomo Tesio
@ 2016-02-18 12:28 ` Charles Forsyth
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Forsyth @ 2016-02-18 12:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-18 12:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17  8:19 [9fans] startboot signature Giacomo Tesio
2016-02-18 12:28 ` Charles Forsyth

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).