[Ultimate Reboot] When call activate function




[Ultimate Reboot] When call activate function

Postby MasterCna » 14. Mar 2017, 20:07

Hi,problem is when i call Activate function in the kernel for interrupts. Implementation Gdt and then Activate the interrupt class right at this line:
Code: Select all
interrupts.Activate();

the kernel was crashed or reboot over and over and the Virtual machine show me errors. I tested in VMware, Virtual Box and Qemu. in the vmware and qemu kernel reboot unlimited. in Virtual Box kernel crashed. I checked all code in port and gdt hole class more than 3 times with tutorials all things are same. i can't find the bug.
anybody have idea what that means? do you think which part of interrupt make this problem ? :!: :?:
User avatar
MasterCna
 
Posts: 11
Joined: 7. Mar 2017, 00:17

by Advertising » 14. Mar 2017, 20:07

Advertising
 

Re: [Ultimate Reboot] When call activate function

Postby algorithman » 15. Mar 2017, 10:42

Yeah, interrupts are difficult... everything has to be byte-perfect.
Did you set up the gdt first? Do the gdt and idt entry classes have __attribute__((packed)) ?
User avatar
algorithman
Administrator
 
Posts: 49
Joined: 2. Mar 2017, 11:40

Re: [Ultimate Reboot] When call activate function

Postby MasterCna » 16. Mar 2017, 00:39

everything is okay (maybe).
Yes i setup the gdt first like tutorials, and used __attribute__((packed)). 2 more check for classes and everything is fine but not at run ! :|
Looking for solution...
User avatar
MasterCna
 
Posts: 11
Joined: 7. Mar 2017, 00:17

Re: [Ultimate Reboot] When call activate function

Postby algorithman » 16. Mar 2017, 15:06

well if everything was okay, it would work ;-)
do you have dummy entries at the beginning of the gdt? I think at least 1 was necessary.
do you subtract 1 from the InterruptDescriptorTablePointers size?
do you have entries for all 256 interrupt numbers in the idt (pointing at least to InterruptIgnore)?
User avatar
algorithman
Administrator
 
Posts: 49
Joined: 2. Mar 2017, 11:40

Re: [Ultimate Reboot] When call activate function

Postby Mixony » 24. Mar 2017, 18:25

Maybe you need to change

i[0] = (uint32_t)this;
i[1] = sizeof(GlobalDescriptorTable)<<16;

to

i[0] = sizeof(GlobalDescriptorTable)<<16;
i[1] = (uint32_t)this;
Mixony
 
Posts: 24
Joined: 12. Mar 2017, 08:18

Re: [Ultimate Reboot] When call activate function

Postby algorithman » 27. Mar 2017, 11:02

Yes, I think that is right... that is how it is in my gdt.cpp and also how it is in the commit for video 3
https://github.com/AlgorithMan-de/wyoos ... b2645cf856
I just watched over video 3 and there it seems to be wrong... I don't know how that has happened - I mean why is it different in the video and in the commit?
User avatar
algorithman
Administrator
 
Posts: 49
Joined: 2. Mar 2017, 11:40

Re: [Ultimate Reboot] When call activate function

Postby algorithman » 27. Mar 2017, 15:02

Actually, the whole design with the array of 2 uint32's (one of which shifted by 16 bit) is not so great...
this should be like the InterruptDescriptorTablePointer class: a packed object with one 32 bit pointer and one 16 bit size.
User avatar
algorithman
Administrator
 
Posts: 49
Joined: 2. Mar 2017, 11:40

Re: [Ultimate Reboot] When call activate function

Postby Bilal » 27. Jun 2018, 11:56

I have same problem and finally fixed, you need to double check the gdt.cpp as follows:

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

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


instead of

Code: Select all
uint16_t GlobalDescriptorTable::DataSegmentSelector()
{
    return (uint8_t*)&codeSegmentSelector - (uint8_t*)this;
}

uint16_t GlobalDescriptorTable::CodeSegmentSelector()
{
    return (uint8_t*)&dataSegmentSelector - (uint8_t*)this;
}
Bilal
 
Posts: 1
Joined: 22. Apr 2017, 17:01


Return to Interrupts

Who is online

No registered users

cron