Study UNIX Kernel

Hi all,
I hope you are fine,

I'd like study Os I tried a book like Silberschatz it's a good book but like
other books it talks about the concepts abstractly and that's due to it try
to encompass many concepts from many operating systems in GENERAL.

i am not too much comfortable from these method i'd like to go something
concrete... so I decided to read and study an actual implementation of an OS
(it's source code) . I decided to do that by studying :

  • C Programming language
  • A Machine Architecture corresponding to a selected operating system
  • A selected operating system

the Criteria am considering for selecting an OS is :

  • it runs on a machine that have books and documentation that describes it (preferably but not restricted to Intel )
  • the OS itself has plenty of books and documentation describing and explaining it's concepts and source code and of course open source the most important criteria is that it's old enough to be quite easy covering the fundamentals and then I could read more about subsequent versions for more complexity .
  • the OS is Unix or Unix-like or A modification or derived from Unix Kernel.

-----------------------------------

I tried searching for Xenix because it runs on 80386 which is an Intel well documented machine but I found that the OS itself is a closed source ..

my question now : I'd like you to help me please to choose the OS and the Corresponding Machine meeting the above criteria (even it's too old but it must have books and documentation still available till now) ... i have searched the internet too much but am still confused ...

and please tell me if am thinking correct to try learning this way ..

thanks too much for you all

"the OS is Unix or Unix-like or A modification or derived from Unix Kernel."

Well... That would seem to cover just about all possibilities, yes.

You might try MINIX. It was the old 16-bit x86 kernel Linus Torvalds learned on, now a 32-bit kernel.

1 Like

I would recmmend:
The Design of the UNIX Operating System: Maurice J. Bach: 0076092031369: Amazon.com: Books

then to study and try, is to run your own minix system:
Operating Systems Design and Implementation: Andrew S. Tanenbaum, Albert S. Woodhull: 9788120329553: Amazon.com: Books

L. Torvald used this book to create his linux kernel...

1 Like

corona688 and vbe you really sure that the MINIX book contain all the source code with Explanation of every function an line assuming i know C well ? i have heard about this book but what's you opinion about reading microkernel os first shouldn't i read monolithic kernel first ??? what's the difference between then during study ??

minix is a very basic OS, up to you to make it more rich.. I think it is the best start for anyone wanting to understand what is going on in a basic OS since if you follow the book you should end with a working basic system, then as I said up to you to use GNU stuff to enrich your OS now you are a master in C compilation :wink:

1 Like

I cant think of any other book where you have source code in it...

As you want to specifically study kernel functionality look what else Tannenbaum has edited

1 Like

vbe another question please ... when i opened wikipedia page for that os i found the platforms (machines) are not limited to intel 80386 but there is others ... how does the book treat the machine .. does that vary in code .. code for every machine ?? or how does it treat this issue ... thanks

Why not start reading and find out?

1 Like

At the time of 1rst edition, there were many more affordable processors than INTEL on the market and so the book was so you could develop an OS with what you found...
I read the book back in 1992 I think and started to studay and develop a minx on a 80286 I recuperated and on a Z80, I wanted to try on a motorola68000 I had but busted the keyboard interface... Before finishing a friend came along with a linux alpha version and I went on dual boot with that spending my nights and weekend ... And dropped my minix project. but from what I remember there might be a site that gives you hints ( and code) depending on architecture and if so it would be mentionned in the book I cant check for you as I dont know what I did with my copy...

1 Like

I would suggest to start with classic. Old UNIX kernels are very easy to understand und to hack. You can find e.g. UNIX v6 or v7 on TUHS archive, Supnik's PDP-11 simulator (simh) and take Lion's Commentary on UNIX v6 source code - Lions' Commentary on UNIX 6th Edition, with Source Code. The book was long time ago a study guide for students learning Operating systems.

1 Like

If you want to study a modern Unix derived from AT&T Unix code (SVR4), you might have a look to Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture . An open source branch (Illumos) is available here

1 Like

thanks you all

[corona688] I'd like to design the route from the beginning so i don't like read something
then drop it and fail at the middle

[agent.kgb] can I find books and manuals and datasheet explaining both
Architecture,assembly and interface with PDP-11 ?
the book you mentioned contain code snippets only or have the complete
source code attached in an appendix or can i get it for version 6 from some
website written in C ?

thanx

There are a lot of information about PDP-11 in the Internet. It is the first computer, UNIX runs on. Just search for PDP-11 to find general information and links, and then

The book I've mentioned contains source code, but I am not sure, how full it is. UNIX v6/v7 source code is available from The Unix Heritage Society site and as a software kit to Bob Supnik's simulator Software Kits

1 Like

That is often the way of things, sadly. One doesn't reach the moon with their first rocket, and we aren't still running the first UNIX circa epoch time 0.

Retracing UNIX's footsteps from the beginning as agent.kgb suggests is an interesting approach. The PDP-11 is a very primitive computer but not quite so primitive that you have to input the bootloader by toggling switches.

This might be of interest.

Expanded Main Page - OSDev Wiki

They have a forum page which I joined some time ago but not been on since I adopted shell scripting as my language of choice.

Enjoy...

I'd like to ask what's the C compiler on which unix 6 was written for pdp-11 machine and how to get it's manual pls ..

knowing C
compiler manual
machine architecture and instruction set
source code of unix version 6
lion's notes

this mix could put me on the begging of the trace ...isn't that true ?

The closest thing to a description of the C Language and compiler used for version 6 would be: The C Programming Language by Kernighan and Ritchie. Note that this is the 1st edition describing the original K&R C; not later editions that described using the ANSI C language and subsequent revisions of the ISO C standards.

And note that, of course, the standard C library is not available in the kernel; libc.a is only available to link with user level programs. And, if you're thinking about the shared libraries that are used today; they hadn't been envisaged (let alone implemented) in the UNIX version 6 timeframe.

1 Like

I was searching on the internet and found many pdp-11 models at wikipedia.com page:
PDP-11 - Wikipedia ,in the models section in the page i found many many models which model of pdp-11 ran unix 6 and was targeted by Ritchie's Compiler For Unix ... does it vary from model to another ?? thanx

It was developed on the PDP-11/20, so at the very least, ought to work there. Most of the differences between models were I/O buses and peripherals...

1 Like

If I remember correctly UNIX version 6 could run on any PDP-11. UNIX version 7 required a PDP-11/45 or later model because it assumed the separation of instruction (code) space from data space that wasn't available in earlier models.

2 Likes