Commit 5835d7b0 authored by Timothy E Baldwin's avatar Timothy E Baldwin Committed by ROOL
Browse files

Build kernel using relocatable AOF

* Add KernelBaseA absolute symbol.
* Use KernelBase - KernelBaseA to convert some expressions
  to/from AREA relative form.
* Link to correct address.
* Remove ORG directive
* Move EndOfKernel to separate AREA
parent 2a3ad40a
......@@ -89,8 +89,9 @@ install: ${EXPORTS} inst_dirs
${KERNEL_MODULE}: ${ROM_OBJECT} ${DIRS}
${MKDIR} bin
${LD} -bin -o $@ ${ROM_OBJECT}
${LD} -aif -bin -d -o ${KERNEL_MODULE}_aif ${ROM_OBJECT}
SetEval KernelBase "4" + STR ( 227858432 + ( HALSize LEFT ( LEN HALSize - 1 ) ) * 1024 )
Do ${LD} -bin -base <KernelBase> -o $@ ${ROM_OBJECT}
Do ${LD} -aif -base <KernelBase> -bin -d -o ${KERNEL_MODULE}_aif ${ROM_OBJECT}
${TOGPA} -s ${KERNEL_MODULE}_aif ${KERNEL_MODULE}_gpa
#
......
......@@ -175,6 +175,7 @@ EndOfAMB
! 0, "AMB section size = &" :CC: :STR: (EndOfAMB - StartOfAMB)
AREA zzzzzz, DATA, READONLY
EndOfKernel
DCD 0
......
......@@ -298,12 +298,12 @@ CBack_VectorReq * 4
SUBT Arthur Code
OPT 4
ORG ROM + OSROM_HALSize
AREA |!!!!OSBase|,CODE,READONLY
ENTRY ; Not really, but we need it to link
KernelBase
KernelBaseA * ROM + OSROM_HALSize
ToRelative * KernelBase - KernelBaseA
; *****************************************************************************
;
......@@ -320,7 +320,7 @@ RISCOS_Header
DCD (RISCOS_Entries_End - RISCOS_Entries) / 4
DCD OSROM_ImageSize*1024 - OSROM_HALSize
DCD 0
DCD EndOfKernel - RISCOS_Header
DCD EndOfKernel - KernelBaseA
ASSERT (. - RISCOS_Header) = OSHdr_size
RISCOS_Entries
......@@ -428,19 +428,19 @@ EndData
SVCDespatcher ROUT
SWIRelocation * SVCDespatcher-SWIDespatch
SWIRelocation * SVCDespatcher - ToRelative - SWIDespatch
SLVK_SetV * {PC}-SWIRelocation
ORR lr, lr, #V_bit
SLVK_TestV * {PC}-SWIRelocation
! 0,"SLVK_TestV at ":CC:(:STR:SLVK_TestV)
! 0,"SLVK_TestV at ":CC:(:STR:(SLVK_TestV - ToRelative))
ORRVS lr, lr, #V_bit
SLVK * {PC}-SWIRelocation
! 0,"SLVK at ":CC:(:STR:SLVK)
! 0,"SLVK at ":CC:(:STR:(SLVK - ToRelative))
Local_SLVK
LDR r12, [sp], #4
......@@ -456,7 +456,7 @@ Local_SLVK
BNE %FT50
SWIReturnWithCallBackFlag * {PC}-SWIRelocation
! 0,"SWIReturnWithCallBackFlag at ":CC:(:STR:SWIReturnWithCallBackFlag)
! 0,"SWIReturnWithCallBackFlag at ":CC:(:STR:(SWIReturnWithCallBackFlag - ToRelative))
40 TEQ r11, #0
......@@ -467,7 +467,7 @@ SWIReturnWithCallBackFlag * {PC}-SWIRelocation
B callback_checking + SWIRelocation
! 0,"VSetReturn at ":CC:(:STR:({PC}-SWIRelocation))
! 0,"VSetReturn at ":CC:(:STR:({PC} - SWIRelocation - ToRelative))
50
; Some programs abuse XOS_GenerateError by using it purely as a method
; to trigger callbacks, or to convert null terminated strings to BASIC
......@@ -687,7 +687,7 @@ JTABLE & SWIWriteC
; The fudge branch to exit a dirty SWI handler
DirtyBranch
B SLVK +DirtyBranch-BranchToSWIExit
B SLVK + DirtyBranch - ToRelative - BranchToSWIExit
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
......@@ -168,7 +168,7 @@ Vdu5NextLine
TST ecfptr, #63 ; ecf pointer, wrapping if
SUBEQ ecfptr, ecfptr, #64 ; necessary
ASSERT HardFont < &40000000 :LOR: HardFont >= &C0000000
ASSERT HardFont - ToRelative < &40000000 :LOR: HardFont - ToRelative >= &C0000000
ASSERT WsPtr < &40000000 :LOR: WsPtr >= &C0000000
TEQ charmsk, #0 ; Double height? (MI=yes)
LDRMIB charbyte, [charptr, -charptr, ASR #1] ; Use ASR, as font will be at
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment