Re: [hatari-devel] SCU/VME register access?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi Christian,

(Replying to list as I think this is of generic interest.)

On 14.6.2024 9.12, Christian Zietz wrote:
While I've noted this in the m68k-linux.txt, in 2019, for linux v5.0,
when it's started with Hatari LILO:
-----------------------------------------------------------------
- Linux barfs at ST-RAM memory range given after TT-RAM.  However,
    if kernel is loaded to TT-RAM and ST-RAM range is given before
    TT-RAM range, kernel crashes.  Based on mails from 2013, this
    seems to be a known Linux/Atari issue

    Workaround: Hatari lilo.c gives ST-RAM before TT-RAM in bootinfo
------------------------------------------------------------------

As far as I can see, the kernel is linked to a fixed address of 0x1000:
https://github.com/torvalds/linux/blob/master/arch/m68k/kernel/vmlinux-std.lds
and does not contain relocation information. Hence, one would have to
build a special kernel to be able to run it from TT-RAM (e.g., 0x1001000).

At least v6.9 kernel boot seem to work fine when started by bootstrap
program, if I drop the "-s" option from "bootargs", and define only 4MB
ST-RAM in Hatari.

Depends on the definition of "fine", I guess. :-) Since it hangs without
any console output whatsoever, I can't say whether it crashed due to the
VBL interrupt issue or due to lack of RAM on the TT.

A test with Falcon *emulation* (where the kernel does not hang due to
VBL) shows that this kernel clearly is unhappy with only 4 MiB ST-RAM.

Boots fine for me, both in Falcon and TT [1] emulation:
$ hatari --natfeats on --machine tt --dsp off --fpu 68882 --mmu on -s 4 --data-cache off --ttram 64 --addr24 off --vme off --ide-master bb-rootfs.img ./bootstra.tos

With following "bootargs" file content (with kernel named as "vmlinux"):
----------------------------
-d -k vmlinux root=/dev/sda ro debug=nfcon video=atafb:sthigh console=tty init=/init
----------------------------

[1] when VME regs are disabled with "--vme off", like above.

Screenshot attached (of Falcon boot as it has nicer colors).


> See screenshot.

Looks like what I got when "bootargs" still told kernel to be loaded to (4MB of) ST-RAM (with "-s" option)?


Hence, I'm afraid without a smaller kernel further testing on my TT
makes no sense. But after my email from yesterday I'm fairly confident
that these kernels are simply broken because of the VBL IRQ.

Btw. that's not the only problem.

Hatari emulation has also some issues with MMU + data-cache emulation, which according to Toni, do not happen under WinUAE for m68k-linux on Amiga.

User-space programs crash when data-cache emulation is enabled (e.g. init, which causes kernel panic).

It would be nice to verify that it really does not happen on real HW, either with Falcon, or after Nicolas fixes SCU emulation, on TT. That will require use of a root file system though, so it's something that could be done after other Linux kernel boot issues (which are easier to debug) have been fixed.


	- Eero

Attachment: 4mb-boot.png
Description: PNG image



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/