diff --git a/config/cml/container_ruleset.template b/config/cml/container_ruleset.template index 67e55fd..004d0fe 100644 --- a/config/cml/container_ruleset.template +++ b/config/cml/container_ruleset.template @@ -1,7 +1,7 @@ symbols CONT%(cn)d_TYPE_LINUX 'Linux Container' CONT%(cn)d_TYPE_BARE 'Bare Container' -CONT%(cn)d_TYPE_POSIX 'Codezero POSIX Services' +CONT%(cn)d_TYPE_POSIX 'POSIX Container' CONT%(cn)d_TYPE_TEST 'Test Container' CONT%(cn)d_OPT_NAME 'Container Name' @@ -44,18 +44,18 @@ CONT%(cn)d_LINUX_PAGE_OFFSET 'Container %(cn)d Linux PAGE_OFFSET Parameter' CONT%(cn)d_LINUX_PHYS_OFFSET 'Container %(cn)d Linux PHYS_OFFSET Parameter' CONT%(cn)d_LINUX_ROOTFS_ADDRESS 'Container %(cn)d Linux ROOTFS Address' -default CONT%(cn)d_PAGER_LMA from 0x0 -default CONT%(cn)d_PAGER_VMA from 0x0 -default CONT%(cn)d_PAGER_SHM_START from 0x0 -default CONT%(cn)d_PAGER_SHM_END from 0x0 -default CONT%(cn)d_PAGER_TASK_START from 0x0 -default CONT%(cn)d_PAGER_TASK_END from 0x0 -default CONT%(cn)d_PAGER_UTCB_START from 0x0 -default CONT%(cn)d_PAGER_UTCB_END from 0x0 -default CONT%(cn)d_LINUX_ZRELADDR from 0x0 -default CONT%(cn)d_LINUX_PAGE_OFFSET from 0x0 -default CONT%(cn)d_LINUX_PHYS_OFFSET from 0x0 -default CONT%(cn)d_LINUX_ROOTFS_ADDRESS from 0x0 +default CONT%(cn)d_PAGER_LMA from CONT%(cn)d_PHYS0_START +default CONT%(cn)d_PAGER_VMA from CONT%(cn)d_VIRT0_START +default CONT%(cn)d_PAGER_SHM_START from 0x40000000 +default CONT%(cn)d_PAGER_SHM_END from 0x50000000 +default CONT%(cn)d_PAGER_TASK_START from 0x30000000 +default CONT%(cn)d_PAGER_TASK_END from 0x40000000 +default CONT%(cn)d_PAGER_UTCB_START from 0xf8100000 +default CONT%(cn)d_PAGER_UTCB_END from 0xf8200000 +default CONT%(cn)d_LINUX_ZRELADDR from (CONT%(cn)d_LINUX_PHYS_OFFSET + 0x8000) +default CONT%(cn)d_LINUX_PAGE_OFFSET from CONT%(cn)d_VIRT0_START +default CONT%(cn)d_LINUX_PHYS_OFFSET from CONT%(cn)d_PHYS0_START +default CONT%(cn)d_LINUX_ROOTFS_ADDRESS from (CONT%(cn)d_LINUX_PHYS_OFFSET + 0x500000) default CONT%(cn)d_VIRTMEM_REGIONS from 1 default CONT%(cn)d_PHYSMEM_REGIONS from 1 @@ -91,27 +91,63 @@ when CONT%(cn)d_PHYSMEM_REGIONS < 3 suppress CONT%(cn)d_PHYS3_START CONT%(cn)d_P when CONT%(cn)d_PHYSMEM_REGIONS < 4 suppress CONT%(cn)d_PHYS3_START CONT%(cn)d_PHYS3_END -default CONT%(cn)d_PHYS0_START from 0x0 -default CONT%(cn)d_PHYS0_END from 0x0 -default CONT%(cn)d_PHYS1_START from 0x0 -default CONT%(cn)d_PHYS1_END from 0x0 -default CONT%(cn)d_PHYS2_START from 0x0 -default CONT%(cn)d_PHYS2_END from 0x0 -default CONT%(cn)d_PHYS3_START from 0x0 -default CONT%(cn)d_PHYS3_END from 0x0 +### Sanity check for memory regions ### +require CONT%(cn)d_PHYS0_START < CONT%(cn)d_PHYS0_END +require CONT%(cn)d_PHYS1_START < CONT%(cn)d_PHYS1_END +require CONT%(cn)d_PHYS2_START < CONT%(cn)d_PHYS2_END +require CONT%(cn)d_PHYS3_START < CONT%(cn)d_PHYS3_END -default CONT%(cn)d_VIRT0_START from 0x0 -default CONT%(cn)d_VIRT0_END from 0x0 -default CONT%(cn)d_VIRT1_START from 0x0 -default CONT%(cn)d_VIRT1_END from 0x0 -default CONT%(cn)d_VIRT2_START from 0x0 -default CONT%(cn)d_VIRT2_END from 0x0 -default CONT%(cn)d_VIRT3_START from 0x0 -default CONT%(cn)d_VIRT3_END from 0x0 -default CONT%(cn)d_VIRT4_START from 0x0 -default CONT%(cn)d_VIRT4_END from 0x0 -default CONT%(cn)d_VIRT5_START from 0x0 -default CONT%(cn)d_VIRT5_END from 0x0 +require CONT%(cn)d_VIRT0_START < CONT%(cn)d_VIRT0_END +require CONT%(cn)d_VIRT1_START < CONT%(cn)d_VIRT1_END +require CONT%(cn)d_VIRT2_START < CONT%(cn)d_VIRT2_END +require CONT%(cn)d_VIRT3_START < CONT%(cn)d_VIRT3_END +require CONT%(cn)d_VIRT4_START < CONT%(cn)d_VIRT4_END +require CONT%(cn)d_VIRT5_START < CONT%(cn)d_VIRT5_END + +# Physical Regions for containers should start after kernel, +# assuming kernel to be using 0x0-0x40000 Physcial Memory region +derive kernel_size from (0x0 + 0x40000) # cannot set value directly +require CONT%(cn)d_PHYS0_START >= kernel_size +require CONT%(cn)d_PHYS1_START >= kernel_size +require CONT%(cn)d_PHYS2_START >= kernel_size +require CONT%(cn)d_PHYS3_START >= kernel_size + +# TODO: We can add check for end address of physical region to be +# less than RAM SIZE, need to find out RAM SIZE? + +# Rules for Linux kernel parameters +require CONT%(cn)d_LINUX_ZRELADDR > CONT%(cn)d_LINUX_PHYS_OFFSET + 0x8000 + +# FIXME: Restriction for rootfs? + +# Rules for posix containers +# UTCB area starts from 0xf8100000 +derive utcb_start from (0x0 + 0xf8100000) # cannot set value directly +require CONT%(cn)d_PAGER_UTCB_START >= utcb_start + +# TODO: Do we want to check if PAGER_LMA/VMA lies in allocated memory regions + +default CONT%(cn)d_PHYS0_START from 0x40000 +default CONT%(cn)d_PHYS0_END from 0x1000000 +default CONT%(cn)d_PHYS1_START from 0x1000000 +default CONT%(cn)d_PHYS1_END from 0x1100000 +default CONT%(cn)d_PHYS2_START from 0x1100000 +default CONT%(cn)d_PHYS2_END from 0x1200000 +default CONT%(cn)d_PHYS3_START from 0x1200000 +default CONT%(cn)d_PHYS3_END from 0x1300000 + +default CONT%(cn)d_VIRT0_START from 0x90000000 +default CONT%(cn)d_VIRT0_END from 0xa0000000 +default CONT%(cn)d_VIRT1_START from 0x40000000 +default CONT%(cn)d_VIRT1_END from 0x50000000 +default CONT%(cn)d_VIRT2_START from 0x30000000 +default CONT%(cn)d_VIRT2_END from 0x40000000 +default CONT%(cn)d_VIRT3_START from 0xf8100000 +default CONT%(cn)d_VIRT3_END from 0xf8200000 +default CONT%(cn)d_VIRT4_START from 0xd0000000 +default CONT%(cn)d_VIRT4_END from 0xe0000000 +default CONT%(cn)d_VIRT5_START from 0xe0000000 +default CONT%(cn)d_VIRT5_END from 0xf0000000 default CONT%(cn)d_OPT_NAME from (CONT%(cn)d_TYPE_LINUX==y) ? "linux%(cn)d" : ((CONT%(cn)d_TYPE_BARE==y) ? "bare%(cn)d" : ((CONT%(cn)d_TYPE_TEST==y) ? "test%(cn)d" : "posix%(cn)d")) @@ -145,10 +181,10 @@ menu cont%(cn)d_posix_pager_params menu cont%(cn)d_linux_pager_params - CONT%(cn)d_LINUX_ZRELADDR@ - CONT%(cn)d_LINUX_PAGE_OFFSET@ CONT%(cn)d_LINUX_PHYS_OFFSET@ + CONT%(cn)d_LINUX_ZRELADDR@ CONT%(cn)d_LINUX_ROOTFS_ADDRESS@ + CONT%(cn)d_LINUX_PAGE_OFFSET@ menu cont%(cn)d_virtmem_list CONT%(cn)d_VIRTMEM_REGIONS% @@ -178,16 +214,16 @@ menu cont%(cn)d_physmem_list menu container%(cn)d_options CONT%(cn)d_OPT_NAME$ + cont%(cn)d_physmem_list + cont%(cn)d_virtmem_list cont%(cn)d_linux_pager_params cont%(cn)d_bare_pager_params cont%(cn)d_posix_pager_params - cont%(cn)d_physmem_list - cont%(cn)d_virtmem_list choices container%(cn)d_type - CONT%(cn)d_TYPE_LINUX CONT%(cn)d_TYPE_BARE CONT%(cn)d_TYPE_POSIX + CONT%(cn)d_TYPE_LINUX CONT%(cn)d_TYPE_TEST default CONT%(cn)d_TYPE_BARE diff --git a/configure.py b/configure.py index 28d75d6..f75aea5 100755 --- a/configure.py +++ b/configure.py @@ -23,7 +23,7 @@ def autogen_rules_file(options, args): # Prepare default if number of containers not supplied if not options.ncont: - options.ncont = 4 + options.ncont = 1 print "Max container count not supplied (-n), using %d as default." % options.ncont return generate_container_cml(options.arch, options.ncont)