English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 03 March 2011, 20:04   #1
h0ffman
Registered User
 
Join Date: Aug 2008
Location: Salisbury
Posts: 744
Boot block examples?

Was wondering if anyone had any boot block example code? I think the steps i need to do are...

1. Allocate memory
2. Use TrackDisk.Device to load a section off the disk into the allocated memory
3. Kill system
4. Jmp into the data loaded off the disk.

Any pointers would be ACE

Cheers in advance..

Edit - Also, with killing the system, as I'm going to be taking over all of the 1 meg chip ram on an a600 I figured will have to set the stack pointer somewhere else, or will it be at the top of the ram already?
h0ffman is offline  
Old 03 March 2011, 20:12   #2
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
http://eab.abime.net/showthread.php?t=28001

Further down in that thread
BippyM is offline  
Old 03 March 2011, 20:45   #3
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by h0ffman View Post
Was wondering if anyone had any boot block example code? I think the steps i need to do are...
Here is a small example straight from my Super Cars crack. I guess you're mostly interested in how to load via trackdisk so there is no memory allocation etc. here.

Code:
BOOT    dc.l    "DOS"<<8
    dc.l    0
    dc.l    "STR!"

    pea    $60000
    move.l    (a7),a2
    lea    .BOOT(pc),a0
    move.w    #1024/4-1,d7
.copy    move.l    (a0)+,(a2)+
    dbf    d7,.copy
    rts

.BOOT
; disable instruction cache
    cmp.w    #36,$14(a6)
    bcs.b    .nocache
    moveq    #0,d0
    moveq    #1<<0,d1
    move.l    a1,a5
    jsr    -648(a6)    
    move.l    a5,a1
.nocache

    pea    $30000
    move.l    (a7)+,$28(a1)
    move.l    #1636*512,$2c(a1)
    move.l    #74*512,$24(a1)
    jsr    -456(a6)
    movem.l    d0-a6,-(a7)
    jsr    $30000
    movem.l    (a7)+,d0-a6
Quote:
Originally Posted by h0ffman View Post
1. Allocate memory
2. Use TrackDisk.Device to load a section off the disk into the allocated memory
3. Kill system
4. Jmp into the data loaded off the disk.

Any pointers would be ACE
That's completely correct.

Quote:
Originally Posted by h0ffman View Post
Also, with killing the system, as I'm going to be taking over all of the 1 meg chip ram on an a600 I figured will have to set the stack pointer somewhere else, or will it be at the top of the ram already?
Since you have complete control over the system you should set the stackpointer yourself to a safe location (preferably either very low or very high in mem).

Last edited by StingRay; 03 March 2011 at 21:01. Reason: postion of the [/code] tag fixed
StingRay is offline  
Old 04 March 2011, 16:44   #4
h0ffman
Registered User
 
Join Date: Aug 2008
Location: Salisbury
Posts: 744
Wicked.. got the boot block working. The music disk engine wasn't working to start with, until I remembered it has all the OS saving calls it does before starting up. They aint gonna work if you destory memory are they!!
h0ffman 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
Why can't I open the Topaz-font in a boot block? Leffmann Coders. General 13 19 May 2010 21:52
Amiga - DOS versions - give me some examples laffer Retrogaming General Discussion 77 18 January 2008 17:09
AGA programming with C examples/tutorials? Calgor Coders. General 13 04 April 2007 18:53
Plasma examples anyone? jobro Coders. General 5 27 November 2005 17:25
Block It! sw2001 request.Old Rare Games 4 17 November 2004 21:11

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:16.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09077 seconds with 13 queries