Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit Linux source code?

Tags:

linux

I want to modify the source code for Linux. I don't know from where to start.

I want to study the code and then modify it and see the changes by runnng it. Where do I start? I am a college passout and I know C and C++ but never edited the source code of Linux. I want a small light-weight Linux that has small source code files so that I can study it and modiy. To create my own one. Which Linux will be best for me and how do I get started with editing the soucre code? Will just installing Linux also give me its source code?

like image 568
user223541 Avatar asked Jan 01 '10 09:01

user223541


People also ask

Can we edit Linux source code?

If you want to modify the Linux Kernel or one of the "core" applications that usually form a distribution, and if you don't have much experience with Linux or modifying it, I recommend looking at Linux From Scratch.

Can you edit Linux kernel?

changing linux kernel involves two things: Downloading the source code, compiling the kernel. Here when you compile the kernel for first time it will take time. I have attached link to start compiling kernel and install it. Now-a-days its quiet easy.

What is source code in Linux?

Source code (also referred to as source or code) is the version of software as it is originally written (i.e., typed into a computer) by a human in plain text (i.e., human readable alphanumeric characters).


2 Answers

The term "Linux" can mean a couple of different things.

The Linux Kernel

This is the real Linux, and is available from http://kernel.org/.

You won't find a small or light weight version of this. The kernel is the kernel. (That said, you can turn features off during compile time, which is useful if you are targeting low powered hardware such as for an embedded device).

Linux distributions

This is a Linux kernel, bundled with a big stack of other software needed to make it useful. The source code for the various pieces of software are available separately.

A netinstall of Debian gives you the core of the system in a small download. It has a package management system that makes it easy to get the source code of the various programs available for it.

like image 153
Quentin Avatar answered Oct 20 '22 09:10

Quentin


What exactly do you want to edit from a Linux distribution?

Linux itself is just a kernel, but the term is also used to refer to operating systems using the kernel. If you want to tinker with GUI programs, you can install a Linux distribution then download the source of those programs separately. If you want to tinker with the kernel itself, the source can be obtained from kernel.org. Each Linux distribution has it's own set of programs and features you can change around to your liking, but I doubt you want to edit everything that comes in a standard distribution like Ubuntu, as recompiling everything each time to see changes will take a while.

Linux is a lot to dive into for a first timer in the OS field. There is a great smaller Unix-like operating system for learning called MINIX. The source download is around 2.2M I believe and it is used as a teaching aid in many operating system development courses worldwide. Personally I'd sink my teeth into that a bit before taking on Linux, but the choice is yours, so have fun with it! Build it, break it, and try to rebuild it again! It's a great learning experience.

like image 21
John T Avatar answered Oct 20 '22 10:10

John T