V8086 mode hell...
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Actually, I can't even get the interrupt code itself to execute when I come from virtual mode.
All the code I posted (irq_common_stub) does not get executed! Any ideas why?
Edit: not even creating an LDT helps. Why doesn't this work? Has anyone got any working code they could point me to, just so I can see where I'm going wrong?
All the code I posted (irq_common_stub) does not get executed! Any ideas why?
Edit: not even creating an LDT helps. Why doesn't this work? Has anyone got any working code they could point me to, just so I can see where I'm going wrong?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
that doesnt really reproduce your issue - right now your fat driver trips over an unformatted HD:
Running bochs without harddisk sends the code into an infinite loop.
Summarized, I couldn't get to your actual problem. I don't have any bootdisks that allow me to partition the disk image and format it to FAT32. If you can easily disable that code it'd be great, otherwise we'll have to do with the hex dumps
In the meantime, you've got yourself some other bugs to fix
[edit] Why is SS reported to be the null selector? that is bound to give problems [/edit]
Code: Select all
[FAT ] Initializing FAT32 structures...
I've been rudely interrupted by the processor with this message for you:
Division By Zero
Registers at time of crash:
Error code: 0
Interrupt number: 0
EAX: 0xffffffff EBX: 0x 0 ECX: 0xffffffff EDX: 0xffffffff
EBP: 0x 328498 ESP: 0x 32824c ESI: 0x 0 EDI: 0x 10d8e2
Segments at time of crash:
CS: 0x 8 DS: 0x 10 ES: 0x 100010
FS: 0x 10 GS: 0x 100010 SS: 0x 0
Summarized, I couldn't get to your actual problem. I don't have any bootdisks that allow me to partition the disk image and format it to FAT32. If you can easily disable that code it'd be great, otherwise we'll have to do with the hex dumps
In the meantime, you've got yourself some other bugs to fix
[edit] Why is SS reported to be the null selector? that is bound to give problems [/edit]
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Sounds good.
The bug you got was in my FAT32 initialization code, and it needs a valid FAT32 bootesector (otherwise divide by zero and worse comes). I'm not 100% sure how to tell if the drive is FAT32 or some other filesystem so I didn't check.
I've just committed the version of source that that image works with to my CVS so you can check that when you need to (it's all in the CPP_Kernel folder).
The bug you got was in my FAT32 initialization code, and it needs a valid FAT32 bootesector (otherwise divide by zero and worse comes). I'm not 100% sure how to tell if the drive is FAT32 or some other filesystem so I didn't check.
I've just committed the version of source that that image works with to my CVS so you can check that when you need to (it's all in the CPP_Kernel folder).
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Bochs reports the following tss settings:
GDT[0x05]=32-Bit TSS (Busy) at 0x0000001c, length 0x00067
tr:s=0x0028, dl=0x001c0067, dh=0x00008900, valid=1
In short, your TSS is probably not where you expect it to be. Check your GDT writing functions that it encodes the base of the GDT as expected (it currently seems to encode the base to 0x0000001c instead of 0x001c0000)
GDT[0x05]=32-Bit TSS (Busy) at 0x0000001c, length 0x00067
tr:s=0x0028, dl=0x001c0067, dh=0x00008900, valid=1
In short, your TSS is probably not where you expect it to be. Check your GDT writing functions that it encodes the base of the GDT as expected (it currently seems to encode the base to 0x0000001c instead of 0x001c0000)
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
0x0000001c... I never noticed that before.
Out come the Intel manuals, got to figure out what went wrong
Edit:
Link map:
Now the problem is this:
At least we're making progress?
Edit: nope, nothing I've done is working... I'm somewhat confused at this error as I'm sure my SS0 and ESP0 values are correct.
Out come the Intel manuals, got to figure out what went wrong
Edit:
Code: Select all
GDT[0x05]=32-Bit TSS (Busy) at 0x0010f61c, length 0x00068
Code: Select all
0x0010f61c _global_tss
Code: Select all
00024918077e[CPU0 ] interrupt(): SS selector null
00024918077e[CPU0 ] interrupt(): SS selector null
00024918077e[CPU0 ] interrupt(): SS selector null
Edit: nope, nothing I've done is working... I'm somewhat confused at this error as I'm sure my SS0 and ESP0 values are correct.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Obviously not:
Code: Select all
tr:s=0x28, base=0x10f61c, valid=1
ss:esp(0): 0x0000:0x00000000
ss:esp(1): 0x0000:0x00000000
ss:esp(2): 0x0000:0x00000000
cr3: 0x00000000
eip: 0x00000000
eflags: 0x00000000
cs: 0x0000 ds: 0x0000 ss: 0x0000
es: 0x0000 fs: 0x0000 gs: 0x0000
eax: 0x00000000 ebx: 0x00000000 ecx: 0x00000000 edx: 0x00000000
esi: 0x00000000 edi: 0x00000000 ebp: 0x00000000 esp: 0x00000000
ldt: 0x0000
i/o map: 0x0000
Last edited by pcmattman on Sun Jul 19, 2009 5:56 pm, edited 1 time in total.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Oh my, I fixed it!
It was rather simple... I forgot to set the stuff. Here's why:
I had a function to install the TSS (which also initialized it's SS0:ESP0 values), which I replaced when I found that the TR was in the wrong place.
When I removed it I forgot about the whole 'initialization of TSS' part and so everything in the TSS was NULL. Now, problem solved.
Thankyou so much everyone, I can't believe that I actually have a working virtual mode task now!
Edit: you know, there's something so satisfying looking at a screen like this after about a month of trying to get virtual mode working:
What I wouldn't have given to see that back then, now all I have to do is figure out how on earth I'm meant to handle this .
It was rather simple... I forgot to set the stuff. Here's why:
I had a function to install the TSS (which also initialized it's SS0:ESP0 values), which I replaced when I found that the TR was in the wrong place.
When I removed it I forgot about the whole 'initialization of TSS' part and so everything in the TSS was NULL. Now, problem solved.
Thankyou so much everyone, I can't believe that I actually have a working virtual mode task now!
Edit: you know, there's something so satisfying looking at a screen like this after about a month of trying to get virtual mode working:
Code: Select all
[GDT ] Installing GDT... Done!
[IDT ] Installing IDT... Done!
[INT ] Installing interrupts (ISR/IRQ)... Done!
[TMR ] Installing timer... Done!
[KBD ] Installing keyboard... Done!
[MEM ] Installing memory manager... Done!
[MTSK] Initializing multitasking... Done!
[MTSK] Creating idle task and enabling tasking... Done!
[NULL] Idle task has started.
I've been rudely interrupted by the processor with this message for you:
General Protection Fault
Crash at 0x 1002 EFLAGS: 0x 33202
Registers at time of crash:
Error code: 26
Interrupt number: 13
EAX: 0x fb EBX: 0x 0 ECX: 0x 0 EDX: 0x 0
EBP: 0x 0 ESP: 0x 10ead0 ESI: 0x 0 EDI: 0x 0
V8086 SS:ESP (checks eflags)
SS: 0x 20 ESP: 0x 2900
<snip>