Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!princeton!udel!mmdf From: NU070156%NDSUVM1.BITNET@cunyvm.cuny.edu (Glen Overby) Newsgroups: comp.os.minix Subject: Re: Kernel Startup Question Message-ID: <702@louie.udel.EDU> Date: Sat, 14-Nov-87 01:30:10 EST Article-I.D.: louie.702 Posted: Sat Nov 14 01:30:10 1987 Date-Received: Sun, 15-Nov-87 16:20:26 EST Sender: mmdf@udel.EDU Lines: 24 In his article of 12 Nov 87, Dan Dietrich writes: > I do not understand how the memory manager >is run when the kernel boots up. Looking at kernel/main() in the book, >line 914 sets the process table PC value from the array task[]. >This array (line 5143) has 0 entered for the memory manager, file system and >init(). main() does ready the memory manager and file system (line 915) >but how do they start up when their PCs are 0 ?? I can't seem to find >where the PC values get set. You found it. All Minix processes (not device tasks) start at offset 0 in their code or data segment (code segment for split I&D; data segment for non split). Their segment registers will be set to point at the click- (16-byte) aligned segment. So, while it's not immediately obvious, it is correct to set their initial PC to 0. Also notice that the initial stack for these three processes gets set to INIT_SP (0x10). The specialised startup in head.s (lib/MINIX/head.s) sets the stack to point inside of an array in the process' data space. This is one of Minix's articles of "dirty laundry". Glen Overby Bitnet: nu070156@ndsuvm1 UUCP: uunet!ndsuvax!ncoverby