Jump to content
xisto Community
Jguy101

What Language Is Linux Written In ?

Recommended Posts

I''ve been wondering lately, what language is Linux written in?

 

I'm interested in this, because my friend and I are considering writing our own distro. I know, it sounds like a bit of a feat, but one guy wrote MEPIS by playing with the Debian source code. I think the two of us could do something similar. ;)

Share this post


Link to post
Share on other sites

Linux I am not sure about, but I do know that UNIX is entirely written in C, and I'm willing to make a safe bet that Linux itself is also written in C.Writing a distro seems to be more about packages included and the package management used than actually altering the source code. If I was going to creat a distro, I'd basically end up creating another Slackware.

Share this post


Link to post
Share on other sites

You do not need to program to make a new distro.

however, for the sake of answering your question.....

Linux itself is written in C and Assembly.
GNU is written mostly in C.
Libraries are written in C and C++ (QT is written in C++, GTK i believe is C)
Boot scripts are USUALLY written in Bash Script, but there is no reason you couldnt use some other scripting language


To create a differant distro, here's what you need to do....

1) Decide on a package management system.
You can use a currently existing system such as RPM, Debian PKG, Gentoo's Portage, or Slackware's TGZ.

Alternativly, you could choose to have no package management system, and the user will needto compile everything from source (similar to Linux From Scratch)

OR Ideally, Program your own package management system (the language of your choice)

2) The Kernel....
Most distro's patch the vanilla linux kernel. For example, Gentoo has many krnels available, some patched to be optimised towards desktop use, some optimised for server use.

You need to decide on what makes your distro differant / beter than other distro's and patch the kernel accordingly.

For example, you may decide that disk IO is more important that disk reliability on your distro, so you may want to patch your kernel with the experimental file system Reiser4.

Alternativly, you could use the kernel from anouther distro, for example the Gentoo kernel for performance, or the Redhat kernel for a more server oriented kernel.

Alternativly, you could just use the un-patched vanilla linux kernel from kernel.org

3) Boot scripts.
Many disto's use differant methods for selecting what scripts are executed dureing boot up.
Slackware just executes every script that has executable permissions.

Redhat / Fedora executes every script that has a symbolic link in the runlevel folder.

Gentoo uses a tool called rc-update,

Either use a currently existing method, or create your own method.

4) Create an Install CD.
This doesnt have to be complicated.
a simple install CD could be a simpl bootable CD, that just coppies a default install folder to the root of the hard disk, and installs GRUB to the MBR.


Their are2 reasons i can think of for creating a distro...
1) for fun and learning
2) because there are no distro's that work exactly the way you like.

For help getting started, you may want to look at Linux From Scratch.

http://www.linuxfromscratch.org/

this is a book with step by step instructions on how to start with a completely empty hard disk, and download and compile a full linux distro.

the end result is a completely customised, lightning fast minimal distro.
then books like Beyond Linux From Scratch will help you turn this into a full OS with all the features of any top quality distro.

Many people create there own distro's using LFS as a base to work from.

Enjoy.

Share this post


Link to post
Share on other sites

Like all OSes, Linux is written in any programming language someone who adds to it rights in. Since OS kernels are compiled, the used language doesn't matter. However, most OSes are written in Assembly and C++.~Viz

Share this post


Link to post
Share on other sites

Well i would recomend that instead of making your own distribution , you should focus on maintainng an already established distribution. Alot of distributions require maintainers as people leave as they dont have time to contribute . Like Danial Robbins , founder of Gentoo....he had a family to take care of..but he did take a job at Microsoft :SGood Distros to contribute are Ubuntu , Fedora and Gentoo as they have a very strong community based program.

Share this post


Link to post
Share on other sites

And for the ones that' not a developer. Contributing by testing the new software and report the bugs.If you're very familiar with a distro, you may also help others on the forum, guide them to the Open Source World.

Share this post


Link to post
Share on other sites

Its amasing, but this thing seems to happen all the time in the Linux forum.A question is asked, but instead of beeing answered, they get an alien surgestion."Q: How do i create a new distro ?""A: Use Ubuntu""Q: Does Linux support brand X wireless network""A: I dont Know, use Ubuntu""Q: Whats the capital of Scotland?""A: Ubuntu"Lol. If only this site had a humour section.Seriously though.....Go for Linux From Scratch, or google for "Meta Distribution"a Meta Distribution is a bit like a distro used for creating s custom distro ( gentoo :) yipee )

Share this post


Link to post
Share on other sites

A little off-topic, but some of my friends tried ubuntu 5.04 and hated it... three of them to be precise .... and they switched to alternate OSes. One of them jumped back to Windows and CS :), one to Archlinux and one took up gentoo on my suggestion. Surprisingly, one of them got pained with the package management system, and the other two got pained with X (Max resolution of 640x480 on 17" monitors ... i810 chipset). The guy who didn't like the package management is now using gentoo and is very happy with it.LFS sounds very interesting. I think I'm gonna take it up next semester when I have some free time. How long will it take to install LFS if I follow the handbook? A week maybe? Since Gentoo took 1 day to give me a usable KDE, LFS should take longer.

Share this post


Link to post
Share on other sites

not surprising. I don't like Ubuntu because it's annoying. It's debian configurator keeps overriding my manual configurations, which I need for running some games on my computer. Also, since it's Ubuntu, regular users can't open up extra X windows,(xinit /usr/local/games/[gamename]/[game] -- : 1) which makes me wonder, how is this a bad thing? It's actually better than if the game crashes and you losing all of your programs, like running Mercury Messenger and Skype in the background.After thinking for a while and returned back to SuSE Linux and have stuck to it since.I don't like gentoo because there's too much configuration needed and the compilation takes forever.xboxrulz

Share this post


Link to post
Share on other sites

I''ve been wondering lately, what language is Linux written in?

 

I'm interested in this, because my friend and I are considering writing our own distro. I know, it sounds like a bit of a feat, but one guy wrote MEPIS by playing with the Debian source code. I think the two of us could do something similar. :)

1064329983[/snapback]


I think in C

Share this post


Link to post
Share on other sites

How long will it take to install LFS


Linux from scratch leaves you with a bootable linux OS and a full set of development tools.

bascially, all your basic bash commands, and a compiler.

This took me 2 solid days on a 1.2Ghz Athlon Thunderbird.

he whole of the linux from scratch is equivelent to a gentoo @emerge system@ (forgive me, im on a windows machine, and the keyborad is set to american... no speach marks)

Its a good learning experiance, but it gets repetative.

you spend half the time readinf explanations of why you need to do each step, and typing...

wget files and patchestar -zxf blahgzcat patch.diff.gz | patch -P0./configre --prefix=/usr <and other random options >makemake install 

the *FUN* doesnt start untill you more onto the other books, like BeyondLinuxFrom scratch, which helps you build things like Xorg.

Share this post


Link to post
Share on other sites

Well... I gotta try everything I can right now, because I've only got one sem left before I graduate and once I leave, I doubt I'll have free internet ;). Besides, I don't think I'll have the freedom and time later on. I'll give LFS a shot .... let's see what it has to offer :).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.