* Icode is the octal bootstrap
* program executed in user mode
* to bring up the system.
0104413, /* sys exec; init; initp */
0000014, /* initp: init; 0 */
0062457, /* init: </etc/init\0> */
* Called from m40.s or m45.s as
* soon as a stack and segmentation
* clear and free user core
* find which clock is configured
* call all initialization routines
* fork - process 0 to schedule
* - process 1 execute bootstrap
* panic: no clock -- neither clock responds
* loop at loc 6 in user mode -- /etc/init
* zero and free all of core
printf("mem = %l\n", maxmem
*5/16);
maxmem
= min(maxmem
, MAXMEM
);
mfree(swapmap
, nswap
, swplo
);
UISA
->r
[7] = ka6
[1]; /* io segment */
proc
[0].p_flag
=| SLOAD
|SSYS
;
rootdir
= iget(rootdev
, ROOTINO
);
rootdir
->i_flag
=& ~ILOCK
;
u
.u_cdir
= iget(rootdev
, ROOTINO
);
u
.u_cdir
->i_flag
=& ~ILOCK
;
copyout(icode
, 0, sizeof icode
);
* Return goes to loc. 0 of user init
* Load the user hardware segmentation
* registers from the software prototype.
* The software registers must have
* been setup prior by estabur.
if((up
=u
.u_procp
->p_textp
) != NULL
)
while(rp
> &UISD
->r
[0]) {
* Set up software prototype segmentation
* registers to implement the 3 pseudo
* text,data,stack segment sizes passed
* The argument sep specifies if the
* text and data+stack segments are to
if(nseg(nt
) > 8 || nseg(nd
)+nseg(ns
) > 8)
if(nseg(nt
)+nseg(nd
)+nseg(ns
) > 8)
if(nt
+nd
+ns
+USIZE
> maxmem
)
*dp
++ = ((nt
-1)<<8) | RO
;
while(ap
< &u
.u_uisa
[8]) {
*dp
++ = ((nd
-1)<<8) | RW
;
while(ap
< &u
.u_uisa
[8]) {
while(ap
< &u
.u_uisa
[16]) {
*--dp
= ((128-ns
)<<8) | RW
| ED
;
* Return the arg/128 rounded up.