* This function will init QEMU * */
| 48 | * |
| 49 | */ |
| 50 | void rt_hw_board_init(void) |
| 51 | { |
| 52 | /* clear .bss */ |
| 53 | rt_hw_clear_bss(); |
| 54 | |
| 55 | /* init hardware interrupt */ |
| 56 | rt_hw_interrupt_init(); |
| 57 | |
| 58 | /* init the console */ |
| 59 | rt_hw_console_init(); |
| 60 | rt_console_set_device("console"); |
| 61 | |
| 62 | /* initialize 8253 clock to interrupt 1000 times/sec */ |
| 63 | outb(TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT); |
| 64 | outb(IO_TIMER1, TIMER_DIV(RT_TICK_PER_SECOND) % 256); |
| 65 | outb(IO_TIMER1, TIMER_DIV(RT_TICK_PER_SECOND) / 256); |
| 66 | |
| 67 | /* install interrupt handler */ |
| 68 | rt_hw_interrupt_install(INTTIMER0, rt_timer_handler, RT_NULL, "tick"); |
| 69 | rt_hw_interrupt_umask(INTTIMER0); |
| 70 | |
| 71 | /* init memory system */ |
| 72 | #ifdef RT_USING_HEAP |
| 73 | /* RAM 16M */ |
| 74 | rt_system_heap_init((void *)&__bss_end, (void *)(1024UL*1024*8)); |
| 75 | #endif |
| 76 | |
| 77 | #ifdef RT_USING_HOOK |
| 78 | rt_thread_idle_sethook(idle_hook); |
| 79 | #endif |
| 80 | } |
| 81 | |
| 82 | static int reboot(void) |
| 83 | { |
nothing calls this directly
no test coverage detected