Few errors in the tutorials 18-20

Feedback? Questions? Comments? All discussions on the articles and tutorials hosted or developed by us go in here.

Moderator:Moderators

Post Reply
Neutron
Posts:4
Joined:Tue May 19, 2009 2:20 pm
Location:Finland
Few errors in the tutorials 18-20

Post by Neutron » Tue May 19, 2009 3:22 pm

Hi. I've been looking into your tutorials and they really are great, but I've noticed some errors in the demos.

In tutorial 18 where a basic virtual memory manager/pager is implemented, you have added the initialization of the virtual memory manager as the first task in the init()-function and initialization of the physical memory manager as the last task. I don't think this is going to work.

The first thing vmmngr_initialize() does is a call to physical memory manager to allocate a block (pmmngr_alloc_block) for a page table. This function then checks the pmmngr_get_free_block_count() <= 0. The variables used in this function are set in the pmmgr_init(), which you haven't yet called therefore causing block allocation to fail by returning zero which causes the vmmgr_initialize() to return too soon. I think you should move the vmm initialization after the pmm initilization.

The same mistake exists in the Tutorial 19 demo.

The floppy tutorial states that the floppy connector/cable is similar to IDE cables. This is true, but you have described them too similar. The floppy cable actually has only 34 pins and the table "Floppy Interface Cable Pins" is actually for IDE-cables not floppy cables. (For more believable pinouts, check http://www.interfacebus.com/PC_Floppy_Drive_PinOut.html for instance). Also the picture of "physical layout of a generic 3-1/2" floppy disk" is clearly for a hard disk. I think you should edit that picture and remove the two extra platters or put a comment.

I'd also like to remind you that there are other types of floppy disks, too, than the 3,5" 1,44 MB. I still have a 5,25" floppy drive in my computer (stole it from a 386 machine :-) ). The 3,5" disks also came in 720 kB and 2,88 size. The 5,25" disks had at least 160 kB, 360 kB and 1,2 MB. Of course these all are quite obsolete by now, but I think a floppy driver should take account that the disk it's handling might be some other type than the 1,44 MB floppy. Especially when you have bolded the sections about disk properties, such as 18 sectors per track, 63 tracks per disk and so on, these really depend on disk. (Bios parameter block, anyone?)

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: Few errors in the tutorials 18-20

Post by Mike » Mon May 25, 2009 5:13 pm

In tutorial 18 where a basic virtual memory manager/pager is implemented, you have added the initialization of the virtual memory manager as the first task in the init()-function and initialization of the physical memory manager as the last task. I don't think this is going to work.
Ah, yes, that is problematic and will need to be fixed.
Also the picture of "physical layout of a generic 3-1/2" floppy disk" is clearly for a hard disk. I think you should edit that picture and remove the two extra platters or put a comment.
Very true. Both of those sections are already planned for rewriting actually :)
but I think a floppy driver should take account that the disk it's handling might be some other type than the 1,44 MB floppy. Especially when you have bolded the sections about disk properties, such as 18 sectors per track, 63 tracks per disk and so on, these really depend on disk. (Bios parameter block, anyone?)
That is a good point, the tutorial right now expects the user to have a 3.5" floppy disk. It should describe the other types as well. Ill be sure to add that on the tutorial update.

Thank you for all of your suggestions :D
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

Post Reply