#include "uart.h" #include "io.h" #include "demo_functionality.h" #include "paging.h" #include "atags.h" void setup(uint32_t r0, uint32_t machine_type, struct atag_header *atags) { uart_init(); // When we attach screen session after loading kernel with socat // we miss kernel's greeting... So we'll make the kernel wait for // one char we're going to send from within screen //getchar(); puts("Hello, kernel World!"); prints("ARM machine type: 0x"); printhext(machine_type); puts(""); // value 3 introduced by stage1 code means no atags was found if (r0 == 3) puts("No ATAGS was found!"); else { prints("ATAGS copied to 0x"); printhex((uint32_t) atags); puts(""); puts("__ ATAGS contents __"); print_atags(atags); puts("__ end of ATAGS contents __"); } // prints some info demo_paging_support(); // prints some info demo_current_mode(); // prints some info and sets upp translation table, turns on MMU setup_flat_map(); // prints some info and sets up a section for PL0 code, // loads a blob there demo_setup_PL0(); // jumps to unprivileged code... never, ever, ever returns demo_go_unprivileged(); while (1) { char c = getchar(); if (c == '\r') putchar('\n'); putchar(c); } }