Subversion Repositories HelenOS-historic

Rev

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

Rev 1771 Rev 1782
Line 28... Line 28...
28
 
28
 
29
#include "main.h" 
29
#include "main.h" 
30
#include <printf.h>
30
#include <printf.h>
31
#include "asm.h"
31
#include "asm.h"
32
#include "_components.h"
32
#include "_components.h"
-
 
33
#include <ofw.h>
33
 
34
 
34
#define KERNEL_VIRTUAL_ADDRESS 0x400000
35
#define KERNEL_VIRTUAL_ADDRESS 0x400000
35
 
36
 
-
 
37
bootinfo_t bootinfo;
-
 
38
 
36
void bootstrap(void)
39
void bootstrap(void)
37
{
40
{
38
    printf("HelenOS SPARC64 Bootloader\n");
41
    printf("HelenOS SPARC64 Bootloader\n");
39
   
42
 
40
    component_t components[COMPONENTS];
43
    component_t components[COMPONENTS];
41
    bootinfo_t bootinfo;
-
 
42
    init_components(components);
44
    init_components(components);
43
   
45
 
44
    printf("\nMemory statistics\n");
46
    printf("\nMemory statistics\n");
45
    printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS);
47
    printf(" kernel entry point at %L\n", KERNEL_VIRTUAL_ADDRESS);
46
    printf(" %L: boot info structure\n", &bootinfo);
48
    printf(" %L: boot info structure\n", &bootinfo);
47
   
49
   
48
    unsigned int i;
50
    unsigned int i;
49
    for (i = 0; i < COMPONENTS; i++)
51
    for (i = 0; i < COMPONENTS; i++)
50
        printf(" %L: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size);
52
        printf(" %L: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size);
-
 
53
 
-
 
54
    screen_t scr;
-
 
55
   
-
 
56
    ofw_screen(&scr);
-
 
57
    printf("\n%P: fb, %dx%dx%d\n", ofw_translate(scr.addr), scr.width, scr.height, scr.bpp);
-
 
58
 
51
   
59
   
52
    printf("\nCopying components\n");
60
    printf("\nCopying components\n");
53
    unsigned int top = 0;
61
    unsigned int top = 0;
54
    bootinfo.cnt = 0;
62
    bootinfo.cnt = 0;
55
    for (i = 0; i < COMPONENTS; i++) {
63
    for (i = 0; i < COMPONENTS; i++) {
Line 62... Line 70...
62
            bootinfo.cnt++;
70
            bootinfo.cnt++;
63
        }
71
        }
64
        top += components[i].size;
72
        top += components[i].size;
65
        printf("done.\n");
73
        printf("done.\n");
66
    }
74
    }
67
   
75
 
68
    printf("\nBooting the kernel...\n");
76
    printf("\nBooting the kernel...\n");
69
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo, sizeof(bootinfo));
77
    jump_to_kernel((void *) KERNEL_VIRTUAL_ADDRESS, &bootinfo, sizeof(bootinfo));
70
}
78
}