From: Kasper V. L. <ve...@da...> - 2000-02-19 11:59:56
|
> Well I've got a quick PCT system working. It ends up w/ > > _process_run (p->pr_cr3, p->pr_pct, USER_CS, 0x3202, 0, USER_DS); That looks okay. > But as soon as the called process tries to push to the stack it > page faults. I > didn't spend very long hunting, but anyway: > > SS = 0x00100023 > ESP= 0x0 > ESI= 0x0 > EBP= 0x00837000 > DS = 0x23 > CS = 0x1b Apart from the extra 1 in the SS it seems correct. And as soon as the called process tries to push something on the stack it SHOULD page fault. The exception error code should probably indicate that it is an access rights violation that caused the page fault (as opposed to a non-present page). The value you try to push on the stack will be written into memory at 0xfffffffc (which is a part of the read-only mapping of page tables and directories). If you look at init/src/crt/crt0.S you'll see the following lines of code: .align 4 _crt0_prolog: movl _crt0_saved_sp, %esp popf popal ret .align 4 _crt0_epilog: pushal pushf movl %esp, _crt0_saved_sp int $0x40 The prolog code is called with the _process_run() function and as you can see the first thing it does is to set %esp to something sensible. > Should SS have the extra 1 in it? I've got to order a new Insight > from Intel, > so I don't know the selector structure. But I don't think a bad > selector would > cause a page fault. It cannot. AFAIK it should cause a GPF, but who knows what happens. /Kasper BTW: I'm working on a specification of the PCT and IRQ stuff - I'm looking forward to seeing your work under CVS :-) |