Subversion Repositories HelenOS

Rev

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

Rev 3883 Rev 3922
Line 26... Line 26...
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
#include "main.h" 
29
#include "main.h" 
30
#include <printf.h>
30
#include <printf.h>
-
 
31
#include <align.h>
31
#include <macros.h>
32
#include <macros.h>
32
#include "msim.h"
33
#include "msim.h"
33
#include "asm.h"
34
#include "asm.h"
34
#include "_components.h"
35
#include "_components.h"
35
 
36
 
Line 71... Line 72...
71
    unsigned int i;
72
    unsigned int i;
72
    for (i = 0; i < COMPONENTS; i++)
73
    for (i = 0; i < COMPONENTS; i++)
73
        printf(" %L: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size);
74
        printf(" %L: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size);
74
   
75
   
75
    printf("\nCopying components\n");
76
    printf("\nCopying components\n");
-
 
77
   
76
    unsigned int top = 0;
78
    unsigned int top = 0;
77
    bootinfo.cnt = 0;
79
    bootinfo.cnt = 0;
78
    for (i = 0; i < COMPONENTS; i++) {
80
    for (i = 0; i < min(COMPONENTS, TASKMAP_MAX_RECORDS); i++) {
79
        printf(" %s...", components[i].name);
81
        printf(" %s...", components[i].name);
80
        top = ALIGN_UP(top, PAGE_SIZE);
82
        top = ALIGN_UP(top, PAGE_SIZE);
81
        memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size);
83
        memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size);
82
        if (i > 0) {
84
        if (i > 0) {
83
            bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
85
            bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
Line 86... Line 88...
86
        }
88
        }
87
        top += components[i].size;
89
        top += components[i].size;
88
        printf("done.\n");
90
        printf("done.\n");
89
    }
91
    }
90
   
92
   
-
 
93
    unsigned int *cpumap = (unsigned int *) CPUMAP;
-
 
94
    bootinfo.cpumap = 0;
-
 
95
    for (i = 0; i < CPUMAP_MAX_RECORDS; i++) {
-
 
96
        if (cpumap[i] != 0)
-
 
97
            bootinfo.cpumap |= (1 << i);
-
 
98
    }
-
 
99
   
91
    printf("\nBooting the kernel...\n");
100
    printf("\nBooting the kernel...\n");
92
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo, sizeof(bootinfo));
101
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo);
93
}
102
}