Discussion:
Format_Argument_Block
(too old to reply)
will
2005-11-08 07:37:04 UTC
Permalink
After the lab yesterday, i was pretty certain i understood how to use format argument block.
After modifying my code, I get stuck on an Exception 13. Here's the output...

Exception 13 received, killing thread 0x00036000
eax=00000000 ebx=7ffff000 ecx=00000004 edx=00001563
esi=7ffff000 edi=00000000 ebp=7fffeffc
eip=00001043 cs=00000007 eflags=00010212
Interrupt number=13, error code=0
index=0, TI=0, IDT=0, EXT=0
user esp=7fffefdc, user ss=0000000f
cs: index=0, ti=1, rpl=3
ds: index=1, ti=1, rpl=3
es: index=1, ti=1, rpl=3
fs: index=1, ti=1, rpl=3
gs: index=1, ti=1, rpl=3
Init process exited with code -1

If I modify any other setting in Load_User_Program, I get either a page fault
or an Exception 12, so I'm sure *most* of it is correct. But when I completely
remove the Format_Argument_Block call, I get the same output as above.

Because it was mentioned in discussion, I can say that I use the pointer
to a physical page as the first parameter for this routine.

Any ideas?

will
Daniel Ramsbrock
2005-11-08 12:52:14 UTC
Permalink
What are you using as the third parameter?

Daniel
Post by will
Because it was mentioned in discussion, I can say that I use the pointer
to a physical page as the first parameter for this routine.
c***@CSIC.UMD.EDU
2005-11-08 15:05:06 UTC
Permalink
Virtual user add, 0x80000000 - PAGE_SIZE
Daniel Ramsbrock
2005-11-08 15:18:59 UTC
Permalink
That's probably your problem. Think about what was being passed as the
third parameter before: argBlockAddr, the logical (NOT linear) address
of the argument block. See if you can figure out how that corresponds to
the current situation (I think that's as much information as I can give
without crossing the line).

Daniel
Post by c***@CSIC.UMD.EDU
Virtual user add, 0x80000000 - PAGE_SIZE
c***@CSIC.UMD.EDU
2005-11-08 15:32:12 UTC
Permalink
As per my understanding this is the logical address
The linear address would be 0xffffffff - PAGE_SIZE,
what i am passing in is 0x80000000 - PAGE_SIZE
Daniel Ramsbrock
2005-11-08 17:47:12 UTC
Permalink
Right, but PAGE_SIZE is not nearly the same as
userContext->argBlockAddr. On top of that, PAGE_SIZE is 4096--you
probably meant USER_VM_SIZE, right?

Daniel
Post by c***@CSIC.UMD.EDU
As per my understanding this is the logical address
The linear address would be 0xffffffff - PAGE_SIZE,
what i am passing in is 0x80000000 - PAGE_SIZE
Daniel Ramsbrock
2005-11-08 18:04:39 UTC
Permalink
I just realized where the confusion might be coming in. While the
argument block does END at 0xFFFFFFFF, it STARTS at 0xFFFFF000. You need
to be pointing to the bottom (beginning) of the argument block (but you
still have to use the logical address).

Incidentally, you need to be pointing to the TOP of the initial stack
page (which initially happens to be the same address as the bottom of
the argument page). The stack will grow down from there.

Daniel
Post by Daniel Ramsbrock
Right, but PAGE_SIZE is not nearly the same as
userContext->argBlockAddr. On top of that, PAGE_SIZE is 4096--you
probably meant USER_VM_SIZE, right?
Daniel
Post by c***@CSIC.UMD.EDU
As per my understanding this is the logical address
The linear address would be 0xffffffff - PAGE_SIZE,
what i am passing in is 0x80000000 - PAGE_SIZE
c***@CSIC.UMD.EDU
2005-11-08 20:09:55 UTC
Permalink
Yeah, i was doing that, i was using Round_Up_To_Page for doing this, the problem
was somewhere else, its fixed. Thanks though.

Continue reading on narkive:
Loading...