OSDev.org
https://forum.osdev.org/

Studying the Alexei Frounze Protected Mode Tutorials
https://forum.osdev.org/viewtopic.php?f=13&t=31932
Page 1 of 1

Author:  ~ [ Fri May 19, 2017 11:57 am ]
Post subject:  Studying the Alexei Frounze Protected Mode Tutorials

The tutorials seem to be here more cleanly:
http://members.tripod.com/protected_mode/alexfru/pmtuts.html


I'm currently trying to study paging.

I'm carefully studying TUT08, the tutorial about paging.

What I'm seeing is that the code contains a lot of functions to pack the basic functionality.

But it seems like the functionality central to each tutorial isn't packed, it's just laid as code in main().

For example, the paging tutorial hasn't packed the code to find free 4096 blocks, allocate, fill, enable/disable paging, into functions like the rest of basic functionality.


It makes the key concepts harder to reuse than the common bulk of basic functions.

At least it allows people to practice packing those special functions, for example packing the paging code in main() into a set of reusable paging functions.

I think that this is an important thing to point out to make these tutorials more understandable, and to develop additional packed code elements here to make the main ideas of each tutorial much more reusable and easy to visualize.

Author:  Brendan [ Fri May 19, 2017 1:15 pm ]
Post subject:  Re: Studying the Alexei Frounze Protected Mode Tutorials

Hi,

~ wrote:
But it seems like the functionality central to each tutorial isn't packed, it's just laid as code in main().

For example, the paging tutorial hasn't packed the code to find free 4096 blocks, allocate, fill, enable/disable paging, into functions like the rest of basic functionality.

It makes the key concepts harder to reuse than the common bulk of basic functions.


The entire point of any tutorial is to teach. To do this example code is deliberately simplified and presented in a way to make it easier to teach, and is therefore not intended to be used in real software and not intended to re-used in real software.

The single biggest problem with a lot of tutorials is that they have compilable example code in the first place. They should use psuedo-code that can't be compiled, or have no code, to make sure that the reader actually does learn and doesn't just "copy & paste" without learning anything. That way people wouldn't make the insane "let's reuse something that was never intended to be reused" assumption.


Cheers,

Brendan

Author:  Sik [ Sat May 20, 2017 3:31 am ]
Post subject:  Re: Studying the Alexei Frounze Protected Mode Tutorials

Brendan wrote:
The single biggest problem with a lot of tutorials is that they have compilable example code in the first place. They should use psuedo-code that can't be compiled, or have no code, to make sure that the reader actually does learn and doesn't just "copy & paste" without learning anything. That way people wouldn't make the insane "let's reuse something that was never intended to be reused" assumption.

Really, they shouldn't even be teaching a given algorithm unless that's the whole thing they're trying to teach (in other words, avoid pseudocode at all costs too). They should just tell people what things they're supposed to do then leave them to figure out how to write code that achieves said goal. Bonus points because it'll let the programmer integrate things nicely according to their chosen design.

I think the problem is that a lot of people write tutorials with code thinking that'll help beginners, when the only thing they achieve with that is just let them copypaste code without looking at the problem and then go to forums to pester other people asking why their stuff doesn't work =P

Author:  hgoel [ Sun May 21, 2017 7:54 pm ]
Post subject:  Re: Studying the Alexei Frounze Protected Mode Tutorials

Sik wrote:
Brendan wrote:
The single biggest problem with a lot of tutorials is that they have compilable example code in the first place. They should use psuedo-code that can't be compiled, or have no code, to make sure that the reader actually does learn and doesn't just "copy & paste" without learning anything. That way people wouldn't make the insane "let's reuse something that was never intended to be reused" assumption.

Really, they shouldn't even be teaching a given algorithm unless that's the whole thing they're trying to teach (in other words, avoid pseudocode at all costs too). They should just tell people what things they're supposed to do then leave them to figure out how to write code that achieves said goal. Bonus points because it'll let the programmer integrate things nicely according to their chosen design.

I think the problem is that a lot of people write tutorials with code thinking that'll help beginners, when the only thing they achieve with that is just let them copypaste code without looking at the problem and then go to forums to pester other people asking why their stuff doesn't work =P


I disagree. Not being given any pseudocode makes the tutorial potentially ambiguous (as language is), the last thing someone getting started on a new project needs is having to spend a ton of time dealing with unfamiliar concepts, trying to get them to work with nothing concrete to go on. Normal language just isn't strict enough to help a beginner gain the confidence and understanding he/she needs to continue. You'll end up with less pestering over why their code doesn't work, but it'll be because they just gave up instead of trying to solve their problem, the few who would get past would be the lucky few who happened to interpret the tutorial correctly or did end up 'persting' people.

Instead, pseudocode prevents copy-paste while still defining things strictly enough to follow. I know that I wouldn't have been able to get into osdev if I hadn't been able to initially learn stuff by either copypaste + experimentation or by following pseudocode and translating it into my own code. That gave me the confidence to actually try my own designs and to try and work without tutorials. I'd be okay with no copypaste simply because not enough people bother with the experimentation phase, and I feel that I would have been able to pull through with just pseudocode as well.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/