OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Dec 12, 2017 10:25 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Studying the Alexei Frounze Protected Mode Tutorials
PostPosted: Fri May 19, 2017 11:57 am 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1032
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.

_________________
Image http://www.archefire.org/_PROJECTS_/ (udocproject@yahoo.com)

YouTube Development Videos:
http://www.youtube.com/user/AltComp126/videos

Current IP address for hosts file (all subdomains):
190.150.9.244 archefire.org


Top
 Profile  
 
 Post subject: Re: Studying the Alexei Frounze Protected Mode Tutorials
PostPosted: Fri May 19, 2017 1:15 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8169
Location: At his keyboard!
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

_________________
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.


Top
 Profile  
 
 Post subject: Re: Studying the Alexei Frounze Protected Mode Tutorials
PostPosted: Sat May 20, 2017 3:31 am 
Offline
Member
Member

Joined: Wed Aug 17, 2016 4:55 am
Posts: 171
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

_________________
https://github.com/sikthehedgehog/indigo


Top
 Profile  
 
 Post subject: Re: Studying the Alexei Frounze Protected Mode Tutorials
PostPosted: Sun May 21, 2017 7:54 pm 
Offline
Member
Member
User avatar

Joined: Sun Feb 09, 2014 7:11 pm
Posts: 86
Location: Within a meter of a computer
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.

_________________
"If the truth is a cruel mistress, than a lie must be a nice girl"
Working on Cardinal
Find me at #Cardinal-OS on freenode!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group