English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   support.Amix (https://eab.abime.net/forumdisplay.php?f=125)
-   -   Minix (https://eab.abime.net/showthread.php?t=79233)

rabindranath72 28 July 2015 14:12

Minix
 
Since this thread is supposed to host all UNIX flavours, it seems weird no one posted about MINIX :)
The full MINIX distribution can be found here:

http://aminet.net/misc/os

The original distribution, the two upgrades and some docs.

I managed to boot and run the bootdisk from Update 1 (which includes code to avoid the kernel crashing on 680x0, x>0) and most crucially, hard disk support.
Now, for real hardware, you need either a SCSI or XT.
Worryingly enough, I couldn't install EITHER on WinUAE; something within MINIX doesn't seem to like how WinUAE handles the devices. Or is it? Did anyone succeed?
In a related post, I mentioned I couldn't even get a proper hdf image under the XT protocol working; that's another attempt I'd like to try before giving up on emulation, and working solely on my A1200/30.
In related news, I'm in the process of writing a proper IDE driver for my A1200.

strim 29 July 2015 08:32

Quote:

Originally Posted by rabindranath72 (Post 1033168)
In related news, I'm in the process of writing a proper IDE driver for my A1200.

Woot, that's pretty much awesome. No one wrote anything Minix/Amiga related for ages :).

Would you mind sharing your effort? Is the old Minix code even buildable in 2015? What toolchain do you use?

Maybe you can publish the code on GitHub? I wrote a few NetBSD/amiga drivers, I could take a look.

rabindranath72 29 July 2015 13:08

Quote:

Originally Posted by strim (Post 1033329)
Woot, that's pretty much awesome. No one wrote anything Minix/Amiga related for ages :).

Would you mind sharing your effort? Is the old Minix code even buildable in 2015? What toolchain do you use?

Maybe you can publish the code on GitHub? I wrote a few NetBSD/amiga drivers, I could take a look.

I'll definitely share, though it's been 20 years since I have touched an Amiga, and more than 10 since a wrote a device driver, so I guess it's a shot in the dark right now. ;)
The idea was to use emulation to get a clean HD install of MINIX, but apparently MINIX doesn't like WinUAE :(
I tried with both SCSI and XT emulation; I can see SCSI hdf images from MINIX, but then MINIX filesystem creation doesn't work; then I tried XT hdf images, but I can't even get AmigaOS to format an hdf file with XT format (see the thread in WinUAE support.) If you could try getting an XT format hdf (Toni Wilen says he got it working...somehow) it would be really helpful, at least I could see if MINIX likes XT better than SCSI on WinUAE.

As a toolchain I was thinking of using cc on MINIX itself on WinUAE (just for that retro-experience ;) ) although I also have Aztec C 5.10 on my A1200, as it supports pre-ANSI C.

What NetBSD drivers did you write? I'll definitely look at Linux, NetBSD and AROS for IDE implementations, I want to keep things as simple as possible, say ATA-1 level, so as to re-use as much of the official AT code in MINIX as possible.

Another challenge, for the future, is to allow MINIX to fully support virtual memory (I have a 68030 accelerator in my A1200) and replace process shadowing. But until I get a proper HD installation of MINIX that's not really (easily) feasible.

redblade 29 July 2015 16:52

I was going to play with the patches tonight. Wrote the disks with yadi and messydos file handler from Aminet.

I remember the update was good as it didn't crash my A1200. But I didn't use the patches.

strim 29 July 2015 17:22

Quote:

Originally Posted by rabindranath72 (Post 1033378)
If you could try getting an XT format hdf (Toni Wilen says he got it working...somehow) it would be really helpful, at least I could see if MINIX likes XT better than SCSI on WinUAE.

First I'd have to try to get it running, to be honest I never used Minix on Amiga. My only experiences with Minix are with versoin 3 on x86, which seems to be very different.

Quote:

As a toolchain I was thinking of using cc on MINIX itself on WinUAE (just for that retro-experience ;) ) although I also have Aztec C 5.10 on my A1200, as it supports pre-ANSI C.
So, Minix 1.5 is written in pre-ANSI C? Ouch ;). I hoped to cross-compile it from some modern OS with not-so-huge amount of work required...

Quote:

What NetBSD drivers did you write?
Here's the list.


Quote:

I'll definitely look at Linux, NetBSD and AROS for IDE implementations, I want to keep things as simple as possible, say ATA-1 level, so as to re-use as much of the official AT code in MINIX as possible.
Agreed, best to keep it simple.

Quote:

Another challenge, for the future, is to allow MINIX to fully support virtual memory (I have a 68030 accelerator in my A1200) and replace process shadowing. But until I get a proper HD installation of MINIX that's not really (easily) feasible.
I don't want to discourage you, but it sounds like a very ambitious project ;). And there are already UNIX-likes for Amiga that support virtual memory and MMU (NetBSD, Linux). I think the most appealing part of Minix are its very small requirements and the fact it can work even on a plain 68000.

rabindranath72 29 July 2015 20:35

Quote:

Originally Posted by strim (Post 1033421)
First I'd have to try to get it running, to be honest I never used Minix on Amiga. My only experiences with Minix are with versoin 3 on x86, which seems to be very different.

Ah yes, Minix 3 is a completely different beast. I suggest you buy Operating Systems: Design and Implementation (first edition) which fully documents Minix 1.1. It's an attractive system because it's very simple, easily expandable, and can be understood and maintained in its entirety by a single person.

Quote:

Originally Posted by strim (Post 1033421)
So, Minix 1.5 is written in pre-ANSI C? Ouch ;). I hoped to cross-compile it from some modern OS with not-so-huge amount of work required...

Yup! That's why I want to make my life simple, and use old development tools. Also, the system is very modular; as I am going only to add a driver, I won't need to recompile everything, only compile my part and link with existing object code.


Quote:

Originally Posted by strim (Post 1033421)

My kudos to you! That's pretty impressive. My only experience writing drivers is for the Cetia PPC SBCs under LynxOS (before it became a Linux variant.) I worked in some astrophysics projects, writing drivers for real-time data acquisition and monitoring systems. Never dealt with disk peripheral, so it will be something new.



Quote:

Originally Posted by strim (Post 1033421)
I don't want to discourage you, but it sounds like a very ambitious project ;). And there are already UNIX-likes for Amiga that support virtual memory and MMU (NetBSD, Linux). I think the most appealing part of Minix are its very small requirements and the fact it can work even on a plain 68000.

LOL yeah I know of the alternatives, but the point of the experiment is exactly to write the code; I have always been fascinated by the 68030 processor, I never wrote anything related to MMUs, and the simple fact that such an extension still doesn't exist is an attractive enough proposition for me to consider spending time on it. I bought an A1200+68030 accelerator exactly for this purpose (definitely not to play games; well except the occasional Sierra or Lucasarts adventure ;) ), so I will have to put the hardware to good use :)
In any case, for starters I only want to implement some form of memory protection (similar to what the 8088 provides), so I'll have only to hack the memory manager.

rabindranath72 30 July 2015 12:17

Note that if you want to develop with an existing MINIX system, Atari ST emulation is robust enough to handle MINIX, including hard drive support, so you could install a full MINIX ST system. The executables produced are compatible between the ST and Amiga versions (unless they use some specific hardware, obviously). ST can work as an excellent cross-development platform.

In terms of more "modern" compiler, you could check the ACK compiler.
http://tack.sourceforge.net/
Version 5.6 is relatively modern, it has 68k as a target architecture, and it can compile old non-ANSI code.

rabindranath72 15 January 2019 16:22

Just a quick heads-up! It's been three years already! Well, only last month I managed to get my A1200 up and running, after finally having the physical space to set it up (moving to a much larger home.)

I am using the Atari ST version of MINIX (running under the Hatari emulator) as a development machine, as even the latest versions of WinUAE don't provide reliable support for hard drives under MINIX (although it works fine from floppy.) MiNT under the Atari ST also provides a minix-fs driver, so that I can easily move images from virtual MINIX filesystems to a windows folder, from which I can read files and import them in WinUAE or my A1200 (via PCMCIA CF reader.) It's a bit convoluted, but it works.

I managed to re-compile the OS after applying the 1.5.10.1 and .2 patches. Note for some reason I couldn't get a working kernel image with the assembler string handling routines compiled into libc.a; both my A1200 and WinUAE (emulating both A1200 and A500) crash at boot. As this is not of immediate concern for my work, I'll try to address the problem later.

As I mentioned earlier, the idea is to build a IDE driver. As a first step, I managed to modify the kernel to introduce a check for the Gayle gate array, and the kernel successfully identifies it, both on my A1200, and on WinUAE-emulated A600 and A1200.

Next step: implementing the IDE register map.

gulliver 15 January 2019 17:29

This is really cool.

I understand there is a long road ahead of you, but it would be great, once your project is finished that you could upload your complete Minix WinUAE hardfile to Aminet.

rabindranath72 15 January 2019 17:52

Quote:

Originally Posted by gulliver (Post 1297924)
This is really cool.

I understand there is a long road ahead of you, but it would be great, once your project is finished that you could upload your complete Minix WinUAE hardfile to Aminet.

I plan on at least reporting regularly, time permitting (full-time job, a wife, and two small kids make things a bit...difficult :crazy )

gulliver 15 January 2019 23:21

Quote:

Originally Posted by rabindranath72 (Post 1297934)
I plan on at least reporting regularly, time permitting (full-time job, a wife, and two small kids make things a bit...difficult :crazy )

Then you are in the same boat as me. :D

Thanks

jayminer 17 January 2019 11:13

I love projects like this! I'm curious though, I have (basically) no experience of Minix, how much can it do nowadays? Does it have proper networking, is much of the GNU-userland portable to it/usable under it?

Twiggy 18 January 2019 11:55

Incredible stuff. Looking forward to hearing more about this.

Toni Wilen 19 January 2019 18:47

Quote:

Originally Posted by rabindranath72 (Post 1297895)
as even the latest versions of WinUAE don't provide reliable support for hard drives under MINIX (although it works fine from floppy.)

If I remember correctly, last time I asked for config and pre-installed HDF and description how to duplicate the problem (with valid test case, for example A2090 install surely won't work with A590/A2091/A3000 and vice versa because A2090 does not support RDB).

I am not going to waste time with any random tests or install attempts.

rabindranath72 21 January 2019 09:58

Quote:

Originally Posted by Toni Wilen (Post 1298810)
If I remember correctly, last time I asked for config and pre-installed HDF and description how to duplicate the problem (with valid test case, for example A2090 install surely won't work with A590/A2091/A3000 and vice versa because A2090 does not support RDB).

I am not going to waste time with any random tests or install attempts.

Yes I sent you many different logs; the tests were not random. Reproducing the issue was time consuming, as you had to re-do the installation from scratch; did you ever try to do it? At some point I simply stopped trying. I can assure you that the willingness to avoid time wastes is reciprocal ;)

In any case, I am interested in my software running on my machine, not on emulation, so if WinUAE doesn't work at this point it's not much of an issue for me.

rabindranath72 21 January 2019 10:40

Quote:

Originally Posted by jayminer (Post 1298297)
I love projects like this! I'm curious though, I have (basically) no experience of Minix, how much can it do nowadays? Does it have proper networking, is much of the GNU-userland portable to it/usable under it?

Thanks for your interest! My interest in MINIX is mostly academic; I have always been interested in OS development, and MINIX follows the philosophy of early UNIX of being simple enough and small enough to be fully understood by a single person. It's simple yet quite sophisticated since the kernel works by message passing.
MINIX supported networking as early as version 1.5 on PC, and on ST from 1.6.25, I think. The Amiga version was "left behind" at 1.5.10.2 with no networking.
I am not aware of attempts to port a GNU-userland to it; there is however at least one attempt to produce a PC cross-compiler that targets ST MINIX 1.6.25, however recompiling the OS meant quite a lot of changes to the K&R code had to be applied:
http://www.beastielabs.net/minix/
I provided a small "hack" so that the full cross-development environment could work on cygwin.

Someone has also managed to port MINIX 2.0.2 to Atari ST, but no source code was released.

I didn't go that route because I don't have the time to change all of the code in the Amiga version. Ideally, I'd like to produce at least an Amiga 1.6.25 port, but that may be in the (far) future, mostly depending on the free time I have. For now, I'd be happy to get a full HD installation on my A1200 :D

Toni Wilen 22 January 2019 16:42

I am not interested in installing minix, it is someone else's problem :)

There is still too many unknown variables, for example does it happen with all minix supported configs (A2090, A2091, A3000)?

Config should be really simple, no "more compatible" checked, fastest possible CPU.

rabindranath72 23 January 2019 13:02

Quick update: I successfully managed to detect the IDE devices on my A1200 (CF card.) I have two different CFs, one with two partitions, and another with a single partition. I can detect both.

rabindranath72 13 January 2020 10:01

It's been almost a year!

I have the pleasure to report that the ATA driver for Minix is now working.

- LBA28 addressing
- Supports up to two drives (no IDE doubler, though)
- Up to 7 partitions per drive
- MINIX partitions are limited to 32Mb
- No interrupts support for now; the driver works by polling. A similar solution was adopted as an option for the IBM PC version of Minix, and a loss of 10-15% performance was reported
- Tested on A1200, both physical hardware (using a CF 128Mb drive) and WinUAE emulation. It should work on A600 too, but I haven't tested it yet. It would require some changes to work on A4000 (not really interested in supporting this at the moment)
- Uses Fast memory if available for buffering

I am working on releasing the sources as an update (on top of 1.5.10.1/2) as soon as possible. I will release a pre-installed hdf image to run on A1200 as well.

To date, I have installed the full OS on both my A1200 and in emulation, I have run tests, and even recompiled the OS (it makes a heavy use of the hard disk) without any issues.
Interestingly, as previously mentioned, the default XT/SCSI drivers that come with Minix (for use on A590/A2090/A2091/A3000 SCSI) don't seem to work (at least in emulation; I haven't got any hardware to test them.)

redblade 13 January 2020 19:19

I will be interested in this :).

When did you change development to Amiga or were you using Hatari for part of the development process?


All times are GMT +2. The time now is 04:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04891 seconds with 11 queries