projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f4a0aa0
)
Comments and a bit of initialization order cleanup.
author
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 28 Sep 2004 07:39:45 +0000
(07:39 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 28 Sep 2004 07:39:45 +0000
(07:39 +0000)
src/threads/init.c
patch
|
blob
|
history
diff --git
a/src/threads/init.c
b/src/threads/init.c
index 0e8e2b9f7508a1ba9b591b70d2a5f80798fa3aef..9347ad42b9ecffd5b9d155691478191b738ab831 100644
(file)
--- a/
src/threads/init.c
+++ b/
src/threads/init.c
@@
-62,27
+62,33
@@
int main (void) NO_RETURN;
int
main (void)
{
int
main (void)
{
- /*
Initialize everything needed for printf() first. */
+ /*
Clear BSS and get machine's RAM size. */
ram_init ();
ram_init ();
+
+ /* Initialize ourselves as a thread so we can use locks. */
thread_init ();
thread_init ();
+
+ /* Initialize the console so we can use printf(). */
vga_init ();
serial_init_poll ();
console_init ();
/* Greet user. */
vga_init ();
serial_init_poll ();
console_init ();
/* Greet user. */
- printf ("Pintos booting with %'zd kB RAM...\n", ram_pages *
(PGSIZE / 1024)
);
+ printf ("Pintos booting with %'zd kB RAM...\n", ram_pages *
PGSIZE / 1024
);
/* Parse command line. */
argv_init ();
/* Parse command line. */
argv_init ();
- /* Initialize memory system
, segments, paging
. */
+ /* Initialize memory system. */
palloc_init ();
palloc_init ();
+ malloc_init ();
paging_init ();
paging_init ();
+
+ /* Segmentation. */
#ifdef USERPROG
tss_init ();
gdt_init ();
#endif
#ifdef USERPROG
tss_init ();
gdt_init ();
#endif
- malloc_init ();
/* Set random seed if argv_init() didn't. */
random_init (0);
/* Set random seed if argv_init() didn't. */
random_init (0);
@@
-122,14
+128,15
@@
main (void)
#endif
}
#else
#endif
}
#else
+ /* Run the compiled-in test function. */
test ();
#endif
test ();
#endif
+ /* Finish up. */
if (do_power_off)
power_off ();
if (do_power_off)
power_off ();
-
- /* Terminate this thread. */
- thread_exit ();
+ else
+ thread_exit ();
}
\f
/* Clear BSS and obtain RAM size from loader. */
}
\f
/* Clear BSS and obtain RAM size from loader. */