English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 18 December 2022, 14:21   #1
Yagi Uda
Registered User
 
Join Date: Dec 2022
Location: Birmingham
Posts: 4
2022 m68k-linux installation

I hope this is the correct place for this query. Backstory... I've been playing with a little project to get a github command line program (that does some data processing) expected to run on Linux on the Amiga (purely for the reason of see it run on a classic machine). Using CMake I can build and run it natively on Raspbian, also on Ubuntu (under Windows.) I've been trying cross compiling using https://github.com/bebbo/amiga-gcc (no joy as no Fortran and have failed a workaround by trying to converting Fortran to C using available tools, and also struggling to convert Posix / multithread C++ code to single thread.) I have tried also GCC natively under AmigaOS4.1 with the PowerPC GCC ppc-aimgaos-gcc as I've read it has some C++ threading and gfortran addition was possible, but it wasn't easy enough for me to build myself. All "user error" over-reaching on my part.

Trying a different tack, I noticed I could cross compile the program successfully to m68k-linux using Ubuntu https://packages.ubuntu.com/focal/am...m68k-linux-gnu etc. I never appreciated what m68k-linux was. The compiled output doesn't run on an Amiga (nor At*ri ST) with their regular OS (of course.) But if I can get Linux running on the hardware, then the executable I have should run (?)

So the first Google result takes me here http://www.linux-m68k.org/ which has lots of nice detail than I can follow, although conscious some of the text is 27 years old (!)

I also see a nice step by step guide here https://forum.amiga.org/index.php?topic=65146.0 (although this is also from 2013)

Also https://wiki.debian.org/M68k/Status and here https://cdimage.debian.org/cdimage/ports/ are current but I get stuck working out what to do with the image not finding a guide (yet). I can download it, unzip/tar it in Windows or Linux. Place on a new Amiga partition and boot?

I see Linux in the wild [ Show youtube player ] This slow speed is not a problem for my use case.

And Googling for both terms "winuae" "m68k-linux" hints that it might be possible to do the same virtually which might be an easier first step than real hardware.

So after all of that, please can anyone share if there is a 2022 accepted best practice for the easiest way to get m68k-linux working that I could follow? FYI I'm almost competent at following instructions for Linux / Windows, but I'm very much on the learning curve for Amiga ways of working and 'idiots guide' suggestions are appreciated ;-)

Thanks for reading and best wishes for the holidays and New Year.
Yagi Uda is offline  
Old 19 December 2022, 08:13   #2
Twiggy
\m/
 
Twiggy's Avatar
 
Join Date: Nov 2008
Location: Devon, U.K.
Posts: 573
Second that.

If only there was a nice and easy .hdf ready made!
Twiggy is offline  
Old 20 December 2022, 17:00   #3
Yagi Uda
Registered User
 
Join Date: Dec 2022
Location: Birmingham
Posts: 4
Working through a couple of the (to me) simpler examples for info... This is very old, but the files are still there. Let's try WinUAE first. Ok - easy enough.

https://www.debian.org/releases/slin...ethods.en.html

Quote:
Use the following steps to install Debian from your pre-existing AmigaOS setup.

1. Get the files amiga/amigainstall.lha and common/base2_1.tgz.
2. Unpack amigainstall.lha into a partition with at least 10MB free. We recommend you unpack it into the main directory.
3. After unpacking, you should have a debian directory. Move common/base2_1.tgz into that same debian directory. Do not rename any files in this directory.
4. Write down the Linux partition name for the location where your new debian directory is. See Device Names in Linux, Section 4.3 for more information on Linux partition naming.
5. Prepare your partitions for Linux. See Partitioning Prior to Installation, Section 4.6.
6. In the Workbench, start the Linux installation process by double-clicking on the ``StartInstall'' icon in the debian directory.

If you are running AmigaOS, you can use the HDToolBox program to partition your disk prior to installation. Here's how:

