Porting Linux

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
Any good places to start porting linux? I would like infromation on it, not looking for ctrl+c ctrl+v make.

As in porting Linux to a new system? If so I am not sure how many people around here have got down and dirty with it. I certainly have not but I have been a somewhat silent observer of things that went into DSlinux, various open source handhelds, the likes of the raspberry pi and such like, to that end I would like to believe I can at least point you in the right direction.

If you have never set up https://www.archlinux.org/ , http://www.linuxfromscratch.org/ or something that forces you to at least know roughly what is going on at each step from the kernel on up then I would do that first of all.

Step 1 is figure out your architecture. In most cases even if it is a system without a version Linux it will be running upon a processor that does have it (ARM, cut down X86, powerpc of some form, MIPS base processor of some form.... or at least something common), you might then have a version of Linux already on a similar device or be able to use a slightly more generic port as a jumping off point (something like http://www.uclinux.org/description/ being the one used for DSlinux). You might also be lucky and find say Debian has a version in your architecture and you have enough storage, CPU and memory to do it justice ( https://www.debian.org/ports/ ). If you are doing it for a games related system then I probably should point at something like http://www.dingux.com/ but you might wish to find a more modern fork.
You are going to want to know the C programming language and the basics of assembly for the processor you are working in, possibly also a smattering of X86 assembly depending upon what you are porting around. It might also be worth having a look at something like http://jslinux.org/ and all the code around it.

Once you have the kernel speaking to enough of the hardware you have (hopefully it is fairly fixed) to say you have reasonable IO, access to storage* and possibly some graphics options (at least a terminal of some form, even if you are going over SSH/telnet into it) some would say port some kind of dev tools to it, I am happy enough with cross compilation but it is a good step, even if it is only something like python. If you do not like SSH/telnet (or at doing it over something slow/awkward like a soldered serial cable) and do not have graphics then you might also consider a web interface, I am not sure what generic ones there are to look at but it is common enough these days and used by things like firewalls/routers and virtualisation platforms so there is that at least.
Now you get to flesh out the hardware support if it was not already there, hopefully it is a reasonably open or a reasonably hacked/documented setup, and start the ever fun process of porting all the packages you want to it, or writing software for it.

*you might have a RAM only/boot from (effectively) read only memory type affair, this is fine too.
 
  • Like
Reactions: gudenau and ground

gudenau

Largely ignored
OP
Member
Joined
Jul 7, 2010
Messages
3,882
Trophies
2
Location
/dev/random
Website
www.gudenau.net
XP
5,419
Country
United States
As in porting Linux to a new system? If so I am not sure how many people around here have got down and dirty with it. I certainly have not but I have been a somewhat silent observer of things that went into DSlinux, various open source handhelds, the likes of the raspberry pi and such like, to that end I would like to believe I can at least point you in the right direction.

If you have never set up https://www.archlinux.org/ , http://www.linuxfromscratch.org/ or something that forces you to at least know roughly what is going on at each step from the kernel on up then I would do that first of all.

Step 1 is figure out your architecture. In most cases even if it is a system without a version Linux it will be running upon a processor that does have it (ARM, cut down X86, powerpc of some form, MIPS base processor of some form.... or at least something common), you might then have a version of Linux already on a similar device or be able to use a slightly more generic port as a jumping off point (something like http://www.uclinux.org/description/ being the one used for DSlinux). You might also be lucky and find say Debian has a version in your architecture and you have enough storage, CPU and memory to do it justice ( https://www.debian.org/ports/ ). If you are doing it for a games related system then I probably should point at something like http://www.dingux.com/ but you might wish to find a more modern fork.
You are going to want to know the C programming language and the basics of assembly for the processor you are working in, possibly also a smattering of X86 assembly depending upon what you are porting around. It might also be worth having a look at something like http://jslinux.org/ and all the code around it.

Once you have the kernel speaking to enough of the hardware you have (hopefully it is fairly fixed) to say you have reasonable IO, access to storage* and possibly some graphics options (at least a terminal of some form, even if you are going over SSH/telnet into it) some would say port some kind of dev tools to it, I am happy enough with cross compilation but it is a good step, even if it is only something like python. If you do not like SSH/telnet (or at doing it over something slow/awkward like a soldered serial cable) and do not have graphics then you might also consider a web interface, I am not sure what generic ones there are to look at but it is common enough these days and used by things like firewalls/routers and virtualisation platforms so there is that at least.
Now you get to flesh out the hardware support if it was not already there, hopefully it is a reasonably open or a reasonably hacked/documented setup, and start the ever fun process of porting all the packages you want to it, or writing software for it.

*you might have a RAM only/boot from (effectively) read only memory type affair, this is fine too.

Two things.
I did not expect such a good reply.
Thanks. This should help.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Sonic Angel Knight @ Sonic Angel Knight: @_@