Why is kernel placed at 1M in Bare Bones tutorial

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.
gsingh2011
Member
Member
Posts: 83
Joined: Tue Feb 03, 2009 11:37 am

Why is kernel placed at 1M in Bare Bones tutorial

Post by gsingh2011 »

If I understand correctly, in the bare bones tutorial we load the kernel at 1 MB. But we haven't switched to protected mode yet, and in real mode we can only access up to 1 MB, right? So how can we load our kernel at 1 MB?
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by bluemoon »

By temporary switch to protected mode(recommended), or unreal mode; do the copy, and switch back to real mode.
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by sortie »

The Bare Bones tutorial assume you are loading a multiboot kernel with GRUB. It will do whatever tricks you need to load a kernel (such as entering protected mode). This tutorial is not a follow-up to a bootloader tutorial.
gsingh2011
Member
Member
Posts: 83
Joined: Tue Feb 03, 2009 11:37 am

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by gsingh2011 »

sortie wrote:The Bare Bones tutorial assume you are loading a multiboot kernel with GRUB. It will do whatever tricks you need to load a kernel (such as entering protected mode). This tutorial is not a follow-up to a bootloader tutorial.
Ok, thanks. It would be nice if this was at least mentioned, so people like me who've read about real mode and protected mode understand what's going on.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Love4Boobies »

You mean you should actually read the tutorial. It obviously mentions this.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
gsingh2011
Member
Member
Posts: 83
Joined: Tue Feb 03, 2009 11:37 am

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by gsingh2011 »

Love4Boobies wrote:You mean you should actually read the tutorial. It obviously mentions this.
You're right. I have a bad habit of skipping prefaces, sorry.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Love4Boobies »

Don't feel bad. The purpose of tutorials is to spoonfeed the ignorant with introductory material so as to think they've actually accomplished something. Just because you've failed such a simple task doesn't mean you would have learned anything by succeeding.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Prochamber
Member
Member
Posts: 100
Joined: Wed Mar 13, 2013 2:27 am

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Prochamber »

Love4Boobies wrote:Don't feel bad. The purpose of tutorials is to spoonfeed the ignorant with introductory material so as to think they've actually accomplished something. Just because you've failed such a simple task doesn't mean you would have learned anything by succeeding.
Wait a minute, tutorials aren't that bad.
The word "tutor" in tutorial indicates their purpose is to teach not to spoonfeed.
Everyone needs to start somewhere.
TachyonOS - Violates causality on 95% of attempts. Runs at approximately 1.5c.
gsingh2011
Member
Member
Posts: 83
Joined: Tue Feb 03, 2009 11:37 am

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by gsingh2011 »

Prochamber wrote:
Love4Boobies wrote:Don't feel bad. The purpose of tutorials is to spoonfeed the ignorant with introductory material so as to think they've actually accomplished something. Just because you've failed such a simple task doesn't mean you would have learned anything by succeeding.
Wait a minute, tutorials aren't that bad.
The word "tutor" in tutorial indicates their purpose is to teach not to spoonfeed.
Everyone needs to start somewhere.
That's true. The first time I got my kernel to boot using the bare bones tutorial was when I was 15. I wouldn't have been able to do it if there wasn't a site like OSDev.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Love4Boobies »

Prochamber wrote:Wait a minute, tutorials aren't that bad.
I was being a little bit sarcastic. Even if tutorials are not necessarily evil by nature, they are almost always misused. If anything, they should serve as simple implementation examples to those who have already studied the subject. If anything in a tutorial is fresh information to you, you are doing something wrong. Due to the fact that they're so short, they leave out pretty much everything, yet give newbies the illusion that they've covered a lot of ground. Here are some of the dangers of their ignorance:
  • They remain unaware of the tutorial's subtleties (e.g., if you search through the OP's posts, you will notice some of the confusion).
  • They remain unaware of alternatives.
  • They get stuck after the tutorial, unless there is a follow-up. They never learn to become self-reliant, which is a pitty considering that tutorials on more advanced topics don't really exist.
