Subversion Repositories HelenOS

Rev

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

Rev 4153 Rev 4581
Line 85... Line 85...
85
   
85
   
86
    printf("\nMemory statistics\n");
86
    printf("\nMemory statistics\n");
87
    printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS);
87
    printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS);
88
    printf(" %L: boot info structure\n", &bootinfo);
88
    printf(" %L: boot info structure\n", &bootinfo);
89
 
89
 
90
    unsigned int i, j;
-
 
91
    for (i = 0; i < COMPONENTS; i++) {
-
 
92
        printf(" %L: %s image (size %d bytes)\n",
-
 
93
            components[i].start, components[i].name, components[i].size);
-
 
94
    }
-
 
95
 
-
 
96
    printf("\nCopying components\n");
-
 
97
 
-
 
98
    unsigned int top = 0;
90
    unsigned int top = 0;
99
    bootinfo.cnt = 0;
91
    bootinfo.cnt = 0;
-
 
92
    unsigned int i, j;
100
    for (i = 0; i < COMPONENTS; i++) {
93
    for (i = 0; i < COMPONENTS; i++) {
101
        printf(" %s...", components[i].name);
94
        printf(" %L: %s image (size %d bytes)\n",
-
 
95
            components[i].start, components[i].name, components[i].size);
102
        top = ALIGN_UP(top, KERNEL_PAGE_SIZE);
96
        top = ALIGN_UP(top, KERNEL_PAGE_SIZE);
103
        memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size);
-
 
104
        if (i > 0) {
97
        if (i > 0) {
105
            bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
98
            bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
106
            bootinfo.tasks[bootinfo.cnt].size = components[i].size;
99
            bootinfo.tasks[bootinfo.cnt].size = components[i].size;
107
            strncpy(bootinfo.tasks[bootinfo.cnt].name,
100
            strncpy(bootinfo.tasks[bootinfo.cnt].name,
108
                components[i].name, BOOTINFO_TASK_NAME_BUFLEN);
101
                components[i].name, BOOTINFO_TASK_NAME_BUFLEN);
109
            bootinfo.cnt++;
102
            bootinfo.cnt++;
110
        }
103
        }
111
        top += components[i].size;
104
        top += components[i].size;
-
 
105
    }
-
 
106
    j = bootinfo.cnt - 1;
-
 
107
 
-
 
108
    printf("\nCopying components\n");
-
 
109
 
-
 
110
    for (i = COMPONENTS - 1; i > 0; i--, j--) {
-
 
111
        printf(" %s...", components[i].name);
-
 
112
        memcpy((void *)bootinfo.tasks[j].addr, components[i].start,
-
 
113
            components[i].size);
112
        printf("done.\n");
114
        printf("done.\n");
113
    }
115
    }
114
   
116
   
-
 
117
    printf("\nCopying kernel...");
-
 
118
    memcpy((void *)KERNEL_VIRTUAL_ADDRESS, components[0].start,
-
 
119
        components[0].size);
-
 
120
    printf("done.\n");
-
 
121
 
115
    printf("\nBooting the kernel...\n");
122
    printf("\nBooting the kernel...\n");
116
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo);
123
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo);
117
}
124
}
118
 
125
 
119
/** @}
126
/** @}