Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware). I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
On 02/23/2014 10:54 PM, subham soni wrote:
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? developing you own Kernel. nice. i suggest you learn more about kernel design and their role's. that will make you aware of how things work. http://wiki.osdev.org/ (+ many more) will be your friends. I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware). This would help you on your way. :) I googled out and I came to know that I should start from Device Drivers. device drivers are for kernel's that are running. if you want to make your own, you have to design a infrastructure for drivers to place. Now which device driver should I code? if you are thinking of starting from Linux source, give it a try :p. /dev/null is an excellent example to start. Or should I master Shell Scripting? depends on type of work, but i think basic things like Makefile, compiling from shell, and doing echo work should be ok (at minimum). For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where? all i can say is: learn more about low power thingi'es so that you can re iterate on what your asking.
Linux OS -> GNU/Linux OS GNU userland utilities/applications with Linux Kernel :) summary: learn more about kernel design, how they work, decide hardware to bake on. read hardware document learn from others kernel VM will be handy. (qemu, ...) patience <--- important be ready for hiccup's
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- *Kuldeep Singh Dhaka* +91-8791676237 Programmer, Open Source, Embedded System, Entrepreneur, System Administrator, Animal Lover, Web Developer, Learner. My GnuPG Public Key <http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x23816C5609DC7E26> Fork Me <http://github.com/kuldeepdhaka> Bitcoins Accepted.
On Sun, Feb 23, 2014 at 10:54:31PM +0530, subham soni wrote:
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from?
Hi, 2014-02-24 01:24, subham soni :
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware). I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies I read some books about how to DIY an OS . Of course it's simple and crude, but it's a good start, I think.
Hidemi Kawai, Homemade Operating System Within 30 Days Yuan Yu, Operating System From Scratch (I don't know if there is an English edition. The project from thisbook is on GitHub: https://github.com/yyu/osfs00) " <http://www.amazon.com/Homemade-Operating-System-Chinese-Edition/dp/7115287961>There are many ways to learn OS, but I believe the best way is to learn by practice. There are many open source OS code, but the code bases are huge. You will get lost in the source code labyrinth. There are good books, /Operating System: Design and Implementation/ by A.S. Tanenbaum and A.S. Woodhull for example, but they don't teach you where to begin either. That's why you should come here. If Tanenbaum's book is a reference, my project series is a tutorial. Prof. Tanenbaum tells you what. I'll tell you how." <http://www.amazon.com/Homemade-Operating-System-Chinese-Edition/dp/711528796...> Above are two funny books involving me into coding and learning about OS. However, if you're serious, please just ignore :-P All the best, Freeman Zhang <http://www.amazon.com/Homemade-Operating-System-Chinese-Edition/dp/711528796...>
On Mon, Feb 24, 2014 at 6:43 AM, freeman <freeman.zhang1992@gmail.com> wrote:
Hi, 2014-02-24 01:24, subham soni :
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware). I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
First learn about how compilation is done. How the program is actually executed. Learn about linker scripts, you'll need that black magic art that you'll definitely going to need. With this information you can at least understand the role BIOS play and how bootloader comes into play. Before your kernel coding starts i think you should at the very least be able to replicate a dummy bootloader, just to motivate yourself :P. Intel manuals (System programmer) would be your guide if you are doing this for PC. Last but not the least, test your code as a program first on PC. Make functions that are generic and could work with the arguments you pass to them. So with that said you can very easily create dynamic memory management code and test it as a module, then integrate it with kernel. You must always use parameters and don't assume anything. As your each module gets ready then integrate it with your kernel. You'll need to write some test programs as well so as to know that it actually works. Break it down into manageable pieces first before you start coding!. There would be a lot of code required before you can just print Hello World using your own printk or printf. Some resources you can google are osdev wiki, lots of info but please don't copy paste understand it first and then try to write by yourself. You'll learn alot by doing yourself.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
I read some books about how to DIY an OS . Of course it's simple and crude, but it's a good start, I think.
Hidemi Kawai, Homemade Operating System Within 30 Days Yuan Yu, Operating System From Scratch (I don't know if there is an English edition. The project from this book is on GitHub: https://github.com/yyu/osfs00)
" There are many ways to learn OS, but I believe the best way is to learn by practice. There are many open source OS code, but the code bases are huge. You will get lost in the source code labyrinth.
There are good books, Operating System: Design and Implementation by A.S. Tanenbaum and A.S. Woodhull for example, but they don't teach you where to begin either.
This is by far the best book if you are actually serious about it. Definitely nobody will teach you how it's actually done but it'll guide you the best. You'll have to answers on your own.
That's why you should come here. If Tanenbaum's book is a reference, my project series is a tutorial. Prof. Tanenbaum tells you what. I'll tell you how."
Above are two funny books involving me into coding and learning about OS. However, if you're serious, please just ignore :-P
All the best, Freeman Zhang
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
---P.K.S -- Pranay Srivastava
Should I directly dive into device drivers , I started referring Linux Device Drivers 3 for kernel 2.x. But seriously couldn't understand a thing. I dream is to have my own linux distro that surpasses all the limitations of present distros. On 2/24/14, Pranay Srivastava <pranjas@gmail.com> wrote:
On Mon, Feb 24, 2014 at 6:43 AM, freeman <freeman.zhang1992@gmail.com> wrote:
Hi, 2014-02-24 01:24, subham soni :
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware). I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
First learn about how compilation is done. How the program is actually executed. Learn about linker scripts, you'll need that black magic art that you'll definitely going to need.
With this information you can at least understand the role BIOS play and how bootloader comes into play.
Before your kernel coding starts i think you should at the very least be able to replicate a dummy bootloader, just to motivate yourself :P.
Intel manuals (System programmer) would be your guide if you are doing this for PC.
Last but not the least, test your code as a program first on PC. Make functions that are generic and could work with the arguments you pass to them. So with that said you can very easily create dynamic memory management code and test it as a module, then integrate it with kernel. You must always use parameters and don't assume anything. As your each module gets ready then integrate it with your kernel. You'll need to write some test programs as well so as to know that it actually works. Break it down into manageable pieces first before you start coding!.
There would be a lot of code required before you can just print Hello World using your own printk or printf.
Some resources you can google are osdev wiki, lots of info but please don't copy paste understand it first and then try to write by yourself. You'll learn alot by doing yourself.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
I read some books about how to DIY an OS . Of course it's simple and crude, but it's a good start, I think.
Hidemi Kawai, Homemade Operating System Within 30 Days Yuan Yu, Operating System From Scratch (I don't know if there is an English edition. The project from this book is on GitHub: https://github.com/yyu/osfs00)
" There are many ways to learn OS, but I believe the best way is to learn by practice. There are many open source OS code, but the code bases are huge. You will get lost in the source code labyrinth.
There are good books, Operating System: Design and Implementation by A.S. Tanenbaum and A.S. Woodhull for example, but they don't teach you where to begin either.
This is by far the best book if you are actually serious about it. Definitely nobody will teach you how it's actually done but it'll guide you the best. You'll have to answers on your own.
That's why you should come here. If Tanenbaum's book is a reference, my project series is a tutorial. Prof. Tanenbaum tells you what. I'll tell you how."
Above are two funny books involving me into coding and learning about OS. However, if you're serious, please just ignore :-P
All the best, Freeman Zhang
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
---P.K.S -- Pranay Srivastava
On Sun, Feb 23, 2014 at 9:44 PM, subham soni <sonikernel1@gmail.com> wrote:
Should I directly dive into device drivers , I started referring Linux Device Drivers 3 for kernel 2.x. But seriously couldn't understand a thing. I dream is to have my own linux distro that surpasses all the limitations of present distros.
How about starting with first listing out "all the limitations of present distros" and how do you plan to solve them. Thanks - Manish
On 2/24/14, Pranay Srivastava <pranjas@gmail.com> wrote:
On Mon, Feb 24, 2014 at 6:43 AM, freeman <freeman.zhang1992@gmail.com> wrote:
Hi, 2014-02-24 01:24, subham soni :
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware). I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
First learn about how compilation is done. How the program is actually executed. Learn about linker scripts, you'll need that black magic art that you'll definitely going to need.
With this information you can at least understand the role BIOS play and how bootloader comes into play.
Before your kernel coding starts i think you should at the very least be able to replicate a dummy bootloader, just to motivate yourself :P.
Intel manuals (System programmer) would be your guide if you are doing this for PC.
Last but not the least, test your code as a program first on PC. Make functions that are generic and could work with the arguments you pass to them. So with that said you can very easily create dynamic memory management code and test it as a module, then integrate it with kernel. You must always use parameters and don't assume anything. As your each module gets ready then integrate it with your kernel. You'll need to write some test programs as well so as to know that it actually works. Break it down into manageable pieces first before you start coding!.
There would be a lot of code required before you can just print Hello World using your own printk or printf.
Some resources you can google are osdev wiki, lots of info but please don't copy paste understand it first and then try to write by yourself. You'll learn alot by doing yourself.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
I read some books about how to DIY an OS . Of course it's simple and crude, but it's a good start, I think.
Hidemi Kawai, Homemade Operating System Within 30 Days Yuan Yu, Operating System From Scratch (I don't know if there is an English edition. The project from this book is on GitHub: https://github.com/yyu/osfs00)
" There are many ways to learn OS, but I believe the best way is to learn by practice. There are many open source OS code, but the code bases are huge. You will get lost in the source code labyrinth.
There are good books, Operating System: Design and Implementation by A.S. Tanenbaum and A.S. Woodhull for example, but they don't teach you where to begin either.
This is by far the best book if you are actually serious about it. Definitely nobody will teach you how it's actually done but it'll guide you the best. You'll have to answers on your own.
That's why you should come here. If Tanenbaum's book is a reference, my project series is a tutorial. Prof. Tanenbaum tells you what. I'll tell you how."
Above are two funny books involving me into coding and learning about OS. However, if you're serious, please just ignore :-P
All the best, Freeman Zhang
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
---P.K.S -- Pranay Srivastava
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thanks - Manish
On Sun, Feb 23, 2014 at 10:54 PM, subham soni <sonikernel1@gmail.com> wrote:
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware).
You can start with reading Linux kernel development by Robert Love. Also look at minix3 microkernel and its feature. You need to understand the various modules of OS before writing a one....
I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
I don't think drivers is the good place to start.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Which of the Linux Distros should I take into consideration?Debian,Fedora,Gentoo,Slackware,openSUSE,etc.. there are so many, which distros should I take into consideration, consider the limitations and start working?Secondly, is the kernel (if the same version is considered) same on two different distros? That is , distributions differ at the Kernel level as well? On 2/24/14, priyaranjan <priyaranjan45678@gmail.com> wrote:
On Sun, Feb 23, 2014 at 10:54 PM, subham soni <sonikernel1@gmail.com> wrote:
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware).
You can start with reading Linux kernel development by Robert Love. Also look at minix3 microkernel and its feature. You need to understand the various modules of OS before writing a one....
I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
I don't think drivers is the good place to start.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Mon, Feb 24, 2014 at 6:44 AM, subham soni <sonikernel1@gmail.com> wrote: First and foremost do not top post on this mailing list. Google about toppost and bottom post. Which of the Linux Distros should I take into
consideration?Debian,Fedora,Gentoo,Slackware,openSUSE,etc.. there are so many, which distros should I take into consideration,
It doesn't really matter. All distros have same kernel running inside with some customization. It is matter of choice Debian and Fedora are very good but serious Distros for development. You can choose either.
consider the limitations and start working?
The limitations of distros are not necessarily the limitations of kernel. Both are two different beast Dig a bit more and read about how linux ecosystem works. What does a distribution actually contains. What are the different binaries etc.
Secondly, is the kernel (if the same version is considered) same on two different distros? That is , distributions differ at the Kernel level as well?
Yes and No. Two distribution can have absolutely same kernel but with customizations for various things like drivers etc. You can get source for kernel and compile your own kernel for pretty much any distribution. I think you should read more on OS development 1. Robert Love's Linux kernel Development 2. Maurice J Bach: Design of Unix operating system 3. Richard Steven's Advanced programming in Unix Environment 4. Rob pike's Unix Programming environment 5. Operating system by Galvin and Silberschatz 6. Jim Turley's 80386 advanced programming techniques 7. Linux device drivers (goes without saying) 8. Understanding Linux Kernel (if you are upto it)
On 2/24/14, priyaranjan <priyaranjan45678@gmail.com> wrote:
On Sun, Feb 23, 2014 at 10:54 PM, subham soni <sonikernel1@gmail.com> wrote:
Hello, I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from? I have a good experience of the commands in Linux (Ubuntu,Fedora,Debian,Slackware).
You can start with reading Linux kernel development by Robert Love. Also look at minix3 microkernel and its feature. You need to understand the various modules of OS before writing a one....
I googled out and I came to know that I should start from Device Drivers. Now which device driver should I code? Or should I master Shell Scripting? For developing a kernel (my aim here would be to increase the battery life, since most laptops have only 1.30 hrs or 2.00 hrs in Linux OS) and 3.00 hrs in Windows Environment. How should I start and from where?
I don't think drivers is the good place to start.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thank you Warm Regards Anuz
On Sun, 23 Feb 2014 22:54:31 +0530, subham soni said:
I am a newbie to kernel development. I would like to develop my own kernel from scratch. From where should I start from?
A large supply of caffeine, you're going to be writing a *lot* of code. For example, linux-0.01 was 100 source files totalling 11,283 or so lines of code. For linux 0.96, that jumped to 200 files and 35,000+ lines of code. And 0.99.15 was 175,000 or so lines. So figure you're going to be about a quarter million lines of code before you get to a usable self-hosting environment.
I would suggest you to choose a module(lets say, for example, memory manager) and start understanding the internals of that module end to end raise the questions/doubts, which I guess you will find while understanding the code, here in this forum. Likewise there are different layers and modules which you must understand theoretically as well programmatically. This might help you to find the root cause of poor battery life, which may or may not be because of kernel bug. In general kernel code is optimized atleast the core platform is. you wont generally find unnecessary code blocks that might increase cpu cycles or memory usage. My suggestion would be that you start understanding the kernel code and find the code blocks which you feel can be optimized and start from there. PS: You will find heavily multithreaded and optimized code(took several 1000 man hours over years to write), which may make you to lose your intent. But it would be a good exercise for you to learn a industry standard or even better code which is a must for writing any kernel level modules. At the least it will improve your coding skills. On Mon, Feb 24, 2014 at 11:27 PM, <Valdis.Kletnieks@vt.edu> wrote:
On Sun, 23 Feb 2014 22:54:31 +0530, subham soni said:
I am a newbie to kernel development. I would like to develop my
own
kernel from scratch. From where should I start from?
A large supply of caffeine, you're going to be writing a *lot* of code.
For example, linux-0.01 was 100 source files totalling 11,283 or so lines of code.
For linux 0.96, that jumped to 200 files and 35,000+ lines of code.
And 0.99.15 was 175,000 or so lines.
So figure you're going to be about a quarter million lines of code before you get to a usable self-hosting environment.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- G B Rakesh
participants (10)
-
Anuz Pratap Singh Tomar -
freeman -
John de la Garza -
Kuldeep Singh Dhaka -
Manish Katiyar -
Pranay Srivastava -
priyaranjan -
rakesh Bhaskar -
subham soni -
Valdis.Kletnieks@vt.edu