Subversion Repositories HelenOS-historic

Rev

Rev 820 | Rev 853 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 820 Rev 852
Line 34... Line 34...
34
#include <arch/mm/frame.h>
34
#include <arch/mm/frame.h>
35
#include <mm/frame.h>
35
#include <mm/frame.h>
36
#include <interrupt.h>
36
#include <interrupt.h>
37
#include <align.h>
37
#include <align.h>
38
#include <console/console.h>
38
#include <console/console.h>
-
 
39
#include <console/kconsole.h>
-
 
40
#include <console/cmd.h>
39
 
41
 
40
/* This is a good joke, SGI HAS different types than NT bioses... */
42
/* This is a good joke, SGI HAS different types than NT bioses... */
41
/* Here is the SGI type */
43
/* Here is the SGI type */
42
static char *basetypes[] = {
44
static char *basetypes[] = {
43
    "ExceptionBlock",
45
    "ExceptionBlock",
Line 150... Line 152...
150
 
152
 
151
    printf("Memory map:\n");
153
    printf("Memory map:\n");
152
 
154
 
153
    desc = arc_entry->getmemorydescriptor(NULL);
155
    desc = arc_entry->getmemorydescriptor(NULL);
154
    while (desc) {
156
    while (desc) {
155
        printf("%s: %d (size: %dKB)\n",basetypes[desc->type],
157
        printf("%s: %d(%P) (size: %dKB)\n",basetypes[desc->type],
-
 
158
               desc->basepage * ARC_FRAME,
156
               desc->basepage * ARC_FRAME,
159
               desc->basepage * ARC_FRAME,
157
               desc->basecount*ARC_FRAME/1024);
160
               desc->basecount*ARC_FRAME/1024);
158
        desc = arc_entry->getmemorydescriptor(desc);
161
        desc = arc_entry->getmemorydescriptor(desc);
159
    }
162
    }
160
}
163
}
Line 170... Line 173...
170
    arc_entry->write(1, &ch, 1, &cnt);
173
    arc_entry->write(1, &ch, 1, &cnt);
171
    interrupts_restore(ipl);
174
    interrupts_restore(ipl);
172
   
175
   
173
}
176
}
174
 
177
 
-
 
178
static int cmd_reboot(cmd_arg_t *argv)
-
 
179
{
-
 
180
    arc_entry->reboot();
-
 
181
    return 0;
-
 
182
}
-
 
183
static cmd_info_t reboot_info = {
-
 
184
    .name = "reboot",
-
 
185
    .description = "Reboot computer",
-
 
186
    .func = cmd_reboot,
-
 
187
    .argc = 0
-
 
188
};
-
 
189
 
175
/** Initialize ARC structure
190
/** Initialize ARC structure
176
 *
191
 *
177
 * @return 0 - ARC OK, -1 - ARC does not exist
192
 * @return 0 - ARC OK, -1 - ARC does not exist
178
 */
193
 */
179
int arc_init(void)
194
int arc_init(void)
Line 187... Line 202...
187
    arc_putchar('A');
202
    arc_putchar('A');
188
    arc_putchar('R');
203
    arc_putchar('R');
189
    arc_putchar('C');
204
    arc_putchar('C');
190
    arc_putchar('\n');
205
    arc_putchar('\n');
191
 
206
 
-
 
207
    /* Add command for resetting the computer */
-
 
208
    cmd_initialize(&reboot_info);
-
 
209
    cmd_register(&reboot_info);
-
 
210
 
192
    return 0;
211
    return 0;
193
}
212
}
194
 
213
 
195
static bool kbd_polling_enabled;
214
static bool kbd_polling_enabled;
196
static chardev_t console;
215
static chardev_t console;
Line 302... Line 321...
302
            }
321
            }
303
            basesize = ALIGN_DOWN(basesize, FRAME_SIZE);
322
            basesize = ALIGN_DOWN(basesize, FRAME_SIZE);
304
 
323
 
305
            total += basesize;
324
            total += basesize;
306
           
325
           
307
            zone_create(ADDR2PFN(base),
326
            zone_create(ADDR2PFN(base), SIZE2FRAMES(basesize),
308
                    SIZE2FRAMES(ALIGN_DOWN(basesize,FRAME_SIZE)),
-
 
309
                    ADDR2PFN(base),0);
327
                    ADDR2PFN(base), 0);
310
        }
328
        }
311
        desc = arc_entry->getmemorydescriptor(desc);
329
        desc = arc_entry->getmemorydescriptor(desc);
312
    }
330
    }
313
 
331
 
314
    config.memory_size = total;
332
    config.memory_size = total;