home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / datafile / _btriscbsd / booter / s / _main < prev    next >
Encoding:
Text File  |  1994-09-20  |  4.5 KB  |  168 lines

  1. ; $NetBSD$
  2.  
  3. ;
  4. ; Copyright (c) 1994 Mark Brinicombe.
  5. ; Copyright (c) 1994 Brini.
  6. ; All rights reserved.
  7. ;
  8. ; This code is derived from software written for Brini by Mark Brinicombe
  9. ;
  10. ; Redistribution and use in source and binary forms, with or without
  11. ; modification, are permitted provided that the following conditions
  12. ; are met:
  13. ; 1. Redistributions of source code must retain the above copyright
  14. ;    notice, this list of conditions and the following disclaimer.
  15. ; 2. Redistributions in binary form must reproduce the above copyright
  16. ;    notice, this list of conditions and the following disclaimer in the
  17. ;    documentation and/or other materials provided with the distribution.
  18. ; 3. All advertising materials mentioning features or use of this software
  19. ;    must display the following acknowledgement:
  20. ;    This product includes software developed by Brini.
  21. ; 4. The name of the company nor the name of the author may be used to
  22. ;    endorse or promote products derived from this software without specific
  23. ;    prior written permission.
  24. ;
  25. ; THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
  26. ; WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  27. ; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  28. ; IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  29. ; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  30. ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  31. ; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  32. ; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  33. ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  34. ; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  35. ; SUCH DAMAGE.
  36. ;
  37. ; RiscBSD kernel project
  38. ;
  39. ; _main.s
  40. ;
  41. ; boot loader entry point
  42. ;
  43. ; Created      : 12/09/94
  44. ; Last updated : 12/09/94
  45. ;
  46. ; Based on kate/boot/_main.s
  47. ;
  48. ;    $Id$
  49. ;
  50.  
  51.     GET    h.asmregs
  52.  
  53.         AREA    |C$$code|, CODE, READONLY
  54.  
  55.     ENTRY
  56.  
  57.         IMPORT  |_main|
  58.         EXPORT  |__main|
  59.  
  60. |__main|
  61.         SWI     &20010                  ; OS_GetEnv
  62.         MOV     sp,a2
  63.         SUB     sl,sp,#2048
  64.  
  65.         LDR     a4,[pc,#|__cli_ptr|-.-8]
  66.         STR     a1,[a4,#0]
  67.         LDR     a4,[pc,#|__himem_ptr|-.-8]
  68.         STR     a2,[a4,#0]
  69.         LDR     a4,[pc,#|__stack_ptr|-.-8]
  70.         STR     sl,[a4,#0]
  71.         LDMIA   a3,{a1,a2}
  72.         AND     a2,a2,#&ff
  73.         LDR     a3,[pc,#|__time_ptr|-.-8]
  74.         STMIA   a3,{a1,a2}
  75.         LDR     a4,[pc,#|__robase_ptr|-.-8]
  76.         LDR     a1,[a4,#0]
  77.         LDR     a4,[pc,#|__base_ptr|-.-8]
  78.         STR     a1,[a4,#0]
  79.         LDR     a4,[pc,#|__rwlimit_ptr|-.-8]
  80.         LDR     a1,[a4,#0]
  81.         LDR     a4,[pc,#|__lomem_ptr|-.-8]
  82.         STR     a1,[a4,#0]
  83.         LDR     a4,[pc,#|__break_ptr|-.-8]
  84.         STR     a1,[a4,#0]
  85.  
  86.         CMP     sl,a1
  87.         MOVLSS  pc,lr                   ; no stack - exit fast
  88.         ADD     sl,sl,#256
  89.         MOV     fp,#0
  90.         LDR     a1,[pc,#|__alloca_list_ptr|-.-8]
  91.         CMP     a1,#0
  92.         STRNE   fp,[a1,#0]
  93.         B       |_main|
  94.  
  95.  
  96.         IMPORT  |Image$$RO$$Base|
  97.         IMPORT  |Image$$RW$$Base|
  98.         IMPORT  |Image$$RW$$Limit|
  99.  
  100. |__cli_ptr|
  101.         DCD     |__cli|
  102.  
  103. |__robase_ptr|
  104.         DCD     |__robase|
  105. |__base_ptr|
  106.         DCD     |__base|
  107. |__rwbase_ptr|
  108.         DCD     |__rwbase|
  109. |__rwlimit_ptr|
  110.         DCD     |__rwlimit|
  111. |__himem_ptr|
  112.         DCD     |__himem|
  113. |__lomem_ptr|
  114.         DCD     |__lomem|
  115.  
  116. |__break_ptr|
  117.         DCD     |__break|
  118. |__stack_ptr|
  119.         DCD     |__stack|
  120.  
  121. |__time_ptr|
  122.         DCD     |__time|
  123.  
  124.         IMPORT  |__alloca_list|,WEAK
  125. |__alloca_list_ptr|
  126.         DCD     |__alloca_list|
  127.  
  128.         IMPORT  |__uname_dont_pack|,WEAK
  129.         EXPORT  |__uname_dont_pack_ptr|
  130. |__uname_dont_pack_ptr|
  131.         DCD     |__uname_dont_pack|
  132.  
  133.  
  134.  
  135.         EXPORT  |__cli|         ; CLI from OS_GetEnv
  136. |__cli|
  137.         DCD     0
  138.  
  139.         EXPORT  |__base|        ; BASE (application = 0x8000)
  140. |__robase|
  141.         DCD     |Image$$RO$$Base|
  142. |__base|
  143.         DCD     0
  144.         EXPORT  |__lomem|       ; LOMEM
  145. |__rwbase|
  146.         DCD     |Image$$RW$$Base|
  147. |__rwlimit|
  148.         DCD     |Image$$RW$$Limit|
  149. |__lomem|
  150.         DCD     0
  151.         EXPORT  |__himem|       ; HIMEM from OS_GetEnv
  152. |__himem|
  153.         DCD     0
  154.  
  155.         EXPORT  |__break|       ; the 'break'
  156. |__break|
  157.         DCD     0
  158.         EXPORT  |__stack|       ; stack limit
  159. |__stack|
  160.         DCD     0
  161.  
  162.         EXPORT  |__time|        ; start time - 5 byte format
  163. |__time|
  164.         DCD     0               ; low word
  165.         DCD     0               ; high byte
  166.  
  167.         END
  168.