Rev 2245 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2245 | Rev 2263 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | #include <arch.h> |
36 | #include <arch.h> |
37 | #include <arch/boot.h> |
37 | #include <arch/boot.h> |
38 | #include <config.h> |
38 | #include <config.h> |
39 | #include <arch/console.h> |
39 | #include <arch/console.h> |
40 | #include <ddi/device.h> |
40 | #include <ddi/device.h> |
- | 41 | #include <genarch/fb/fb.h> |
|
- | 42 | #include <genarch/fb/visuals.h> |
|
- | 43 | #include <ddi/irq.h> |
|
41 | 44 | ||
42 | #include "aux_print/printf.h" |
45 | #include "aux_print/printf.h" |
43 | #include <print.h> |
46 | #include <print.h> |
44 | #include <config.h> |
47 | #include <config.h> |
45 | #include <interrupt.h> |
48 | #include <interrupt.h> |
- | 49 | #include <arch/drivers/init.h> |
|
46 | 50 | ||
47 | bootinfo_t bootinfo; |
51 | bootinfo_t bootinfo; |
48 | 52 | ||
49 | void arch_pre_main(void) |
53 | void arch_pre_main(void) |
50 | { |
54 | { |
51 | aux_printf("arch_pre_main\n"); |
55 | aux_printf("arch_pre_main\n"); |
52 | int i; |
56 | int i; |
53 | 57 | ||
54 | init.cnt = bootinfo.cnt; |
58 | init.cnt = bootinfo.cnt; |
55 | 59 | ||
56 | printf("Used memmory\n"); |
- | |
57 | for (i = 0; i < bootinfo.cnt; ++i) { |
60 | for (i = 0; i < bootinfo.cnt; ++i) { |
58 | init.tasks[i].addr = bootinfo.tasks[i].addr; |
61 | init.tasks[i].addr = bootinfo.tasks[i].addr; |
59 | init.tasks[i].size = bootinfo.tasks[i].size; |
62 | init.tasks[i].size = bootinfo.tasks[i].size; |
60 | - | ||
61 | // aux_printf("%L, %d\n", bootinfo.tasks[i].addr, bootinfo.tasks[i].size); |
- | |
62 | } |
63 | } |
63 | 64 | ||
64 | /* TODO this code just setups irq testing bed */ |
65 | /* TODO this code just setups irq testing bed */ |
65 | setup_exception_stacks(); |
66 | setup_exception_stacks(); |
66 | } |
67 | } |
67 | 68 | ||
68 | #include <ddi/irq.h> |
- | |
69 | void arch_pre_mm_init(void) |
69 | void arch_pre_mm_init(void) |
70 | { |
70 | { |
71 | aux_printf("arch_pre_mm_init\n"); |
71 | aux_printf("arch_pre_mm_init\n"); |
72 | 72 | ||
73 | /* It is not assumed by default */ |
73 | /* It is not assumed by default */ |
74 | interrupts_disable(); |
74 | interrupts_disable(); |
75 | 75 | ||
76 | /* Initialize dispatch table */ |
76 | /* Initialize dispatch table */ |
77 | exception_init(); |
77 | exception_init(); |
78 | - | ||
79 | - | ||
80 | } |
78 | } |
81 | 79 | ||
82 | void arch_post_mm_init(void) |
80 | void arch_post_mm_init(void) |
83 | { |
81 | { |
84 | aux_printf("arch_post_mm_init\n"); |
82 | aux_printf("arch_post_mm_init start()\n"); |
- | 83 | drivers_init(); |
|
85 | interrupt_init(); // needs malloc ... so after mm init |
84 | interrupt_init(); |
- | 85 | ||
86 | console_init(device_assign_devno()); // need hash table of irq ... so after irq_init |
86 | console_init(device_assign_devno()); |
- | 87 | //fb_init(0x12000000, 640, 480, 1920, VISUAL_RGB_8_8_8); |
|
87 | 88 | ||
88 | /* TODO */ |
- | |
89 | - | ||
90 | interrupts_enable(); |
89 | interrupts_enable(); |
91 | while(1); |
90 | // while(1); |
- | 91 | aux_printf("machine:\n", MACHINE ); |
|
- | 92 | aux_printf("arch_post_mm_init end()\n"); |
|
92 | } |
93 | } |
93 | 94 | ||
94 | void arch_post_cpu_init(void) |
95 | void arch_post_cpu_init(void) |
95 | { |
96 | { |
96 | /* TODO */ |
97 | /* TODO */ |