1. Start HDToolBox, select the disk you want to use, click on the ``Partition Drive'' button and select or create the partition you want to use as the Debian root filesystem.
2. Next, you need to enable the ``Advanced options'' and change the following items under ``Change'':
. set the filesystem to ``Custom Filesystem'' or ``Reserved Filesystem'' (the label which is shown depends on version of HDToolBox you have installed)
. set the identifier to 0x4c4e5800 (this is the hexadecimal equivalent of ``LNX\0'')
. disable the ``Auto-mount this partition'' checkbox
. disable ``Custom Bootcode''
. set the ``Reserved blocks at'' settings to 2 for start and 0 for end

If you are making more than one Linux partition, go ahead and create the additional partitions, just as above.
After having done this, select a partition that is to be used as a swap partition, and repeat the same steps as above, but set the identifier to 0x53575000 instead (this represents "SWP\0" in ASCII).
Write down the Linux partition names for the root and swap filesystems you just created. See Device Names in Linux, Section 4.3 for more information on Linux partition naming.
Go back to the main window of HDToolBox and select ``Save changes to drive''. Think twice before actually clicking on ``Yes'' -- have you chosen the correct partitions? No important data could get lost now if you made a mistake? Then click ``OK''. If required, the Amiga will reboot after this.
- I've done all of this, here I've noted the modified 0x identifier addresses aren't saved in HDToolBox when returning to the dialog boxes for my partitions.

