Page 1 of 2
mode after bare bones
Posted: Thu Mar 19, 2009 9:31 am
by mittwoch
hello,
i've done the bare bones-tutorial, and now i'd like to go on.
i thought of trying something like switching to protected mode, but i don't know whether I'm already in there or not, since in the bare bones tutorial, i wrote some c code without doing a .code16-inline-assembly call.
So my question is what mode did grub my 'kernel' load in?
thanks in advance, mittwoch
Re: mode after bar bones
Posted: Thu Mar 19, 2009 10:14 am
by jal
mittwoch wrote:i've done the bare bones-tutorial, and now i'd like to go on. i thought of trying something like switching to protected mode, but i don't know whether I'm already in there or not
The bare bones tutorial is a
tutorial, explaining exactly what it does (how and why). If you do not know when you are in protected mode, you are pretty clueless, and probably just compiled the bare bones code without actually
reading the tutorial and code.
JAL
Re: mode after bar bones
Posted: Thu Mar 19, 2009 10:28 am
by mittwoch
i have read the tutorial and code, even searched it for the words 'protected mode' and 'real mode', but i didn't find something telling me in which mode i am.
Re: mode after bar bones
Posted: Thu Mar 19, 2009 11:39 am
by Troy Martin
mittwoch wrote:i have read the tutorial and code, even searched it for the words 'protected mode' and 'real mode', but i didn't find something telling me in which mode i am.
Ah crap, either we need to add that in or make
Getting Started and everything related to
Bare bones mandatory before going to Bare bones itself.
Re: mode after bare bones
Posted: Thu Mar 19, 2009 11:43 am
by Firestryke31
Did you read up about GRUB? That would definitely have told you which mode you're in. Never just blindly use something, but understand at least what it does before using it. That will get you far in not only OS deving, but probably life in general.
Re: mode after bare bones
Posted: Thu Mar 19, 2009 11:49 am
by Troy Martin
I'm thinking about moving the bare bones kernel article to something named, say, Bare bones kernel, and having a page called Bare bones that is sort of a "STOP! Have you read through the following articles?..." page. Anyone think that's a good ideer?
Re: mode after bar bones
Posted: Fri Mar 20, 2009 3:22 am
by jal
mittwoch wrote:i have read the tutorial and code, even searched it for the words 'protected mode' and 'real mode', but i didn't find something telling me in which mode i am.
In that case consider yourself not (yet) fit for making an OS.
JAL
Re: mode after bare bones
Posted: Fri Mar 20, 2009 3:26 am
by Solar
Oh, come on, give him a break. He's right in some way - Bare Bones is one of the most prominent pages, repeatedly referenced etc. How many of you have really done all the reading they should have before jumping right into it? And no, the page did not make mention of what the mode is after running the Bare Bones.
Yes, he could've looked it up in the Grub manual.
No, stuff like "you're not good enough yet" isn't called for here, IMHO. We've had much worse questions here.
Re: mode after bare bones
Posted: Fri Mar 20, 2009 3:41 am
by AJ
/me Agrees with Solar.
I think that the mode thing could be made explicit Barebones tutorial. Remember that the Barebones is designed for complete beginners. If anything, this question highlights a problem with the barebones that should be fixed.
Cheers,
Adam
[Edit]Added some additional info to the tutorial preface.[/Edit]
Re: mode after bare bones
Posted: Fri Mar 20, 2009 5:35 am
by jal
AJ wrote:Remember that the Barebones is designed for complete beginners.
Complete beginners as in "first time OS development" yes. Complete beginners as in "not having the required knowledge as prescribed" no. But since it seems I'm being outnumbered, I stand corrected.
JAL
Re: mode after bare bones
Posted: Fri Mar 20, 2009 6:15 am
by Solar
Just a gut feeling that we, as a community, are getting a bit
too aggressive and negative.
Mittwoch came, read the Wiki
first, actually found and executed the Bare Bones tutorial (successfully!), and knows enough to realize there's something strange going on with him doing C code without having done .code16 stuff, so he asks (politely).
That's his first post, and he got one
heck of a lot further than most first-timers here!
@ Mittwoch:
Welcome to OSDev. Never mind the reception you've got, I think we've got a severe case of nerves here...
Re: mode after bare bones
Posted: Fri Mar 20, 2009 7:24 am
by mittwoch
by the way, i found the answer for my question on my own: i'm in protected mode!
(i've read it in the GDT-Tutorial)
ps: i don't know whether it's a useful piece of information, but i when first tried to compile the c-kernel from the barebones-tutorial with the '-Werror' option (like i was advised by the tutorial), it didn't work since the two warnings of the compiler were treated as errors. then i compiled it without this option, and it worked without problems.
Re: mode after bare bones
Posted: Fri Mar 20, 2009 7:47 am
by Solar
Yep... it's somewhat uncomfortable that way. It is expected that the comment line - "insert your code here" - actually makes use of the parameters.
I wouldn't want to take out either the -Werror nor the parameters (as both are helpful), but I wouldn't want to bloat the tutorial with parameter-handling code...
Re: mode after bare bones
Posted: Fri Mar 20, 2009 10:35 am
by Troy Martin
Solar wrote:Just a gut feeling that we, as a community, are getting a bit too aggressive and negative.
/agree=completely
I wouldn't want to take out either the -Werror nor the parameters (as both are helpful), but I wouldn't want to bloat the tutorial with parameter-handling code...
It's possible we could "handle" the parameters in a clean and simple way, using just some kind of "if (param1 == param2);" that should count as usage without doing anything. If I'm wrong, it's because I have asmbrain.
Re: mode after bare bones
Posted: Fri Mar 20, 2009 1:58 pm
by jal
Troy Martin wrote:because I have asmbrain.
You mean your thoughts are cut up in little pieces from which it is impossible to tell what you're thinking about without you explaining each fragment extensively? :)
JAL