ARM 부트 소스 수정중에 의문점이 있습니다.

radiocallas의 이미지

--------------------------------------------------------------------
(gdb) si
0x5c8 in ProtectionDisable ()
1: x/i $pc 0x5c8 : msr cpsr_ctl, r0
(gdb) info register
r0 0x10 16
r1 0xf003001c -268238820
r2 0xf003ff00 -268173568
r3 0x6fbffdf1 1874853361
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x0 0
r8 0x0 0
r9 0x0 0
r10 0x0 0
r11 0xa5cc 42444
r12 0xa610 42512
sp 0xa5cc 42444
lr 0x237c 9084
pc 0x5c8 1480
fps 0x0 0
cpsr 0x200000d3 536871123
(gdb) si
0x5cc in ProtectionDisable ()
1: x/i $pc 0x5cc : swi 0x000000ff
(gdb) info register
r0 0x10 16
r1 0xf003001c -268238820
r2 0xf003ff00 -268173568
r3 0x6fbffdf1 1874853361
r4 0x0 0
r5 0x0 0
r6 0x0 0
r7 0x0 0
r8 0x0 0
r9 0x0 0
r10 0x0 0
r11 0xbfffffff -1073741825
r12 0xa610 42512
sp 0xbfffffff -1073741825
lr 0xbfffffdb -1073741861
pc 0x5cc 1484
fps 0x0 0
cpsr 0x20000010 536870928
(gdb) si
q
0xffff000c in ?? ()
1: x/i $pc 0xffff000c: Cannot access memory at address 0xffff000c
Disabling display 1 to avoid infinite recursion.
(gdb) q
--------------------------------------------------------------------

s3c2510a 칩을 사용하는 보드에 이미 어느정도 되어 있는 부트 코드를 수정해서 넣고 있습니다.(armboot에서 Start.S만 가져왔습니다.) 그러던중에 어셈에서 'SWI 0xff' 명령으로 소프트웨어 인트럽터를 호출했는데, '0x8'에 위치한 벡터 테이블로 안갑니다. 'swi 0xff'를 실행하면, 멈춰서 'Ctrl+c'로 빠져나오면, 위 GDB로 디버깅한 것에서 보시는 것처럼 Abort 오류를 '0xffff000c' 상위 벡터 테이블 주소로 넘어가게 되는데, 그 주소에는 아무것도 없으니, 위에서 처럼 액서스 할 수 없다는 메시지를 출력합니다.

참고로 'b 0x8'을 'swi 0xff'대신 넣으면 잘넘아 갑니다. 그래서 생각한것이 swi명령이 '0x8'이 아닌 '0xffff0008'로 가는게 아닌가 해서 이렇게 질문드립니다. 혹, 제가 짐작한게 맞다면, 상위 벡터 테이블로 설정된 것을 원래대로 되돌리는 방법과 위에서 처럼 상위 벡터 테이블로 가게 하는 방법을 알고 싶습니다.

powerc20의 이미지

간단하게 말씀드리면 cp15 register 1 에 보면 13번 비트가 VINITHI란 비트입니다.
0이면 exception vector의 주소가 0x0 이고 1이면 0xffff0000이 됩니다.'

수정 방법은 해당 arm processor TRM을 참조하세요. trm 은 www.arm.com에 있습니다.

즐거운 하루 되세요.

radiocallas의 이미지

reset하는 소스에서 CP15 레지스터 설정하는 부분 마지막에 아래처럼 추가해서 처리했더니, 제대로 벡터테이블을 찾아가네요.

@ cp15 Register1 [13] = 1: 상위벡터 0: 하위벡터
mrc p15, 0, r0, c1, c0, 0
and r0, r0, #0xffffdfff
mcr p15, 0, r0, c1, c0, 0

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.