October 24th, 2010, 11:33 PM #1
- Join Date
- Oct 2010
Running Linux on stuff, and other OS shenanigan questions
I have been working on a side project now that I have some free time on my hands, and I have been writing some stuff in C++. I havent worked with hardware before, and I dont understand how I would get something to just run a code in C. I think that I would need to run linux on it, than I could just make the exe. run as soon as it boots up. But how to get linux or anything else onto a printer, or an ipod, or a phone, or exactly where ever this all goes inside of a computer ( I understand it should be on the hard drive, but all the stuff I keep finding about bios is getting me confused). Cant really find anywhere that will explain these know how basics of how to get an OS into a machine, and I dont have enough time to slowly learn computer engineerin from the bottom (I cant even handel maxwells equations well enough, nevermind anything more advanced than that.
So If someone could please enlighten me on this process, or refer me to some sort of guide or anything I would be very grateful. Thanks in advance.
October 25th, 2010, 05:12 AM #2
- Join Date
- Oct 2001
- Tampa, FL USA
- Blog Entries
Welcome to TechIMO! I have moved your discussion thread to the programming forum.
From a generic standpoint, developing an operating system is a matter of knowing how to interface with the provided resources of the target device. The operating system is basically an I/O layer between various abstracts.
There can be portability in an operating system design, which it readily demonstrated by porting the Linux kernel to x86, IA64, MIPS, and numerous other architectures. However, you can not just toss whatever operating system at whatever device. Porting an operating system to another platform can be a challenging task, and even more so for architectures lacking viable documentation - reverse engineering, if required, is rarely a simple process.
If developing in assembly language, you can delve right into OS coding once you ascertain certain hardware parameters, such as interrupts, registers, etc. Have fun.
If developing an operating system in a higher language, such as C or C++, you are first going to need to develop or extend a compiler for the target architecture. For example, GCC is the primary compiler for Linux. The Linux kernel core is largely developed in the C language, which GCC compiles into machine code - a grossly oversimplified explanation, but this is a forum post, so...
When it comes to deploying Linux, you are generally looking to invoke a bootloader to load the core kernel, which then loads various daemons, servers, and (usually) userland applications. Accomplishing the process varies wildly, again depending upon the target device. There is not an "one size fits all" methodology to accomplishing the described process. Some devices might require little to no modification (typical generic x86 PC), others might require changing boot sector data or modifying a few lines of assembly code in the system firmware, while others might need extensive work like a firmware overhaul or rewrite.
Anyway, it appears you are more interested in running an application on a target device. Traditionally, you first need an operating system as an intermediary between the device and your application. Determine your target device, then ideally hope someone else has already developed or ported an operating system and compiler for the architecture. Develop your application in C, C++, or whatever language the compiler supports, then deploy the operating system and software accordingly. What devices are you hoping to target? I know you mentioned the iPod. There is (was?) a uClinux porting project targeting the architecture, so it would be a good place to start. Drop a web search.
Ultimately, if you are truly ever interested in operating system development and how operating systems interface with hardware, you best bet is start reading.... and then read more.... and continue reading more.... and well, ya' likely get the point. The OSDev wiki is a good place to start learning the fundamental abstracts of operating system design. As your knowledge expands, you could perhaps look into various tutorials on using and extending Minix or another academic operating system, plus maybe consider grabbing a PIC or Stamp development kit with documentation and various resources to better learn about how to interface software with hardware.Robert Richmond | Infinite perceptions. One reality.
October 25th, 2010, 05:28 PM #3
- Join Date
- Oct 2010
Thanks for the welcome and for the help RobRich, Iv started reading up on how everything works together (thanks for the OSDev link). Also for the tip on the uClinux, gonna go check that out later. Havent figured out what hardware I should use, I am just looking for whatever is available to serve my purposes. Since I have a pretty decent access to hardware spare parts, and can haggle for more if I need. So changing the encasing or shape is easy for me as long as I maintain the architecture, so going to go look at whats available. Thanks again!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By dauss in forum Mobile ComputingReplies: 0Last Post: May 3rd, 2006, 04:16 AM
By flyguyspy in forum General Tech DiscussionReplies: 3Last Post: July 13th, 2005, 05:26 PM
By helpmetweak in forum Applications and Operating SystemsReplies: 2Last Post: May 8th, 2005, 05:45 AM
By filipino in forum Graphic Design and Digital PhotographyReplies: 5Last Post: January 30th, 2005, 10:49 AM
By Etruscan in forum Networking and InternetReplies: 5Last Post: September 30th, 2002, 08:56 PM