I am expressing my thoughts on what I learned so far and where I want to go. Long read here. So, I doubt anybody will read it. But at least this will serve as my notes for later.
The only mentors I have - are on IRC on #minix - and they have been helpful. The NetBSD and Hurd people are friendly as well.
I don't think the goal is full compatibility with NetBSD. The user land came from NetBSD and other things. But Minix will remain a microkernel OS and try to stay lightweight. Minix 3 will still be a real world useful OS. Minix and NetBSD have their own goals. Minix user land should strive to be compatible with NetBSD but cannot be 100% compatible because NetBSD kernel is monolithic while Minix is a microkernal. So Minix can have its user land updated from newer releases of NetBSD. This should make it easier (still lot of work) to port user land libraries, commands, and other software found installed via pkgin/pkgsrc.
Instead of writing a new book (take too long), we should strive to create a new book as an addendum to the edition 3 Minix book based on what Minix 3.3 and 3.4+ are and what we want Minix to become. What is found in the Minix 3 wiki. And what the differences between the 3.1.0 book version and 3.4+. And a little more about the changes between each version. I know - I am asking a lot since it seems the project is in hibernation. I say 3.4+ to include changes in git master and various PRs that have not been merged - yet. What PRs are good to include that have not been merged into git master?
I want to create a new release - just to do a release so people will have an up-to-date Minix 3 OS to play with - include the source code - even if we need to create a DVD image instead of a CD. Otherwise, store the source code that matches the binaries on the CD or DVD as a tarball bzipped or tarball gzipped (depends on what compression tools are installed). I have no power to do this so it would be my own download site and the images would be UNOFFICIAL. Is there some service somewhere that can build and host things for us and do security audits and provide some kind of (not sure of the right words here) to authenticate who the ISO image files came from? Of course, they would not be official but they could prove they came from me?
There are commits to Minix git master that are not in the latest 3.4rc6 that I find helpful, such as, booting from EFI instead of legacy BIOS.
Yes, there is the Minix 3 wiki - a great resource, but it mainly focuses on the later versions of Minix 3 - not the Minix 3 book version 3.1.0. Plus, when i say "new book", I am talking about an addendum to the original Minix 3 book that can have a PDF created or printed or single-page HTML page. This is so you can read it offline when you have no internet connection. Read it from your tablet or phone while waiting in a doctors office, etc... or something to read in bed before you go to sleep... The new book would be considered as an addendum to the wonderful Minix 3 book. This way - everything does not have to be re-written because much of the knowledge in the Minix 3 book is still very valid.
I think Minix should strive to be a lightweight / minimal microkernel-based operating system for laptops and desktops and single-board computers like BeagleBone Black and the Raspberry Pi 1 thru 3. I would not consider Minix as a server OS because that is what NetBSD and others can provide - plus they have the eyeballs to make the server OS secure on the internet; Minix does not. Raspberry Pi 4 would require 64-bit support in Minix. We are not ready for 64-bit. I think it is far more important to have a good working port of i386 and ARM 32-bit - and the 32-bit ARM support will be for 32-bit Beagle boards and Raspberry Pi. Have good preemptive multithreading support. We have GNU pth and mthreads. But we need better support than that including kernel threads. I want to take a look at the clone( ) sys call used in Linux (just the documentation for inspiration) and see what NetBSD source code has for LWP (Lightweight Processes) that implement a 1:1 kernel and user mode thread. I mainly need threading for USB support but it would allow more software to work on Minix. When I say lightweight, I mean our goal is to not compete with well-established OSes like NetBSD or Linux. Even a desktop would not be heavily loaded with a ton of applications - just your basic stuff. Even some X and lightweight desktop/window manager would be OK. I keep stressing lightweight because the OS should be a real-world OS but also keep it small so others can learn from it, build quicker, and take up less space on a CD/DVD but also less on their hard drive. And quicker to download the ISO.
Should we move to 64-bit? Eventually. But not today. Not this year. I will not debate about 64-bit. It is a practical matter - resources - getting existing stuff to work first.
Of course, this is only my opinion - just my 2 cents - real Minix developers' view points probably differ.
I am going to continue to reply to this message as I learn more. I am going to start writing little test programs in C to see what is going on. Making changes to existing stuff in Minix. Play with Linix, NetBSD, FreeBSD including Windows 10 to see how PCI and USB work there - probably via test programs written in C. See USBView project on github from Microsoft for Windows to list USB devices.
After doing some research, such as, looking on the Minix 3 wiki, I see that there is some PCI and USB support. But the USB support is only working on the ARM - the Beagle boards - that i can tell. I have not tried it on ARM. I just know some USB parts like USBD are not even built on the i386.
Minix 3 currently has USB Support via DDEKit
Here are 4 ways to get USB support working for i386 port of Minix 3.4+:
(1). Look into why the existing support of USB via DDEKit is not being built (USBD) on Minix 3.4+. Supposedly, I read it works on the ARM 32-bit support for the Beagle boards, but how well? And some things are hard-coded for the ARM / Beagle boards.
However, PCI does look like it is working on i386 - try the lspci command on Minix 3.4 - i do not know how well. Not sure about the other stuff like APIC and ACPI.
(2). or try to port USB support (this may include PCI, ACPI, APIC support as well) from NetBSD because it is the closest thing to Minix compared to FreeBSD or Linux or HelenOS.
(3). or write our own home made solution.
(4). or port rump kernels from NetBSD to Minix 3.4+. The Hurd has done this and the Hurd is a microkernel OS as well.
Take a look at the man pages, documentation, books, and source code of other open source operating systems like NetBSD, FreeBSD, OpenBSD, Linux, HelenOS, Hurd, Windows, etc. However, be careful about Linux and Hurd because it is GPL/LGPL licensed.
FreeBSD has good documentation on their USB support and other things like PCI and device drivers and how it boots. Take a look at all their online books. FreeBSD support initially came from NetBSD.
FreeBSD USB Support in the FreeBSD Architecture Handbook
See all of FreeBSD online books / documentation here:
I also bought a Kindle book from amazon named Design and Implementation of FreeBSD
Things to know about USB
Read up on USB, ACPI, PCI, PIC / APIC on the OSDev.org wiki
There is also specifications of a PCI bus called PCI-X and PCI Express.
Read up on protected mode, virtual memory vs. physical memory, GDT, paged memory. And how to pass messages in Minix 3 between the device drivers, servers, and the micokernel. And how does user mode libraries and applications use USB and PCI to do stuff? How do user mode applications and libraries communicate with the servers in Minix? Much of that is in the Minix 3 book I need to revisit.
Understand the various USB host controllers: UHCI, OHCI, EHCI, and xHCI. UHCI and OHCI are USB 1.x host controllers. EHCI is a USB host controller for USB 2.0 devices. USB 2.0 must support USB 1.x which means there must be support for UHCI and OHCI controllers as well. xHCI is a USB host controller for USB 3.0 devices and includes support for USB 1.x, 2.0, and 3.0 under the one xHCI controller. Learn about the various classes of USB devices including host controllers, hubs, HID, mass storage, etc.
These days, there is USB 3.2 and USB 4.0. See
usb.org and click the developers tab to search for specifications to download.
And of course, studying Minix 3 in the The Minix Book - Operating System - Design and Implementation - 3rd edition. And read Modern Operating Systems as well. Sure, maybe not up-to-date but still very, very useful.
But playing with Minix 3 running in a VM or on bare metal. If using Minix 3.4rc6, use pkgin to install git and other things to get the latest Minix source code from git. Build Minix. Studying its source code. Read the book and look at the source code to see how Minix boots up. Read about its device drivers and servers and the kernel.
You can try Minix and NetBSD in a VM like qemu, bochs, Virtual Box or VMWare, but it is best to see how real USB devices work on bare metal.
On Minix, you can use the lspci command to list pci devices. On Linux, you can use lspci and lsusb commands to list pci and usb devices.
On NetBSD, they have a pcictl command. And there is a library for usb named libusb to be used by applications I think? but this libusb is not the same libusb I mention below. So, there might be a clash with the share object filename - not sure how to deal with that situation... does anybody know?
USB Support in HelenOS
HelenOS source code in git
USB support in Linux
Synopsys DesignWare Core SuperSpeed USB 3.0 Controller in Linux
Here is some info as well about the DesignWare USB Controller... Not sure if it applies to what Linux or NetBSD has...
What other open source OSes out there that have USB (and of course PCI, ACPI, APIC) support we can research?
Especially BSD or similar licensed.
You need to know C programming but helps to know a little C++ and assembly language for x86.
And helps to know how the OS boots and initializes devices including various buses like ISA, PCI, AGP, USB, etc.
brokenthorn.com OS Dev is a good place but it appears the site is down. Here is the link at the Internet Archive:
If you get any USB book, get the 1st or 2nd book below.
Books on USB (Universal Serial Bus)
Get this Kindle book which is only US$10
USB: The Universal Serial Bus (FYSOS: Operating System Design Book 8) by Benjamin David Lunt
Another book on USB. You will find other books by the same publisher/author about PCI, ISA, Protected Mode, 486, Pentium Pro/Pentium II as well.
Universal Serial Bus System Architecture by Anderson Mindshare
There are other books I have listed below on USB but I do not have them. I only list them to make you aware of their existence.
USB Complete: The Developer's Guide (Complete Guides series) Fifth Edition by Jan Axelson
USB Embedded Hosts: The Developer's Guide by Jan Axelson
Serial Port Complete: COM Ports, USB Virtual COM Ports, and Ports for Embedded Systems (Complete Guides series) 2nd Edition by Jan Axelson
USB 3.0 Technology: Comprehensive Guide to SuperSpeed USB First Edition by Donovan Anderson
USB Design by Example: A Practical Guide to Building I/O Devices by John Hyde
I read a lot of Kindle books. I can read them via the web brower logged into
amazon.com web site, on my iPad via Kindle app I got from the App Store, on my Android phone via Kindle app i got via Google Play app store, and at one time I had a 10" Kindle Fire tablet.
libusb - USB Library for user-mode applications to call to list USB devices but also be able to write a user-mode device driver. This library is cross-platform and written in C. Libusb works on Windows, Linux, NetBSD, OpenBSD, and others. It is LGPL licensed. It is in the NetBSD pkgin/pkgsrc or you can get the source code tarball or from git yourself. You can actually build it now on Minix provided you include a pthreads implementation like GNU pth or mthreads and you pass the environment for the pthread.h to the configure script. However, any OS such as Minix which does not have a back end will default to the null_usb back end which is just a stub. But this does allow you to build it. Once you can build it, then you can add an implementation for Minix there. Just follow what NetBSD is doing. The are many USB applications that use this library. If you use a SDR device such as RTL-SDR, then it requires libusb.
Looks like rtl-sdr was ported to NetBSD as well.
I am continuing with my education in C programming, advanced programming in the UNIX environment, assembly language for x86, reading various tutorials like brokenthorn OS Dev, books on USB, PCI, ISA, Protected mode, the Minix book of course, learning about UNIX commands and its environment, bash shell programming, editors like vi, emacs, pico/nano, mc (and its mcedit and mcview), learning by using Minix and NetBSD and reading their source code, etc.
Any suggestions or comments? Please be constructive though.
Anybody else interested in helping? Research? Write test programs in C? See what NetBSD is doing? Help make changes to Minix to give us good thread and USB support?
Anybody else interested in pursuing this journey into Minix 3, NetBSD, threads and USB support?
Some consider working on operating systems a black art. I consider it fun, very technical which I like, and it gives me an understanding about the internals of an OS to help me be a better applications programmer on UNIX like systems. Will I be a great Minix internals developer - probably not - but it will help me tremendously give me a better idea of what REALLY is happening in the system. No more guesses, gaps in knowledge, or misunderstanding - I want to know for sure what really is happening so i can make better judgement calls writing applications or debugging them.
Thank you,
Daniel Morgan