How do I start learning how to use Protected Mode (32-bit)?

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.
starmanz
Posts: 17
Joined: Sat Mar 18, 2017 4:52 am

Re: How do I start learning how to use Protected Mode (32-bi

Post by starmanz »

iansjack wrote:
Example: "I need a tutorial for the GDT. By the way, why doesn't this boot?

"It doesn't boot because..."
WHAT ABOUT THE GDT?!
It didn't boot because you don't know what you are doing.

You don't know what you are doing because you don't understand how the processor works.

You don't understand how the processor works because you didn't read the manual that describes how it works.

You didn't read the manual because, with one week's experience, you already know better than those who have been doing low-level programming for decades.

The comparison with Homer Simpson is most apposite.

Ignorance is bliss!
It was an example... -_- why did it have to go this way? A forum is supposed to give you good answers to your questions. You never give me any help. The only thing you do is recommend me sucking manuals. They all suck! Everyone here loves them so much. Well, guess what. Many people hate them. This is why nobody is interested anymore.

Stop giving me posts on my thread saying "Manuals are so good check this intel one out omg" or "Manuals will teach beginners everything".

I might be amateur or something.
AX BX CX DX BP SP SI DI. The registers that never die. 16-bit... will always sit... in a book where people look. My signature is terrible! I think we all know that.
starmanz
Posts: 17
Joined: Sat Mar 18, 2017 4:52 am

Re: How do I start learning how to use Protected Mode (32-bi

Post by starmanz »

When I see OS projects, I think "Did they waste their time on manuals?"...
AX BX CX DX BP SP SI DI. The registers that never die. 16-bit... will always sit... in a book where people look. My signature is terrible! I think we all know that.
User avatar
zaval
Member
Member
Posts: 659
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: How do I start learning how to use Protected Mode (32-bi

Post by zaval »

starmanz wrote:When I see OS projects, I think "Did they waste their time on manuals?"...
if those are OS projects consisting of a little more than 3-line Readme file (or napoleonic plans or endless arguing expressed on forums in enormously lengthy prose), they 100% sure have spent most of their time on reading manuals.
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
FusT
Member
Member
Posts: 91
Joined: Wed Sep 19, 2012 3:43 am
Location: The Netherlands

Re: How do I start learning how to use Protected Mode (32-bi

Post by FusT »

starmanz wrote:A forum is supposed to give you good answers to your questions.
.........
Stop giving me posts on my thread saying "Manuals are so good check this intel one out omg" or "Manuals will teach beginners everything".
"RTFM" is probably the best advice you can get. Yes the manuals are long and not easy to understand but reading them is the only way you'll ever fully understand the processor.
If you don't like the advice, or don't like to RTFM, OSDev is not the hobby for you.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How do I start learning how to use Protected Mode (32-bi

Post by iansjack »

starmanz wrote:Stop giving me posts on my thread saying "Manuals are so good check this intel one out omg" or "Manuals will teach beginners everything".
No sooner said than done. But you might want to find a hobby that more suits your abilities.
I might be amateur or something.
No "might" about it.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How do I start learning how to use Protected Mode (32-bi

Post by iansjack »

starmanz wrote:When I see OS projects, I think "Did they waste their time on manuals?"...
Yes and No.

Yes, they did read the manuals.

No, they didn't waste their time.
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: How do I start learning how to use Protected Mode (32-bi

Post by matt11235 »

starmanz wrote:When I see OS projects, I think "Did they waste their time on manuals?"...
Admittedly manuals aren't the most interesting things in the world, but they're the best source of information.
Also maybe a colouring book is maybe more your kind of thing? ;)
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: How do I start learning how to use Protected Mode (32-bi

Post by Schol-R-LEA »

I do have to agree with him that we have not been very helpful. Starmanz, I don't know if you saw my earlier post, but I did make an effort to help, though as I said, I needed more information about what you had tried and what resources In the wiki you had read (since it seemed to me that you were looking in the wrong place, and I was hoping to figure out why the wiki was so confusing so I could fix it).

I agree that the response in general has been rather dismissive and hostile, but the reason for it is simple: no one who isn't already a seasoned developer with years of experience in several languages and environments should even be considering OS Dev. A decade of programming is pretty much the minimum necessary to even understand the topic well enough to work in it.

True, I and most of the other regulars here started sooner, but in retrospect that was a mistake. Don't repeat our mistakes, learn from them.

I am going to add that to the wiki. We need to be more forceful on this point.
Last edited by Schol-R-LEA on Wed Mar 29, 2017 2:32 pm, edited 1 time in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How do I start learning how to use Protected Mode (32-bi

Post by iansjack »

The reason that the responses have been dismissive (mine at least) is the OP's instance that the manuals are rubbish that he can't be bothered to read, and that he knows better than everyone else. People have to make just a little effort if they are to be taken seriously. Much the same applies to another current thread.

I'm fed up with people who aren't prepared to read documentation, think they know it all, but demand solutions from other people. We are just doing this for fun and I have no time for overdemanding scroungers. As I said before - if you don't like it then ask for your money back.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: How do I start learning how to use Protected Mode (32-bi

Post by Schol-R-LEA »

OK, I added it: this should be required reading for all new members.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: How do I start learning how to use Protected Mode (32-bi

Post by Brendan »

Hi,
Schol-R-LEA wrote:I agree that the response in general has been rather dismissive and hostile, but the reason for it is simple: no one who isn't already a seasoned developer with years of experience in several languages and environments should even be considering OS Dev. A decade of programming is pretty much the minimum necessary to even understand the topic well enough to work in it.
Sounds like a nice theory, and it's a shame it's pure nonsense that does not work.

The fact is that the entire point of higher level languages is to prevent the need for a normal programmer to know about or care about things like virtual memory management, or multiple CPUs, or how caches work, or how any device driver works internally, or any of the other "many million" different architectural details that are necessary to write an OS. If someone has spend 50 years writing web pages in 20 different languages (PHP, Perl, Python, ...) exactly how much would they learn about power management? I'll give you a hint - the answer begins with a 'z' and rhymes with "hero". Quite frankly, 50 years of web development ("programming") probably isn't even enough to figure out how to implement a simple linked list.

What people need is low level ("bare metal") programming experience that you can't get from high level languages. One of the goals of this web site is to provide a way for people to get that experience. There is no point having a web site for people that have enough experience to not need any web site.


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
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: How do I start learning how to use Protected Mode (32-bi

Post by Schol-R-LEA »

OK, those are fair points. A programmer with ten years re-writing the same COBOL or VB.Net programs over and over again still won't have the background to pass a basic data structures course, never mind learn OS dev. No amount of Python or Ruby programming will make you ready for OS dev, I don't disagree.

Rather, what I was offering was a heuristic, a minimum boundary that would apply for most people. I am really saying that someone with less than ten years experience in general won't be ready for OS dev, even if they spent a large part of that time on C and assembly. I was saying 'Jacks or Better to Open', where 'jacks' is 'a significant amount of low-level programming, and a several years of programming in general'. It isn't a hard and fast rule, but... well, how many here wouldn't have been better off polishing their skills, practicing at coding, reading up on algorithms and general programming theory, etc. for several more years before starting? I know I could have.

Still, it is a valid point, and I have changed to read as follows: "A decade of programming, including a few years of low-level coding in assembly language and/or a systems language such as C, is pretty much the minimum necessary to even understand the topic well enough to work in it."

The real problem isn't even lack of skill and knowledge, it's the Dunning-Kruger Effect. This group, like many others, gets an endless procession of novice developers who don't know they are novices. Too many would-be OS devs think they already know everything they need to know about programming, and are offended when we tell them that they haven't even started learning yet.
Last edited by Schol-R-LEA on Wed Mar 29, 2017 4:30 pm, edited 1 time in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: How do I start learning how to use Protected Mode (32-bi

Post by Schol-R-LEA »

Also, just to make things crystal clear, I don't actually expect this notice to stop anyone from walking into the buzzsaw of their own volition. I got pretty much the same warning 20+ years ago, and I didn't listen then, either. It's more of a disclaimer, a legend on the map reading "Here Be Dragons". The ones who dream of seeing dragons will still try to sail there.

I mostly just want people to slow down, sit down, and read at least some of the material in the wiki before they jump into coding (or copypasta'ing). Ten years is perhaps a bit of an exaggeration, but a touch of hyperbole seems called for in this instance.
Last edited by Schol-R-LEA on Wed Mar 29, 2017 4:34 pm, edited 1 time in total.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: How do I start learning how to use Protected Mode (32-bi

Post by neon »

Hello,
Can't you see what I want? Instead, you talk about something else ignoring everything I asked for.
Your original question is missing context -- I wanted to obtain more information to better understand what you are trying to do and what you are having trouble with. I also wanted to learn what you have already attempted and better see what specific articles you looked at as well as what parts of it you aren't sure about. If you aren't sure about any part of those articles, ask.

Surely, you cannot expect us to provide examples or go into detail about anything when you have not even told us what you were not sure about. What "functions" did you want to learn about and what do you already know about them?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Re: How do I start learning how to use Protected Mode (32-bi

Post by IanSeyler »

Ok, I'll bite. Here is an example of jumping to 32-bit protected mode (without a LEA instruction):

https://github.com/ReturnInfinity/Pure6 ... fs_mbr.asm

Feel free to remove the e820 and disk read code.

-Ian
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
Post Reply