home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,630 of 4,255   
   wolfgang kern to muta...@gmail.com   
   Re: 32 on 64   
   20 Mar 23 16:54:23   
   
   From: nowhere@never.at   
      
   On 20/03/2023 14:51, muta...@gmail.com wrote:   
   > On Monday, March 20, 2023 at 8:54:21 PM UTC+8, wolfgang kern wrote:   
   >   
   >>> I assume the syntax would be:   
   >>>   
   >>> mov eax, after   
   >>> mov [esp + 0], eax   
   >>> mov eax, sub   
   >>> jmp *eax   
   >>> after:   
   >>>   
   >>> sub:   
   >>> ...   
   >>> mov eax, [esp + 0]   
   >>> jmp *eax   
   >> this may not work as you expect.   
   >   
   > Why not?   
      
   you think this stack position is as a save place to hold values ?   
   IRQs (timer/kbd/mouse/...) may use it. And that's why PUSH/POP were   
   implemented :)   
      
   mov eax,[rsp+0]  act as MOVZXD rax,[rsp]   
      
   >> and what's wrong with call/ret in long mode   
   >>   
   >> FF D0 .... C3   
   >> 48 FF D0 .... C3   
   >   
   > I want my 32-bit code to work on both an 80386 and on   
   > an x64 in long mode.   
      
   Now this is a really bad idea, because this looses a lot of features   
   from both modes and will end up in weird detours for no reason.   
   The difference between this two modes is just too large and for switch   
   demands all options were designed and implemented..   
      
   >> if you like to run 32 bit code within 64 bit environment then just   
   >> switch back and forth between this two modes.   
   >> Oh, you don't have a BIOS/UEFI function for such ? write your own.   
      
   > I don't want to write my own. I want to follow the EFI   
   > spec and have carefully-generated assembler that can   
   > tolerate running on both 32 and 64-bit environments.   
      
   You cant build your own OS by "don't want to write..."   
   and you wont follow UEFI boot specs by using 32-bit code.   
      
   > I'm not sure there is actually a way to write my own   
   > even outside of the EFI spec. Don't I need access to   
   > the GDT or whatever which can't be manipulated until   
   > I exit boot services?   
      
   once the GDT is proper setup to cover LM64 and PM32 needs, the switches   
   don't need to alter GDT entries, only descriptors have to change.   
   __   
   wolfgang   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca