none
C code running failed when back to OS during S3 resume in WEC7: RRS feed

  • Question

  • Hi, guys,

    I am trying to do some work with ACPI S3 in WEC7. Now during resume BIOS could jump to waking vector and do some restore work, then jump back where the system entered into S3 sleep. At this time I did the reinitialization work about serial and superIO by ASM code and OS could output some message via serial port by ASM code, too. At this time current IP will 0x82xxxxxx and CS is 0x8. But RETAILMSG calling failed and OS ran to somewhere unknown (CS will be change to 0x38 from 0x8, current IP will be something like 0x67xxxxxx and I could access this linear address via hardware debugger tool). Before entering into S3 sleep, I saved the current segment (CS, DS, SP, BP, IP), CPU control registers (CR0, CR3 and CR4), GDT, IDT, LDT, TSS. During resume I restored them and virtual address could be accessed. I compared the segment and CPU control registers in these two periods, before suspend and after resume. I found that only GS, FS, ES, SS are different.  If I set GS, FS, ES, SS directly OS also will also run to the above 0x67xxxxxx.

    What is the possible reason? Is somework about processor ignored? Thanks and best regards.

    Friday, May 25, 2012 1:35 PM

All replies

  • Now i am guessing the reason is the transition from ring 0 to ring 3. It seems that winCE uses call gate, not sysenter/sysexit.
    Monday, May 28, 2012 9:15 AM