Perhaps the above points are better illustrated by an analogy: Do you believe a tutorial on configuring routers can teach networking?
Prochamber wrote:The word "tutor" in tutorial indicates their purpose is to teach not to spoonfeed.
That's not a very good argument. Despite its name, computer science is neither a science nor the study of computers.
Prochamber wrote:Everyone needs to start somewhere.
Indeed. However, that somewhere shouldn't de a tuturial. They make lousy primary sources of information.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Kevin »

Love4Boobies wrote:Perhaps the above points are better illustrated by an analogy: Do you believe a tutorial on configuring routers can teach networking?
Did you learn everything about networking before you first used a network?
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Love4Boobies »

My point is not to learn everything. My point is that tutorials don't have enough information to serve as proper learning materials. Tutorials are what I am criticizing.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Prochamber
Member
Member
Posts: 100
Joined: Wed Mar 13, 2013 2:27 am

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by Prochamber »

Love4Boobies wrote:
Prochamber wrote:Wait a minute, tutorials aren't that bad.
I was being a little bit sarcastic. Even if tutorials are not necessarily evil by nature, they are almost always misused. If anything, they should serve as simple implementation examples to those who have already studied the subject. If anything in a tutorial is fresh information to you, you are doing something wrong. Due to the fact that they're so short, they leave out pretty much everything, yet give newbies the illusion that they've covered a lot of ground. Here are some of the dangers of their ignorance:
  • They remain unaware of the tutorial's subtleties (e.g., if you search through the OP's posts, you will notice some of the confusion).
  • They remain unaware of alternatives.
  • They get stuck after the tutorial, unless there is a follow-up. They never learn to become self-reliant, which is a pitty considering that tutorials on more advanced topics don't really exist.
You make quite good points, that the makers of tutorials don't expect them to be used as a sole resource. However I disagree that they are menu to be used by those that have already studied the subject. Most tutorials aim to get you started at something and are aimed at someone who has little or no experience in the subject.
Love4Boobies wrote:
Prochamber wrote:Everyone needs to start somewhere.
Indeed. However, that somewhere shouldn't be a tutorial. They make lousy primary sources of information.
You are correct in saying that if you have experience in operating system development you shouldn't be using tutorials. However what about people who don't, if not a tutorial then what should it be? Newbies have little knowledge in the subject so there are not many resources they can use. They don't want to buy books, technical articles are full of words they don't know, forums care little about seemingly obvious questions, reading code from other is hard if you have no background in its purpose and figuring it out for yourself can only be done if you have a basis to work on. It would seem like tutorials are the only way to get started.
TachyonOS - Violates causality on 95% of attempts. Runs at approximately 1.5c.
fronty
Member
Member
Posts: 188
Joined: Mon Jan 14, 2008 5:53 am
Location: Helsinki

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by fronty »

Prochamber wrote:However what about people who don't, if not a tutorial then what should it be? Newbies have little knowledge in the subject so there are not many resources they can use.
Books, course materials, or even a course if possible. There are many books on the subject, at least several quite usable. Many universities have course materials freely available, and if the newbie is studying software technology in university, there's a good chance he has to take at least one or more OS course. I think there's lots of good resources they can use.
leejbaxter
Member
Member
Posts: 25
Joined: Sat Jan 15, 2011 8:40 pm

Re: Why is kernel placed at 1M in Bare Bones tutorial

Post by leejbaxter »

I agree and disagree...

In my opinion, tutorials are kinda dumbed-down hands-on sources of information; they absolutely shouldn't be used as a sole source of information for a newbie, but they should be used as the first!!! Tutorials tend to provide a minimal amount of information about a topic, but they explain it in plain English, and they provide a means to allow the keen learner to get their feet wet before they go about searching for more in-depth sources of information (which online tutorials often contain links to).

Its like one of the posters mentioned; a newbie has to begin somewhere, and a tutorial is the best place! I've found that's the best way to learn; find a tutorial to pick up the basics and get your feet wet, then when you're comfortable follow the path to more in-depth information and start to experiment...
Lee.J.Baxter - Designer of CHAOS (Cybernetic Hivemind Adaptive Operating System)
Post Reply