Solar's Law on Kernel Space

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Solar's Law on Kernel Space

Post by Solar »

Yes, the topic is a bit cavalier, but I got your attention, didn't I? 8)

A recurring problem on this board is that some who start out to work on their "pet OS" don't have enough coding experience to begin with, and get tangled up by pretty basic problems: pointers, compiler options, what a linker does, that kind of things.

I feel that it is a shame to have these rookie programmers get frustrated simply because they tackled something that is well over their head. Dealing with these cases here time and again isn't that much fun either, and - at least to my feeling - has dulled the overall quality of the board noticeably over the years as veterans turn away from too much repetitive beginner's questions and too few advanced topics.

I'd like to come up with a snappy, one-sentence advice that could become "Solar's Law on Kernel Space", or "The OSDev Mantra for Beginners" if you like, or "Candy's Candy for Computer Kids" or whatever, something that would fit into an e-mail or forum signature. Something that could help pointing out to rookies that you need a full set of skills to navigate kernel space unharmed, while at the same time pointing out that gathering experience in userspace first can be fun and rewarding, too.

However, anything I could conjure up so far is too long and doesn't quite capture the point.

Any help? Thoughts on the issue?
Every good solution is obvious once you've found it.
User avatar
naiksidd_85
Member
Member
Posts: 76
Joined: Thu Jan 17, 2008 1:15 am

Post by naiksidd_85 »

hi solar You have said it rightly that the new people on the forum (like me),
have really dumb query's.
and this must be taking lot of your time.
but hey we are here because we know we have really veteran programmers like you who can figure out the problem where we struggle a lot.
:roll:
Learning a lot these days THANKS to OSdev users
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

naiksidd_85 wrote:hi solar You have said it rightly that the new people on the forum (like me),
have really dumb query's.
and this must be taking lot of your time.
but hey we are here because we know we have really veteran programmers like you who can figure out the problem where we struggle a lot.
:roll:
Ah yes, but the thing is we really *don't* mind answering dumb queries about OSDev - it's when I try to answer questions and recieve the answer "How do I run this through a preprocessor, then?" or "what is a linker?" That I start to get annoyed. OSDev is *not* an easy subject, and too many people seem to be attempting it with only a knowledge of VB.NET or some similar language and then (and this is the part I take exception to) posting every little problem they come across in this forum. I could mention examples but all you need to do is take a look at the first page on the "OS Development" and "General Programming" sections...
User avatar
naiksidd_85
Member
Member
Posts: 76
Joined: Thu Jan 17, 2008 1:15 am

Post by naiksidd_85 »

hi james,

first of all thanks for the great tutorial you have put up.

and yes before posting any query I do try to find the answere on wiki or Google.
will try to do the HOME WORK first and then ask help
hope all the new people do the same
Learning a lot these days THANKS to OSdev users
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Hi Solar

Post by DeletedAccount »

Hi ,
Solar is correct ... Although i have asked many idiotic questions i have received answers .. Almost everyone here in osdev is very helpful ...
But i just want to state that the prerequisites which you stated are
needed for any non-trivial project ... not just os development ....

I was considered a nerd in my old school because i could compile
programs without the Turbo C++ blue screen .. ie the Turbo C++
IDE .... Also i found many questions like "can i write an OS in
Visual Basic " ? .. i also found someone trying to use bios interrupts
for writing drivers in protected mode ..

Regards
Sandeep Mathew
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

The point of this "Solar's Law" is not that you should google before you post. You should always do that.

The point is that you should know what pointers are all about, should know at least 75% of your compiler's options, should know about what a linker does, should know about how to "marry" ASM and C code, should know about project management, version control and debugging, before you start thinking about writing a bootloader or a kernel.

To put it differently, "my own OS" is the poorest possible choice as a first programming project.
Every good solution is obvious once you've found it.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Solar's Law on Kernel Space

Post by Brendan »

Hi,
Solar wrote:I'd like to come up with a snappy, one-sentence advice that could become "Solar's Law on Kernel Space", or "The OSDev Mantra for Beginners" if you like, or "Candy's Candy for Computer Kids" or whatever, something that would fit into an e-mail or forum signature. Something that could help pointing out to rookies that you need a full set of skills to navigate kernel space unharmed, while at the same time pointing out that gathering experience in userspace first can be fun and rewarding, too.

However, anything I could conjure up so far is too long and doesn't quite capture the point.

Any help? Thoughts on the issue?
If one sentence is too small then how about something larger, like a haiku or a limerick?

Code: Select all

There once was a guy from Nantucket
Who tried writing a great "bit bucket"
He struggled in vain
All he got was pain
And after years he said "Ah fluck it".
Solar wrote:A recurring problem on this board is that some who start out to work on their "pet OS" don't have enough coding experience to begin with, and get tangled up by pretty basic problems: pointers, compiler options, what a linker does, that kind of things.

I feel that it is a shame to have these rookie programmers get frustrated simply because they tackled something that is well over their head.
In theory, there's probably enough information in the wiki and enough intermediate developers around to answer beginner's questions, and because the intermediate developers (as a group) have diverse knowledge they can often help each other - veterans would only really need to worry about the occasional question from intermediate developers.
Solar wrote:Dealing with these cases here time and again isn't that much fun either, and - at least to my feeling - has dulled the overall quality of the board noticeably over the years as veterans turn away from too much repetitive beginner's questions and too few advanced topics.
IMHO veterans have much larger problems: by the time they become veterans they've used up their "college days", and "real life" bites a huge chunk out of their butt. I'm talking about the job, bills, mortgage, spouse, kids, tax, the lawn, the car, the sleep deprivation, the birthdays and funerals and barbeques in the park, the freaking mobile phone salesman that wastes an hour of your Friday afternoon, the mechanic that says your car won't be fixed until next week. Your parents ring and say they're visiting for the weekend - rip 2 days out of your calander and throw them in the fire. Your work sends you away for 2 weeks of "how to waste an employees life" training. For *$%*# sake, I'm trying to write an OS here dammit!

