自己動手做OS, micro kernel develop on Beagleboard-XM(ARMv7) lab3 Initialize stack pointer and printk
lab3,Happy Moon Festival!!! We'll study how to initial stack
and add a printk function for debug in lab3.
終於有點空閒時間了,大家中秋節快樂,
這個例子練習了ARM在開機時initial stack的部份,
並加入了一個printk的功能,以便日後debug.
I just give some notes for now.
start.S -
__vector_reset will invoke when boot,
it will initialize stack pointer then clear bss section
and then invoke plat_boot function to print helloworld.
開始後會跳到__vector_reset去進行stack initial的動作
,然後初始化bss段,跳到plat_boot去動作。
boots.c
It will print helloworld and invoke test_printk function.
會印出helloworld並呼叫 test_printk。
source code download (原始碼下載):
https://github.com/tzuCarlos/v1OS.git
further study:
Jserv's CuRTOS give us a nice ARM boot asm example, we'll need to disable MMU, setup stack, timer, interrupt and some hardwares. though bootloader already did some during boot, but for portal reason, a nice OS still need to initial by itself.
請先看Jserv大,寫的CuRTOS的啟動程式部份,裡面有很詳細的註解,不過今天我們只有做stack的配置。
https://github.com/jserv/CuRT/blob/master/arch/arm/mach-pxa/start.S
參考資料:
Jesrv, CuRTOS, https://github.com/jserv/CuRT
王佑中博士,CuRTOS解析, https://sites.google.com/site/embedded2009/introduction-to-curt-v1
http://www.bravegnu.org/gnu-eprog/c-startup.html#_stack
留言