English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 27 June 2010, 15:36   #1
vriviere
 
Posts: n/a
Exception 0

Hello.

First, I'm new to UAE and Amiga programming, I may have missed something.

I'm hacking an alternate Kickstart ROM for WinUAE. It works fine in any case until I enable the VBL.
If I select a 68020 emulation, everything works as expected.
If I select a 68000 emulation, instead of jumping to the exception vector 27 as expected, it jumps to the exception vector 0.
As far as I know, this should never happen on 680x0, in any case.
So I think there is a bug in WinUAE 68000 emulation.
It fails with both WinUAE 2.1.0 and the latest 2.2.0 beta 12.

My program is very simple, here is the main code:
Code:
        move.l  #redbg,0x00             // Exception vector 0 (???)
        move.l  #greenbg,0x6c           // Exception vector 27 (IRQ level 3)
 
        move.w  #0xc020,0xdff09a        // INTENA Enable VBL
        move.w  #0x2200,sr              // Allow Level 3 interrupts
 
        move.w  #0x000f,0xdff180        // Background color = blue
 
halt:   bra.s   halt
 
greenbg:
        move.w  #0x00f0,0xdff180        // Background color = green
        rte
 
redbg:
        move.w  #0x0f00,0xdff180        // Background color = red
        rte
Basically, I setup the VBL then I put a blue backround (which should never be seen).
On the VBL handler I set the background to green.
On the handler of the bogus exception 0 I set the background to red.
I have not acknowledged the interrupts but I don't think it is important for this test.

When running this ROM:
- on 68020 the background is green as expected
- on 68000 the background is red
Furthermore, if I press Shift+F12 to enter the debugger, then 'z', 'Enter', I get continuous messages about "Exception 0".

Please tell me if this is a bug or if I'm missing something.
You can find the full program and a prebuilt ROM as attachment.
Attached Files
File Type: zip mykick.zip (1.0 KB, 108 views)
 
Old 27 June 2010, 15:49   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,250
It is not a bug, 68000 fetches interrupt vector numbers from end of address space (this is documented in 68000 manual). Make sure strange 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F are at the end of ROM image.

(This was not emulated in older versions)
Toni Wilen is offline  
Old 27 June 2010, 18:24   #3
vriviere
 
Posts: n/a
Many thanks for your quick answer.
I have found your bytes at the end of the standard Kickstart ROM, which maps to address 0xFFFFF0.
I have put them at the end of my experimental ROM, and now it works as expected on 68000

Nevertheless, I can't find any reference to this unusual feature in any 68000 documentation, including the official one:
http://cache.freescale.com/files/32b.../MC68000UM.pdf
However, it is stated that the external hardware can request an interrupt either :
- in auto-vector mode: the CPU uses the standard vector number associated to the interrupt level
- in user-vector mode: the external hardware specifies an explicit vector number

Maybe the Amiga hardware always use user-vector interrupts ?
In that case, that additional table to be put at the end of the addressing space would not be used directly by the 68000, but instead used by the hardware generating the interrupts. That would make sense.
 
Old 27 June 2010, 18:38   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,250
Pages 5-9 and 5-10.

Quote:
The interrupt acknowledge cycle places the level of the interrupt being acknowledged on address bits A3–A1 and drives all other address lines high. The interrupt acknowledge cycle reads a vector number when the interrupting device places a vector number on the data bus and asserts DTACK to acknowledge the cycle.
"interrupting device" = rom in a 68000 based Amiga. CPU thinks it is reading interrupt vector number from interrupt controller but actually CPU accesses plain ROM.. (address 0xfffffffx where x = (interrupt level * 2) OR 1)
Toni Wilen is offline  
Old 28 June 2010, 00:03   #5
vriviere
 
Posts: n/a
Thanks, everything is clear now.

Just a final remark: Since this "interrupt vector fetch" feature is provided by the interrupt device (= the ROM), it should be associated to the chipset or some other hardware, but not the CPU.
So if I use A500 settings in UAE and I switch to a 68020 CPU, to be 100% logicial the "interrupt vector fetch" feature should remain enabled, isn't it ?
 
Old 29 June 2010, 18:45   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,250
Quote:
Originally Posted by vriviere View Post
Thanks, everything is clear now.

Just a final remark: Since this "interrupt vector fetch" feature is provided by the interrupt device (= the ROM), it should be associated to the chipset or some other hardware, but not the CPU.
So if I use A500 settings in UAE and I switch to a 68020 CPU, to be 100% logicial the "interrupt vector fetch" feature should remain enabled, isn't it ?
It is CPU doing the fetch as documented in pages 5-9 and 5-10 (cheap design, chipset does not need any extra support hardware..). No idea about other CPUs but AFAIK it does not happen in 68020+.

I have not done any 68020+/AGA logic analyzer tests, only A500 which clearly shows ROM enable line going active during interrupt initialization.
Toni Wilen is offline  
Old 30 June 2010, 13:55   #7
Retro1234
Boo

Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 4,366
Intresting projects on your homepage vriviere whats this hacked kickstart?
Retro1234 is offline  
Old 30 June 2010, 14:32   #8
vriviere
 
Posts: n/a
Since your question is out of topic here, I only make a short answer.

As a proof of concept, I have ported EmuTOS to Amiga, in the form of an alternative ROM. EmuTOS is a Free clone of the original Atari ST operating system. Currently, it works very well on Amiga, including 640x400 monochrome display, keyboard, mouse and IDE as mass storage. It is able to run clean Atari ST software when they don't access the hardware directly.

I knew almost nothing about Amiga 10 days ago, but the Amiga hardware is very nice and well documented, and UAE very accurate, so I got the first results very quickly.
 
Old 30 June 2010, 15:21   #9
Retro1234
Boo

Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 4,366
Quote:
Originally Posted by vriviere View Post
Since your question is out of topic here, I only make a short answer.

As a proof of concept, I have ported EmuTOS to Amiga, in the form of an alternative ROM. EmuTOS is a Free clone of the original Atari ST operating system. Currently, it works very well on Amiga, including 640x400 monochrome display, keyboard, mouse and IDE as mass storage. It is able to run clean Atari ST software when they don't access the hardware directly.

I knew almost nothing about Amiga 10 days ago, but the Amiga hardware is very nice and well documented, and UAE very accurate, so I got the first results very quickly.
Sorry for going off-topic and thankyou for your reply, that sounds very intresting and look forward to seeing this in action
Retro1234 is offline  
Old 25 June 2012, 15:36   #10
BlankVector
Registered User
 
Join Date: Jun 2012
Location: France
Posts: 175
I finally made EmuTOS for Amiga available to the public.
Thanks again for your support.

PS: My former vriviere account has been deleted
BlankVector 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
"Exception "Line 1111 Emulator" ($2c) Error at $1004" when exiting game demolition support.WinUAE 15 30 November 2012 17:43
** CHK Exception ** CmdrVimes Coders. General 2 17 September 2010 17:14
WHDLoad - Exception "Privilege Violation" Error ricky500 project.WHDLoad 12 13 November 2008 23:45
Exception "Privilege Violation" on MadTV andy_blah project.WHDLoad 2 29 August 2008 18:50
Nightbreed Interactive Movie - "Line 1111 Emulator" exception MethodGit project.WHDLoad 5 18 April 2007 16:27

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 03:45.


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