SamyPesse / How-to-Make-a-Computer-Operating-System

How to Make a Computer Operating System in C++
https://samypesse.gitbook.io/how-to-create-an-operating-system
Apache License 2.0
21.35k stars 3.42k forks source link

unexplained files, independent src directories for each chapter #46

Open mattrozak opened 10 years ago

mattrozak commented 10 years ago

I'm currently trying to write my own basic os by [loosely] following this guide and other sources. One issue I repeatedly experience while using this repo is the files and directories in src that haven't been introduced in any of the readme files. I understand what they do, they just don't feel like they belong - yet. I understand that this is a work in progress, but it feels that these extraneous files don't belong in the master branch until they have been explained.

Since the chapters make it feel like the OS is being built incrementally, IMO, it makes more sense if each chapter had its own src directory that only contained the files that have been introduced up to that point.

aristotle0x01 commented 10 years ago

i think your idea does make sense, each chapter has its own src, thus giving us a incremental sense. which would also make it easier for the new comers to learn.

pczarn commented 10 years ago

:+1: Copy src to each chapter, or... It would make more sense to incrementally commit src to a new repository and add a submodule to each chapter. I don't know any better way with git tags, branches or something.

jaxrtech commented 10 years ago

I guess the only other thing you need to think about is if you do some sort of hot fix on one of the files. How would you carry the changes over to all the future src chapters in a straight and forward way? Just throwing that out there thinking about this, but I agree I think it would be better laid out in this incremental fashion. It would be help out people getting started to understand what stage they are at with the code. It's not as easy to follow when you don't have the reference code right with the text at that particular part in the tutorial. :+1:

mattrozak commented 10 years ago

I do agree that propagating the changes over multiple src directories would be a pain, but this is also a problem that can be solved in a few lines of bash.

jaxrtech commented 10 years ago

Then again isn't that what git merge is for? lol

pczarn commented 10 years ago

@jaxrtech As I said, propagating changes throughout all chapters could be simply done with git rebase. But then src needs to be maintained in a separate git repo and every chapter must point to some commit/tag/branch in that repo via submodule. But are submodules straightforward enough?

git merge works for branches.

Looks like submodules can even track branches: http://stackoverflow.com/questions/1777854/git-submodules-specify-a-branch-tag

kannan83 commented 10 years ago

not a bad idea ;-)