OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 6:40 am

All times are UTC - 6 hours




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 49 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject: Re: 32-bit kernel that runs 64-bit apps
PostPosted: Sun Jun 29, 2014 2:52 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
linguofreak wrote:
I'd define bitness by the bitness of the ABI provided to kernel modules (which will likely be the bitness of most of the code in the kernel): If kernel modules have to be 32-bit, it's a 32 bit kernel, even if there's a bit of 64-bit code to thunk to a 64-bit userland. The only exception I'd make to this is if the kernel requires a 64-bit CPU (rather than just being able to make use of one if present).


RDOS ABI supports 16, 32 and 64 bits. It's register based, and 16-bit code will typically extended pointers to 32-bit while the 64-bit module will allocate a 32-bit copy of pointers and copy page table entries,

The C/C++ API is constructed with inline assembly, and will vary depending on compiler,


Top
 Profile  
 
 Post subject: Re: 32-bit kernel that runs 64-bit apps
PostPosted: Sun Jun 29, 2014 2:55 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
Candy wrote:
rdos wrote:
Of course a functional 32-bit kernel can be made to run 64-bit applications. ... The process is quite simple:


In short, to make a 32-bit kernel run 64-bit processes, just add 64-bit process support.

Still confused about what the discussion is actually about. You need to add 64-bit process support to be able to run 64-bit processes; AMD didn't design it backwards-compatible enough to run 64-bit software under 32-bit OSes without modification.


It goes both ways. In order for a long mode OS to run 32-bit processes you need to add support for 32-bit processes. Every executable format needs support in the kernel.


Top
 Profile  
 
 Post subject: Re: 32-bit kernel that runs 64-bit apps
PostPosted: Sun Jun 29, 2014 3:05 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
thepowersgang wrote:
On a side note - Would your ideas be switching between protected and long mode? Or running 32-bit kernel code in compatibility mode?


It could be done both ways. I switch between modes primarily because this allows the kernel to use call gates for 32-bit application kernel entry points. If I used compability mode instead, I'd need a common entry point, and a far call to 32-bit code from long mode.


Top
 Profile  
 
 Post subject: Re: 32-bit kernel that runs 64-bit apps
PostPosted: Sun Jun 29, 2014 6:41 am 
Offline
Member
Member
User avatar

Joined: Tue Dec 25, 2007 6:03 am
Posts: 734
Location: Perth, Western Australia
This discussion has reached a conclusion, and is now heading nowhere fast. Locking

_________________
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 49 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 48 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group