When running the install file, the initial black screen appears with some text, but then nothing more after an hour. CPU remains at 50%, but it's not crashed (I can still type to the screen.) I've tried various WinUAE configs (trying defaults and also those mentioned for Amix e.g. both AGA and Full ECS but I'm going into guess mode.) Also interesting for A3000 chosen hardware the text identifies A2000.

= = = = = = = = = = = = =

Another attempt was using https://wiki.debian.org/M68k/Installing

Quote:
A typical command line to boot Linux with amiboot looks like this:

amiboot -d -k vmlinuz-3.2.0-4-amiga -r initrd.gz root=/dev/ram video=pal
I have amiboot-5.6 to use on the command line, I have vmlinux-3.2.0-4 (and also 3.16.0-4) but can only find an initrd.img-xxx file from the downloaded sources which is 4 MB, and same size if I GZip it to meet any expectations.

With little Fast RAM it complains and aborts. Adding max 8 MB Z2 Fast RAM and various amounts of Z3 Fast RAM up to 512 MB it progresses and says it is decompressing the kernel, but always stops with: Compressed image too large! Aborting. I think here I'm still looking for the correct files.

= = = = = = = = = = = = =

I did get Amix working though. Although have failed there so far trying to copy additional files using all of the suggestions.

Quote:
Emulator: TAR-archive as a hardfile -method
You'll need some kind of *nix to create tar archives if you want to do basic transfer of files over to AMIX:

tar cvf transfer.tar transferdir
Then add this transfer.tar to WinUAE as a hardfile on SCSI ID 5 or 3 (any ID that's not in use), and boot AMIX. To extract the files (to the current directory) you can (g)tar from the device that the transfer.tar archive is attached to:

(g)tar xvf /dev/dsk/c5d0s0
(if it doesn't work on that device, try c5d0s1)

If you get read errors at the end of the package, try to force it to 512k blocksize: tar -b512 -c -v -f testpackage.tar sourcefolder
Here I stumbled into some error messages about permissions - after Googling seems it wanted the same user or user folder to be on Amix as was on the source Ubuntu where I created the tarfile. After creating a new user I get a different error message "problem reading group entry" "group not changed", a bus error, segmentation fault and core dump. I'll keep trying and query in the Amix group on here if needed.

It's a good job I can say this is "a learning experience"
Attached Thumbnails
Click image for larger version

Name:	linux-install.JPG
Views:	99
Size:	96.7 KB
ID:	77458  
Yagi Uda is offline  
Old 20 December 2022, 17:10   #4
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Yagi Uda View Post
- I've done all of this, here I've noted the modified 0x identifier addresses aren't saved in HDToolBox when returning to the dialog boxes for my partitions.
Try pressing Enter while still in the input gadget after entering your identifiers - HDToolBox is a bit buggy this way.


I installed Debian on my A4000 back in the 90's, and I remember one specific thing that wasn't obvious from the instructions, and that was that if you want to use the IDE interface, you had to add some nodes to /dev using the mknod command - the ready-made root filesystems only included nodes for the A3000 SCSI interface, IIRC.
I can't remember how I got the root filesystem placed on the partition in the first place, though..
hooverphonique is offline  
Old 20 December 2022, 18:21   #5
Yagi Uda
Registered User
 
Join Date: Dec 2022
Location: Birmingham
Posts: 4
Brilliant - thank-you. That worked. I should have thought of that. Onwards to the next step progressing the install.

Quote:
Originally Posted by hooverphonique View Post
Try pressing Enter while still in the input gadget after entering your identifiers - HDToolBox is a bit buggy this way.

Last edited by Yagi Uda; 20 December 2022 at 18:25. Reason: Got mixed up with my progress and error messages
Yagi Uda is offline  
Old 22 December 2022, 13:44   #6
vk3heg
Registered User
 
vk3heg's Avatar
 
Join Date: Oct 2008
Location: Australia
Age: 55
Posts: 223
Installing Debian on a real Amiga is a slow pain in the arse.... I have it install on my A3000 with a warpengine 68040@40mhz. 128Mb on the warp, 8mb ram. I'm using a buddha due to not having any scsi disks...

It took many attempts, due to the installer not finding things (Ie: It would find the HD, but not the network card. Or the other way around....)

Oh, btw: it's SLOW! 15 Minutes to boot to a login...

If you don't mind going down the emulation route then this will work.

https://wiki.debian.org/M68k/QemuSystemM68k

Just replace the cd iso with the current one, and the same with the kernel.

I use the emulated system to compile some programs and then transfer them to the real install..
vk3heg is offline  
Old 22 December 2022, 17:53   #7
Yagi Uda
Registered User
 
Join Date: Dec 2022
Location: Birmingham
Posts: 4
QEmu is a new one for me - I'd not spotted it whilst searching for m68k-linux and amiga linux. I'm away from my toys for a few days (visiting family for Christmas) but I'll give that a try as soon as I can. Sounds good to be able to try something there is confidence in it working - and then I'll continue tinkering with Debian. Many thanks!
Yagi Uda is offline  
Old 31 December 2022, 09:28   #8
vk3heg
Registered User
 
vk3heg's Avatar
 
Join Date: Oct 2008
Location: Australia
Age: 55
Posts: 223
Quote:
Originally Posted by Yagi Uda View Post
With little Fast RAM it complains and aborts. Adding max 8 MB Z2 Fast RAM and various amounts of Z3 Fast RAM up to 512 MB it progresses and says it is decompressing the kernel, but always stops with: Compressed image too large! Aborting. I think here I'm still looking for the correct files.

Amiboot has issues with compressed kernel's. You need to un-compress the kernel and it'll then load in fine.
vk3heg is offline  
Old 31 December 2022, 23:55   #9
vk3heg
Registered User
 
vk3heg's Avatar
 
Join Date: Oct 2008
Location: Australia
Age: 55
Posts: 223
For other's following:

This is the amiboot line on real hardware. I'm still using a 5.x
kernel/intrid though, the rest of the system is up to date. Later
kernel/intrid's crash on my Amiga 3000.


amiboot -k vmlinux-5.15.0-2-m68k -r initrd.img-5.15.0-2-m68k
root=/dev/sda2 fb=false

Btw: I've never been able to get M68K Linux installed via WinUAE or FS-UAE.
vk3heg is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best m68k disassembler dirkwhoffmann Coders. Asm / Hardware 11 06 September 2022 10:08
ASM-one 1.48 for m68k nihilazo request.Apps 5 17 August 2022 17:42
Linux Debian 10 m68k Fs-Uae frakswe support.FS-UAE 5 06 May 2021 20:19
M68K and libraries rcman Coders. Asm / Hardware 3 05 February 2020 21:03
Porting to Tiny Core Linux and Puppy Linux lorenzos support.FS-UAE 1 05 January 2013 16:13

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:03.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08896 seconds with 14 queries