OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Jun 20, 2018 12:14 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to emulate Linux program?
PostPosted: Mon Jun 04, 2018 9:44 pm 
Offline

Joined: Mon Jun 04, 2018 9:39 pm
Posts: 1
Hello, I am a beginner OS developer and I want to know how to emulate Linux program? I want to port some nice program for Linux. I already created simple Linux program to display text using printf() function, and then I compile it with GCC for Linux, now how can I make the text be displayed in screen of emulator (same as writing text to memory address 0xB8000)?? Thanks.


Top
 Profile  
 
 Post subject: Re: How to emulate Linux program?
PostPosted: Mon Jun 04, 2018 10:15 pm 
Offline

Joined: Tue Apr 03, 2018 2:44 pm
Posts: 12
I'm confused, do you want to emulate or port? Emulating means you don't change the program but instead modify your OS to provide a similar-ish environment that the program expects, while porting means you modify the program itself to work in your OS. Assuming the former, that depends greatly on how far along your OS is, so we need more details. You're going to need an ELF loader and support the system calls the program expects, some amount of libc unless the program was statically linked etc. Tell us more about the state of your OS and what you're trying to do.

_________________
Image is my operating system.

"...not because [it is] easy, but because [it is] hard; because that goal will serve to organize and measure the best of [my] energies and skills..."


Top
 Profile  
 
 Post subject: Re: How to emulate Linux program?
PostPosted: Tue Jun 05, 2018 2:00 am 
Offline

Joined: Wed Feb 22, 2017 4:57 pm
Posts: 8
From what I can gather, he wants to port a program that prints hello world, that he wrote in Linux to an x86 emulator. I recommend you start from here before doing anything.


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

All times are UTC - 6 hours


Who is online

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