OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:59 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How hard would it be to make a Linux ABI-compatible OS?
PostPosted: Wed Feb 07, 2018 3:03 pm 
Offline

Joined: Thu Oct 20, 2016 12:26 pm
Posts: 15
Title.

I don't think it would be *too* difficult to get a very basic compatibility, but I think it's interesting to ponder nonetheless.

Are there any major obstacles that would render this impossible?


Top
 Profile  
 
 Post subject: Re: How hard would it be to make a Linux ABI-compatible OS?
PostPosted: Wed Feb 07, 2018 3:41 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

hexcoder wrote:
I don't think it would be *too* difficult to get a very basic compatibility, but I think it's interesting to ponder nonetheless.

Are there any major obstacles that would render this impossible?


If you're writing a "monolithic Unix-like kernel", this might actually be easier than not providing Linux ABI compatibility because you won't need to make minor changes to things like C/POSIX libraries (e.g. you'd be able to use GNU's libraries "as is").

If you're not writing a "monothic Unix-like kernel" then it's impossible to say - it could be relatively easy, but it could be an extreme nightmare too.

Of course ABI compatibility isn't very useful on its own - almost all of the software is open source and easy to recompile; and to run Linux binaries without recompiling you'd have to provide more than just the ABI (e.g. same file system layout, same "/proc" file system, same environment variables, compatible graphics and sound libraries, ...).

Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: How hard would it be to make a Linux ABI-compatible OS?
PostPosted: Wed Feb 07, 2018 4:00 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1225
There will probably always be the need to rewrite some software and use only standard libraries across systems more and more.

The programming environment wasn't probably ready to be distributed across many OSes when there were only 1 or 2 of them for desktop PCs. So now the code needs to be cleaned so that a single developer can realistically manage to port software portably by relying on implementing everything based on standard libraries present in any system, and clean the rest to use wrapper functions to minimize the usage of non-portable libraries and language versions that aren't currently supported in your own OS or others that you might need to use as a devloper.

_________________
Live PC 1: Image Live PC 2: Image

YouTube:
http://youtube.com/@AltComp126/streams
http://youtube.com/@proyectos/streams

http://master.dl.sourceforge.net/projec ... 7z?viasf=1


Top
 Profile  
 
 Post subject: Re: How hard would it be to make a Linux ABI-compatible OS?
PostPosted: Thu Feb 08, 2018 4:48 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
I'm writing an microkernel-based OS that is source-compatible to Linux (but not binary compatible). That means implies implementing Linux-specific functions like epoll(), signalfd(), timerfd() just to name a few, Linux /proc and /sys file systems, netlink sockets, the Linux ioctl()s for devices in /dev. I definitely can be done, but if you're not writing a monolithic UNIX-like kernel, you'll have to spend a lot of time on designing IPC primitives that enable you to efficiently emulate the Linux stuff in user-space.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: How hard would it be to make a Linux ABI-compatible OS?
PostPosted: Fri Feb 09, 2018 12:08 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
~ wrote:
There will probably always be the need to rewrite some software and use only standard libraries across systems more and more.

The programming environment wasn't probably ready to be distributed across many OSes when there were only 1 or 2 of them for desktop PCs. So now the code needs to be cleaned so that a single developer can realistically manage to port software portably by relying on implementing everything based on standard libraries present in any system, and clean the rest to use wrapper functions to minimize the usage of non-portable libraries and language versions that aren't currently supported in your own OS or others that you might need to use as a devloper.


I get the distinct impression that this is just a small snippet from a larger conversation. Either than, or ~ forgot his meds again.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 28 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