where does the actual code of exception handler reside in Linux?










0















This is from my textbook that describes how processor trigger exception handler:



enter image description here



and it says that:



The processor then triggers the exception by making an indirect procedure
call, through entry k of the exception table, to the corresponding handler. Figure 8.3 shows how the processor uses the exception table to form the address of the appropriate exception handler. The exception number is an index into the exception table, whose starting address is contained in a special CPU register called the exception table base register.



so my question is, where does the actual code of exception handler reside ? in kernel? and what about the exception table base register, is its content an adreess in kernel?










share|improve this question


























    0















    This is from my textbook that describes how processor trigger exception handler:



    enter image description here



    and it says that:



    The processor then triggers the exception by making an indirect procedure
    call, through entry k of the exception table, to the corresponding handler. Figure 8.3 shows how the processor uses the exception table to form the address of the appropriate exception handler. The exception number is an index into the exception table, whose starting address is contained in a special CPU register called the exception table base register.



    so my question is, where does the actual code of exception handler reside ? in kernel? and what about the exception table base register, is its content an adreess in kernel?










    share|improve this question
























      0












      0








      0








      This is from my textbook that describes how processor trigger exception handler:



      enter image description here



      and it says that:



      The processor then triggers the exception by making an indirect procedure
      call, through entry k of the exception table, to the corresponding handler. Figure 8.3 shows how the processor uses the exception table to form the address of the appropriate exception handler. The exception number is an index into the exception table, whose starting address is contained in a special CPU register called the exception table base register.



      so my question is, where does the actual code of exception handler reside ? in kernel? and what about the exception table base register, is its content an adreess in kernel?










      share|improve this question














      This is from my textbook that describes how processor trigger exception handler:



      enter image description here



      and it says that:



      The processor then triggers the exception by making an indirect procedure
      call, through entry k of the exception table, to the corresponding handler. Figure 8.3 shows how the processor uses the exception table to form the address of the appropriate exception handler. The exception number is an index into the exception table, whose starting address is contained in a special CPU register called the exception table base register.



      so my question is, where does the actual code of exception handler reside ? in kernel? and what about the exception table base register, is its content an adreess in kernel?







      linux exception-handling






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 2:58









      amjadamjad

      42710




      42710






















          1 Answer
          1






          active

          oldest

          votes


















          1














          This is a little out of my depth, but I found this Wikipedia article: Interrupt descriptor table. Quoting from there:




          [In real mode], in the 8086 processor, the interrupt table ... always resides at the same location in memory, ranging from 0x0000 to 0x03ff. On the 80286 and later, the size and locations of the IVT can be changed. ... The protected mode IDT may reside anywhere in physical memory.




          Regardless of where the exception table resides, I'm certain that it is memory reserved by the kernel, and likewise the exception handling functions are defined in the kernel source code; e.g. traps.c and related.



          Other references for further information related to but also going beyond this exact question:



          https://0xax.gitbooks.io/linux-insides/content/Interrupts/linux-interrupts-5.html
          https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s05.html
          http://en.tldp.org/LDP/khg/HyperNews/get/devices/exceptions.html



          NOTE: I am assuming we are talking about the x86 architecture here. As the Wikipedia article mentions, other chip architectures are likely to be similar, especially conceptually, but are also likely to differ in the details.






          share|improve this answer























          • Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

            – amjad
            Nov 16 '18 at 4:41










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53292553%2fwhere-does-the-actual-code-of-exception-handler-reside-in-linux%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          This is a little out of my depth, but I found this Wikipedia article: Interrupt descriptor table. Quoting from there:




          [In real mode], in the 8086 processor, the interrupt table ... always resides at the same location in memory, ranging from 0x0000 to 0x03ff. On the 80286 and later, the size and locations of the IVT can be changed. ... The protected mode IDT may reside anywhere in physical memory.




          Regardless of where the exception table resides, I'm certain that it is memory reserved by the kernel, and likewise the exception handling functions are defined in the kernel source code; e.g. traps.c and related.



          Other references for further information related to but also going beyond this exact question:



          https://0xax.gitbooks.io/linux-insides/content/Interrupts/linux-interrupts-5.html
          https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s05.html
          http://en.tldp.org/LDP/khg/HyperNews/get/devices/exceptions.html



          NOTE: I am assuming we are talking about the x86 architecture here. As the Wikipedia article mentions, other chip architectures are likely to be similar, especially conceptually, but are also likely to differ in the details.






          share|improve this answer























          • Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

            – amjad
            Nov 16 '18 at 4:41















          1














          This is a little out of my depth, but I found this Wikipedia article: Interrupt descriptor table. Quoting from there:




          [In real mode], in the 8086 processor, the interrupt table ... always resides at the same location in memory, ranging from 0x0000 to 0x03ff. On the 80286 and later, the size and locations of the IVT can be changed. ... The protected mode IDT may reside anywhere in physical memory.




          Regardless of where the exception table resides, I'm certain that it is memory reserved by the kernel, and likewise the exception handling functions are defined in the kernel source code; e.g. traps.c and related.



          Other references for further information related to but also going beyond this exact question:



          https://0xax.gitbooks.io/linux-insides/content/Interrupts/linux-interrupts-5.html
          https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s05.html
          http://en.tldp.org/LDP/khg/HyperNews/get/devices/exceptions.html



          NOTE: I am assuming we are talking about the x86 architecture here. As the Wikipedia article mentions, other chip architectures are likely to be similar, especially conceptually, but are also likely to differ in the details.






          share|improve this answer























          • Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

            – amjad
            Nov 16 '18 at 4:41













          1












          1








          1







          This is a little out of my depth, but I found this Wikipedia article: Interrupt descriptor table. Quoting from there:




          [In real mode], in the 8086 processor, the interrupt table ... always resides at the same location in memory, ranging from 0x0000 to 0x03ff. On the 80286 and later, the size and locations of the IVT can be changed. ... The protected mode IDT may reside anywhere in physical memory.




          Regardless of where the exception table resides, I'm certain that it is memory reserved by the kernel, and likewise the exception handling functions are defined in the kernel source code; e.g. traps.c and related.



          Other references for further information related to but also going beyond this exact question:



          https://0xax.gitbooks.io/linux-insides/content/Interrupts/linux-interrupts-5.html
          https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s05.html
          http://en.tldp.org/LDP/khg/HyperNews/get/devices/exceptions.html



          NOTE: I am assuming we are talking about the x86 architecture here. As the Wikipedia article mentions, other chip architectures are likely to be similar, especially conceptually, but are also likely to differ in the details.






          share|improve this answer













          This is a little out of my depth, but I found this Wikipedia article: Interrupt descriptor table. Quoting from there:




          [In real mode], in the 8086 processor, the interrupt table ... always resides at the same location in memory, ranging from 0x0000 to 0x03ff. On the 80286 and later, the size and locations of the IVT can be changed. ... The protected mode IDT may reside anywhere in physical memory.




          Regardless of where the exception table resides, I'm certain that it is memory reserved by the kernel, and likewise the exception handling functions are defined in the kernel source code; e.g. traps.c and related.



          Other references for further information related to but also going beyond this exact question:



          https://0xax.gitbooks.io/linux-insides/content/Interrupts/linux-interrupts-5.html
          https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s05.html
          http://en.tldp.org/LDP/khg/HyperNews/get/devices/exceptions.html



          NOTE: I am assuming we are talking about the x86 architecture here. As the Wikipedia article mentions, other chip architectures are likely to be similar, especially conceptually, but are also likely to differ in the details.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 14 '18 at 23:02









          landru27landru27

          787213




          787213












          • Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

            – amjad
            Nov 16 '18 at 4:41

















          • Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

            – amjad
            Nov 16 '18 at 4:41
















          Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

          – amjad
          Nov 16 '18 at 4:41





          Hi could you also look at this question, please? stackoverflow.com/questions/53331232/…

          – amjad
          Nov 16 '18 at 4:41



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53292553%2fwhere-does-the-actual-code-of-exception-handler-reside-in-linux%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo