mirror of
https://github.com/drasko/codezero.git
synced 2026-04-18 01:39:05 +02:00
Fix error about inclusion of start.afx.S -- there was a dependencies error in the SConscript leading to incorect multiple inclusion in the constructed kernel.S.
This commit is contained in:
@@ -42,23 +42,23 @@ def ksymToLds(target, source, env):
|
|||||||
asmFile.write( '''
|
asmFile.write( '''
|
||||||
.section .text
|
.section .text
|
||||||
.align 4
|
.align 4
|
||||||
.global %s;
|
.global %s
|
||||||
.type %s, function;
|
.type %s, function
|
||||||
.equ %s, %s
|
.equ %s, %s
|
||||||
''' % (symbol, symbol, symbol, (hex(int(address, 16) - 0xf0000000))))
|
''' % (symbol, symbol, symbol, (hex(int(address, 16) - 0xf0000000))))
|
||||||
|
|
||||||
def createKernelSFile(target, source, env):
|
def createKernelSFile(target, source, env):
|
||||||
with open(target[0].path, 'w') as asmFile:
|
with open(target[0].path, 'w') as asmFile:
|
||||||
asmFile.write('''
|
asmFile.write('''
|
||||||
/* This file defines kernel symbols extracted from the kernel image in their physical address */
|
/* This file defines kernel symbols extracted from the kernel image in their physical address */
|
||||||
.include "start.axf.S"
|
.include "%s"
|
||||||
|
|
||||||
.section .kernel
|
.section .kernel
|
||||||
|
|
||||||
.incbin "%s"
|
.incbin "%s"
|
||||||
|
|
||||||
''' % (source[0].path))
|
''' % (source[0].path , source[1].path))
|
||||||
for image in source[1:]:
|
for image in source[2:]:
|
||||||
asmFile.write('''
|
asmFile.write('''
|
||||||
.align 4
|
.align 4
|
||||||
.section .%s
|
.section .%s
|
||||||
@@ -104,7 +104,7 @@ def createLinkerScript(target, source, env):
|
|||||||
outFile.write(inFile.read().replace('__LINKER_ITEMS_EDIT_MARKER__', linkerItems))
|
outFile.write(inFile.read().replace('__LINKER_ITEMS_EDIT_MARKER__', linkerItems))
|
||||||
|
|
||||||
startAxfS = Command('start.axf.S', images[0], ksymToLds)
|
startAxfS = Command('start.axf.S', images[0], ksymToLds)
|
||||||
kernelS = Command('kernel.S', images + [startAxfS], createKernelSFile)
|
kernelS = Command('kernel.S', [startAxfS] + images, createKernelSFile) # Order of dependencies is crucial here.
|
||||||
mainC = Command('main.c', ['main.c.in'] + images, createMainC)
|
mainC = Command('main.c', ['main.c.in'] + images, createMainC)
|
||||||
linkerScript = Command('linker.lds', ['linker.lds.in'] + images, createLinkerScript)
|
linkerScript = Command('linker.lds', ['linker.lds.in'] + images, createLinkerScript)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user