Re: [Etherboot-developers] Q: does xstart work?
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Eric W B. <ebi...@ln...> - 2002-07-23 08:56:42
|
ke...@us... (Ken Yap) writes: > >> ADDR32 LJMPI(_execaddr-_start) > > Incidentally if you feel motivated to convert this bit of data > segment-modifying code to a push onto the stack followed by a ret, > please do. I will or something similiar, accessing the 32bit data segment from 16bit is a fairly bad thing to do. After staring at the problem of relocating the part of etherboot that must run in 16bit real mode I have finally come up with a clean design, that will be easy to convert to. - The 16bit code will normally live above 1MB. - The 16bit code will be pushed on the 16bit stack just before use. - _prot_to_real && _real_to_prot will be replaced by _real_call which preservs all registers except %esp, and %eax. _real_call pushes the 16bit code onto the real mode stack. An example from my test code. pushl $ 1f pushl $ 2f - 1f call _real_call 1: .code16 movl $0x88880000, %ebp shll $16, %ebx shll $16, %ecx shll $16, %edx shll $16, %esi shll $16, %edi ret .code32 2: Eric |