ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hahah... you could also try assembler... I think that won't have any problems with anything... you know, since you are working on such a low level that is quiet impossible (if you know what you are doing) to have problems with anything... (deps, binds, that sort of stuff).
I insist. C or C++... those are the two basic languages you need to know to develop a good app for linux.
c0c0deuz,
You might try Beginning Linux Programming (ISBN 1861002971). Just picked it up - seems pretty comprehensive (900+ pages), covers low level c stuff, tcl, perl, shell scripting, writing for X... assumes really basic c knowledge.
I got a copy of Beginning Linux Programming a few months back. It's an okay book. Good to glance at while on The Throne. Handy reference. For the most part though programming is programming on any platform. I used to write utils for windows before and I don't really find programming on linux too different. The biggest differences (in my humble opionion) would be as follows :
1.) C is the dominant language on linux
2.) Linux guys scoff at Hungarian notation (thank jesus)
3.) Linux has many libraries & such to learn as opposed to MS's APIs, which ARE ALL KNOWING AND CONTROL EVERYTHING!!!!!!!!!!!!!!!!
Anyways, that's my two cents on programming.
Ciccio - no offense, but please research before you post (I know I'm guilty of the same thing). Things you tell people seeking answers can really hurt them. When you say things like "it is a fact that the kernel is mostly programmed on C++" without knowing, it spreads mis-information and ignorance.
The kernel SHOULD be written in standard C++. And, toolkits like GTK+ which provide decorators for xlib functionality should natively support standard C++. I would rather design an application using classes, and inheritance than navigate an action oriented design.
Why? OOP can be just as confusing to follow than proc code. At least a kerenl written in C can be accessed in C or C++. Try using a LoadKernelAndEveryKnownApplication class from C. I'm glad the kernel & most apps are in C. C is all straightforward and doesn't bog you down with templates, classes & the like. Besides, just be glad its not written in all Java (not that it could be).
I was told by a Microsoft developer that they are implementing their entire operating system as managed code. I suspect that if that is true, than they will not document their system interface in some later versions of Windows.
Java is a framework that supports high quality OOP programming. I think it's great for cross platform solutions but probably not so great for system implementation.
A standard C++ kernel would be more manageable and easier to document. Templates are awesome and among the most promising technologies of the future. I'd like to see an entire kernel documented in UML and made out of standard C++ components. That would kick ass.
>>I'd like to see an entire kernel documented in UML and made out of standard C++ components.
I triple-dawg-dare you to write one.
>>Java is a framework that supports high quality OOP programming. I think it's great for cross platform solutions but probably not so great for system implementation.
It's impossible to use Java for systems programming. Even if it were possible, I would absolutly hate to do it.
I don't know if it's the programmers or some weird coincedence, but for some reason C++ programs often come out very bloated. And by bloated I mean the size of the executable, the size of the source code and often times, feature bloat.
Sorry, before in this thread someone told that the kernel was written in pure C. And that makes more sense than a C++ kernel...
Anyway... I think that the only programming language to learn is C. I mean... with C you can do virtually everything. It's the base of the OS and It's the lower-level language (above assembler, obviously) You could write a kernel in java (i'd like to see how that works) but it won't be useful.
I really don't think you can write a kernel in Java. I'm no expert in Java, so it's possible I'm mistaken, but it just dosen't make any sense. You can't directly access memory with Java, from what I understand, so how are you going to load the kernel into memory or access the BIOS information? Plus, all the applications would have to be written in Java, or there would have to be some sort of access layer. It just sounds impossible and ridiculous to me. But if anyone knows if it is in fact possible to write a kernel in Java, please post.
Java is middleware, and it hosts a virtual machine. It's not designed for kenel programming. The virtual machine simulates the kernel with a virtual kernel mode.
The kernel is written in C, all kernels are as far as i'm aware.
C++ for kernels would suck, because the ABI is C++ specific, so making it hard for other languages to invoke system level stuff, and you wouldn't get much gain out of it anyway. Bear in mind you can write object oriented C.
Windows won't be written in managed code anytime soon. The .NET wrapper libs will be.
It's code that is managed by the common language runtime. The middleware compiles the code to a user mode security specification. It handles constraints in user mode, as opposed to kernel mode.
I don't like OOC because it is obfusicated. I don't think that there would be any problem implementing the kernel in standard C++. It would improve readability, extensibility, and modularity. As you said, the kernel has taken more of an object based design over the years, why not refactor it in standard C++ and document it in UML.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.