flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Long mode ISR triple fault |
Author |
|
smiddy 09 Jan 2012, 20:35
I probably can't help by reading your source. Though I can add some trouble shooting ideas. Try using Bochs, VirtualBox, and Virtual PC. If you can download VM Ware, use the trial and check it there too.
What is weird is you say "(GDT selector 0040 from IDT ? but all sectors use 0008)" so I assume you expected them to be the same? Are the ISRs in one and the general routines (for the IDT) in a separate one and are they segment registers being updated correctly? (BTW, I'm used to a flat 32 bit mode, so a page table and TSS are simply words I've not applied yet). Just some thoughts, hope it helps. |
|||
09 Jan 2012, 20:35 |
|
cod3b453 09 Jan 2012, 22:38
My VM breakdown is:
Bochs - never worked originally VirtualPC - VGA and 32bit only VM Ware - does not boot (drivers hang) VirtualBox - 32bit VESA or VGA, ATAPI or ATA, 64bit QEMU - 24bit VESA or VGA, ATAPI or ATA, 64bit (I have hex dump routines in the 32bit loader stage that can show the values on VGA or VESA) ---- The error code shown in QEMU suggests selector 0040 but I have no idea where it's pulling this from since all the ISRs use 0008 in their entries. Quote: IN: |
|||
09 Jan 2012, 22:38 |
|
smiddy 10 Jan 2012, 15:54
I'm not sure I see what you're saying, but it does seem like all of your other segments are 0010 except the Stack, which is 0020, and your Code at 0008. What does your GDT look like? Is 0040 specific to the IDT or are the routines (base ones) within 0040? Where could that change within your code, perhaps one of your ISRs is changing it from what it should be to 0040?
|
|||
10 Jan 2012, 15:54 |
|
cod3b453 10 Jan 2012, 18:08
This trace only shows the current state not the state it tried to load. I'll post hex dumps shortly.
edit: A zip with images of the hex dumps, memory map table and example ISO, hd images can been seen here: [removed] As shown in idt.png, the selector field is 0008 not the 0040 suggested. Last edited by cod3b453 on 11 Jan 2012, 21:09; edited 1 time in total |
|||
10 Jan 2012, 18:08 |
|
smiddy 10 Jan 2012, 20:37
I'll check it out, I'll traveling so I may not get to it until Friday-ish. I will try them on what I have here, but at home I can do more.
I will study the hex dumps. Right now I cannot make heads or tails out of them, though at first glance they look symmetric (the TSS one I will have to study TSS to get a clue). |
|||
10 Jan 2012, 20:37 |
|
cod3b453 11 Jan 2012, 20:27
OK I think I have realised what the issue is - I have accidentally zeroed the Type field in IDT entry generator which should be 8E at offset 5 not 80...though some other issue is currently happening.
edit: OK I had made a minor mistake in the ISR it now works! Just to explain the issues here - I had used a normal code segment descriptor definition for the GDT entry used by the IDT entries but this should have been an interrupt gate descriptor (with type = 0xE). One other important field is the IST, which can be set to a non-zero value (1..7) to perform a stack switch (RSP) before calling the ISR (and swaps back on iretq). This should then look like this in memory (dpl=0): xx xx ss ss 01 8E yy yy zz zz zz zz 00 00 00 00 where the ISR is at zz zz zz zz yy yy xx xx, selector (and rpl) is ss ss thanks for looking smiddy Last edited by cod3b453 on 12 Jan 2012, 00:31; edited 1 time in total |
|||
11 Jan 2012, 20:27 |
|
smiddy 11 Jan 2012, 23:21
No problem...happy to help (if I did).
|
|||
11 Jan 2012, 23:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.