Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial 5: Error when executing 'asm("sti");' #14

Open
jj01101010 opened this issue Jul 17, 2019 · 9 comments
Open

Tutorial 5: Error when executing 'asm("sti");' #14

jj01101010 opened this issue Jul 17, 2019 · 9 comments

Comments

@jj01101010
Copy link

If i execute the line you see above. VirtualBox is crashing and spamming my terminal with many lines but i dont know 1. Why it is crashing and 2. How can I fix this crash

Pls help me i am lost

@jj01101010
Copy link
Author

But i have to say your tutorial series is GREAT pls never leave this project

@sgermain06
Copy link

Hey, I have the same problem. If I comment out the sti call, it doesn't crash, but if I don't, as soon as it calls it, VirtualBox crashes. Were you ever able to fix this? Anyone can help?

@sgermain06
Copy link

Ah! I found out what was happening. In my gdt constructor, I had inverted the indexes of the array I sent to the lgdt command. After I switched those around, it stopped crashing. Now, I have another problem though. When I call sti, not only I don't receive any interrupt calls to my HandleInterrupt function, but after like 5-10 seconds, my screens clear and fills with some weird characters. I'm trying to compare my code with the code in this git repository and, so far, I seem to be matching. I'm sure I'm missing something stupid...

@sgermain06
Copy link

Yeah, I found what I did. In the interrupts.cpp, I set the handlerAddressLowBits twice instead of setting the handlerAddressLowBits and handlerAddressHighBits. Everything is working fine now.

@fluecs
Copy link

fluecs commented Apr 7, 2021

Same issue. Can't seem to fix it.

@M1sterPl0w
Copy link

@HayJayDee @Ilc-Ilia-Developer Is it possible to show your code? Maybe I can take a look.

@StjepanBM1
Copy link

Does anyone know how to fix this issue?

@ssagar-linux
Copy link

I resolved following issue via:-
-GlobalDescriptorTable::SegmentDescriptor::SegmentDescriptor(uint32_t limit, uint32_t base , uint8_t type)
+GlobalDescriptorTable::SegmentDescriptor::SegmentDescriptor(uint32_t base, uint32_t limit, uint8_t type)

mistakenly using base & limit interchangeably

@yutojama
Copy link

  1. check out constructor of GlobalDescriptorTable(), make sure i[0] = sizeof(GlobalDescriptorTable) << 16; i[1] = (uint32_t) i[2];
  2. check all structs with attribute((packed)), make sure everything is placed just in the order as tutorial and nothing is randomly swapped. For me, I changed sequence of size and base in InterruptDescriptorTablePointer and that led to error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants