码迷,mamicode.com
首页 > 其他好文 > 详细

RT-Thread

时间:2016-02-11 11:10:48      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:

ubuntu@ubuntu:~$ python -V
Python 2.7.10
ubuntu@ubuntu:~$ sudo apt-get install scons

rt-thread-master/bsp/x86/rtconfig.h

/* RT-Thread config file */
#ifndef __RTTHREAD_CFG_H__
#define __RTTHREAD_CFG_H__

/* RT_NAME_MAX*/
#define RT_NAME_MAX        8

/* RT_ALIGN_SIZE*/
#define RT_ALIGN_SIZE    8

/* PRIORITY_MAX */
#define RT_THREAD_PRIORITY_MAX    32

/* Tick per Second */
#define RT_TICK_PER_SECOND        1000

/* SECTION: RT_DEBUG */
/* Thread Debug */
#define RT_DEBUG
#define RT_THREAD_DEBUG

#define RT_USING_OVERFLOW_CHECK

/* Using Hook */
#define RT_USING_HOOK

/* Using Software Timer */
/* #define RT_USING_TIMER_SOFT */
#define RT_TIMER_THREAD_PRIO        4
#define RT_TIMER_THREAD_STACK_SIZE    512
#define RT_TIMER_TICK_PER_SECOND    10

/* SECTION: IPC */
/* Using Semaphore*/
#define RT_USING_SEMAPHORE

/* Using Mutex */
#define RT_USING_MUTEX

/* Using Event */
#define RT_USING_EVENT

/* Using MailBox */
#define RT_USING_MAILBOX

/* Using Message Queue */
#define RT_USING_MESSAGEQUEUE

/* SECTION: Memory Management */
/* Using Memory Pool Management*/
#define RT_USING_MEMPOOL

/* Using Dynamic Heap Management */
#define RT_USING_HEAP

/* Using Small MM */
#define RT_USING_SMALL_MEM

/* SECTION: Device System */
/* Using Device System */
#define RT_USING_DEVICE

/* SECTION: Console options */
#define RT_USING_CONSOLE
/* the buffer size of console*/
#define RT_CONSOLEBUF_SIZE    128

#define IDLE_THREAD_STACK_SIZE        1024  /* idle stack 1K */

/* SECTION: finsh, a C-Express shell */
#define RT_USING_FINSH
/* Using symbol table */
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION


#endif

 

 

rt-thread-master/bsp/x86/rtconfig.py

import os

# toolchains options
ARCH=ia32
CPU=‘‘
CROSS_TOOL=gcc

if os.getenv(RTT_CC):
    CROSS_TOOL = os.getenv(RTT_CC)

# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery,

if  CROSS_TOOL == gcc:
    PLATFORM     = gcc
    EXEC_PATH     = ‘‘

elif CROSS_TOOL == keil:
    print ================ERROR============================
    print Not support keil yet!
    print =================================================
    exit(0)
elif CROSS_TOOL == iar:
    print ================ERROR============================
    print Not support iar yet!
    print =================================================
    exit(0)

if os.getenv(RTT_EXEC_PATH):
    EXEC_PATH = os.getenv(RTT_EXEC_PATH)

BUILD = debug

if PLATFORM == gcc:
    # toolchains
    PREFIX = ‘‘
    CC = PREFIX + gcc
    AS = PREFIX + gcc
    AR = PREFIX + ar
    LINK = PREFIX + gcc
    TARGET_EXT = elf
    SIZE = PREFIX + size
    OBJDUMP = PREFIX + objdump
    OBJCPY = PREFIX + objcopy

    DEVICE =  -mtune=generic
    CFLAGS = DEVICE +  -Wall -fno-stack-protector
    AFLAGS =  -c + DEVICE +  -x assembler-with-cpp
    LFLAGS = DEVICE +  -Wl,--gc-sections,-Map=rtthread-ia32.map,-cref,-u,_start -T x86_ram.lds -nostdlib

    CPATH = ‘‘
    LPATH = ‘‘

    if BUILD == debug:
        CFLAGS +=  -O0 -gdwarf-2
        AFLAGS +=  -gdwarf-2
    else:
        CFLAGS +=  -O2

    POST_ACTION = OBJCPY +  -O binary $TARGET rtthread.bin\n + SIZE +  $TARGET \n

 

