Which Linux distro uses Linux kernel as is with no modification [closed] - c

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to do some learning with Linux kernel and as you all know there is nothing better than playing with the code itself, Can you please let me know which one of the Linux distros is the easiest to work with? In other words, As far as I know Ubuntu for example modify the kernel for their distro, so the question again, which distro is using the Linux kernel as is with no modification?
Appreciate your guidance.

When it comes to no-frills (no external patches to the kernel) have a look at Slackware. Or follow "Linux from Scratch", that's as bare-bones as it gets.

If you want to start playing with the Linux kernel, I'd recommend a distribution which makes it particularily easy to compile the kernel yourself. Although I cannot provide detailed guidance, Gentoo seems to do so (although gentoo has other drawbacks, I don't know a single person in real life who actually used gentoo for more than two years).
I would not try and look for distributions not modifying the kernel, it's probably not worth the effort. Patches will probably be minor compared to the overall size of the kernel.

You can easily run Ubuntu for example with a vanilla kernel by following https://wiki.ubuntu.com/KernelTeam/GitKernelBuild.

Related

Port C Project from Windows to Linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am tasked with porting a massive c project from windows to linux. I have never ported anything over to linux before and am pretty new to linux. The project uses quite a bit of win32 calls. I have looked through some of it and understand what those parts do, however there are many moving parts and i feel it would take too much time to look through it all. What would be the best way to port it over? Is it foolish of me to think I can move the project over to the linux machine and work through the errors one by one?
Thank you in advanced!
Wine is a Windows Emulator for Linux, more exactly a re-implementation of the Windows API and binary interface, mainly for Unix-like OSes. It has also a builtin library named libwine, which is essentially a compatibility layer between the relevant Linux APIs (mainly: libc and X11) and the Win32.
Compiling the project with libwine, you will compile a Linux executable (binary), using the libwine as a shared lib (shared lib == dll). On this way, you can use the Windows API calls in a Linux project.
Your knowledge of the Win32 API helps a lot, most likely the compatibility isn't 100%. Probably you will have to modify the code a little bit (but not too much).

Would an ARM Processor be the way to go? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was making a little device that would have three buttons (like the ones at radioshack) and each preform its own action. These buttons and their actions would be controlled by a very small real time operating system that I would put on this device.
Would I need an ARM Processor in any way?
How would I put the real time operating system on the device?
What OS would I have to compile this on (ex. Ubuntu? Mac OS X? Windows 7?)?
Are there any examples of anyone doing this?
P.S. No prebuilt boards (ex. arduino). I would build the board myself.
Any feedback would be greatly appreciated!
Even if you don't want to use a prebuilt board in the finished product, I'd recommend getting a prebuilt board (like the Arduino), build your product, program it, test it, etc. while on the breadboard, and then simply rebuild it however you want, using the same hardware as you've been using.
That helps you out especially the next time you're building something, because you already have the prototype board and the toolchain ready to go.
Compiling your files can be done on any OS.
Enumerated version:
No, and I wouldn't even recommend using an ARM processor; but rather an Atmega328 or similar.
Using a programmer.
Any.
Probably millions, or at least hundreds of thousands of examples, yes.

Trimming down freebsd [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am trying to trim down FreeBSD to understand/learn how things work. I have a few questions if someone can help me with that:
1) when we say kernel, can I separate code wise from the rest of the FreeBSD code? What I mean is, I want to know what all files/dirs come under kernel.
2) I know a book called Linux from scratch. Is there any related book for FreeBSD?
Any pointers are most welcome.
Thank you.
FreeBSD is one cohesive system. Whereas Linux is a kernel plus a bunch of packages, all of FreeBSD core is built together (everything but the ports tree). The FreeBSD Handbook is the best resource to start from for learning FreeBSD. There is also a Developer's handbook that can be found on the FreeBSD website. As for what the kernel is in terms of source files, anything under /usr/src/sys is kernel source code. If you want to know about the workings of the kernel, the book "The Design and Implementation of the FreeBSD Operating System" is the definitive guide to the details of the kernel.

