view bootman/bootman.a @ 2728:09c66281e12a lwtools-port

Fixes
author Boisy Pitre <boisy.pitre@nuance.com>
date Wed, 01 Aug 2012 19:18:46 -0500
parents 9b435e747ff2
children
line wrap: on
line source

         NAM    bootman
         TTL    Boot Manager

BOOTTRACK equ   0


         PSECT  bootman,$11,$80,0,0,entry

         VSECT
         ENDSECT

TOP      EQU   $FE00

* The entry point of the boot manager
* Entry: stack is set up, U points to static storage
         csect
sectptr  rmb    2
         endsect

entry    lbsr   mach_init   initialize the machine we're running on
         leas   entry,pcr   set up stack
         leau   entry-256,pcr set up static storage
         leax   entry-512,pcr set up sector buffer pointer
         stx    sectptr,u
         leax   welcome,pcr
         bsr    writestr

* start booter calling
bootup
         leax   cfg_boot,pcr
         ldy    ,x             get address of booter
         beq    bootup         if 0, try again

* call booter's get info entry
         leax   attempt,pcr
         bsr    writestr
         jsr    12,y
         bsr    writestr
         leax   crlf,pcr
         bsr    writestr

loop     bra    loop


attempt  fcc     "Attempting to boot from "
         fcb     0
welcome  fcc     "NitrOS-9 Boot Manager"
crlf     fcb     13,10
         fcb     0

* Helpful routines

* writestr - write string to output handler
* Entry:
*   X = address of string (nul terminated)
* Preserves:
*   Y
writestr:
         pshs    y
         leay    llio,pcr
writeloop
         lda     ,x+
         beq     writedone
         jsr     3,y
         bra     writeloop
writedone
         puls    y,pc
         
         endsect