Subversion Repositories HelenOS

Rev

Rev 4647 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4647 Rev 4651
Line 65... Line 65...
65
 
65
 
66
 
66
 
67
/** Prints bootloader version information. */
67
/** Prints bootloader version information. */
68
static void version_print(void)
68
static void version_print(void)
69
{
69
{
70
    printf("HelenOS ARM32 Bootloader\nRelease %s%s%s\nCopyright (c) 2007 HelenOS project\n",
70
    printf("HelenOS ARM32 Bootloader\nRelease %s%s%s\nCopyright (c) 2009 HelenOS project\n",
71
        release, revision, timestamp);
71
        release, revision, timestamp);
72
}
72
}
73
 
73
 
74
 
74
 
75
/** Copies all images (kernel + user tasks) to #KERNEL_VIRTUAL_ADDRESS and jumps there. */
75
/** Copies all images (kernel + user tasks) to #KERNEL_VIRTUAL_ADDRESS and jumps there. */
Line 89... Line 89...
89
 
89
 
90
    unsigned int top = 0;
90
    unsigned int top = 0;
91
    bootinfo.cnt = 0;
91
    bootinfo.cnt = 0;
92
    unsigned int i, j;
92
    unsigned int i, j;
93
    for (i = 0; i < COMPONENTS; i++) {
93
    for (i = 0; i < COMPONENTS; i++) {
94
        printf(" %L: %s image (size %d bytes)\n",
-
 
95
            components[i].start, components[i].name, components[i].size);
-
 
96
        top = ALIGN_UP(top, KERNEL_PAGE_SIZE);
94
        top = ALIGN_UP(top, KERNEL_PAGE_SIZE);
97
        if (i > 0) {
95
        if (i > 0) {
98
            bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
96
            bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
99
            bootinfo.tasks[bootinfo.cnt].size = components[i].size;
97
            bootinfo.tasks[bootinfo.cnt].size = components[i].size;
100
            strncpy(bootinfo.tasks[bootinfo.cnt].name,
98
            strncpy(bootinfo.tasks[bootinfo.cnt].name,
Line 104... Line 102...
104
        top += components[i].size;
102
        top += components[i].size;
105
    }
103
    }
106
    j = bootinfo.cnt - 1;
104
    j = bootinfo.cnt - 1;
107
 
105
 
108
    printf("\nCopying components\n");
106
    printf("\nCopying components\n");
109
 
-
 
-
 
107
    printf("Component\tAddress\t\tSize (Bytes)\n");
-
 
108
    printf("============================================\n");
110
    for (i = COMPONENTS - 1; i > 0; i--, j--) {
109
    for (i = COMPONENTS - 1; i > 0; i--, j--) {
111
        printf(" %s...", components[i].name);
110
        printf("%s\t\t0x%x\t%d\n", components[i].name, bootinfo.tasks[j].addr, components[i].size);
112
        memcpy((void *)bootinfo.tasks[j].addr, components[i].start,
111
        memcpy((void *)bootinfo.tasks[j].addr, components[i].start,
113
            components[i].size);
112
            components[i].size);
114
        printf("done.\n");
-
 
115
    }
113
    }
-
 
114
    printf("KERNEL\t\t0x%x\t%d\n", KERNEL_VIRTUAL_ADDRESS, components[0].size);
116
   
115
 
117
    printf("\nCopying kernel...");
-
 
118
    memcpy((void *)KERNEL_VIRTUAL_ADDRESS, components[0].start,
116
    memcpy((void *)KERNEL_VIRTUAL_ADDRESS, components[0].start,
119
        components[0].size);
117
        components[0].size);
120
    printf("done.\n");
-
 
121
 
118
 
122
    printf("\nBooting the kernel...\n");
119
    printf("\nBooting the kernel...\n");
123
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo);
120
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo);
124
}
121
}
125
 
122