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 8991463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:43:56+00:00 2026-06-15T22:43:56+00:00

I am working on a small kernel as a project for my University. I

  • 0

I am working on a small kernel as a project for my University.
I have overridden (not sure if that’s the correct expression) a timer interrupt routine.

It works well until the first context switching. Context switching is in dispatch() which is called when a process uses all of its appointed time (time out).

My routine is initialized just before main process starts and it should restore after it’s done (although I never got to that).
I also tried initializing it every time a process is started and restoring it during context switching or when that process ends. I tried this because I have a completed project from 2005 (slightly different) which I look up to for ideas, not copy-pasting.

Timer interrupt:

void interrupt System::timer(...){
intOff;
    cout << currentTime << "\n";
    currentTime++;

    if(System::runningTime){
        System::runningTime--;
        if(!System::runningTime) {
          dispatch();
        }
    }
    else asm int 60h;
intOn;
}

initializing new and restoring old routine:

void System::init(){
  cout << "init\n";
  oldTimer = getvect(0x1c);
  setvect(0x1c, &timer);
  setvect(0x60, oldTimer);
}
void System::restore(){
  cout << "restore " << System::running->getName() << System::running->getID() << "\n";
  setvect(0x1c, oldTimer);
}

Process that I run:

void run(){
            cout << "Test" << mod << " time:" << System::currentTime << "\n";
        while(System::currentTime < 100){
        br++;
        }
    }

//mod is like id

When I run the program I get:

init
Test1 time:0 //from process one, indication it has begun, it has permission to run for 2 cycles, current time is 0

0 //current time on the start of timer routine

1 //current time on the start of timer routine

Test2 time:2 //from process two, it has begun, permission to run for 2 cycles, current time is 2 as expected

I have put cout << System::currentTime; in run() after br++. What I got was “2” geting printed to infinity. That is a indication that currentTime doesn’t get increased, which means that my timer routine is not called anymore.

I have looked on this problem from various angles, tried various methods and nothing worked. Any and every idea is appreciated. [:

  • 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-06-15T22:43:58+00:00Added an answer on June 15, 2026 at 10:43 pm

    I didn’t think about sending the End-of-interrupt signal to the interrupt controller. Just needed to add

    asm {
    push ax
    in al, 0x61
    or al, 0x80 // 10000000b
    out 0x61, al
    and al, 0x7F // 01111111b
    out 0x61, al
    mov al, 0x20
    out 0x20, al
    pop ax
    }
    

    and now works like a charm.

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

Sidebar

Related Questions

Im working on a small application to try out an idea that I have.
I'm working on a small uni project where I have a program for a
I have a java project that I'm working on which was working until a
We have service that's working with small to large sets of data (document generation),
Im working on a small project. What Im trying to Do, is Have a
Iam working on small booking room system. In my solution I have a Reservation
I am working on small python payroll project where you enter employee name, wage,
I'm working on a small app that uses the Facebook API. What I want
I am writing small kernel for the 8086 processor (Working in BC3.1, on Windows
I am working with small application for display bubbles images on android screen.I have

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.