Thread: how and where is int_bottom invoked?

  1. #1
    Registered User
    Join Date
    Jan 2024
    Posts
    23

    how and where is int_bottom invoked?

    Hello,

    I am following along a tutorial on operating systems and do not understand where in the code the "int_bottom" routine is invoked (it is written in interrupstubs.s).
    Can someone tell me how/where it is invoked? Thanks!

    this is the tutorial, the code is written first in commit number 5:
    Files for part 5, https://www.youtube.com/watch?v=AgeX-U4dKSs * AlgorithMan-de/wyoos@01557ac * GitHub

    you can go to commit number 5 by cloning this repository and executing
    git checkout 01557ac3b68bc7f9e39e76d4b4bf2fdbe627ce3d to reset to commit number 5.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,670
    They're assembler macros.
    Code:
    .macro HandleException num
    .global _ZN16InterruptManager19HandleException\num\()Ev
    _ZN16InterruptManager19HandleException\num\()Ev:
        movb $\num, (interruptnumber)
        jmp int_bottom
    .endm
    Which then gets invoked by the assembler to generate a whole bunch of interrupt handlers.
    Code:
    HandleException 0x00
    HandleException 0x01
    HandleException 0x02
    HandleException 0x03
    // etc etc
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2024
    Posts
    23
    thanks for your reply. This I understood but I mean the "int_bottom" routine as I wrote. Nowhere in the code do I see a jump to "int_bottom". I know that a hardware interrupt writes the interrupt vector onto the pci and then the cpu is switched into interrupt mode. It somehow fetches the interrupt vector from the pci but then where is the piece of code that sets the instruction pointer to "int_bottom"?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,670
    What do you think 'jmp int_bottom' does?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jan 2024
    Posts
    23
    oh wow ouch... thank you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. passing nullable type to a P/invoked function
    By WDT in forum C# Programming
    Replies: 3
    Last Post: 06-27-2009, 08:48 AM
  2. how to get all invoked system API of a program
    By George2 in forum C Programming
    Replies: 3
    Last Post: 07-21-2006, 09:39 AM
  3. Replies: 2
    Last Post: 05-31-2006, 02:12 AM

Tags for this Thread