免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3749 | 回复: 3

[BootLoader] RedBoot中配置使用的是cdl脚本,请教各位有没有该种脚本语言的详细教程 [复制链接]

论坛徽章:
0
发表于 2011-08-08 17:06 |显示全部楼层
最近在研究redBoot的启动配置,发现redboot在配置方面做得还是比较方便的,它使用
的是组件描述语言cdl。如:
  1. cdl_package CYGPKG_HAL_MIPS {
  2.     display "MIPS architecture"
  3.     parent        CYGPKG_HAL
  4.     hardware
  5.     include_dir   cyg/hal
  6.     define_header hal_mips.h
  7.     description   "
  8.         The MIPS architecture HAL package provides generic support
  9.         for this processor architecture. It is also necessary to
  10.         select a CPU variant and a specific target platform HAL
  11.         package."

  12.     cdl_interface CYGINT_HAL_MIPS_VARIANT {
  13.         display  "Number of variant implementations in this configuration"
  14.         requires 1 == CYGINT_HAL_MIPS_VARIANT
  15.     }

  16.     compile       hal_misc.c context.S mips-stub.c mipsfp.c
  17.     compile       hal_syscall.c

  18.     make {
  19.         <PREFIX>/lib/vectors.o : <PACKAGE>/src/vectors.S
  20.         $(CC) -Wp,-MD,vectors.tmp $(INCLUDE_PATH) $(CFLAGS) -c -o $@ $<
  21.         @echo $@ ": \\" > $(notdir $@).deps
  22.         @tail -n +2 vectors.tmp >> $(notdir $@).deps
  23.         @echo >> $(notdir $@).deps
  24.         @rm vectors.tmp
  25.     }

  26.     define_proc {
  27.         puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK hal_arch_program_new_stack"
  28.     }

  29.     cdl_option CYGHWR_HAL_MIPS_CPU_FREQ {
  30.         display "CPU frequency"
  31.         flavor  data
  32.         legal_values 0 to 1000000
  33.         default_value 50
  34.         description "
  35.            This option contains the frequency of the CPU in MegaHertz.
  36.            Choose the frequency to match the processor you have. This
  37.            may affect thing like serial device, interval clock and
  38.            memory access speed settings."
  39.     }

  40.     cdl_option CYGDBG_HAL_MIPS_DEBUG_GDB_CTRLC_SUPPORT {
  41.         display "Architecture GDB CTRLC support"
  42.         calculated { CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT || CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT }
  43.         active_if { CYGINT_HAL_DEBUG_GDB_CTRLC_UNSUPPORTED == 0 }
  44.         description "
  45.             If either the CTRLC or BREAK support options in hal.h are set
  46.             then set our own option to turn on shared generic support for
  47.             control C handling."
  48.     }

  49.     cdl_option CYGSEM_HAL_MIPS_EMULATE_UNIMPLEMENTED_FPU_OPS {
  50.         display  "Emulate unimplemented FPU opcodes"
  51.         flavor   bool
  52.         default_value 1
  53.         description "
  54.            Enabling this option will include a hook in the exception
  55.            processing so that Unimplemented Operation FPU exceptions
  56.            may be handled. This option has no effect if there is no
  57.            hardware floating-point unit. Note that not all situations
  58.            in which an exception is raised may be handled. If not, the
  59.            exception will be passed on as normal through the standard
  60.            exception delivery mechanism."
  61.     }

  62.     cdl_interface CYGINT_HAL_MIPS_STUB_REPRESENT_32BIT_AS_64BIT {
  63.         display  "Represent 32-bit registers as 64-bit to GDB"
  64.         flavor booldata
  65.         description "
  66.         This interface may be implemented by MIPS variant or platform HALs
  67.         to instruct the MIPS stub to interwork correctly with GDB which
  68.         expects 64-bit register values, even in application code which has
  69.         been compiled as 32-bit.  Do not use this for real 64-bit code."
  70.     }

  71.     cdl_interface CYGINT_HAL_MIPS_INTERRUPT_RETURN_KEEP_SR_IM {
  72.         display  "Interrupt return keeps interrupt mask bits in SR"
  73.         description "
  74.         On some MIPS variants, the status register (SR) contains a number
  75.         of interrupt mask bits (IM\[0..7\]).  Default behavior is to restore
  76.         the whole SR over an interrupt.  This means that if the ISR
  77.         modifies those bits, the change is lost when the interrupt returns.
  78.         If this interface is implemented, changes made to the SR IM bits by
  79.         an ISR will instead be preserved.
  80.         Variants whose HAL_INTERRUPT_MASK() routines (et al) modify the IM
  81.         bits in the SR should implement this interface to get the necessary
  82.         preserving behavior."
  83.     }

  84.     cdl_component CYGPKG_REDBOOT_MIPS_OPTIONS {
  85.         display       "Redboot for MIPS options"
  86.         flavor        none
  87.         no_define
  88.         parent        CYGPKG_REDBOOT
  89.         active_if     CYGPKG_REDBOOT
  90.         description   "
  91.             This option lists the target's requirements for a valid Redboot
  92.             configuration."

  93.         cdl_component CYGSEM_REDBOOT_MIPS_LINUX_BOOT {
  94.             active_if      CYGBLD_BUILD_REDBOOT_WITH_EXEC
  95.             display        "Support booting Linux via RedBoot"
  96.             flavor         bool
  97.             default_value  1
  98.             description    "
  99.                This option allows RedBoot to support booting of a Linux kernel."
  100.             compile -library=libextras.a redboot_linux_exec.c

  101.             cdl_option CYGDAT_REDBOOT_MIPS_LINUX_BOOT_ENTRY {
  102.                 display        "Default kernel entry address"
  103.                 flavor         data
  104.                 default_value  0x80100750
  105.             }

  106.             cdl_option CYGDAT_REDBOOT_MIPS_LINUX_BOOT_ARGV_ADDR {
  107.                 display        "Default argv address"
  108.                 flavor         data
  109.                 default_value  0x80030000
  110.             }

  111.             cdl_option CYGDAT_REDBOOT_MIPS_LINUX_BOOT_COMMAND_LINE {
  112.                 display        "Default COMMAND_LINE"
  113.                 flavor         data
  114.                 default_value  { "" }
  115.             }
  116.         }
  117.     }

  118. }
复制代码
我对这种脚本语言几乎不懂,看这个只能靠猜,有没有哪位仁兄对这个比较在行的,指导一下!

论坛徽章:
0
发表于 2011-08-18 19:37 |显示全部楼层
回复 1# jyhhappyjyh


    原来cdl不是一种新的语言,是tcl脚本,语法规则一致!

论坛徽章:
0
发表于 2012-05-13 17:22 |显示全部楼层
对,只是一种脚本

论坛徽章:
0
发表于 2012-06-21 14:07 |显示全部楼层
还真不懂这个
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP