Move filesys_init into main_thread.
[pintos-anon] / src / threads / init.c
index 81188e950c6e8825052c18003d3eeea761ae1435..6e06f2faab178c8ee83a01051355ef42dded2956 100644 (file)
@@ -33,18 +33,12 @@ void power_off (void);
 static void
 main_thread (void *aux UNUSED) 
 {
-  struct disk *hda;
   disk_init ();
-  hda = disk_get (1);
-  if (hda != NULL) 
-    {
-      char buf[DISK_SECTOR_SIZE];
-      disk_read (hda, 0, buf);
-      //hex_dump (buf, sizeof buf);
-    }
-  else
-    printk ("no hda\n");
-  thread_execute ("a.out");
+
+#ifdef FILESYS
+  filesys_init (true);
+#endif
+  filesys_self_test ();
 }
 
 int
@@ -81,10 +75,6 @@ main (void)
   timer_init ();
   kbd_init ();
 
-#ifdef FILESYS
-  filesys_init (false);
-#endif
-
   thread_init ();
 
   t = thread_create ("main", main_thread, NULL);