OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:03 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: DBGF: No debugger attached
PostPosted: Thu Jan 02, 2020 2:56 am 
Offline

Joined: Thu Jan 02, 2020 2:24 am
Posts: 2
[wiki]DBGF: No debugger attached, waiting 1 second for one to attach (event=100)
1.Stopping the VM![/wiki]

---------------------------------------------------------------------------------------------------
Hi my friends :D
I am a new member of this forum and this is my first topic [-o<
My question : I've developing a simple OS with C++ and ASM Language in Linux Mint and run my OS on VirtualBox .
In Interrupts part when i want run my OS i get a this error : ((DBGF: No debugger attached, waiting 1 second for one to attach (event=100)
1.Stopping the VM!))
:oops: :oops:


Image
[img]http://s6.picofile.com/file/8383613126/Capture2.PNG[/img]

Please help me to fix it [-o<


Top
 Profile  
 
 Post subject: Re: DBGF: No debugger attached
PostPosted: Fri Jan 03, 2020 6:15 am 
Online
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5102
ialireza wrote:
Hi my friends :D
I am a new member of this forum and this is my first topic [-o<

Welcome! Since you're new here, I recommend reading this post.

ialireza wrote:
In Interrupts part when i want run my OS i get a this error : ((DBGF: No debugger attached, waiting 1 second for one to attach (event=100)
1.Stopping the VM!))

This means your OS has crashed. If you scroll up a bit, the log will tell you more information about the crash, which might help you locate the problem.

There isn't anything else I can tell you without seeing more of the log or your source code.


Top
 Profile  
 
 Post subject: Re: DBGF: No debugger attached
PostPosted: Fri Jan 03, 2020 8:08 am 
Offline

Joined: Thu Jan 02, 2020 2:24 am
Posts: 2
Octocontrabass wrote:
ialireza wrote:
Hi my friends :D
I am a new member of this forum and this is my first topic [-o<

Welcome! Since you're new here, I recommend reading this post.

ialireza wrote:
In Interrupts part when i want run my OS i get a this error : ((DBGF: No debugger attached, waiting 1 second for one to attach (event=100)
1.Stopping the VM!))

This means your OS has crashed. If you scroll up a bit, the log will tell you more information about the crash, which might help you locate the problem.

There isn't anything else I can tell you without seeing more of the log or your source code.



Thank you for your recommendations :wink: . finally, I debug my code and Find it ,
My Error ---> Mr. GDT :mrgreen:

The GDT code :
Code:
GlobalDescriptorTable::GlobalDescriptorTable()
    : nullSegmentSelector(0, 0, 0),
        unusedSegmentSelector(0, 0, 0),
        codeSegmentSelector(0, 64*1024*1024, 0x9A),
        dataSegmentSelector(0, 64*1024*1024, 0x92)
{
    uint32_t i[2];
    i[1] = (uint32_t)this;
    i[0] = sizeof(GlobalDescriptorTable) << 16;
    asm volatile("lgdt (%0)": :"p" (((uint8_t *) i)+2));
}

GlobalDescriptorTable::~GlobalDescriptorTable()
{
}

uint16_t GlobalDescriptorTable::DataSegmentSelector()
{
    return (uint8_t*)&dataSegmentSelector - (uint8_t*)this;
}

uint16_t GlobalDescriptorTable::CodeSegmentSelector()
{
    return (uint8_t*)&codeSegmentSelector - (uint8_t*)this;
}

GlobalDescriptorTable::SegmentDescriptor::SegmentDescriptor(uint32_t base, uint32_t limit, uint8_t type)
{
    uint8_t* target = (uint8_t*)this;

    if (limit <= 65536)
    {
        // 16-bit address space
        target[6] = 0x40;
    }
    else
    {
        // 32-bit address space
        // Now we have to squeeze the (32-bit) limit into 2.5 regiters (20-bit).
        // This is done by discarding the 12 least significant bits, but this
        // is only legal, if they are all ==1, so they are implicitly still there

        // so if the last bits aren't all 1, we have to set them to 1, but this
        // would increase the limit (cannot do that, because we might go beyond
        // the physical limit or get overlap with other segments) so we have to
        // compensate this by decreasing a higher bit (and might have up to
        // 4095 wasted bytes behind the used memory)

        if((limit & 0xFFF) != 0xFFF)
            limit = (limit >> 12)-1;
        else
            limit = limit >> 12;

        target[6] = 0xC0;
    }

    // Encode the limit
    target[0] = limit & 0xFF;
    target[1] = (limit >> 8) & 0xFF;
    target[6] |= (limit >> 16) & 0xF;

    // Encode the base
    target[2] = base & 0xFF;
    target[3] = (base >> 8) & 0xFF;
    target[4] = (base >> 16) & 0xFF;
    target[7] = (base >> 24) & 0xFF;

    // Type
    target[5] = type;
}

uint32_t GlobalDescriptorTable::SegmentDescriptor::Base()
{
    uint8_t* target = (uint8_t*)this;

    uint32_t result = target[7];
    result = (result << 8) + target[4];
    result = (result << 8) + target[3];
    result = (result << 8) + target[2];

    return result;
}

uint32_t GlobalDescriptorTable::SegmentDescriptor::Limit()
{
    uint8_t* target = (uint8_t*)this;

    uint32_t result = target[6] & 0xF;
    result = (result << 8) + target[1];
    result = (result << 8) + target[0];

    if((target[6] & 0xC0) == 0xC0)
        result = (result << 12) | 0xFFF;

    return result;
}



Top
 Profile  
 
 Post subject: Re: DBGF: No debugger attached
PostPosted: Fri Jan 03, 2020 8:30 am 
Offline
Member
Member

Joined: Sat Dec 28, 2019 5:19 am
Posts: 47
Location: Iran
for idt.base i think you should provide a *pointer* to your idt table. i think you should use "&" before DescriptorTable but not sure.

_________________
https://mmdmine.github.io


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Octocontrabass and 68 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group