Welcome, Guest. Please login or register.

Author Topic: How to Hijack the classic Amiga hardware?  (Read 5872 times)

Description:

0 Members and 4 Guests are viewing this topic.

Offline msh5150

  • Newbie
  • *
  • Join Date: Nov 2005
  • Posts: 10
    • Show all replies
Re: How to Hijack the classic Amiga hardware?
« on: November 09, 2005, 08:54:36 AM »
To get you started the following might be of interest:

movea.l 4.s,a6           ;Execbase
jsr     _LVOForbid(a6)   ;Disable multitasking

lea    $dff000,a5        ;Custom chip base
move.w #$7FFF,intena(a5) ;Disable interrupts
move.w #$7FFF,dmacon(a5) ;Disable DMA

..... You can now do what you like :)

If you are running on 68010+ your VBR will be 0 at this point.

This code can be on a bootblock. But of course if you disable everything then you'll need to make your own raw trackloader. (Isn't that hard).
 

Offline msh5150

  • Newbie
  • *
  • Join Date: Nov 2005
  • Posts: 10
    • Show all replies
Re: How to Hijack the classic Amiga hardware?
« Reply #1 on: November 09, 2005, 12:09:36 PM »
When in a bootblock I've never had my VBR be anything other than 0. But to cover all bases then use _LVOSupervisor() to do a VBR read.

Is a need to call Disable()?  I've killed interrupts in hardware with the intena write surely?

@xeron
Yes, he probably should  :-D  (Hi BTW - was there ever another Fast Intro Comp on #amigascne? Or a sequel to DotMatrix?  8-) )
 

Offline msh5150

  • Newbie
  • *
  • Join Date: Nov 2005
  • Posts: 10
    • Show all replies
Re: How to Hijack the classic Amiga hardware?
« Reply #2 on: November 09, 2005, 03:23:39 PM »
"But that will leave me in user mode won't it? Is code in the bootblock of a floppy started in system or user mode? Is there a guide on the format of the bootblock somewhere?"

Yes it will. If you want to be in supervisor mode use the exec call _LVOSupervisor() and then take over the machine after that.

The bootblock is 1K long.  The first 4 bytes are 'DOS' and then a number. Usually 0, but can be others. You can also use the word 'BOOT' for the first 4 bytes (I think).

The next 4 bytes are the checksum. Amiga won't boot your code unless this is correct.

The next 4 bytes are a block pointer to the root block (this can be ignored as you are making your own system and don't need to adhere to AmigaOS specs).

You can find more info about it here:
http://amiga.emugaming.com/adfaq.html

IMHO you might be best off doing some 'oldskool' hardware bashing code first to learn about the hardware (like trackloaders or copper/blitter effects).  Then try to build on this experience later. I'm sure most people reading this topic will have gained thier experience that way.
 

Offline msh5150

  • Newbie
  • *
  • Join Date: Nov 2005
  • Posts: 10
    • Show all replies
Re: How to Hijack the classic Amiga hardware?
« Reply #3 on: November 09, 2005, 04:33:11 PM »
Get yourself the 3rd revision of the Hardware Reference Manual - that should help a lot! I still use mine quite a bit  :-D

Also this might be of interest on some other bits:
http://www.mways.co.uk/amiga/howtocode/

This should point you in the right direction  :-)

The first things I ever coded on the Amiga was some copper bar type stuff - this will teach you how to work with setting up the display.