mirror of
https://github.com/drasko/codezero.git
synced 2026-01-15 04:13:16 +01:00
Changes between 16 March 2010 - 6 April 2010
Mutex system call fixed for multiple contenders Userspace irq support extended to keyboard/mouse. Scheduler modified for real-time irq tasks
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import os, sys, shelve, glob
|
||||
from os.path import join
|
||||
from tools.pyelf.elfsize import *
|
||||
from tools.pyelf.elf_section_info import *
|
||||
|
||||
PROJRELROOT = '../../'
|
||||
|
||||
@@ -22,6 +23,11 @@ from scripts.linux.build_atags import *
|
||||
from pack import *
|
||||
from packall import *
|
||||
|
||||
def fill_pager_section_markers(cont, pager_binary):
|
||||
cont.pager_rw_section_start, cont.pager_rw_section_end, \
|
||||
cont.pager_rx_section_start, cont.pager_rx_section_end = \
|
||||
elf_loadable_section_info(join(PROJROOT, pager_binary))
|
||||
|
||||
def build_linux_container(config, projpaths, container):
|
||||
linux_builder = LinuxBuilder(projpaths, container)
|
||||
linux_builder.build_linux(config)
|
||||
@@ -33,9 +39,12 @@ def build_linux_container(config, projpaths, container):
|
||||
|
||||
# Calculate and store size of pager
|
||||
pager_binary = \
|
||||
"cont" + str(container.id) + "/linux/linux-2.6.33/linux.elf"
|
||||
join(BUILDDIR, "cont" + str(container.id) +
|
||||
"/linux/linux-2.6.33/linux.elf")
|
||||
config.containers[container.id].pager_size = \
|
||||
conv_hex(elf_binary_size(join(BUILDDIR, pager_binary)))
|
||||
conv_hex(elf_binary_size(pager_binary))
|
||||
|
||||
fill_pager_section_markers(config.containers[container.id], pager_binary)
|
||||
|
||||
linux_container_packer = \
|
||||
LinuxContainerPacker(container, linux_builder, \
|
||||
@@ -70,9 +79,13 @@ def build_posix_container(config, projpaths, container):
|
||||
os.path.walk(builddir, glob_by_walk, ['*.elf', images])
|
||||
|
||||
# Calculate and store size of pager
|
||||
pager_binary = "cont" + str(container.id) + "/posix/mm0/mm0.elf"
|
||||
pager_binary = join(BUILDDIR,
|
||||
"cont" + str(container.id) + "/posix/mm0/mm0.elf")
|
||||
config.containers[container.id].pager_size = \
|
||||
conv_hex(elf_binary_size(join(BUILDDIR, pager_binary)))
|
||||
conv_hex(elf_binary_size(pager_binary))
|
||||
|
||||
print 'Find markers for ' + pager_binary
|
||||
fill_pager_section_markers(config.containers[container.id], pager_binary)
|
||||
|
||||
container_packer = DefaultContainerPacker(container, images)
|
||||
return container_packer.pack_container(config)
|
||||
@@ -89,9 +102,11 @@ def build_default_container(config, projpaths, container):
|
||||
os.path.walk(projdir, glob_by_walk, ['*.elf', images])
|
||||
|
||||
# Calculate and store size of pager
|
||||
pager_binary = "conts/" + container.name + "/main.elf"
|
||||
pager_binary = join(PROJROOT, "conts/" + container.name + "/main.elf")
|
||||
config.containers[container.id].pager_size = \
|
||||
conv_hex(elf_binary_size(join(PROJROOT, pager_binary)))
|
||||
conv_hex(elf_binary_size(pager_binary))
|
||||
|
||||
fill_pager_section_markers(config.containers[container.id], pager_binary)
|
||||
|
||||
container_packer = DefaultContainerPacker(container, images)
|
||||
return container_packer.pack_container(config)
|
||||
|
||||
@@ -67,6 +67,10 @@ pager_start = \
|
||||
\t\t\t.pager_lma = __pfn(CONFIG_CONT%(cn)d_PAGER_LOAD_ADDR),
|
||||
\t\t\t.pager_vma = __pfn(CONFIG_CONT%(cn)d_PAGER_VIRT_ADDR),
|
||||
\t\t\t.pager_size = __pfn(page_align_up(CONT%(cn)d_PAGER_MAPSIZE)),
|
||||
\t\t\t.rw_sections_start = %(rw_sec_start)s,
|
||||
\t\t\t.rw_sections_end = %(rw_sec_end)s,
|
||||
\t\t\t.rx_sections_start = %(rx_sec_start)s,
|
||||
\t\t\t.rx_sections_end = %(rx_sec_end)s,
|
||||
\t\t\t.ncaps = %(caps)d,
|
||||
\t\t\t.caps = {
|
||||
'''
|
||||
@@ -160,7 +164,12 @@ def generate_kernel_cinfo(config, cinfo_path):
|
||||
# Currently only these are considered as capabilities
|
||||
total_caps = c.virt_regions + c.phys_regions + len(c.caps)
|
||||
fbody += cinfo_start % (c.id, c.name)
|
||||
fbody += pager_start % { 'cn' : c.id, 'caps' : total_caps}
|
||||
fbody += pager_start % { 'cn' : c.id, 'caps' : total_caps,
|
||||
'rw_sec_start' : hex(c.pager_rw_section_start),
|
||||
'rw_sec_end' : hex(c.pager_rw_section_end),
|
||||
'rx_sec_start' : hex(c.pager_rx_section_start),
|
||||
'rx_sec_end' : hex(c.pager_rx_section_end),
|
||||
}
|
||||
cap_index = 0
|
||||
for mem_index in range(c.virt_regions):
|
||||
fbody += cap_virtmem % { 'capidx' : cap_index, 'cn' : c.id, 'vn' : mem_index }
|
||||
|
||||
@@ -23,12 +23,13 @@ from config.configuration import *
|
||||
map_list = (['EB', 'ARM1136', 'realview-eb', 'arm1136'],
|
||||
['EB', 'ARM11MPCORE', 'realview-eb-mpcore', 'arm11mpcore'],
|
||||
['EB', 'CORTEXA8', 'realview-eb', 'cortex-a8'],
|
||||
['EB', 'CORTEXA9', 'realview-pbx-a9', 'cortex-a9'],
|
||||
['PB926', 'ARM926', 'versatilepb', 'arm926'],
|
||||
['BEAGLE', 'CORTEXA8', 'beagle', 'cortex-a8'],
|
||||
['PBA9', 'CORTEXA9', 'realview-pbx-a9', 'cortex-a9'],
|
||||
['PBA8', 'CORTEXA8', 'realview-pb-a8', 'cortex-a8'])
|
||||
|
||||
data = \
|
||||
data_up = \
|
||||
'''
|
||||
cd build
|
||||
qemu-system-arm -s -S -kernel final.elf -nographic -M %s -cpu %s &
|
||||
@@ -36,6 +37,14 @@ arm-none-insight ; pkill qemu-system-arm
|
||||
cd ..
|
||||
'''
|
||||
|
||||
data_smp = \
|
||||
'''
|
||||
cd build
|
||||
qemu-system-arm -s -S -kernel final.elf -smp %d -nographic -M %s -cpu %s &
|
||||
arm-none-insight ; pkill qemu-system-arm
|
||||
cd ..
|
||||
'''
|
||||
|
||||
def build_qemu_cmdline_script():
|
||||
build_tools_folder = 'tools'
|
||||
qemu_cmd_file = join(build_tools_folder, 'run-qemu-insight')
|
||||
@@ -44,10 +53,14 @@ def build_qemu_cmdline_script():
|
||||
config = configuration_retrieve()
|
||||
cpu = config.cpu.upper()
|
||||
platform = config.platform.upper()
|
||||
smp = config.smp
|
||||
ncpu = config.ncpu
|
||||
|
||||
# Find appropriate flags
|
||||
for platform_type, cpu_type, mflag, cpuflag in map_list:
|
||||
for platform_type, cpu_type, m_flag, cpu_flag in map_list:
|
||||
if platform_type == platform and cpu_type == cpu:
|
||||
mflag = m_flag
|
||||
cpuflag = cpu_flag
|
||||
break
|
||||
|
||||
if not mflag or not cpuflag:
|
||||
@@ -57,9 +70,16 @@ def build_qemu_cmdline_script():
|
||||
if os.path.exists(build_tools_folder) is False:
|
||||
os.system("mkdir " + build_tools_folder)
|
||||
|
||||
# Special case for EB+A9(non-smp)
|
||||
if platform == 'EB' and cpu == 'CORTEXA9' and smp == False:
|
||||
mflag = 'realview-eb'
|
||||
|
||||
# Write run-qemu-insight file
|
||||
with open(qemu_cmd_file, 'w+') as f:
|
||||
f.write(data % (mflag, cpuflag))
|
||||
if smp == False:
|
||||
f.write(data_up % (mflag, cpuflag))
|
||||
else:
|
||||
f.write(data_smp % (ncpu, mflag, cpuflag))
|
||||
|
||||
os.system("chmod +x " + qemu_cmd_file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user