Rev 3190 | Rev 3448 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3190 | Rev 3403 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | { |
53 | { |
54 | while (get_cons_phone() < 0) |
54 | while (get_cons_phone() < 0) |
55 | usleep(50000); // FIXME |
55 | usleep(50000); // FIXME |
56 | } |
56 | } |
57 | 57 | ||
58 | static bool mount_tmpfs(void) |
58 | static bool mount_fs(const char *fstype) |
59 | { |
59 | { |
60 | int rc = -1; |
60 | int rc = -1; |
61 | 61 | ||
62 | while (rc < 0) { |
62 | while (rc < 0) { |
63 | rc = mount("tmpfs", "/", "initrd"); |
63 | rc = mount(fstype, "/", "initrd"); |
64 | 64 | ||
65 | switch (rc) { |
65 | switch (rc) { |
66 | case EOK: |
66 | case EOK: |
67 | printf(NAME ": Root filesystem mounted\n"); |
67 | printf(NAME ": Root filesystem mounted\n"); |
68 | break; |
68 | break; |
69 | case EBUSY: |
69 | case EBUSY: |
70 | printf(NAME ": Root filesystem already mounted\n"); |
70 | printf(NAME ": Root filesystem already mounted\n"); |
71 | break; |
71 | break; |
72 | case ELIMIT: |
72 | case ELIMIT: |
73 | printf(NAME ": Unable to mount root filesystem\n"); |
73 | printf(NAME ": Unable to mount root filesystem\n"); |
74 | return false; |
74 | return false; |
- | 75 | case ENOENT: |
|
- | 76 | printf(NAME ": Unknown filesystem type (%s)\n", fstype); |
|
- | 77 | return false; |
|
75 | default: |
78 | default: |
76 | sleep(5); // FIXME |
79 | sleep(5); // FIXME |
77 | } |
80 | } |
78 | } |
81 | } |
79 | 82 | ||
Line 98... | Line 101... | ||
98 | int main(int argc, char *argv[]) |
101 | int main(int argc, char *argv[]) |
99 | { |
102 | { |
100 | info_print(); |
103 | info_print(); |
101 | sleep(5); // FIXME |
104 | sleep(5); // FIXME |
102 | 105 | ||
103 | if (!mount_tmpfs()) { |
106 | if (!mount_fs("tmpfs") && !mount_fs("fat")) { |
104 | printf(NAME ": Exiting\n"); |
107 | printf(NAME ": Exiting\n"); |
105 | return -1; |
108 | return -1; |
106 | } |
109 | } |
107 | 110 | ||
108 | buf = malloc(BUF_SIZE); |
111 | buf = malloc(BUF_SIZE); |
Line 113... | Line 116... | ||
113 | spawn("/sbin/console"); |
116 | spawn("/sbin/console"); |
114 | 117 | ||
115 | console_wait(); |
118 | console_wait(); |
116 | version_print(); |
119 | version_print(); |
117 | 120 | ||
118 | spawn("/sbin/fat"); |
- | |
119 | spawn("/sbin/tetris"); |
- | |
120 | spawn("/sbin/cli"); |
- | |
121 | // FIXME: spawn("/sbin/tester"); |
- | |
122 | spawn("/sbin/klog"); |
121 | spawn("/sbin/bdsh"); |
123 | 122 | ||
124 | free(buf); |
123 | free(buf); |
125 | return 0; |
124 | return 0; |
126 | } |
125 | } |
127 | 126 |