From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <33aa3b4ddd8d675fa801e5870918d68d@plan9.bell-labs.com> From: "Russ Cox" To: 9fans@cse.psu.edu Subject: Re: [9fans] kernel config changes In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 24 Jan 2003 11:52:40 -0500 Topicbox-Message-UUID: 46865c76-eacb-11e9-9e20-41e7f4b1d025 There's now both port/initcode.c, which does almost what I posted (I've since noticed that the exec cmd line args get passed into the main function, now called startboot): #include #include char cons[] = "#c/cons"; char boot[] = "/boot/boot"; char dev[] = "/dev"; char c[] = "#c"; char e[] = "#e"; char ec[] = "#ec"; char s[] = "#s"; char srv[] = "/srv"; char env[] = "/env"; void startboot(char *argv0, char **argv) { open(cons, OREAD); open(cons, OWRITE); open(cons, OWRITE); bind(c, dev, MAFTER); bind(ec, env, MAFTER); bind(e, env, MCREATE|MAFTER); bind(s, srv, MREPL|MCREATE); exec(boot, argv); for(;;); } On the MIPS there is still an assembly stub that initializes R30 (SB). TEXT _main(SB), $8 MOVW $setR30(SB), R30 MOVW $boot(SB), R1 ADD $12, R29, R2 /* get a pointer to 0(FP) */ MOVW R1, 4(R29) MOVW R2, 8(R29) JAL startboot(SB) The 386 uses just the C code -- no assembly required. You should be able to do almost exactly the same thing for the bitsy -- SB is R12. Russ