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

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.
Post Reply
ITchimp
Member
Member
Posts: 137
Joined: Sat Aug 18, 2018 8:44 pm

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

Post 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!!
Last edited by ITchimp on Thu Jul 02, 2020 2:20 pm, edited 1 time in total.
User avatar
iansjack
Member
Member
Posts: 4834
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post by iansjack »

ITchimp wrote:any comment on why it is so insanely buggy!!
Because it's not a very good tutorial?
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

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

Post 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
ITchimp
Member
Member
Posts: 137
Joined: Sat Aug 18, 2018 8:44 pm

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

Post by ITchimp »

It is a fantastic tutorial... on the contrary....
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

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

Post 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.)
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.
Post Reply