Files
codezero/loader/pre-build.py
Bahadir Balban 59f30a175a More progress on build scripts
Created a config directory for configuration files.
Moved all absolute path variables to a projpaths.py file
All scripts can now universally learn absolute paths via projpaths.py
Moved the config_symbols class to the configuration.py file.
Moved libs to loader since they are only referred by the loader
2009-09-12 13:42:30 +03:00

36 lines
699 B
Python
Executable File

# -*- mode: python; coding: utf-8; -*-
#
# Codezero -- a microkernel for embedded systems.
#
# Copyright © 2009 B Labs Ltd
import os, sys, shelve
# Convert address from python literal to numeric value
def address_remove_literal(address):
value = hex(int(address, 16) - 0xf0000000)
if value[-1] in ['l', 'L']:
value = value[:-1]
return value
ksym_header = \
'''
/*
* %s autogenerated from %s.
*
* This file is included by the loader sources so that any
* kernel symbol address can be known in advance and stopped
* at by debuggers before virtual memory is enabled.
*/
'''
symbol_section = \
'''
.section .text
.align 4
.global %s
.type %s, function
.equ %s, %s
'''