Shop OBEX P1 Docs P2 Docs Learn Events
Gone hardcore with Minix 3 — Parallax Forums

Gone hardcore with Minix 3

Something snapped in my head, I was digging through some junk electronics in my basement and found an old Gateway laptop that I bought back in 1999. This thing has a whopping 40MB hard drive, a CD, a floppy drive, a LAN, a modem with a line connector, amongst other things. Not sure about the RAM, hopefully it might have 512MB, not sure though. So, scratching my head, I decided to go hardcore with a UNIX clone, Minix 3.

After spending an hour, just to load up the system, it finally got to the point of installation and reboot. Yup, after checking some of the directories, looks just like UNIX SysV. Somewhere in the Minix 3 description it states that this version is "self healing", not sure what that means, but now I have a desire to make the system sick and see how close I can get it too a flat line. I wonder how long this will keep me entertained?

Any old timers remember what should be the next step with this setup. Oh, the laptop has a parallel connector, but I don't think I have a printer with that kind of connection. I have a LAN connection but not sure how to get my IP address. I do have a Lexmark T630 with a net connection, I wonder if I can get access to that printer.

Since the laptop has an RS232, maybe I should get out my old SX stuff and see if I can program a chip. But I do not think that their would be a Minix version of SX/B, and no not asm, I am not that far gone:-). So, the big question Vi or EMACS?

Ray
«1

Comments

  • Heater.Heater. Posts: 21,230
    Cool. I have never toyed with Minix.

    I'm guessing you could get OpenSpin and/or prop-gcc compiled and running on there.

    If you use Vim you can find a SPIN syntax highlighting config file for it on this forum.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-30 10:43
    I believe that the 'self-healing' reference refers to Minix 3 including a 'journalizing file system'. Linux has long had these in Ext3 and Ext4, and Windows does something similar with NTFS. And of course, Apple provides the feature, but I just don't know the history.

    I believe Minix 2 lacked the feature and people moved on to Linux because of that.

    Linux will actually let you use all sorts of various file schemes if you so desire. There are a lot of them.

    https://wiki.archlinux.org/index.php/File_systems

    The REISER file system is the most notorious as Hans Reiser seems to have murdered his wife, gone to jail, and been unable to do any further development to what was once a very promising file system. Not sure if he gave up after he killed his spouse or killed his spouse because he hit a dead-end. We may never know.

    https://en.wikipedia.org/wiki/Hans_Reiser

    Minix tries to create something unique and use it as an academic example. It is not always able to keep up with other OSes.

    ++++++++
    My impression was that it offers a free OS with a very expensive textbook. At a cost of over $200.00USD, it seems to be one scholar's pathway to survive the pressures of 'publish or perish'.

    http://www.minix3.org/doc/

    Try Abe Books for a second-hand copy or related text at a much more reasonable price.

    http://www.abebooks.com/book-search/isbn/9786130268398/

    And consider that it may not be as well developed or well-managed as a mainstream Linux, such as Red Hat or Debain. There are advantages with having a huge community of people doing peer review of open-source code and documentation. But, having one author teach the 'all and everything' of an OS may be more comforting to some. Linux authors work in groups with varied success in explaining what they are doing.

    So Minix 3 may just be an academic cul-de-sac. There are many distributions of Linux that will work fine on that old box. Try Puppy Linux for starters as it won't upset the Minix 3 that you have installed. It works entirely in RAM and loads from a CD, or perhaps even floppies ==> http://puppylinux.org/wikka/Pup4DOS

    I have my old XP maching with 512Mb Ram (that is shared with video) running LInux (not sure if it is an older Ubuntu or Debian at this point) and it runs better than it ever did in Windows XP. Linux will support legacy devices nice and install rather easily.

    If it is possible to add a USB port, have a 4Gbyte or larger USB memory stick hold your entire Linux OS. Just use the hard disk for a /home partition or maybe nothing at all.

    ++++++++++
    You could go 'extreme retro' and juse use FreeDOS. It now has CD support as well as floppy support.

    But it seems that the lack of a CD player or a USB port may decide exactly how much you can achieve. My old XP machine has a DVD player in it and USB ports... lack of RAM or lack of speed are not such big challenges.
  • Heater.Heater. Posts: 21,230
    edited 2015-08-30 10:38
    Minix is a microkernel design where the kernel is kept as small and simple as possible and all the other parts are separate processes, drivers, file systems etc. The "self healing" of Minix 3 refers to the fact that should any such service fail it will be killed off and restarted again.

    This is in contrast to Linux which is a monolithic system where a bug in a driver can bring down your whole machine.

    There was wonderful and now famous exchange between Prof Tanenbaum and the young Linus Torvalds about this design choice on some OS mailing list. Google can find it for you.

    The Minix book is great. Or at least it was when I last saw it decades ago. Minix was small and the book described it. It was a brilliant study for students of operating system architecture.

    I get the feeling that Minix 3 has grown too big for that role now. No sure really. Do new editions of the book stick to the old simple code or move on to Minix 3?

    Minix may not be as far developed as Linux in terms of driver availability, platform support and feature set but I would not cast aspersions on how well managed it is. Minix has a focus on reliability and hence is small and hopefully simpler than Linux. It's designed and built by competent people and has been funded by the European Research Council.

    I have not though about Minix for years but now I find this: http://wiki.minix3.org/doku.php?id=www:download:releasenotes-3.3.0 Very interesting, I may be tempted to get a Beagle and try it out.

    Seems there is no plan to port Minix to the Raspberry Pi. Shame.

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-30 11:05
    Wikipedia may give a bit more objectivity than the Minix site.

    If one really desires to learn it, there seems to be no way around buying Tannenbaum's own book.

    https://en.wikipedia.org/wiki/MINIX

    Heater has pointed out that it is something more than another Unix alternative. I just passed by it because of the rather small support community. My impressions of the self-healing aspect are likely naive.
  • Heater.Heater. Posts: 21,230
    Yeah, text books seem to be horrible expensive now a days. I bet there are enough comp. sci. courses around the world using that book to create a steady income stream from poor students.

    Seems Minix 3 supports multi-core processors now. Even more of shame there is no Pi port.
  • I purchased "the book" last year, yes it is expensive, but considering the amount of information contained, it is well worth it. I would say, just about a tad more than a third of the book is source code, the rest is discussion about Minix, and not necessarily Minix 3. Since Minix 3 will run on a Beaglebone Black, I would think that maybe the P2 might be a candidate.

    Now, as far as the OS not being as advanced as Linux or the others, I think that that is a good thing. For what I think I will be doing with it, bloat is the enemy. Not sure as to what I will be doing, it is still to early too tell. Since I am logging in as root, the first thing is to learn some SySAdmin commands, and then check out some more of what is contained in Minix 3.

    I also thought about FreeDOS, but it lacks a few necessary things, multiuser and multitasking. End of story for that usage.

    What I think I will do is pull the Lan connection on the Minix computer, and semi air gap the thing. Since my Win7 box has a real RS232 port, I just might connect to the Minix system via RS232. Then I will be able to log into the Minix system via my desktop terminal program and go from there, semi air gap.

    Since my Minix system(the laptop), has only one RS232 port, I am wondering about using one of my Propeller boards to act as an RS232 expansion unit, not sure about this though. I think that the Minix system has a one TTY hook up to a one user login session capability. I checked the /dev directory and it has only tty0 - tty10 available ports.

    Yes I would like to have my Minix system be able to program some Propeller chips. Now, how to get there could be a big challenge. Since I will be air gapping this unit, I will be able to keep some material on here that I would not normally keep on my desktop. It almost kind of sounds sinister to have a very powerful system running that only a very very limited amount of access to it. On to more investigation of my new toy.

    Ray
  • Heater.Heater. Posts: 21,230
    edited 2015-08-30 12:58
    Ray,

    Since the Raspi B 2 has a similar ARM architecture to the Beagle it should be a candidate for Minix 3. There is some discussion around the net about it but I don't find anyone doing it. I'm not up for writing the required drivers and boot loader.

    Did you mean P2 ? That might be a stretch what with not having an MMU and not much RAM.

    I agree, small and simple is just what you want some times.

    Programming Props from Minix should be fairly straightforward. Minix 3 runs both the GCC and LLVM C/C++ compilers so the Open Source Spin Compiler and program loaders should be easy to compile and use. https://github.com/parallaxinc/OpenSpin. Might be possible to build prop-gcc there.

    You will have to do some little tweaking of serial port names no doubt.
  • A big challenge is that Minix 3 does not support USB, so you have to work with a RS232 port, any Propeller boards with a RS232 programming port? And I am not good enough too write a driver for a RS232-USB dongle. Hmm maybe somebody has already done that.

    So the biggest drawback for porting to an RPi, no USB support. I think once that issue is resolved, the RPi 2 could be an interesting fit for Minix.

    Ray
  • Heater.Heater. Posts: 21,230
    Ah, I did not know of the USB limitation. No Minix for the Pi any time soon then I guess.

    Actually I have no idea, are there any Parallax Prop boards that allow RS232 programming now a days?

    If you have a board that can be programmed with a Prop Plug then all you need is that 2 (or 3?) transistor circuit to convert RS232 to the 3.3v Tx, Rx and reset for the Prop. The schematic is around the Parallax site or here somewhere.

    If you happened to be running Minix 3 on a Beagle you could probably make direct connections from a UART pins on the Beagle to the Prop. We have done that with the Pi and other boards.


  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-30 15:26
    Rsadeika wrote: »
    A big challenge is that Minix 3 does not support USB, so you have to work with a RS232 port, any Propeller boards with a RS232 programming port? And I am not good enough too write a driver for a RS232-USB dongle. Hmm maybe somebody has already done that.

    So the biggest drawback for porting to an RPi, no USB support. I think once that issue is resolved, the RPi 2 could be an interesting fit for Minix.

    Ray

    Of course you can use Propeller boards with RS232 programming. Just wire a level shifter to Pins 30 and 31 as indicated in the Propeller Manual.

    The on-board FTDI device converts TTL level asynchronous serial to USB. The same TTL asynchronous serial is essentially RS232 serial before the level shifter drivers have been attached.

    I am not 100% sure, but you might just be able to attach a Max232 device in parallel with an existing FTDI device at Pins 30 and 31 without interfering with the FTDI use.

    Any board that requires a PropPlug or just the 40 Pin DIP Propeller 1 will do fine.

    The Propeller Tool, BST, and SimpleIDE all will support RS232 port programing if you don't have a USB port. You just have to get the wiring right and have your OS locate the serial port. I have done this both in Windows and Linux with Propellers.

    I built my own transistor based level shifter with the RESn added for programing. There are several versions of schematics for this.

    The PropPlug is simply a USB to RS232 @ 3.3V TTL adapter. What you require is an RS232 at standard +9/-9 to RS232 @ 3.3V TTL adapter.

    Wulfden has apparently cataloged a lot of different solutions that have appeared over the years. The P3 would work well for you, but there are other ways to do this as well.

    http://wulfden.org/TheShoppe/pa/index.shtml

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-30 15:31
    Here is a schematic for a DIY adapter. There are a few alternative out there, but all seem to work well.
    426 x 488 - 19K
  • I did some more testing yesterday, getting good at deleting and installing the system. My FreeDOS bootable CD came in handy, it has fdisk on there so I could remove, or clean up a hard drive. When I purchased "the book", it came with a CD that had Minix 3.0, the latest downloadable version is Minix 3.3.0, there are a lot of differences.

    I was able to load Minix 3.0 onto my laptop, and it ran, with a lot of expected functionality missing, at least for what I wanted to do. The problem with going backwards, is that I have gotten used to a lot of helping hand functionality that is contained in todays popular OS, you pick one, which is not necessarily considered relevant on a hard core system, and therefore not included.

    When I tried loading Minix 3.3.0, onto my laptop, it got loaded and the system ran, but I kept getting a "CU" error, do not know where to even begin with that one. Basically, you could press 'enter' and the '#' reappears, so you could continue on for a minute or so before the error reappears. I guess maybe the system needs more time for the "self healing" to kick in.

    Today I think that I will be looking at putting together my mini-itx box, which is in a storage box with certain pieces that are not found, like the MB. I know I have one, but where did I put it? The last time that I had it running, which has been a few years, I do remember that I could have at least four RS232 ports made available, of course you need those special little cables, not sure if I have enough of those legacy items.

    I guess the first goal is to put together my mini-itx box, with four RS232 ports made available. After installing Minix 3.3.0, and learning a little bit about SysAdmin, then I think I will keep the system "air gapped", as much as it can be with the only other access to it would be via the RS232 port and a terminal program on my desktop. Putting that mini-itx box together should take only a couple of hours, I hope. So on with the next step. I may even take a break and work on my other Propeller project which needs some tweaking, and some consideration as to how I can hook it up to my experimental Minix setup.

    Ray
  • Short update: I looked at my storage box with the mini-itx stuff, moved the parts around, looked at it, not making any sense, put everything back in the box, maybe another time.

    I decided to use my Gateway tower for the installation of Minix 3.3.0, and it installed without errors. This box has an iCore 3, 4GB RAM, and a 1TB drive, so I think it has plenty of operating room. Minix 3.3.0 has a Minix(ACHI) choice for installation, it worked for discovering the SATA drive(s).

    This box does not have any RS232 ports, so I am not sure how to get around this problem. And since Minix does not support USB(yet), not sure of how I could use that for a COMM port that the system could recognize. So, I just might have to look around for a mini-itx system that has at least four functional RS232 ports.

    I did not plug in my Lan cable, so at the moment this system is truly air gapped. But, I will have to figure out some way of attaching some external toys, like a Propeller board of some kind. This could be a real challenge, since I really wanted to use the tty ports in some way.

    Ray
  • Heater.Heater. Posts: 21,230
    Can't you rustle up a old serial port card to plug in there ?

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-31 17:35
    No RS232 ports? There may be one on the motherboard that just requires a dongle to reach the outside world.

    I suspect that you could dual boot Minix3 with any OS if you used one of the LInux boot-loaders -- LILO or Grub.

    Windows would be a bit more work to dual boot along side as it keep count of the partitions on the boot hard drive. If you want to add more partitions, you have to do it within Windows or it won't boot due to the count change. But that isn't a big deal.

    And if you don't have a Windows Rescue CD, you better have Acronis or Ghost make a full backup before you start in on a dual-boot configuration.
  • General impression: I really like the concept of Minix, it gets away from the monolithic model. Minix 3 is still a teaching tool, in my opinion, but it is getting closer to being a work tool. I had one roadblock that prevented me from fully exploring the capabilities of Minix.

    The problem that I encountered was, getting access to the eth0, so I could use 'pkgin' to get some packages. For whatever reason the two units that I was using, old Gateway laptop, and a relatively new Gateway tower have either net cards that just were not working with Minix. Netconf presented a varied selection of eleven choices, but none of them were working with my choice of units. Maybe to further explore Minix, I could pick up a Beaglebone Black, I think the latest version can be purchased for around $60 USD.

    After looking in "the book", and playing around with a live session, I was thinking, how can some of the Minix principles be applied to working the Propeller? Maybe a good candidate for the experiments would be the C3 board. I was also thinking that I generally like the concept of Forth, but for a Minix like system on a Propeller, I would go with job, as opposed to word, and create an easier way of creating the job in an interactive environment. Enough of this day dreaming.

    So, for the time being I will keep the old Gateway laptop with Minix 3.3.0 handy, but it's time move on to another set of experiments. How about creating a hive of Propeller things, that would use some Minix principles to ...

    Ray
  • Heater.Heater. Posts: 21,230
    Ray,
    I really like the concept of Minix, it gets away from the monolithic model.
    Why do we want to get away from a monolithic model?

    I must admit that the idea seems attractive. Spilt the kernel into separate parts running as their own process, drivers, file systems, networking, etc.

    It just seems like a good idea from a software organization point of view. And the main argument seems to be about protecting yourself from the inevitable bugs in a large body kernel code. If you can restart a part that fails then you have a more robust system.

    On the other hand surely all that interprocess communication hurts performance? And what about the added software complexity of it?

    The actual software organization thing is not an issue. Your code can be modularized and partitioned by functionality like any other program, even if it is all just one big blob when compiled. Linux file systems and drivers are loadable modules after all.

    There was a famous argument about this between Torvalds and Tanenbaum about monolithic vs microkernels
    https://en.wikipedia.org/wiki/Tanenbaum–Torvalds_debate

    Anyway, what worries me about MINIX now is finding this in the installation instructions:

    Always stop MINIX this way to avoid data loss as MINIX keeps some files on the RAM disk and only copies them back to the hard disk at shutdown time.

    Ouch! What? That sounds like a bummer if you are using MINIX on something like BeagleBone where one might expect the power to be coming and going at any time as you play with your embedded gizmo.

    I wonder what those files are. Does it matter if that data gets lost? What bad things happen if you just cut the power?



  • All very interesting points, you, being a seasoned programmer, I expect no less. I, on the other hand, am not a seasoned programmer, let alone a good programmer, at that, but I keep trying. Minix, being a clone of UNIX, which is a monolithic model, is still an interesting idea.

    I keep thinking about some of the OS's that you have to keep restarting every time you have some new code added, what a pain. It would be nice if you could just keep your system up and running and be able to add new system code without having any restarts. If you have a modular system, then maybe you could have some modules get turned off/on, without affecting the whole system. Complex, maybe, but wouldn't that be a way of keeping a system from getting bloated with work arounds, missed opportunities.

    I do remember though, when I used to "play" around with my UNIX SysV, every time there was a new driver or program added, I do recall having to do a 'cc root' (or something like that), and then restarting the system, if memory serves me right. So, even with a great system, like UNIX, you had to do the halt/restart thing.

    I hope I created some interest for Minix, with more people looking at it, maybe some of those points listed would get looked at, or at least explained in a more specific manner as to why it helps the Minix, in the long run.

    I am now seriously looking into a Beaglebone Black, but first I have to find some more info about the board, like how many UARTs or ports that could be used by the Minix tty. Since Minix does not have a 'cc' command, how much room does an installation of GCC take up? Not sure how much room the BBB has to support a fully functional Minix system. Yes, I would still like to get something like that to support a Propeller programming environment, and possibly other interesting experiments.

    Ray
  • kwinnkwinn Posts: 8,697
    @Heater

    Re:On the other hand surely all that inter-process communication hurts performance? And what about the added software complexity of it?

    I've also been a fan of modular systems like Minix and do not see any reason why splitting an OS into functional modules should make much if any difference to the level of complexity and speed of a well designed system. After all, monolithic systems still have to communicate between the functional blocks. An added advantage of a micro-kernel system is that it can be set up so it only loads the modules needed by the hardware it is running on, and an image of the system can then be saved for future boots.
  • Heater.Heater. Posts: 21,230
    Ray,

    Don't get me wrong. I have nothing bad to say about Minix. My comments regarding monolithic vs microkernel were not intended as an opinion only an observation.

    Linux systems almost never have to be restarted with an upgrade. Restart is only required if the actual kernel upgraded. Which is not very often and not generally not necessary.

    Linux, is a monolithic kernel, but it is also very modular, all drivers, file systems, etc are separately loadable modules. It is not a microkernel though so there is no way to reload or restart that file system driver that you are actually using at the time.

    Minix may not have "cc" but it does have GCC and the new Clang/LLVM C/C++ compilers. I'm very sure that can be fit into a Beagle's 4GB on-board flash. I used to compile entire Linux systems with only 1GB of Disk so I expect no problem with this.

    Actually I'm very tempted to get a Beagle myself and try Minix on it. Another place to run the Prop tools!
  • Heater.Heater. Posts: 21,230
    kwinn,
    ...monolithic systems still have to communicate between the functional blocks.
    Very true. However there is a lot of difference between simply calling a function in a monolithic program and passing messages to functionality that is in separate processes in separate memory spaces.

    Do I over estimate the overheads of all that message passing and context switching? I don't really know. Does it really matter if such a kernel ends up being a bit slower? After all the trade off is speed verses robustness.

    A monolithic kernel can also allow that you only load the modules you need for the hardware it is running on. Modules can be loaded and unloaded as plug-n-play devices come and go.
  • kwinnkwinn Posts: 8,697
    Heater. wrote: »
    Very true. However there is a lot of difference between simply calling a function in a monolithic program and passing messages to functionality that is in separate processes in separate memory spaces.

    Do I over estimate the overheads of all that message passing and context switching? I don't really know. Does it really matter if such a kernel ends up being a bit slower? After all the trade off is speed verses robustness.

    I don't really know either. It's been a long time since I was involved with software at that level and a lot of software and silicon passed under the bridge since then. I suspect that message passing would not have to be much if any slower than function calls if well designed. Calling a function involves passing parameters as well. Passing the address of a list of parameters should not take any more time than executing a function call.
    A monolithic kernel can also allow that you only load the modules you need for the hardware it is running on. Modules can be loaded and unloaded as plug-n-play devices come and go.

    True. To me it looks like there has been a lot of exchange of ideas between the monolithic and micro kernels. It will be interesting to see how things evolve from here. I suspect some of the micro kernel ideas will gain more traction if multi-core heterogeneous processors continue to become more popular.

  • It would be very interesting if Chip decided to do a, lets say, P3, leaning towards micro kernel implementation, with maybe a nod for a Minix system in particular. Now if were to have 32 COGs and a reasonable amount of RAM...

    Ray
  • Heater.Heater. Posts: 21,230
    Don't we all have "microkernel" systems on our Props anyway?

    We run drivers, UART, fs, video, etc, etc in separate processes. We can start and stop processes at will, we can send messages between processes via HUB, we have locks.

    Our "kernel" is in hardware.

    What you after that we are missing in this picture?
  • kwinnkwinn Posts: 8,697
    Ray, I think Heater is right. We already have a micro kernel system in the P1 if one looks at it in a certain light. I don't see why we couldn't have one with a basic windowing system on the P2 if we wanted. It will have an order of magnitude more memory and several orders of magnitude more processing power than my last Z80 CPM/QNX system did, and I could run four programs simultaneously on that.
  • Heater.Heater. Posts: 21,230
    I do think however that we need a better language for the Propeller.

    We have processes but the Spin language itself has no semantic representation of them.

    We can pass messages between processes through hub but Spin has no semantic representation of that.

    How many times have you seen people asking questions like, "I have a top level object and a serial object, how can I allow all my other objects to use that serial port?"

    That would be obvious, and standardized, if Spin could pass objects or methods as parameters to other objects. Or if Spin had a concept of communication channels that could be passed around.

    Never mind that many newbies are confused as to the distiction between an object and a COG running a process.

    So we all hack our own ad hock solutions to these issues and it's a confusing hard to use mess.

    C/C++ is no better in this respect.


  • So, is it really a better language or an interpreter or interactive session that is needed? I guess if you start with something that feels like Minix, you could use bash and do some scripting to achieve a goal. But it does look like the Propeller could use some kind of interactive session that is less cryptic than what is available now. Now, how could you set up an interactive session to do some specific task, place it in a background session, and move on to doing something else, amongst other things? I guess it's possible with the Propeller, but how do you get there with the least amount of programming pain?

    Ray
  • Heater.Heater. Posts: 21,230
    Hmm...You are talking about the user interface to Minix rather than it's microkernel architecture as such. I'm presuming it's command line interface feels much the same as Unix or Linux.

  • kwinnkwinn Posts: 8,697
    Why not an adaptation of "pipes" as a method of passing parameters between objects and tasks? Looks to me like the high speed access of hub memory is an ideal way of implementing pipes, and they can be used for multiple types of data.
  • Heater.Heater. Posts: 21,230
    The pipes that I know of, in the unix style, don't pass program parameters, they pump data streams from the output of one program to the input of another.

    They also have no idea about "multiple types of data". Those streams are just bytes.

    You make be wonder though. Back in the day there were such tings as "One Man Unix". OMU ran on 68000 (or was it 6809?) systems with little RAM. They supported pipes as far as I remember. Like "ls | sort" for example.

    So I guess such a thing could be done on the P II which is detined to be a more powerful machine.

    It's not a project for me. If I was dead keen on interactivity I would want to see the Espruino Javascript engine running on the P II.




Sign In or Register to comment.