Exceptions crash the system
Re: Exceptions crash the system
The value of eax was 0x258. It's possible that that's a valid selector, but unlikely.
Re: Exceptions crash the system
I don't know exactly what you're talking about.iansjack wrote:The value of eax was 0x258. It's possible that that's a valid selector, but unlikely.
But in the previous message I wrote that lgdt writes the wrong address in gdt.
-
- Member
- Posts: 5572
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Exceptions crash the system
EAX contains the correct value, but does the memory at that address contain the correct values?
You may also want to read the section titled "Aggregates and Unions" in the System V ABI Intel386 Architecture Processor Supplement.
You may also want to read the section titled "Aggregates and Unions" in the System V ABI Intel386 Architecture Processor Supplement.
Re: Exceptions crash the system
Your message made me think that the data is not in the right order, so I added __attribute__((packed)) to the gdt_ptr structure and everything worked as it should.Octocontrabass wrote:EAX contains the correct value, but does the memory at that address contain the correct values?
You may also want to read the section titled "Aggregates and Unions" in the System V ABI Intel386 Architecture Processor Supplement.
Thank you all for your help!