Difference Between Linux Kernel and Unix Kernel(Such as Freebsd) from Programmer's Point of View

difference between Linux kernel and UNIX kernel(such as FreeBSD) from programmer's point of view

For a userland programmer, there is no difference. The userland programming will be coding to a language VM like C and it will be up to the C library routines to translate that into lower level system calls.

Those using other tools such as Perl, Python, Java and so on, are even more removed from the kernel so it will not directly affect them either.

In terms of the kernel programmer, the differences are likely to be significant since the kernels themselves are different. I haven't seen the FreeBSD internals although I've done a fair bit of work inside Linux, so I can't comment intelligently on the low-level differences but (and this final bit is informed opinion, not gospel), since they run independent development streams, the chances of having exactly the same view is small.

UNIX AND LINUX EXPLANATION

Unix and Linux both are OS ,Linux have Linux kernel ,and Unix have Unix kernel.Linux is developed by Open Source development i.e. through sharing and collaboration of code and features through forums etc and it is distributed by various vendors.Unix systems are divided into various other flavors, mostly developed by AT&T as well as various commercial vendors and non-profit organizations.
following link differentiate both OS This Wikipedia of LinuxThis Wikipedia of Unix
all this link give you very clear idea of Linux and Unix

In layman's terms, what is the difference between Mac OS, Ubuntu, Linux, and Unix?

Unix is an operating system originally developed in the 1970s, on which Mac OS X is based. Linux is a kernel (the part of an operating system which interfaces with the hardware), while distributions such as Ubuntu or Fedora add the rest of the software (much of which comes from the GNU project) to make it into a full OS. Linux and the GNU project originally came to exist to provide a free alternative to the closed-source Unix, so while the code is not descended from Unix, they are quite similar.

Super User mode - when exactly do I need it?

Insmod requires superuser privilege because inserting a kernel module modifies the operating system kernel. The module will be able to read and write any memory within the system, read or modify any file on disk, change permissions, ownership of any resources, etc.

And generally these are the sorts of the things that are protected by the superuser privilege: ability to bypass access controls on memory, files and other resources, and to perform various administrative tasks needed to operate the system (and that might render the system insecure or unusable if allowed to a malicious user).

In linux, it is possible to configure the system in such a way that there is not in fact a single superuser, but a series of granular capabilities that each can be granted to individual users (indeed this is how it is modeled in the kernel source code: one does not check whether the current UID is zero, one checks whether the current user has the "change-ownership" capability [CAP_CHOWN]). In the huge majority of deployed linux systems, the system is configured with a single all-or-nothing superuser privilege (i.e. whether the calling user has an effective user ID of 0).

The single superuser privilege (EUID == 0) was the traditional model used in Unix from the earliest days, though there have been a number of implementations that provided more granular privileges.

Modifying files outside your home directory is one use, although it is possible to own files in places other than one's home directory, and it is possible for other users to own files within your home directory.

What is the meaning of POSIX?

POSIX is a family of standards, specified by the IEEE, to clarify and make uniform the application programming interfaces (and ancillary issues, such as commandline shell utilities) provided by Unix-y operating systems.

When you write your programs to rely on POSIX standards, you can be pretty sure to be able to port them easily among a large family of Unix derivatives (including Linux, but not limited to it!); if and when you use some Linux API that's not standardized as part of Posix, you will have a harder time if and when you want to port that program or library to other Unix-y systems (e.g., MacOSX) in the future.

What's the best way to get to know linux or BSD kernel internals?

In college, I had an operating systems class where we used a book by Tanenbaum. In the class, we implemented a device driver in the Minix operating system. It was a lot of fun, and we learned a lot.

One thing to note though, if you pick Minix, it is designed for learning. It is a microkernel, while Linux and BSD are a monolithic kernel, so what you learn may not be 100% translatable to be able to work with Linux or BSD, but you can still gain a lot out of it, without having to process quite as much information.

As a side note, if you've read Just for Fun, Linus actually was playing with Minix before he wrote Linux, but it just wasn't enough for his purposes.

Minix vs Linux for Learning Operating System Design?

I would go for the Minix route, just because of my personal experience with it. Minix is very straightforward, and written from an educational point of view. Linux kernel on the other hand has been around for so long, and is therefore optimized heavily. I do not think that it is a good start.

I wouldn't worry too much about which minix version. The concept remains the same. With the newer versions you are able to run X on it, which can be helpful, but at the same time adds more complexity. Just go with the version you find a good book of.

What are the main *nix OS's which are good for learning *nix programming?

To be called UNIX you have to pass a certification that it conforms to the specification, so Linux is more precisely called a UNIX-like operating system. The main paradigms remain even if many particulars will change if you go from Linux to UNIX and from UNIX to another UNIX flavor. That said, you should take a look at The Art of Unix Programming to get a feeling about the ways of doing things.

The more practical thing to do is to get an easy to use Linux distro (Ubuntu, SuSE, Mandriva) and familiarize yourself with it while doing some programming projects. Then, when you are more familiar with how things work so you can manage to solve issues by yourself with ease, and to get a feeling about a different flavor of OS, try OpenSolaris (Nexenta) or some BSD flavor (for instance FreeBSD). The reason for this is that you'll be able to get an environment which works without much (or any) trouble using mainstream Linux, whereas with less used free Unices you'll may hit upon unsupported hardware, harder configuration and so on.

Also, user oriented distros will fare as well as programmer oriented distros (if such a thing exists) to do programming, all the tools will be there at a single package download away, if they don't come in the DVD or CDs themselves. You can usually set up at install time how you wish to use your OS, there are server groups, programming groups and so on, which you can select.

One of the most shocking differences from the user point of view between Unices and Linux is that Unices do not come with the GNU set of tools. These tools are of very high quality and you will miss them if you get used to them and then move to another flavor. It is usually heard that sysadmins first install all the GNU tools on OSs that don't have them.



Related Topics



Leave a reply



Submit