linux kernel step by step [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
i know c language.my goal is to read linux kernel.so what languages should i learn(write books too) before start reading kernel and is there any book to help reading linux kernel
This book is a little outdated, but Understanding The Linux Kernel is an amazing reference. It will also give you a crash course in i386 features that make a lot of the kernel facilities possible (such as the MMU and how interrupts work. With operating systems, it's sometimes hard to understand where the hardware ends and the OS begins), and reference a lot of the critical source directly.
Also, look into the LWN Kernel article index for more up-to-date references.
One good way to start is come up with a really simple feature that you'd like to add to the kernel and start hacking away at it. (Something I did in college was count how many times each process got preempted and export that value via the /proc file system. Taught me a lot about scheduling, /proc, the process structure, and many other facilities). Also a recommendation, do this in a VM unless you plan to reboot every fifteen minutes.
For ad hoc questions, searching Google works, or asking questions on IRC. (Respectfully, of course.)
The Linux kernel is over 11.5 million lines long! It takes years to be a good programmer and you have to be one if you want to hack the Linux kernel. Taking your age and experience into account, you will most probably fail if you make that your first C project. I recommend getting your hands wet on some other cool stuffs using C. For Example, port the codes in the GreyHat Python book (debuggers, hooking, fuzzing and e.t.c) to C and add interesting features to them. If you are really into OS development, I recommend reading good books on Assembly and writing your own little real time OS. I've seen a real time OS written by a 13 year old kid so it's possible. Good luck!
Not so long ago there was a Linux kernel workshop at Hackerspace Brussels. You can take a look at the links on the event page https://hackerspace.be/LinuxKernelWorkshop
I raised this question myself years ago. I've then got stuck into lines of Linux kernel source code to figure out how it works. Till now my understanding on Linux kernel is still a mix. I think the best way to understand a program is write it by yourself. To build an OS, I think this is the minimum:
computer hardware & architecture
assembler & compiler
assembly
C language
There are lots of books out there that could help you read Linux kernel piece by piece. You still have a lot of time to rewrite it yourself.

LInux vs BSD for kernel development [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I recently updated my rusty C skills, and I've been trying to find a project to try them out on, so I picked kernel development (after all, C is a systems language). So, I was wondering which would be easier to start out with, Linux or one of the BSDs? Linux has a larger userbase (so I would probably have more support), but it also has a humongous codebase (9 million lines last time I checked), would the BSDs be easier to start out with because they combine the userbase and kernel into one large codebase? Also, is it best to just start reading the kernel source code? And, are they trying to implement new features aside from SMP and new drivers?
Unfortunately, I can only speak of Linux kernel hacking for myself. Currently I'm in an internship where I am working on a kernel, and I never did this before. But I was able to learn a lot of stuff in a quite short time, due to several reasons (again, I want to point out that I don't know how much of this is covered withint he BSD community):
Tutorials. The Linux Community is quite big and therefore you will find a lot of beginners information on kernel hacking. I feel like the standard to begin with was this guide. If you read it you will see, that even kernel hacking starts with hello world ;)
Linux Cross Reference. A great tool. It covers the complete Vanilla source code and shows you where each function/struct/define/whatever was defined and implemented, so no long searching for some stuff
The modular build of linux (I assume the same goes for BSD) Clearly you won't be able to look through 9 mio lines of code. But you can start easy with a little loadable kernel module and then go deeper. Maybe look at other modules first, hack them, and finally dig into the directly compiled stuff
The sheer community size. Not only kernel mailing lists, but also a huge number of forums or Q&A sites like this one where you can be sure to get help if you don't know what to do ;)
Just my 2 cents ;)
I am using and developing for Linux for many years, but am lacking any real experience with BSD to recommend either way.
You sound lacking experience for kernel hacking. Just reading kernel source might be insightful, but won't really teach you much. There is a lot going on in Linux kernel besides drivers. For example, latest 2.6.38 was focused on desktop responsiveness. DRM stack is ever changing and could use more man power.
I'd suggest start easy, small fixes for beta drivers, etc.

Resources