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

  • SEARCH
  • Home
  • 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 615039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:10:36+00:00 2026-05-13T18:10:36+00:00

What happens (in detail) when a thread makes a system call by raising interrupt

  • 0

What happens (in detail) when a thread makes a system call by raising interrupt 80? What work does Linux do to the thread’s stack and other state? What changes are done to the processor to put it into kernel mode? After running the interrupt handler, how is control restored back to the calling process?

What if the system call can’t be completed quickly: e.g. a read from disk. How does the interrupt handler relinquish control so that the processor can do other stuff while data is being loaded and how does it then obtain control again?

  • 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-13T18:10:36+00:00Added an answer on May 13, 2026 at 6:10 pm

    A crash course in kernel mode in one stack overflow answer

    Good questions! (Interview questions?)


    • What happens (in detail) when a
      thread makes a system call by raising
      interrupt 80?

    The int $80 operation is vaguely like a function call. The CPU “takes a trap” and restarts at a known address in kernel mode, typically with a different MMU mode as well. The kernel will save many of the registers, though it doesn’t have to save the registers that a program would not expect an ordinary function call to save.

    • What work does Linux do to the
      thread’s stack and other state?

    Typically an OS will save registers that the ABI promises not to change during procedure calls. The stack will stay the same; the kernel will run on a per-thread kernel stack rather than the per-thread user stack. Naturally some state will change, otherwise there would be no reason to do the system call.

    • What changes are done to the
      processor to put it into kernel mode?

    This is usually entirely automatic. The CPU has, generically, a software-interrupt instruction that is a bit like a functional-call operation. It will cause the switch to kernel mode under controlled conditions. Typically, the CPU will change some sort of PSW protection bit, save the old PSW and PC, start at a well-known trap vector address, and may also switch to a different memory management protection and mapping arrangement.

    • After running the interrupt handler,
      how is control restored back to the
      calling process?

    There will be some sort of “return from interrupt” or “return from trap” instruction, typically, that will act a bit like a complicated function-return instruction. Some RISC processors did very little automatically and required specific code to do the return and some CISC processors like x86 have (never-really-used) instructions that would execute dozens of operations documented in pages of architecture-manual pseudo-code for capability adjustments.

    • What if the system call can’t be
      completed quickly: e.g. a read from
      disk. How does the interrupt handler
      relinquish control so that the
      processor can do other stuff while
      data is being loaded and how does it
      then obtain control again?

    The kernel itself is threaded much like a threaded user program is. It just switches stacks (threads) and works on someone else’s process for a while.

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

Sidebar

Related Questions

What happens when a thread is put to sleep by other thread, possible by
What happens in the following code? Does the synchronization work? This is an interview
What happens if I call startUpdatingLocation while startMonitoringSignificantLocationChanges is running? Does significantLocationChange monitoring get
What happens when an application pool is recycled in IIS 7? Does IIS abruptly
Django happens to have a Signals system built in and it would be quite
I work with C++ in emacs, and it works perfect, except for a detail
What happens in the following example? struct B { }; struct D1 : B
What happens to http requests that are being processed when you stop or restart
What happens is, I am fetching the data from web service. Simultaneously 6 async
This happens almost every time I init a new repo. Start a new project.

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.