Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:04:49+00:00 2026-05-28T17:04:49+00:00

I am doing so research trying to find the code in the Linux kernel

  • 0

I am doing so research trying to find the code in the Linux kernel that implements interrupt handling; in particular, I am trying to find the code responsible for handling the system timer.

According to http://www.linux-tutorial.info/modules.php?name=MContent&pageid=86

The kernel treats interrupts very similarly to the way it treats exceptions: all the general >purpose registers are pushed onto the system stack and a common interrupt handler is called. >The current interrupt priority is saved and the new priority is loaded. This prevents >interrupts at lower priority levels from interrupting the kernel while it handles this >interrupt. Then the real interrupt handler is called.

I am looking for the code that pushes all of the general purpose registers on the stack, and the common interrupt handling code.

At least pushing the general purpose registers onto the stack is architecture independent, so I’m looking for the code that is associated with the x86 architecture. At the moment I’m looking at version 3.0.4 of the kernel source, but any version is probably fine. I’ve gotten started looking in kernel/irq/handle.c, but I don’t see anything that looks like saving the registers; it just looks like it is calling the registered interrupt handler.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:04:51+00:00Added an answer on May 28, 2026 at 5:04 pm

    I am looking for the code that pushes all of the general purpose registers on the stack

    Hardware stores the current state (which includes registers) before executing an interrupt handler. Code is not involved. And when the interrupt exits, the hardware reads the state back from where it was stored.

    Now, code inside the interrupt handler may read and write the saved copies of registers, causing different values to be restored as the interrupt exits. That’s how a context switch works.


    On x86, the hardware only saves those registers that change before the interrupt handler starts running. On most embedded architectures, the hardware saves all registers. The reason for the difference is that x86 has a huge number of registers, and saving and restoring any not modified by the interrupt handler would be a waste. So the interrupt handler is responsible to save and restore any registers it voluntarily uses.

    See Intel® 64 and IA-32 Architectures
    Software Developer’s Manual
    , starting on page 6-15.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, after doing a ton of research and trying almost every managed CPP Redist
I have a blogengine.net install that requires privatization. I'm doing research work at the
I'm doing some research on the feasibility of an iPhone application, and can't find
I've been doing a fair amount of research on this, and can't find a
I am trying to find friends who have already installed the application. After doing
I am doing research on a SOA topic and i am trying to understand
I have been doing a lot of research trying to figure this out, but
I'm new to web programming and doing different tutorials that I can find on
I have been doing some research lately over my work project, i am trying
After doing some research about namespacing in PHP I'm trying to figure out what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.