自己動手做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

留言

jserv寫道…
好期待,這是教材嗎?
karose寫道…
作者已經移除這則留言。
karose寫道…
Jserv,這是受到您啟發,自己學習的筆記,我希望一步步的記錄,供大家討論學習。 抱歉筆記中英文夾雜,因為跟一位泰國朋友約好,他要寫android相關文章,他也是您0xlab的粉絲。

這個網誌中的熱門文章

Raspberry Pi (ARMv6)上自幹一個微小作業系統

C語言,大數運算,階層筆記

Linux VLAN 筆記