[질문] GRUB 0.97 stage1.s 분석 중 이어지는 질문입니다;;

freestyle의 이미지

    184 lba_mode:
    185     /* save the total number of sectors */
    186     movl    0x10(%si), %ecx
    187
    188     /* set %si to the disk address packet */
    189     movw    $ABS(disk_address_packet), %si

앞선 내용은 얼렁뚱땅, 여차저차 도움도 받으며
해석했습니다.

그런데, 또다시 질문 올리기 죄송스러워서 혼자 힘으로 해결해 보려 하였으나..
며칠동안 끙끙대기만 하고 해결을 못해 다시 질문 올립니다.

186번째 라인, 아무리 생각해 봐도 의미없는 라인 같은데 정말 그런지요?
저 ecx 레지스터가 어디서 쓰일일도 없고,

185번째 라인의 주석을 봐도 어떻게 해도 저것이 전체 섹터를
의미할 수 있는지 모르겠습니다. OTL

아래에서 %si 레지스터는 000017e의 GRUB을 가리키고 있을텐데 말이죠.
01CA~01CD가 첫번째 partition의 전체 섹터의 파티션 크기라 그것을
가리킬 거라 예상하고 아무리 연관관계를 찾아도 찾지 못하겠네요.

설마 grub 배포소스에 불필요한 내용이 있을까만은, 설마가 사람잡는다고
그 '설마'가 정말인가요?

[root@2KW stage1]# dd bs=512 count=1 if=/dev/sda | od -Ax -tx1z -v
000000 eb 48 90 d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c  >.H....|.P.P....|<
000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb be be 07 b1 04  >...PW...........<
000020 38 2c 7c 09 75 15 83 c6 10 e2 f5 cd 18 8b 14 8b  >8,|.u...........<
000030 ee 83 c6 10 49 74 16 38 2c 74 f6 be 10 07 03 02  >....It.8,t......<
000040 80 00 00 80 dd 59 00 00 00 08 fa 90 90 f6 c2 80  >.....Y..........<
000050 75 02 b2 80 ea 59 7c 00 00 31 c0 8e d8 8e d0 bc  >u....Y|..1......<
000060 00 20 fb a0 40 7c 3c ff 74 02 88 c2 52 be 7f 7d  >. ..@|<.t...R..}<
000070 e8 34 01 f6 c2 80 74 54 b4 41 bb aa 55 cd 13 5a  >.4....tT.A..U..Z<
000080 52 72 49 81 fb 55 aa 75 43 a0 41 7c 84 c0 75 05  >RrI..U.uC.A|..u.<
000090 83 e1 01 74 37 66 8b 4c 10 be 05 7c c6 44 ff 01  >...t7f.L...|.D..<
0000a0 66 8b 1e 44 7c c7 04 10 00 c7 44 02 01 00 66 89  >f..D|.....D...f.<
0000b0 5c 08 c7 44 06 00 70 66 31 c0 89 44 04 66 89 44  >\..D..pf1..D.f.D<
0000c0 0c b4 42 cd 13 72 05 bb 00 70 eb 7d b4 08 cd 13  >..B..r...p.}....<
0000d0 73 0a f6 c2 80 0f 84 ea 00 e9 8d 00 be 05 7c c6  >s.............|.<
0000e0 44 ff 00 66 31 c0 88 f0 40 66 89 44 04 31 d2 88  >D..f1...@f.D.1..<
0000f0 ca c1 e2 02 88 e8 88 f4 40 89 44 08 31 c0 88 d0  >........@.D.1...<
000100 c0 e8 02 66 89 04 66 a1 44 7c 66 31 d2 66 f7 34  >...f..f.D|f1.f.4<
000110 88 54 0a 66 31 d2 66 f7 74 04 88 54 0b 89 44 0c  >.T.f1.f.t..T..D.<
000120 3b 44 08 7d 3c 8a 54 0d c0 e2 06 8a 4c 0a fe c1  >;D.}<.T.....L...<
000130 08 d1 8a 6c 0c 5a 8a 74 0b bb 00 70 8e c3 31 db  >...l.Z.t...p..1.<
000140 b8 01 02 cd 13 72 2a 8c c3 8e 06 48 7c 60 1e b9  >.....r*....H|`..<
000150 00 01 8e db 31 f6 31 ff fc f3 a5 1f 61 ff 26 42  >....1.1.....a.&B<
000160 7c be 85 7d e8 40 00 eb 0e be 8a 7d e8 38 00 eb  >|..}.@.....}.8..<
000170 06 be 94 7d e8 30 00 be 99 7d e8 2a 00 eb fe 47  >...}.0...}.*...G<
000180 52 55 42 20 00 47 65 6f 6d 00 48 61 72 64 20 44  >RUB .Geom.Hard D<
000190 69 73 6b 00 52 65 61 64 00 20 45 72 72 6f 72 00  >isk.Read. Error.<
0001a0 bb 01 00 b4 0e cd 10 ac 3c 00 75 f4 c3 00 00 00  >........<.u.....<
0001b0 00 00 00 00 00 00 00 00 44 ca 44 ca 00 00 80 01  >........D.D.....<
0001c0 01 00 83 fe 3f 0c 3f 00 00 00 8e 2f 03 00 00 00  >....?.?..../....<
0001d0 01 0d 8e fe ff ff cd 2f 03 00 29 10 c2 04 00 00  >......./..).....<
0001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
0001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa  >..............U.<
000200

cppig1995의 이미지

stage1.S 내에서는 다시 안 쓰는 게 맞는 것 같습니다만...



한말글 프로그래밍 언어 "열정" http://me-lang.wo.tc

Real programmers /* don't */ comment their code.
If it was hard to write, it should be /* hard to */ read.

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.