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
timer_init ();
kbd_init ();
-#ifdef FILESYS
- filesys_init (false);
-#endif
-
thread_init ();
t = thread_create ("main", main_thread, NULL);
return get_free_slot (d);
}
+void *
+calloc (size_t a, size_t b)
+{
+ void *p;
+ size_t size;
+
+ size = a * b;
+ if (size < a || size < b)
+ return NULL;
+
+ p = malloc (size);
+ if (p != NULL)
+ memset (p, 0, size);
+
+ return p;
+}
+
void
free (void *p)
{