[haiku-development] Re: Implement 32 bit userland support for 64 bit Haiku

  • From: Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 2 May 2018 10:47:04 +0200

Hi,

One question is if there will be issues with 32 bit pointers. Long mode
seems to support PAE, so
Adrien suggested this isn't a problem?

There will be some work needed, still. IOW, there may be problems, but
only solvable ones.
If I understand this correctly, 32bit apps don't run in long mode, and we
swithc between long and normal mode as needed (on syscalls, and on
interrupts?). But I'm not very familiar with how this works.


AFAIK, there are two general modes which consists of various sub modes to
handle the different stages, the legacy mode where you run a legacy 32 bit
operating system (and other compats which I'm not going to state here), and
the long mode which consists of two sub-modes, the true 64 bit one and the
compat mode which is meant to run 32 bit code on a 64 bit OS.



Doesn't we need also to wrap fork() and similar functions? It seems
under linux they do it, while I
didn't investigate why.

fork() is a syscall.


Sure, but for most syscalls I think it's enough to translate the calling
convention, so basically the registers used from 32 bit to 64 bit.
For others I think we have to supply a true wrapper, but as said I didn't
look deeply enough into that.


-- 
Saluti,
Dario

Other related posts: