MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_board_init

Function rt_hw_board_init

bsp/x86/drivers/board.c:50–80  ·  view source on GitHub ↗

* This function will init QEMU * */

Source from the content-addressed store, hash-verified

48 *
49 */
50void 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
82static int reboot(void)
83{

Callers

nothing calls this directly

Calls 9

rt_hw_clear_bssFunction · 0.85
rt_console_set_deviceFunction · 0.85
outbFunction · 0.85
rt_system_heap_initFunction · 0.85
rt_thread_idle_sethookFunction · 0.85
rt_hw_console_initFunction · 0.70
rt_hw_interrupt_initFunction · 0.50
rt_hw_interrupt_installFunction · 0.50
rt_hw_interrupt_umaskFunction · 0.50

Tested by

no test coverage detected