Recent

Author Topic: AmigaOS can't run program on 1200?  (Read 607 times)

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
AmigaOS can't run program on 1200?
« on: April 21, 2026, 11:30:22 am »
I'm working on an application for Amiga m68k and using a very boosted A4000 profile in AmiBerry.

I'm using FPC 3.2.2 and Lazarus 4.4 on Debian, installed using FPCUpDeluxe with cross compiler for AmigaOS m68k. Also using FPC 3.2.2 with fpIDE version 1.0.12 on an emulated A4000.

Everything's working great.

I switch to a stock A1200 and... nothing.

So I installed the AmigaOS native version, cli-style IDE running ON the emulated A4000, compile the simplest helloworld program with just writeln('hi'); and it works fine on the A4000.

I managed to get the program to run by adding fastram.

How do I not require fastram?

At its simplest I'm making a helloworld app with just writeln(); ..?

The 1200 profile is using the Amiga Forever amiga-os-310-a1200.rom file

Running on terminal it looks like the program exits immediately with no output and no errors. (See screenshot)

Not sure what to check or try next.
« Last Edit: April 22, 2026, 05:56:12 pm by Trenatos »

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
Re: AmigaOS can't run program on 1200?
« Reply #1 on: April 22, 2026, 05:58:10 pm »
Sorted it by changing the Amiga RTL system.pp line 267

Switching from MEMF_FAST to MEMF_ANY and rebuilding the RTL.

Old
Code: Pascal  [Select][+][-]
  1. ASYS_heapPool:=CreatePool(MEMF_FAST,growheapsize2,growheapsize1);

New
Code: Pascal  [Select][+][-]
  1. ASYS_heapPool:=CreatePool(MEMF_ANY,growheapsize2,growheapsize1);

Thausand

  • Hero Member
  • *****
  • Posts: 526
Re: AmigaOS can't run program on 1200?
« Reply #2 on: April 22, 2026, 06:48:02 pm »
Is thank you Trenatos for find.

This is fix for main many year ago (https://gitlab.com/freepascal.org/fpc/source/-/commit/53a67b34b53bec3ca526da2ddd70c69488d69556 ) . I not have see is make repair for fixes 3.2.3.
A docile goblin always follow HERMES.md

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
Re: AmigaOS can't run program on 1200?
« Reply #3 on: April 22, 2026, 11:04:54 pm »
I set up the cross compiler using FPCUpDeluxe, it seems he's not bundling the latest version.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12836
  • FPC developer.
Re: AmigaOS can't run program on 1200?
« Reply #4 on: April 23, 2026, 11:29:02 am »
Since Karoly is awol, I think it would be easiest to discuss what needs merging with Markus, after Karoly he probably has the most knowledge about Amiga.

Then have him post a list (in order if possible) on https://gitlab.com/freepascal.org/fpc/source/-/work_items/41735

Thausand

  • Hero Member
  • *****
  • Posts: 526
Re: AmigaOS can't run program on 1200?
« Reply #5 on: April 23, 2026, 04:57:43 pm »
Since Karoly is awol, I think it would be easiest to discuss what needs merging with Markus, after Karoly he probably has the most knowledge about Amiga.
That funny  :)

I just have read action Charlie and have work for other project (no FPC) hour ago. I not have see ALB for long time. Is no problem, people have life and busy.

@Trenatos:
I not know if fpcup is have support for cross compile Amiga. I never have try.

There is write instruction on how make cross compiler self at ALB Amiga free pascal wiki https://fpcamigawiki.alb42.de/index.php?title=Main_Page) and free pascal wiki (https://wiki.freepascal.org/Amiga#Building).

You have want help for make main compiler (3.3.1) self ? I can make help for instruction but have need little time and learn how is instruction work exact.
A docile goblin always follow HERMES.md

HenrikErlandsson

  • New Member
  • *
  • Posts: 36
  • ^ Happy coder :)
    • Coppershade
Re: AmigaOS can't run program on 1200?
« Reply #6 on: May 01, 2026, 04:33:07 pm »
TL;DR: If you want memory, use MEMF_ANY. Since OS1.3, don't use the MEMF_FAST flag anywhere in application code targeting 68k+OCS/ECS/AGA Amigas!

I have Amiga knowledge. Below, "Amiga" means the original 68k architecture with AmigaOS up to 3.x (this does not use MMU features). For other Amigas, this might not apply (but it could apply for them too.)

- Amigas *can* have up to 2 types of memory, Chip RAM and Fast RAM*
- All Amigas have Chip RAM, but it could all have been allocated, while there is Fast RAM available.
- Not all Amigas have or can add Fast RAM (easily). All Fast RAM could have been allocated, while there is still Chip RAM available.
- Chip RAM needs only be specified for structures and buffers directly used by hardware DMA**
- Fast RAM does not need to be specified. The OS automatically gives Fast RAM first, if type MEMF_ANY (=0) is specified. There are no structures that must lie in Fast RAM. AmigaOS will prioritize Fast before Chip automatically, so if Fast RAM is what you want, specify MEMF_ANY.

Therefore, all (ALL) allocations of memory should use type MEMF_ANY, unless you specifically need Chip RAM for reserving a buffer for use with hardware DMA (e.g. loading or holding a sound, sprite, copper list, or raw image).

If there are many MEMF_FAST occurrences, this could stop FPC programs from running at some random-seeming run-time point and it could be difficult to find. ("I have 'memory', why?")

A search/replace from MEMF_FAST to MEMF_ANY would make the codebase more correct than wrong, and more correct than now (if there are more references, that is). You might also look for the remaining types, because usually only MEMF_ANY and MEMF_CHIP is used for virtually all software.

* The A1000 has "WOM", but this is written before the OS boots. The CD32 has NVRAM, used at low level to save game data as on other consoles.
** "Hardware" meaning the motherboard (chipset). I obviously don't know all expansion cards, but some early SCSI controllers requires Chip RAM buffers for their DMA controller. The driver takes care of copying to the actual loading destination in ANY ram.
« Last Edit: May 02, 2026, 01:45:15 pm by HenrikErlandsson »
6502 / Z80 / Amiga / ARM assembler, Pascal, Delphi, Lingo, Obj-C, Lua, FPC, C# + web front-/backend.

 

TinyPortal © 2005-2018