xv6 is a great Unix like OS for learning OS concepts. You can get a copy of full source code from this Git Repo: https://github.com/mit-pdos/xv6-public .

 

You can compile it and run it using an emulator like qemu.

( https://www.youtube.com/watch?v=ikcfQw4FPEw ).

Here is the relevant playlist :

( https://www.youtube.com/watch?v=DZ0-GMtOtEc&list=PL14-cztsT7zpTikkkROTPka86zLdx7AJh ).

 

( one more lecure on v6 intro : https://www.youtube.com/watch?v=2rAnCmXaOwo )

 

To give you a perspective of this exercise, let's think of these QS: 1. How the OS gets control of CPU in context switch ( with detailed steps ).

( https://www.youtube.com/watch?v=YPIw67LuuY4 )

2. What is a virtual memory and how kernel code manages this virtual memory, what are the data structure to maintain this "virtual memory"?

( https://www.youtube.com/watch?v=TPR8QAL_T4o )

3. How fork() executed inside the kernel and how a child gets PID value zero. What is the first thing child do when OS scheduler schedules it?

4. How are PCBs stored? 5. What are kernel stack and its use in context switch?

6. Detailed steps of scheduler polling each process to select a user process and switch to userspace. etc.

7. How are system calls added?

( https://www.youtube.com/watch?v=21SVYiKhcwM )

 

This book on xv6 explains the implementation of it.

https://pdos.csail.mit.edu/6.828/2016/xv6/book-rev9.pdf

 

You can also follow this course to learn more and work on exciting small assignments and projects: https://pdos.csail.mit.edu/6.828/2016/schedule.html

 

If really want to work move forward from this: You can start with Linux source code :

Here are two into tutorials :

1. https://medium.freecodecamp.org/building-and-installing-the-latest-linux-kernel-from-source-6d8df5345980

2. https://medium.com/@ssreehari/implementing-a-system-call-in-linux-kernel-4-7-1-6f98250a8c38

 

Thanks !

posted in Study Materials Sep 6, 2018 edited Sep 6, 2018 by
by
1,942 views
12
Like
0
Love
0
Haha
1
Wow
0
Angry
0
Sad

5 Comments

5 Comments

Like
2
Can one run three OS in one machine?Like Ubuntu and Windows. But it'll be fun experimenting and grasping the concepts practically.
edited Sep 7, 2018 by
Like
Yes you can run multiple OS in one machine like different flavors of linux (linux mint, fedora, ubuntu, centos), windows
Like
Will it not affect the speed of the machine in that case?
Like
No it won't hurt the machine's speed as in one time you will be able to run only one OS at a time
Like
Have you implemented as well?