很不順, 照著書上跑 skyeye 執行 helloworld.c 竟然給我這個:
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x806dee0
SKYEYE: use arm920t mmu ops
**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************
Your elf file is little endian.
uart_mod:0, desc_in:, desc_out:, converter:
Loaded RAM ./helloworld.bin
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 7, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 13, mem_read_word addr = fffffff8 no bank
^DSKYEYE:Error in mem_read_word, no bank found, NumInstrs 16, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 19, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 25, mem_read_word addr = fffffff8 no bank
^DSKYEYE:Error in mem_read_word, no bank found, NumInstrs 28, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 31, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 37, mem_read_word addr = fffffff8 no bank
^DSKYEYE:Error in mem_read_word, no bank found, NumInstrs 40, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 43, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 49, mem_read_word addr = fffffff8 no bank
^DSKYEYE:Error in mem_read_word, no bank found, NumInstrs 52, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 55, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 61, mem_read_word addr = fffffff8 no bank
^DSKYEYE:Error in mem_read_word, no bank found, NumInstrs 64, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 67, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 73, mem_read_word addr = fffffff8 no bank
^DSKYEYE:Error in mem_read_word, no bank found, NumInstrs 76, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 79, mem_read_word addr = fffffff8 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 85, mem_read_word addr = fffffff8 no bank
我嚇傻了, 怎麼這樣勒?
不過我可不是在重複說明人家已經知道的事情, 我要來討論為什麼 stack 沒設定會產生這種結果? 下面是反組譯的程式碼, 看不懂 arm 組合語言是吧? 我也是, 所以只看這行 (L8) 就好 ...
還沒找到類似 bochs 的模擬器, 只好用猜的, 看看
8 0: e52db004 push {fp} ; (str fp, [sp, #-4]!)
push 指令會動到 stack, 那從 helloworld.c 有看到那行在設定 stack 嗎?沒有, 所以 stack 可能在某塊不能存取的地方, 恭喜踩到地雷, 連結提到的 stack 位址因為沒有好用的模擬器可用來觀察, 就只能先相信了。而實際上把這段 stack 位址補上也的確能正常執行。
沒有留言:
張貼留言
使用 google 的 reCAPTCHA 驗證碼, 總算可以輕鬆留言了。
我實在受不了 spam 了, 又不想讓大家的眼睛花掉, 只好放棄匿名留言。這是沒辦法中的辦法了。留言的朋友需要有 google 帳號。