Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM 2nd processor: regression introduced #140

Open
egrath opened this issue Aug 15, 2024 · 6 comments
Open

ARM 2nd processor: regression introduced #140

egrath opened this issue Aug 15, 2024 · 6 comments

Comments

@egrath
Copy link

egrath commented Aug 15, 2024

Hi,

i'm running the Acorn C 2.01 on the ARM 2nd processor and there was a regression introduced some time ago. With version 4.19 of BeebEm, the compiler/linker no longer works (linker hangs).

Running the same on 4.03 works as expected.

How to reproduce:

*MOUNT 1
*LIB :1.$.LIBRARY
*DIR :1.$.ARM.BENCH
*cc -super -o hellow hellow

On 4.03 this produces a binary executable "hellow" after about 5 seconds. On 4.19 this hangs indefinetely.

@egrath
Copy link
Author

egrath commented Aug 15, 2024

Could narrow it down a little bit. The regression must have been introduced between 4.17 and 4.18 (4.17 working, 4.18 no longer).

Sidenote: The produced binaries ("Hello World", created with Acorn C 2.01A on 4.17) work on 4.19.

chrisn added a commit that referenced this issue Aug 15, 2024
@chrisn
Copy link
Collaborator

chrisn commented Aug 15, 2024

Thanks, and sorry for the regression. I think there are two problems. There was a bug introduced in the ARM emulation, which I've fixed. But now it reports:

Norcroft ARM C (with debugger support) 2.01A Jul 14 1988
link: (Fatal) external symbol table in '$.arm.clib.o.ansilib' is out of date
Finished after 0.81 sec.

This is related to a more recent change to the RTC emulation, which needs a bit more investigation. See #111.

@chrisn
Copy link
Collaborator

chrisn commented Aug 16, 2024

I'm not familiar with the Acorn C compiler tools, do you know if there's a way to find out what date the linker is seeing in ansilib? Or do you have the original installation disks, so I could create a new scsi disk image?

@egrath
Copy link
Author

egrath commented Aug 16, 2024

No, not really familiar with Acorn C 2, but I have the original installation disk, it's attached to this post. Please note that in order to run the binaries from there, you need to adjust the load and execute address to 0x8000 for CC, FPE and LINK as they are primarily meant to run under early versions of Arthur for the Archimedes instead of the Brazil supervisor the ARM evaluation board uses.

ansicr2.zip

@chrisn
Copy link
Collaborator

chrisn commented Aug 16, 2024

Thanks. I get the same error after copying over ansilib from that disk. I've done a bit more experimentation, and it looks like the error occurs if the clock is set earlier than a timestamp in ansilib file.

The error goes away if I hard-code BeebEm to return 90 for the year as presumably the timestamp in ansilib is 1980-something. The RTC only allows 2-digit years, and the modulo-100 change we made in #111 means that the ansilib file looks newer than the current time.

So one solution could be to add more options to let the user control the date from the RTC, e.g., to return a fixed year that's user controlled.

Another option could be to patch the ansilib file so the date is 00, but I'm not sure exactly where the timestamp lives.

@chrisn
Copy link
Collaborator

chrisn commented Aug 20, 2024

BeebEm uses David Sharp's Tarmac emulator, which emulates some instructions that wouldn't have been present on the ARM evaluation system: MUL and SWP. So I'm not sure we'd expect the compiler to run. Strictly, it seems like we should fix those instructions to emulate ARM1 behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants