Recent

Author Topic: [SOLVED] Files on the Amiga  (Read 5289 times)

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Files on the Amiga
« Reply #15 on: February 23, 2023, 06:15:16 am »
All this makes me want to buy the kickstart ROM images and get an emulator.

You could also use AROS which provides the same API ;)
What a pity that FPC RTL and accompanied (3th party) units do their best to hide all that fancy API stuff :D


@Bogen85:
Amiga is a fun platform to tinker with. Nice API as well (albeit perhaps a bit outdated).

PascalDragon has a point though. AROS can be run hosted so that provides a bit more convenience wrt testing (AROS is (at least should be) API compatible with classic AmigaOS except for some newer additional features).

chobani

  • New Member
  • *
  • Posts: 24
Re: Files on the Amiga
« Reply #16 on: February 23, 2023, 03:40:50 pm »
My experience with cross compilers is exhausting. I always miss something, or have something wrong. Last time I found it was easier just to run VM's and compile directly on the source, but I went from C64->PC. I have no knowledge of Amiga which is why I used his VM. That did work fine, except the file issue I am experiencing.

I was able to get an emulator working yesterday, but could just not get fpc to compile from command line. I feel like I almost go there, but when I execute FPC <sourcefile> it seems to do nothing. I think I'll go back to that link you sent with his step by step because with your help, it appears I only need to get FPC updated with the cross compiler (and I might be able to actually test now that I have the emulator going so that will help). The VM ALB42 made runs really slow on my machine for some reason so everything I do takes a while, I tried adjusting it...anyway as you can see I have a lot of lines in the water and everything seems to be a pain with my limited skills in various areas (which, I guess you would expect trying to compile to an old machine you never worked with like this, it's advanced wizardry to me that FPC was even able to make this possible).

I think my next step is trying to get Lazarus/FPC cross compiler working on my own Linux install I have set up going over his instructions you linked. That would probably be the nicest environment for me if I can get there. Thank you very much for the guidance! I'll update wherever I end up here.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Files on the Amiga
« Reply #17 on: February 24, 2023, 05:32:48 pm »
All this makes me want to buy the kickstart ROM images and get an emulator.

You could also use AROS which provides the same API ;)
What a pity that FPC RTL and accompanied (3th party) units do their best to hide all that fancy API stuff :D

No one stops you from accessing the API directly. The units are all there after all.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Files on the Amiga
« Reply #18 on: February 24, 2023, 05:51:25 pm »
All this makes me want to buy the kickstart ROM images and get an emulator.

You could also use AROS which provides the same API ;)
What a pity that FPC RTL and accompanied (3th party) units do their best to hide all that fancy API stuff :D

No one stops you from accessing the API directly. The units are all there after all.
Ofc. I think I should have used a winking smiley instead. Sorry for that.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: Files on the Amiga
« Reply #19 on: February 24, 2023, 05:53:42 pm »
@chobani:
I noticed an issue with the latest vasm/vlink and compiling the Free Pascal 3.2.2 source-tree. I'll have to investigate further f.i. to determine which exact version(s) will still work.

edit: If you want to use vasm/vlink as alternative for the gnu binutils then you can use the latest vlink (as per instructions) but you would have to fall back to an older version of vasm. vasm 1.8l seems to work as intended, here is the link. The latest version of vasm (1.9a) emits errors and eventually fails.

More investigation is required to determine what is causing this (and when the erroneous behaviour was introduced)  but the above described workaround seems to work for now.
« Last Edit: February 24, 2023, 07:36:06 pm by TRon »

chobani

  • New Member
  • *
  • Posts: 24
Re: [SOLVED] Files on the Amiga
« Reply #20 on: February 24, 2023, 09:13:22 pm »
Quote
I noticed an issue with the latest vasm/vlink and compiling the Free Pascal 3.2.2 source-tree. I'll have to investigate further f.i. to determine which exact version(s) will still work.

I was able to read and write files in the same directory with code as posted. Here's is a breakdown of everything I tried and where I failed/succeeded.

Emulator - I went back to this because I realized I was running and older version of the OS and it clearly stated I needed a newer version to run it. So I updated the OS and walla FPC was working! Well sort of, I could not get the install file to work at all. It shows up properly in the Amiga explorer, but double clicking or running from command line did not work. If I went into the FPC compiler folder I could now get FPC to execute, but I could never get it to see even the  primary units to compile hello world. That's where I stayed with that.

Cross Compiler - I followed the steps outlined by ALB42, but I kept failing on the last step. I'm not sure what in the previous steps was causing the issue. I can see from youtube others have gotten this working so I don't want to waste anyone's time with something I'm just not getting right. VASM/VLINK seemed to set up fine and I was failing on the Free Pascal compile so maybe that's what you are seeing too.

Docker - So I relegated myself to the ALB42's Docker. The docker has it's own issues of pain points, but it's very nice having a whole set up to VLC into and just compile the code to the Amiga 68k target and have it work. Now that I actually had an Amiga Emulator up, I copied over the binary and everything seems to work! So at very least I can report that the issue with file writing and reading to the current directory was addressed at some point between 3.0.0 and now.

I'll continue checking here though and can test anything you need might need me to. It would still be much nicer to have the cross compiler up instead of using the Docker, but at least I have a pathway. Would not have got there without you and I very very much appreciate it! I'm sure the Amiga hobbyists do too!

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: [SOLVED] Files on the Amiga
« Reply #21 on: February 24, 2023, 09:33:59 pm »
I am a bit busy atm so will try to reply more thorough later but I can at least let you know that the issue you have with using the installer icon is because when you do a fresh installation of the Amiga Workbench that there is no installer tool installed. You can find one on aminet.net (which exact version I have to verify so will get back to you on that later).

