Hacker News new | ask | show | jobs
by peatfreak 2825 days ago
I just read one chapter, which I thought was OK. It felt more like a book on how the C programming language translates to operating system concepts, rather than a book about the operating system concepts themselves. For example, the chapter I read discusses malloc() and indicates that it allocates memory from the heap, but it doesn't mention sbrk().
2 comments

It often splits practical vs. theoretical concepts. One chapter might go over the theoretical scheduling algorithms, and then another might address practical solutions to internal fragmentation.

Disclaimer: I'm definitely not an expert, I'm reading the book to learn.

These days sbrk is rarely used, in fact, on Apple systems I am under the impression that it is depracated (A quick search confirms this impression).

The correct approach is to use mmap with the MAP_ANON flag (Which interestingly isn't doesn't seem to be fully documented in the Linux documentation...)