ubuntu@ubuntu:~/rt-thread-master/bsp/x86$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build/bsp
CC build/bsp/applications/application.o
CC build/bsp/applications/startup.o
CC build/bsp/drivers/board.o
CC build/bsp/drivers/console.o
CC build/bsp/drivers/keyboard.o
CC build/bsp/drivers/serial.o
CC build/kernel/components/finsh/cmd.o
CC build/kernel/components/finsh/finsh_compiler.o
CC build/kernel/components/finsh/finsh_error.o
CC build/kernel/components/finsh/finsh_heap.o
CC build/kernel/components/finsh/finsh_init.o
CC build/kernel/components/finsh/finsh_node.o
CC build/kernel/components/finsh/finsh_ops.o
CC build/kernel/components/finsh/finsh_parser.o
CC build/kernel/components/finsh/finsh_token.o
CC build/kernel/components/finsh/finsh_var.o
CC build/kernel/components/finsh/finsh_vm.o
CC build/kernel/components/finsh/shell.o
CC build/kernel/components/finsh/symbol.o
CC build/kernel/components/libc/minilibc/ctype.o
CC build/kernel/components/libc/minilibc/math.o
CC build/kernel/components/libc/minilibc/qsort.o
CC build/kernel/components/libc/minilibc/rand.o
CC build/kernel/components/libc/minilibc/stdlib.o
CC build/kernel/components/libc/minilibc/string.o
CC build/kernel/components/libc/minilibc/time.o
CC build/kernel/libcpu/ia32/__udivsi3.o
CC build/kernel/libcpu/ia32/__umodsi3.o
CC build/kernel/libcpu/ia32/backtrace.o
CC build/kernel/libcpu/ia32/interrupt.o
CC build/kernel/libcpu/ia32/showmem.o
CC build/kernel/libcpu/ia32/stack.o
CC build/kernel/libcpu/ia32/trap.o
In file included from drivers/include/bsp.h:17:0,
                 from /home/ubuntu/rt-thread-master/libcpu/ia32/trap.c:17:
/home/ubuntu/rt-thread-master/libcpu/ia32/trap.c: In function rt_hw_idt_init:
/home/ubuntu/rt-thread-master/libcpu/ia32/trap.c:49:29: warning: taking address of expression of type void
   SETGATE(idt[i], 0, GD_KT, &Xdefault, 0);
                             ^
drivers/include/i386.h:69:38: note: in definition of macro SETGATE
  (gate).gd_off_15_0 = (rt_uint32_t) (off) & 0xffff;                                        ^
/home/ubuntu/rt-thread-master/libcpu/ia32/trap.c:49:29: warning: taking address of expression of type void
   SETGATE(idt[i], 0, GD_KT, &Xdefault, 0);
                             ^
drivers/include/i386.h:77:39: note: in definition of macro SETGATE
  (gate).gd_off_31_16 = (rt_uint32_t) (off) >> 16;                                         ^
/home/ubuntu/rt-thread-master/libcpu/ia32/trap.c: In function rt_hw_trap_irq:
/home/ubuntu/rt-thread-master/libcpu/ia32/trap.c:95:4: warning: implicit declaration of function rt_hw_interrupt_handle [-Wimplicit-function-declaration]
    rt_hw_interrupt_handle(T_DEFAULT);
    ^
CC build/kernel/src/clock.o
CC build/kernel/src/device.o
CC build/kernel/src/idle.o
CC build/kernel/src/ipc.o
CC build/kernel/src/irq.o
CC build/kernel/src/kservice.o
CC build/kernel/src/mem.o
CC build/kernel/src/mempool.o
CC build/kernel/src/object.o
CC build/kernel/src/scheduler.o
CC build/kernel/src/thread.o
CC build/kernel/src/timer.o
LINK rtthread.elf
objcopy -O binary rtthread.elf rtthread.bin
size rtthread.elf
   text       data        bss        dec        hex    filename
  73773       3484       9864      87121      15451    rtthread.elf
scons: done building targets.
ubuntu@ubuntu:~/rt-thread-master/bsp/x86$ 

 

RT-Thread

标签:

原文地址:http://www.cnblogs.com/fluray/p/5186343.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!