How would I start learning C for OS Development?
How would I start learning C for OS Development?
Hey... How would I learn C for my operating system? I know quite a lot of functions. How would I learn to use it?
Re: How would I start learning C for OS Development?
I honestly wondered the same thing, but there are people here who may guide you in the proper direction.
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: How would I start learning C for OS Development?
Here ya go... good luck.
4.5 hour tutorial
https://youtu.be/-CpG3oATGIs
4.5 hour tutorial
https://youtu.be/-CpG3oATGIs
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language.
1) This is by far the most comprehensive C Programming course you'll find here, or anywhere else.
2) This C Programming tutorial Series starts from the very basics and covers advanced concepts as we progress. This course breaks even the most complex applications down into simplistic steps.
3) It is aimed at complete beginners, and assumes that you have no programming experience whatsoever.
4) This C Programming tutorial Series uses Visual training method, offering users increased retention and accelerated learning.
Every programmer should and must have learnt C whether it is a Java or C# expert, Because all these languages are derived from C. In this tutorial you will learn all the basic concept of C programming language. Every section in this tutorial is downloadable for offline learning. Topics will be added additional to the tutorial every week or the other which cover more topics and with advanced topics.
This is we will Learn Data Types, Arithmetic, If, Switch, Ternary Operator, Arrays, For Loop, While Loop, Do While Loop, User Input, Strings, Functions, Recursion, File I/O, Exceptions, Pointers, Reference Operator , memory management, pre-processorsand more.
c tutorial for beginners. C programming tutorials for beginners.
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: How would I start learning C for OS Development?
WaterOS wrote:Hey... How would I learn C for my operating system? I know quite a lot of functions. How would I learn to use it?
Code: Select all
<rant_mode>
Code: Select all
</rant_mode>
Next dive into the language standard and, perhaps, into some other truly informative reading: The latest C standard is from 2011 (do we call it C11?), but you don't need to concern yourself with it now. Most of the things are in C89 and C99.
Re: How would I start learning C for OS Development?
I strongly discourage using tutorials to learn C. It's not a particularly friendly language that forgives its misuse and abuse by those who have a very incomplete and/or distorted view of what C really is. Nearly all C tutorials are incomplete, inaccurate or outright wrong. There have been plenty of books on C of the same poor quality and I have had a chance to pick up don't's instead of picking up do's from them. I then had to unlearn the bad things and learn the language the right way, paying attention to the most problematic aspects of the language, including undefined behavior, implementation-defined behavior and unspecified behavior. Those behaviors are bound to bite when writing things like operating systems. Tutorials will deceptively show the ease/simplicity of the language in simple programs. But there's a lot they won't tell. Because either the tutorial authors themselves don't quite know enough or because they just don't have the time or energy to essentially duplicate the knowledge contained in approx. 600 pages of the language standard (we can probably halve that number because not everyone is going to use every bit of the language library or write a C compiler, but that would still be a lot).dchapiesky wrote:Here ya go... good luck.
4.5 hour tutorial
https://youtu.be/-CpG3oATGIs
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language.
1) This is by far the most comprehensive C Programming course you'll find here, or anywhere else.
2) This C Programming tutorial Series starts from the very basics and covers advanced concepts as we progress. This course breaks even the most complex applications down into simplistic steps.
3) It is aimed at complete beginners, and assumes that you have no programming experience whatsoever.
4) This C Programming tutorial Series uses Visual training method, offering users increased retention and accelerated learning.
Every programmer should and must have learnt C whether it is a Java or C# expert, Because all these languages are derived from C. In this tutorial you will learn all the basic concept of C programming language. Every section in this tutorial is downloadable for offline learning. Topics will be added additional to the tutorial every week or the other which cover more topics and with advanced topics.
This is we will Learn Data Types, Arithmetic, If, Switch, Ternary Operator, Arrays, For Loop, While Loop, Do While Loop, User Input, Strings, Functions, Recursion, File I/O, Exceptions, Pointers, Reference Operator , memory management, pre-processorsand more.
c tutorial for beginners. C programming tutorials for beginners.
If someone is about to learn their first programming language, they should not choose C. Learning the basics of programming while using an unfriendly and unforgiving language is no fun. The fact that a C program compiles is nowhere a guarantee that it's correct. The fact that a C program appears to work as expected is nowhere a guarantee that it will continue to do so when moved to another computer or another compiler or a newer version of the same compiler.
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: How would I start learning C for OS Development?
[rant] I learned C as my first language when I was 13 and all I had was Mark William's Let's C on an orginal IBM PC that still had the cassette recorder connector beside the keyboard connector. If it was good enough for me, then it's was good enough for anyone now. [/rant]
However, in terms of the beginner, there will never be a correct program. In terms of the amateur, there will never be a correct program. And in terms of the professional - nada. Why? Cause there's always going to be a patch. There will always be a new idea that breaks old ones... again trial, error, gdb, and this time a break point.
[rant] There should be a RANT button in the editor beside Quote and Code [/rant]
WaterOS - learn C and have fun - then you can rant too!
It is quite friendly - in that it does not limit you in how you express yourself... unlike say Java (the language that binds your hands in wool mittens and wraps you up in a carpet to protect you.) The WHOLE POINT of using C in the context of an OS is that it LETS YOU DO ANYTHING.... And needing forgiveness from a language is stupid - I WANT to poke a byte at address 0x100 (to use BASIC nomenclature) --- I WANT to see what happens when I rolls over 2000 bytes beyond 0xb8000 - just to see.. WHY cause I got's ta' learn to debug sometime... why not now?alexfru wrote:It's not a particularly friendly language that forgives its misuse and abuse by those who have a very incomplete and/or distorted view of what C really is.
You are completely right. And there is a library full of thesis papers on trying make correct programs. There are hundreds of solvers, boolean expression evaluators, and design by contract.... none of which work unless you understand why they are telling you what they tell you... thus trial, error, gdb, and freakin stack trace.alexfru wrote:The fact that a C program compiles is nowhere a guarantee that it's correct
However, in terms of the beginner, there will never be a correct program. In terms of the amateur, there will never be a correct program. And in terms of the professional - nada. Why? Cause there's always going to be a patch. There will always be a new idea that breaks old ones... again trial, error, gdb, and this time a break point.
Moot. Moooooooot. Does not enter into the discussion. Who CARES? Trying to design for the future of compilers controlled by those you do not pay is ludicrous. In C the variable name "new" used to be used like gangbusters until some jackass came along and made it a keyword in C++. "auto" used to mean one thing and now it doesn't. Things evolve, if your program is important enough you go with the flow. If your program is an OS you use gcc 4.3 for 10 or so years before upgrading to 4.6alexfru wrote:The fact that a C program appears to work as expected is nowhere a guarantee that it will continue to do so when moved to another computer or another compiler or a newer version of the same compiler.
[rant] There should be a RANT button in the editor beside Quote and Code [/rant]
WaterOS - learn C and have fun - then you can rant too!
Plagiarize. Plagiarize. Let not one line escape thine eyes...
- MichaelFarthing
- Member
- Posts: 167
- Joined: Thu Mar 10, 2016 7:35 am
- Location: Lancaster, England, Disunited Kingdom
Re: How would I start learning C for OS Development?
And these youngsters learning C should be CANED if they make mistakes: it'll teach them not to do it again.
That's what happened in my day and it never did me any harm!!!
[sorry - couldn't resist it]
That's what happened in my day and it never did me any harm!!!
[sorry - couldn't resist it]
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: How would I start learning C for OS Development?
luxury.MichaelFarthing wrote:And these youngsters learning C should be CANED if they make mistakes: it'll teach them not to do it again.
That's what happened in my day and it never did me any harm!!!
[sorry - couldn't resist it]
I had to manually clean 8" floppy drives with a pencil eraser if I didn't know the hexadecimal value of 10 octal...
interestingly, where I hung out as a kid there were always Bell Telephone employees who were Tandy Color Computer aficionados - a whole clique of 'em - and they would corner you and make fun of you if you couldn't decode the color stripes on a resistor they just happened to have in their shirt pocket...
Those were the days when you couldn't tell the difference between an engineer and a pedophile.
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: How would I start learning C for OS Development?
Except, it must be done by the rules of the language, or you can get screwed.dchapiesky wrote:[C] is quite friendly - in that it does not limit you in how you express yourself... unlike say Java (the language that binds your hands in wool mittens and wraps you up in a carpet to protect you.) The WHOLE POINT of using C in the context of an OS is that it LETS YOU DO ANYTHING....
Except, it may be thousands of credit card numbers and millions of dollars too late.dchapiesky wrote: However, in terms of the beginner, there will never be a correct program. In terms of the amateur, there will never be a correct program. And in terms of the professional - nada. Why? Cause there's always going to be a patch.
In my understanding the flow is such that the Linux kernel compiles with a bunch of compiler options making gcc behave as in good old days when people were able to ignore the C standard and get away with it because compilers (and computers they ran on) weren't powerful enough. Most of undefined behavior was defined in 1989 and hasn't changed much since, so bad code not working anymore shouldn't come as a surprise, and yet it does. Or people force the compiler to be dumb (disable optimizations) and mute (disable or ignore warnings).dchapiesky wrote:Moot. Moooooooot. Does not enter into the discussion. Who CARES? Trying to design for the future of compilers controlled by those you do not pay is ludicrous. In C the variable name "new" used to be used like gangbusters until some jackass came along and made it a keyword in C++. "auto" used to mean one thing and now it doesn't. Things evolve, if your program is important enough you go with the flow. If your program is an OS you use gcc 4.3 for 10 or so years before upgrading to 4.6alexfru wrote:The fact that a C program appears to work as expected is nowhere a guarantee that it will continue to do so when moved to another computer or another compiler or a newer version of the same compiler.
Re: How would I start learning C for OS Development?
We do, indeed. Please concern yourself with this latest standard, as it makes C much more pleasant to use.alexfru wrote:(do we call it C11?), but you don't need to concern yourself with it now. Most of the things are in C89 and C99.
Learn to read.
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: How would I start learning C for OS Development?
I can see you are probably a purist and I can identify with that. In my work I have to be able to deterministically reproduce exactly the same code in exactly the same manner. This task amounts to turning off updates and literally building my entire toolchain from the same tarballs. It is infuriating but it has to be done.alexfru wrote: In my understanding the flow is such that the Linux kernel compiles with a bunch of compiler options making gcc behave as in good old days when people were able to ignore the C standard and get away with it because compilers (and computers they ran on) weren't powerful enough. Most of undefined behavior was defined in 1989 and hasn't changed much since, so bad code not working anymore shouldn't come as a surprise, and yet it does. Or people force the compiler to be dumb (disable optimizations) and mute (disable or ignore warnings).
But I must disagree with you, if only because of the context of this thread - a beginner wanted to know how to use C - not java, not tcl, not lisp, not smalltalk... C.
The issues you are raising, while valid, have no place in a discussion about learning C.
where they would be appropriate:
Long Term Design
Long Term Maintenance
Deployment
Testing (especially against multiple vendor compilers)
Analysis
Etc...
In other words, once young WaterOS has a codebase worth troubling over.
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: How would I start learning C for OS Development?
My first full time job had projects that needed to compile with different compilers for different architectures and yield identical results (save performance differences). In my next full time job security and reliability of several projects were very important. So, this demanded writing solid and portable code and testing and reviewing code for language-specific defects.dchapiesky wrote:I can see you are probably a purist and I can identify with that. In my work I have to be able to deterministically reproduce exactly the same code in exactly the same manner.alexfru wrote: In my understanding the flow is such that the Linux kernel compiles with a bunch of compiler options making gcc behave as in good old days when people were able to ignore the C standard and get away with it because compilers (and computers they ran on) weren't powerful enough. Most of undefined behavior was defined in 1989 and hasn't changed much since, so bad code not working anymore shouldn't come as a surprise, and yet it does. Or people force the compiler to be dumb (disable optimizations) and mute (disable or ignore warnings).
But before we get there, we have to start somewhere. Naturally, nobody's born with knowledge of C.
I started to learn C in the late 90's. Many got internet access for the first time in Russia in 96 or so. For me it was very painful to download an application of interest that wouldn't compile or would but wouldn't work and I had to go through a lot of trouble to make them compile and work without knowing well the language or what someone else's code was supposed to do and how. I didn't have the right books nor a copy of the language standard. I had to reconstruct the language model as described in the standard by trial and error, from bits found in newsgroups and other places online. This is the wrong way to do it. It's inefficient and there still remain gaps after the exercise. How do you close them? You learn the language the right way. You may do it on the job. But you may not always get the job you want if the potential employer sees gaps in your knowledge in the areas deemed crucial.
Further, unlearning/relearning is problematic by itself. So, why not do things the right way when everything you need to do it is available (books, standards, advice, etc)?
I'm afraid we don't have an agreement here.dchapiesky wrote:But I must disagree with you, if only because of the context of this thread - a beginner wanted to know how to use C - not java, not tcl, not lisp, not smalltalk... C.
The issues you are raising, while valid, have no place in a discussion about learning C.
Edit: I should remind you that the context is "How would I learn C for my operating system?". It's gonna be especially tough to make bad code work without crashing, hanging or otherwise misbehaving with minimal debugging facilities.
Re: How would I start learning C for OS Development?
Umm... hmm... I thought I wanted to know how to use C for OS development? I know many functions already. You mean you just learn it naturally, right? Then, it comes to you? Well, I started Assembly with MS-DOS DEBUG and it gave me so much knowledge. Thank you for the 4.5 hours tutorial link by the way, guys!
Re: How would I start learning C for OS Development?
This doesn't make any sense. C language does not have any functions "to know", except the actual syntax for declaring and defining functions.WaterOS wrote: I know many functions already.
Which functions do you know then?
Learn to read.
Re: How would I start learning C for OS Development?
Everything has functions. Java has system.out.printlndozniak wrote:This doesn't make any sense. C language does not have any functions "to know", except the actual syntax for declaring and defining functions.WaterOS wrote: I know many functions already.
Which functions do you know then?
Is there something when you learn C for OS development? I don't want articles saying "Here's a tutorial for C. I learned from IBM's old website that isn't even on Archive... Try this out. You shouldn't use C. You should use Pascal or Basic".
I want some references for using C with programming an OS.