Rev 887 | Rev 913 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 887 | Rev 888 | ||
|---|---|---|---|
| Line 29... | Line 29... | ||
| 29 | #include "main.h" |
29 | #include "main.h" |
| 30 | #include "printf.h" |
30 | #include "printf.h" |
| 31 | #include "ofw.h" |
31 | #include "ofw.h" |
| 32 | 32 | ||
| 33 | #define KERNEL_LOAD_ADDRESS 0x800000 |
33 | #define KERNEL_LOAD_ADDRESS 0x800000 |
| 34 | #define KERNEL_SIZE _binary_____________kernel_kernel_bin_size |
34 | #define KERNEL_SIZE ((unsigned int) &_binary_____________kernel_kernel_bin_end - (unsigned int) &_binary_____________kernel_kernel_bin_start) |
| 35 | 35 | ||
| 36 | static void halt(void) |
36 | static void halt(void) |
| 37 | { |
37 | { |
| 38 | while (1); |
38 | while (1); |
| 39 | } |
39 | } |
| 40 | 40 | ||
| 41 | void bootstrap(void) |
41 | void bootstrap(void) |
| 42 | { |
42 | { |
| 43 | printf("\nHelenOS PPC Bootloader\nKernel size %d, load address %L\n", KERNEL_SIZE, KERNEL_LOAD_ADDRESS); |
43 | printf("\nHelenOS PPC Bootloader\nKernel size %d bytes, load address %L\n", KERNEL_SIZE, KERNEL_LOAD_ADDRESS); |
| 44 | 44 | ||
| 45 | void *addr = ofw_claim((void *) KERNEL_LOAD_ADDRESS, KERNEL_SIZE, 1); |
45 | void *addr = ofw_claim((void *) KERNEL_LOAD_ADDRESS, KERNEL_SIZE, 1); |
| 46 | if (addr == NULL) { |
46 | if (addr == NULL) { |
| 47 | printf("Error: Unable to claim memory"); |
47 | printf("Error: Unable to claim memory"); |
| 48 | halt(); |
48 | halt(); |