The installer script makes all the necessary arrangement to let FPC work correctly on your Amiga system (though you could setup it manually as well but that requires a bit more knowledge on how to configure FPC properly).

chobani

  • New Member
  • *
  • Posts: 24
Re: [SOLVED] Files on the Amiga
« Reply #22 on: February 24, 2023, 10:43:54 pm »
Quote
The installer script makes all the necessary arrangement to let FPC work correctly on your Amiga system (though you could setup it manually as well but that requires a bit more knowledge on how to configure FPC properly).

Ah! I don't expect anyone to show me how to use an Amiga since I only just started a few days ago, but I'm not sure how long it would have been until I got to there! haha, so once again thank you very much.

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: [SOLVED] Files on the Amiga
« Reply #23 on: February 25, 2023, 01:21:40 am »
Ah! I don't expect anyone to show me how to use an Amiga since I only just started a few days ago, but I'm not sure how long it would have been until I got to there! haha, so once again thank you very much.
:)

It was not my intention to explain everything or write a guide, as it will last me a lifetime. There are so many little hidden gems in the OS and peculiarities wrt inner workings that I do not even known them all by heart.

But this one is an important step to get you started. Most people would have given up already by now (deemed too complicated).

The installer is actually present on one of the original Workbench disks so you could copy over that one but since you are spending time already you could just as well install an updated version from aminet.

You can use the Installer v43.3 dev. package from aminet.net (some browsers have issues downloading from a non secure site, just make an exception for this file or aminet as a whole) and copy out the installer executable and installer.info file (if you like to read you can also copy the installer.guide and installer.guide.info files)

Copy these files to your Amiga System drawer (thus drivename:System)

If you have a project icon (such as an installer script icon) then you can leftpress the icon to activate it, then press the right mouse button (keep it pressed) move your mouse to the workbench menu at the top of your screen and select the display icon information from the menu (release the pressed right mouse button) in order to see what kind of tool is associated with the project (an installer script would display installer as the tool, sometime it includes a drawer as well).

If you got that setup correctly then you should be able to double-click the Free Pascal install icon from ALB42's archive as it should now invoke the installer tool automatically. Depending on your answers the installer tool will ask different kind of questions (there is a readme in the Free Pascal package from ALB42 that explains a few of those options/answers)

BTW: if you wish to make your life a bit easier wrt using your Amiga setup then make sure to checkout (also on aminet) kingcon (shell replacements that offers scroll-bars, scroll back buffer, command history etc) and directory opus 4.x (/the/ file manager for Amiga) also known under its pet name DOpus. The 4.x version is the old-fashioned dual pane filemanager while the 5.x version is an attempt at mimicking windows explorer style file management (which makes more sense to install it as Workbench replacement and is why I personally prefer to use 4.x).
« Last Edit: February 25, 2023, 01:41:13 am by TRon »

TRon

  • Hero Member
  • *****
  • Posts: 2435
Re: [SOLVED] Files on the Amiga
« Reply #24 on: February 25, 2023, 02:19:54 am »
As promised, a more elaborated reply.

Emulator -
- snip -
Well sort of, I could not get the install file to work at all.
- snip -
As discussed in the other posts.

When FPC is not setup correctly it will spit out junk, e.g. garbage in garbage out  :)

Quote
Cross Compiler - I followed the steps outlined by ALB42, but I kept failing on the last step. I'm not sure what in the previous steps was causing the issue. I can see from youtube others have gotten this working so I don't want to waste anyone's time with something I'm just not getting right. VASM/VLINK seemed to set up fine and I was failing on the Free Pascal compile so maybe that's what you are seeing too.
It is not every day that I update the binutils and/or verify my setup scripts. Questions like yours is always motivation to check them out and verify if they still work.

That is when I noticed that I ran into errors myself as well. So thank you for having put my attention to that.

Thus, it seems not your wrong doing.

Quote
Docker - So I relegated myself to the ALB42's Docker. The docker has it's own issues of pain points, but it's very nice having a whole set up to VLC into and just compile the code to the Amiga 68k target and have it work.
Thank you for letting know that the docker worked for you.

Quote
Now that I actually had an Amiga Emulator up, I copied over the binary and everything seems to work! So at very least I can report that the issue with file writing and reading to the current directory was addressed at some point between 3.0.0 and now.
There have been a lot of changes/improvements over the years (3.0.0 was released in 2015 !).

I can't remember if reading/writing files was stil one of the issues but back then we were constantly working with Free Pascal from trunk as errors got fixed/reported when they were encountered.

Quote
I'll continue checking here though and can test anything you need might need me to. It would still be much nicer to have the cross compiler up instead of using the Docker, but at least I have a pathway. Would not have got there without you and I very very much appreciate it! I'm sure the Amiga hobbyists do too!
If it would help you (and others out) out then I am more than happy to put up a complete list of instructions that you could follow step by step starting from scratch.

In fact I was already starting to make preparations to do that because as said I do not check my scripts every day and for sure do not update my (working) installation that often (usually I only need to update my scripts when a new version of Free Pascal is released).

In the process of doing so I seem to have ran into the same issue that you seem to have so I need a little more time to verify everything and make sure all is working as intended. Thus, in case interested just let me know and I'll post as soon as is possible.

fwiw: writing that something does not work is not very helpful without being able to see the actual errors so  in case you run into issue then please post some output from the compiler and/or build process. That is the most quickest way to be able to try and replicate the issue and to come up with a solution. In a similar fashion details of the host you use as well as your the input you used to generate the error are important as well. There are so many different setups and so few crystal balls left in the world  ;)

 

TinyPortal © 2005-2018