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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:28:35+00:00 2026-05-26T19:28:35+00:00

I try to build an IDT, after sti execution, the code crashes !! I

  • 0

I try to build an IDT, after sti execution, the code crashes !!

I have an error message :
SingleStep CPU[1] Error : Processor Running

Remark: I use micro Atom with eclipse Helios, the assembly is AT&T

/** *********** New code *********/

New code after I found that the BIOS puts the atom in the protected mode (CR0.PE = 1) and generates IDT/GDT :

The idea is just to use an ISR with APIC timer.

/*Change the address of idt_entries table */
fill_interrupt(ISR_Nbr,(unsigned int) isr33, 0x08, 0x8E);


static void fill_interrupt(unsigned char num, unsigned int base, unsigned short sel, unsigned char flags)
{
    unsigned short *Interrupt_Address;

    /*address = idt_ptr.base + num * 8 byte*/
    Interrupt_Address = (unsigned short *)(idt_ptr.base + num*8);

    *(Interrupt_Address) = base&0xFFFF;
    *(Interrupt_Address+1) = sel;
    *(Interrupt_Address+2) = (flags<<4)&0xFF00;
    *(Interrupt_Address+3) = (base>>16)&0xFFFF;

}

/*********************End new code *********************/

    idt_flush:
push %ebp   //save the context to swith back
mov %esp,%ebp

cli

mov $idt_ptr, %eax //Get the pointer to the IDT, passed as parameter
lidt    (%eax)         //Load the IDT pointer

sti

pop %ebp               //Return to the calling function
ret

What is wrong ???

see the rest of the code:

isr33:
    push %ebp   //save the context to swith back
    mov %esp,%ebp




    pop %ebp //Return to the calling function
    ret


static void init_idt()
{
    int iIndex;


    //Link the IDTR to IDT
    idt_ptr.limit = sizeof(idt_entry_t)*256-1;
    idt_ptr.base = (unsigned int)&idt_entries;

    idt_set_gate(0,(unsigned int) isr0, 0x00, 0xEE);
    for ( iIndex=1; iIndex<32; iIndex++)
    {
        idt_set_gate(iIndex,(unsigned int) isr0, 0x00, 0x00);

    }
    idt_set_gate(ISR_Nbr,(unsigned int) isr33, 0x00, 0xEE);

    //idt_flush((unsigned int)&idt_ptr);
    idt_flush();

}

static void idt_set_gate(unsigned char num, unsigned int base, unsigned short sel, unsigned char flags)
{
    idt_entries[num].base_lo = base&0xFFFF;
    idt_entries[num].base_hi = (base>>16)&0xFFFF;

    idt_entries[num].sel = sel;
    idt_entries[num].always0 = 0;

    idt_entries[num].flags = flags;
}



//IDT
struct idt_entry_struct
{
    unsigned short base_lo;
    unsigned short sel;
    unsigned char always0;
    unsigned char flags;
    unsigned short base_hi;
}__attribute__((packed));
typedef struct idt_entry_struct idt_entry_t;

//IDT register
struct idt_ptr_struct
{
    unsigned short limit;
    unsigned int base;
}__attribute__((packed));
typedef struct idt_ptr_struct idt_ptr_t;

//ISR number
int ISR_Nbr = 33;
  • 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-26T19:28:35+00:00Added an answer on May 26, 2026 at 7:28 pm

    Resolved, As I use a N450 Atom board, it has already a BIOS, the BIOS makes the IDT and GDT, all I have to do it is just to now where they are by reading thier adressess with : sidt (for IDT) and sgdt (for GDT).

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

Sidebar

Related Questions

I am getting this error when I try to build for the device: Code
I'm getting an error message when I try to build my project in eclipse:
Please i have this error when i try to build my project : duplicate
When I try to build my project I get the following message in the
I've included: #import QuartzCore/QuartzCore.h but when I try to build, I get the error
I try to build a menu using the datatype hierarchyid . I have the
I get the following errors when I try to build this project: error C2182:
I try to build subproject ExplorerPlugin from mDNSResponder-107.6.tar.gz archive but receive next link error:
When I try to build my application XCode shows me this error Expected (
I try to build an iPhone app with command line. I have a problem

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.