Page 1 of 1

james molloy's OS kheap has so many bugs !!!

Posted: Thu Jul 02, 2020 3:30 am
by ITchimp
I am reading james molloy's OS dev tutorial, getting to the kheap portion... so far
I have to say it has so many bugs I suspect that he wasn't really rigourous with that
part of tutorial at least...

below is a very incomplete list
* there are cases where unifying left can occur multiple times. but he assume it would only occur
once

* there are cases where unifying right can occur multiple time. but he assume that it would happen
once

* there are case the last header on the heap is a memory block,but he ignores that


* there are cases where page alignment would require the page alignment to occur at the second page
boundry instead of the first one

* all the rewritten holes need to be re-inserted into the ordered array, but his instruction is to leave them
in the same position in the array because it is already in the array... the reality is that after unifying the
hole size has changed, it must be repositioned in the post

* there are also cases where the hole needs to be split into 2 holes and one block...

any comment on why it is so insanely buggy!!

Re: james molloy's OS kheap has so many bugs !!!

Posted: Thu Jul 02, 2020 4:55 am
by iansjack
ITchimp wrote:any comment on why it is so insanely buggy!!
Because it's not a very good tutorial?

Re: james molloy's OS kheap has so many bugs !!!

Posted: Thu Jul 02, 2020 8:47 am
by bzt
I believe we have a list of tutorial bugs on the wiki somewhere. Would you mind adding your list to it? It would be great for newcomers!

EDIT: found it: https://wiki.osdev.org/James_Molloy%27s ... Known_Bugs

Cheers,
bzt

Re: james molloy's OS kheap has so many bugs !!!

Posted: Thu Jul 02, 2020 12:59 pm
by ITchimp
It is a fantastic tutorial... on the contrary....

Re: james molloy's OS kheap has so many bugs !!!

Posted: Fri Jul 03, 2020 5:40 am
by Schol-R-LEA
There are no good OS-Dev tutorials, nor can there be any. We repeat this fact over and over again in the wiki for a reason.

In the case of James Malloy's tutorial, it is also very dated, being one of the older tutorials. A lot has changed since then, and a lot has been learned since then as well. Much of his approach - and that of any contemporary texts - simply isn't valid any more. While it isn't as outdated as, say, Bran's tutorial, there are definitely parts of it which no longer apply.

(This is sort of hypocritical of me, I know, since I've been planning to undertake going through most of the major tutorials myself, including Malloy's, to see what I can glean from each as well as be better able to answer questions about them. But I already know that they are flawed, and don't intend to take any one of them too literally.)