Write comments

[Ultimate Reboot] When call activate function

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:
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 ? :!: :?:

14. Mar 2017, 20:07

Re: [Ultimate Reboot] When call activate function

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)) ?

Re: [Ultimate Reboot] When call activate function

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...

Re: [Ultimate Reboot] When call activate function

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)?

Re: [Ultimate Reboot] When call activate function

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;

Re: [Ultimate Reboot] When call activate function

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?

Re: [Ultimate Reboot] When call activate function

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.

Re: [Ultimate Reboot] When call activate function

27. Jun 2018, 11:56

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

Code:
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:
uint16_t GlobalDescriptorTable::DataSegmentSelector()
{
    return (uint8_t*)&codeSegmentSelector - (uint8_t*)this;
}

uint16_t GlobalDescriptorTable::CodeSegmentSelector()
{
    return (uint8_t*)&dataSegmentSelector - (uint8_t*)this;
}
Write comments




Bei iphpbb3.com bekommen Sie ein kostenloses Forum mit vielen tollen Extras
Forum kostenlos einrichten - Hot Topics - Tags
Beliebteste Themen: NES, Mode, Linux, Rap, Programm

Impressum | Datenschutz