OS에 대해 질문입니다....

winner788의 이미지

현재 만든면서 배우는 OS 커널의 구조와 원리 라는 책으로 공부해서 내용을 추가하고 있습니다.
현재 OS의 구성은
boot.bin 1섹터
setup.bin 2섹터
kernel.bin 11섹터
user_programN.bin 각각 2섹터 (총4개)
이렇게 구성되어 있습니다.

현제 문제점은 커널의 용량을 12섹터까지 늘리면 괜잖은데 13~14섹터로 늘어나면 오류가 납니다...
또 15섹터로 맞추면 오류가 안나구요...
당연이 섹터 계산은 정확하게 했습니다.
문제점을 모르겠습니다...

소스의 다운로드 주소입니다.
http://www.hanb.co.kr/web/example/1325/Source.zip

익명 사용자의 이미지

출판사의 예제 링크를 걸지 마시고 문제가 있는 소스 코드를 올려주시는 게 좋을 듯 합니다.
예제 커널 소스로는 13섹터 이상의 크기를 갖는 커널 코드를 만들 수도 없을뿐더러 그 사이에 무슨 변경사항이 있었는지 재현할 수도 없습니다. 더불어 어떤 식으로 문제가 발생하는지 상세하게 적어주셔야 뭐가 문제인지 짐작이라도 할 수 있겠죠. (오류의 형태에 대한 정확한 설명 - '시스템이 폭주한다' 또는 '~한 오류 메시지가 나온다' 등)

winner788의 이미지

출판사의 소스에서 13섹터로 늘려도 오류가 납니다...
즉 interrupt.asm 마지막에
times 512*2 db 0

이러한 형식으로 컴파일후 vmware에서 돌리면 아래와 같은 오류가 납니다.

*** Virtual machine kernel stack fault (hardware reset) ***
The virtual machine just suffered a stack fault in kernel mode. On a real computer, this would amount to a reset of the processor. It can be caused by an incorrect configuration of the virtual machine, a bug in the operating system, or a problem in the VMware Workstation software. Press OK to reboot virtual machine or Cancel to shut it down.

그래서 커널 스택이 부족한가 해서 커널자체의 스택도 늘려봤는데 안되더군요..
또한 GCC에서 컴파일할때 스택을 512K로 지정한다는(?) 말이 들려서 여러가지 알아봐서 stubedit라는 툴로도 스택(?)을 늘려도 보고 했지만 해결되지가 않았습니다...

익명 사용자의 이미지

init.inc 파일에 보시면 다음과 같이 커널의 Sector 수가 미리 상수값으로 정의되어 있는 것을 알 수 있습니다.

NumKernelSector  equ 11

즉, 늘어난 커널 크기를 인식하지 못하고 11 섹터만 읽으니 프로그램이 폭주한 겁니다.
Boot Sector와 커널 앞부분 코드를 조금 변경해서 커널의 크기를 가변할 수 있게 프로그램 해 주면 되겠네요.

winner788의 이미지

커널의 용량이 늘어남에 따라 init.inc에서도 커널의 용량을 계산해서 커널의 크기만큼 읽게 하였습니다.
또 한 커널의 용량으로 밀려난 유저프로그램도 그에 맞게 수정하였습니다만.... 그래도 문제가 나더군요 ㅠㅠ;;

댓글 달기

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