Ahem, well you get the idea... :oops:


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Solar's Law on Kernel Space

Post by Solar »

Brendan wrote:IMHO veterans have much larger problems: by the time they become veterans they've used up their "college days", and "real life" bites a huge chunk out of their butt. I'm talking about the job, bills, mortgage, spouse, kids, tax, the lawn, the car, the sleep deprivation, the birthdays and funerals and barbeques in the park, the freaking mobile phone salesman that wastes an hour of your Friday afternoon, the mechanic that says your car won't be fixed until next week. Your parents ring and say they're visiting for the weekend - rip 2 days out of your calander and throw them in the fire. Your work sends you away for 2 weeks of "how to waste an employees life" training. For *$%*# sake, I'm trying to write an OS here dammit!

Ahem, well you get the idea... :oops:
You don't know how well I do. :shock: :? 8)
Every good solution is obvious once you've found it.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

My attempt at a one-liner:
The amount of kernel panics is inversely proportional to the amount of bugs you have fixed on your own.
or if you like:
The chance that you don't belong here is inversely proportional to the amount of bugs you have fixed on your own.
_________________
SandeepMathew wrote:But i just want to state that the prerequisites which you stated are
needed for any non-trivial project ... not just os development ....
Not quite. For any userspace project of sufficient size you do need al the knowledge of how your code gets executed. What you generally do not know, and in fact not need, is how your processor works, how a line of code gets translated to assembly, how linking is done exactly, what name mangling is, etc etc. You will need these things if you want to make a decent OS, but not for your regular userspace app.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Emil
Posts: 3
Joined: Sat Jan 26, 2008 7:56 am
Location: Reykjavik, Iceland

Post by Emil »

Combuster wrote:My attempt at a one-liner:
The amount of kernel panics is inversely proportional to the amount of bugs you have fixed on your own.
or if you like:
The chance that you don't belong here is inversely proportional to the amount of bugs you have fixed on your own.
<unlurk>
This is possibly too complicated for some of our more "simple" people and people that insist that they know how to read and write English when they obviously don't. And those seem to be often the most persistent incompetent newbies.
Brendan wrote:IMHO veterans have much larger problems: by the time they become veterans they've used up their "college days", and "real life" bites a huge chunk out of their butt. I'm talking about the job, bills, mortgage, spouse, kids, tax, the lawn, the car, the sleep deprivation, the birthdays and funerals and barbeques in the park, the freaking mobile phone salesman that wastes an hour of your Friday afternoon, the mechanic that says your car won't be fixed until next week. Your parents ring and say they're visiting for the weekend - rip 2 days out of your calander and throw them in the fire. Your work sends you away for 2 weeks of "how to waste an employees life" training. For *$%*# sake, I'm trying to write an OS here dammit!

Ahem, well you get the idea... :oops:
My [Generic Deity]... This is just what is slowing down my OS development and learning... When you have a family and a day job, the only time you have for yourself is when everyone else is asleep(and I should be asleep).
I'm not saying I'm a veteran though, I've only recently started looking into OSdeving again since I last tried it(and failed) as a teenager.
Image

Code: Select all

/* world's last mistake in C */
if(code = CODE_RED) {
    launch_missles();
}
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Emil wrote:<unlurk>
A warm welcome! And one of the best first postings I've seen so far on any forum! :o
This is possibly too complicated for some of our more "simple" people and people that insist that they know how to read and write English when they obviously don't. And those seem to be often the most persistent incompetent newbies.
Hurr, hurr... 8)

I like the idea of "inversely proportional", though. I'll let that simmer on the stove of creativity...
Every good solution is obvious once you've found it.
Emil
Posts: 3
Joined: Sat Jan 26, 2008 7:56 am
Location: Reykjavik, Iceland

Post by Emil »

Solar wrote:
Emil wrote:<unlurk>
A warm welcome! And one of the best first postings I've seen so far on any forum! :o
Thank you, that's very kind. I try not to post unless I have something to contribute and that leads to a lot of lurking on forums and very little posting.
Image

Code: Select all

/* world's last mistake in C */
if(code = CODE_RED) {
    launch_missles();
}
User avatar
Wave
Member
Member
Posts: 50
Joined: Sun Jan 20, 2008 5:51 am

Post by Wave »

Solar wrote:should know at least 75% of your compiler's options
Last I counted GCC had about 330 command line options excluding machine dependent options (including: 1100). Do you really want me to know 75% of those?!?
Conway's Law: If you have four groups working on a compiler, you'll get a 4-pass compiler.
Melvin Conway
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

My [Generic Deity]... This is just what is slowing down my OS development and learning... When you have a family and a day job, the only time you have for yourself is when everyone else is asleep(and I should be asleep).
So true! The kicker is, I'm sleep deprived and I still haven't had time to work on my OS in almost 2 years! :P
Wave wrote:
Solar wrote:should know at least 75% of your compiler's options
Last I counted GCC had about 330 command line options excluding machine dependent options (including: 1100). Do you really want me to know 75% of those?!?
If you can read up on them and understand them quickly without outside help, then you have a lot of the necessary background for OS dev. Memorizing them is not necessary IMO.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Post by DeletedAccount »

Hi ,
Combuster ... I may be wrong ...as always ... I am .

A good workman knows his tools well !
Post Reply