Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
9ccdf417
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9ccdf417
编写于
2月 26, 2013
作者:
P
prife
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
basic mingw support for simulator: kernel and finsh
上级
278cc914
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
297 addition
and
10 deletion
+297
-10
bsp/simulator/SConstruct
bsp/simulator/SConstruct
+22
-1
bsp/simulator/drivers/board.c
bsp/simulator/drivers/board.c
+1
-1
bsp/simulator/mingw.ld
bsp/simulator/mingw.ld
+222
-0
bsp/simulator/rtconfig.h
bsp/simulator/rtconfig.h
+7
-6
bsp/simulator/rtconfig.py
bsp/simulator/rtconfig.py
+40
-2
libcpu/SConscript
libcpu/SConscript
+3
-0
libcpu/sim/win32/cpu_port.c
libcpu/sim/win32/cpu_port.c
+2
-0
未找到文件。
bsp/simulator/SConstruct
浏览文件 @
9ccdf417
...
...
@@ -51,13 +51,34 @@ if rtconfig.PLATFORM == 'cl':
env
.
Append
(
LINKFLAGS
=
rtconfig
.
LFLAGS
)
env
[
'LIBS'
]
=
libs
env
[
'CPPDEFINES'
]
=
definitions
elif
rtconfig
.
PLATFORM
==
'mingw'
:
libs
=
Split
(
'''
winmm
gdi32
winspool
comdlg32
advapi32
shell32
ole32
oleaut32
uuid
odbc32
odbccp32
'''
)
TARGET
=
'rtthread-win32.'
+
rtconfig
.
TARGET_EXT
env
=
Environment
(
tools
=
[
'mingw'
],
AS
=
rtconfig
.
AS
,
ASFLAGS
=
rtconfig
.
AFLAGS
,
CC
=
rtconfig
.
CC
,
CCFLAGS
=
rtconfig
.
CFLAGS
,
AR
=
rtconfig
.
AR
,
ARFLAGS
=
'-rc'
,
LINK
=
rtconfig
.
LINK
,
LINKFLAGS
=
rtconfig
.
LFLAGS
)
env
[
'LIBS'
]
=
libs
env
.
PrependENVPath
(
'PATH'
,
rtconfig
.
EXEC_PATH
)
else
:
TARGET
=
'rtthread'
env
.
Append
(
CCFLAGS
=
rtconfig
.
CFLAGS
)
env
.
Append
(
LINKFLAGS
=
rtconfig
.
LFLAGS
)
env
.
Append
(
LIBS
=
[
'm'
])
# prepare building environment
objs
=
PrepareBuilding
(
env
,
RTT_ROOT
,
has_libcpu
=
False
,
remove_components
=
[
'rtgui'
])
...
...
bsp/simulator/drivers/board.c
浏览文件 @
9ccdf417
...
...
@@ -53,7 +53,7 @@ void rt_hw_win32_low_cpu(void)
#endif
}
#ifdef _
WIN32
#ifdef _
MSC_VER
#ifndef _CRT_TERMINATE_DEFINED
#define _CRT_TERMINATE_DEFINED
_CRTIMP
__declspec
(
noreturn
)
void
__cdecl
exit
(
__in
int
_Code
);
...
...
bsp/simulator/mingw.ld
0 → 100644
浏览文件 @
9ccdf417
/* Default linker script, for normal executables */
OUTPUT_FORMAT(pei-i386)
SEARCH_DIR("/usr/local/mingw32/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
SECTIONS
{
/* Make the virtual address and file offset synced if the alignment is
lower than the target page size. */
. = SIZEOF_HEADERS;
. = ALIGN(__section_alignment__);
.text __image_base__ + ( __section_alignment__ < 0x1000 ? . : __section_alignment__ ) :
{
*(.init)
*(.text)
*(SORT(.text$*))
*(.glue_7t)
*(.glue_7)
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0);
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0);
*(.fini)
/* ??? Why is .gcc_exc here? */
*(.gcc_exc)
PROVIDE (etext = .);
*(.gcc_except_table)
}
/* setction information for finsh shell begin */
. = ALIGN(__section_alignment__);
FSymTab () :
{
___fsymtab_start = .; __fsymtab_start = .;
KEEP(*(FSymTab))
___fsymtab_end = .; __fsymtab_end = .;
}
. = ALIGN(__section_alignment__);
VSymTab () :
{
___vsymtab_start = .; __vsymtab_start = .;
KEEP(*(VSymTab))
___vsymtab_end = .; __vsymtab_end = .;
}
/* setction information for finsh shell end */
/* The Cygwin32 library uses a section to avoid copying certain data
on fork. This used to be named ".data". The linker used
to include this between __data_start__ and __data_end__, but that
breaks building the cygwin32 dll. Instead, we name the section
".data_cygwin_nocopy" and explictly include it after __data_end__. */
.data BLOCK(__section_alignment__) :
{
__data_start__ = . ;
*(.data)
*(.data2)
*(SORT(.data$*))
*(.jcr)
__data_end__ = . ;
*(.data_cygwin_nocopy)
}
.rdata BLOCK(__section_alignment__) :
{
*(.rdata)
*(SORT(.rdata$*))
*(.eh_frame)
___RUNTIME_PSEUDO_RELOC_LIST__ = .;
__RUNTIME_PSEUDO_RELOC_LIST__ = .;
*(.rdata_runtime_pseudo_reloc)
___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
}
.pdata BLOCK(__section_alignment__) :
{
*(.pdata)
}
.bss BLOCK(__section_alignment__) :
{
__bss_start__ = . ;
*(.bss)
*(COMMON)
__bss_end__ = . ;
}
.edata BLOCK(__section_alignment__) :
{
*(.edata)
}
/DISCARD/ :
{
*(.debug$S)
*(.debug$T)
*(.debug$F)
*(.drectve)
}
.idata BLOCK(__section_alignment__) :
{
/* This cannot currently be handled with grouped sections.
See pe.em:sort_sections. */
SORT(*)(.idata$2)
SORT(*)(.idata$3)
/* These zeroes mark the end of the import list. */
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
SORT(*)(.idata$4)
SORT(*)(.idata$5)
SORT(*)(.idata$6)
SORT(*)(.idata$7)
}
.CRT BLOCK(__section_alignment__) :
{
___crt_xc_start__ = . ;
*(SORT(.CRT$XC*)) /* C initialization */
___crt_xc_end__ = . ;
___crt_xi_start__ = . ;
*(SORT(.CRT$XI*)) /* C++ initialization */
___crt_xi_end__ = . ;
___crt_xl_start__ = . ;
*(SORT(.CRT$XL*)) /* TLS callbacks */
/* ___crt_xl_end__ is defined in the TLS Directory support code */
___crt_xp_start__ = . ;
*(SORT(.CRT$XP*)) /* Pre-termination */
___crt_xp_end__ = . ;
___crt_xt_start__ = . ;
*(SORT(.CRT$XT*)) /* Termination */
___crt_xt_end__ = . ;
}
.tls BLOCK(__section_alignment__) :
{
___tls_start__ = . ;
*(.tls)
*(.tls$)
*(SORT(.tls$*))
___tls_end__ = . ;
}
.endjunk BLOCK(__section_alignment__) :
{
/* end is deprecated, don't use it */
PROVIDE (end = .);
PROVIDE ( _end = .);
__end__ = .;
}
.rsrc BLOCK(__section_alignment__) :
{
*(.rsrc)
*(SORT(.rsrc$*))
}
.reloc BLOCK(__section_alignment__) :
{
*(.reloc)
}
.stab BLOCK(__section_alignment__) (NOLOAD) :
{
*(.stab)
}
.stabstr BLOCK(__section_alignment__) (NOLOAD) :
{
*(.stabstr)
}
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section. Unlike other targets that fake this by putting the
section VMA at 0, the PE format will not allow it. */
/* DWARF 1.1 and DWARF 2. */
.debug_aranges BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_aranges)
}
.debug_pubnames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_pubnames)
}
/* DWARF 2. */
.debug_info BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_info) *(.gnu.linkonce.wi.*)
}
.debug_abbrev BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_abbrev)
}
.debug_line BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_line)
}
.debug_frame BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_frame)
}
.debug_str BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_str)
}
.debug_loc BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_loc)
}
.debug_macinfo BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_macinfo)
}
/* SGI/MIPS DWARF 2 extensions. */
.debug_weaknames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_weaknames)
}
.debug_funcnames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_funcnames)
}
.debug_typenames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_typenames)
}
.debug_varnames BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_varnames)
}
/* DWARF 3. */
.debug_ranges BLOCK(__section_alignment__) (NOLOAD) :
{
*(.debug_ranges)
}
}
bsp/simulator/rtconfig.h
浏览文件 @
9ccdf417
...
...
@@ -83,6 +83,7 @@
/* SECTION: Device System */
/* Using Device System */
#define RT_USING_DEVICE
#define RT_USING_DEVICE_IPC
/* #define RT_USING_UART1 */
/* SECTION: Console options */
...
...
@@ -96,9 +97,9 @@
/* SECTION: MTD interface options */
/* using mtd nand flash */
#define RT_USING_MTD_NAND
/* #define RT_USING_MTD_NAND */
/* using mtd nor flash */
#define RT_USING_MTD_NOR
/* #define RT_USING_MTD_NOR */
/* SECTION: finsh, a C-Express shell */
#define RT_USING_FINSH
...
...
@@ -107,7 +108,7 @@
#define FINSH_USING_DESCRIPTION
/* SECTION: device file system */
#define RT_USING_DFS
/* #define RT_USING_DFS */
#define DFS_FILESYSTEM_TYPES_MAX 8
/* DFS: ELM FATFS options */
...
...
@@ -126,7 +127,7 @@
/* #define RT_USING_DFS_NFS */
/* DFS: UFFS nand file system options */
#define RT_USING_DFS_UFFS
/* #define RT_USING_DFS_UFFS */
/* configuration for uffs, more to see dfs_uffs.h and uffs_config.h */
#define RT_CONFIG_UFFS_ECC_MODE UFFS_ECC_HW_AUTO
/* enable this ,you need provide a mark_badblock/check_block function */
...
...
@@ -138,7 +139,7 @@
/* DFS: windows share directory mounted to rt-thread/dfs */
/* only used in bsp/simulator */
#ifdef _WIN32
#define RT_USING_DFS_WINSHAREDIR
//
#define RT_USING_DFS_WINSHAREDIR
#endif
/* the max number of mounted file system */
...
...
@@ -199,7 +200,7 @@
#define RT_LWIP_TCP_WND 8192
/* SECTION: RT-Thread/GUI */
#define RT_USING_RTGUI
/* #define RT_USING_RTGUI */
/* name length of RTGUI object */
#define RTGUI_NAME_MAX 12
...
...
bsp/simulator/rtconfig.py
浏览文件 @
9ccdf417
# toolchains options
ARCH
=
'sim'
#CROSS_TOOL='msvc' or 'gcc' or 'mingw' (mingw is not supported yet!)
CROSS_TOOL
=
'm
svc
'
CROSS_TOOL
=
'm
ingw
'
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path
...
...
@@ -10,11 +10,20 @@ if CROSS_TOOL == 'gcc':
PLATFORM
=
'gcc'
EXEC_PATH
=
'/usr/bin/gcc'
if
CROSS_TOOL
==
'msvc'
:
elif
CROSS_TOOL
==
'mingw'
:
CPU
=
'win32'
PLATFORM
=
'mingw'
EXEC_PATH
=
r
'D:\Program Files\CodeBlocks\MinGW\bin'
elif
CROSS_TOOL
==
'msvc'
:
CPU
=
'win32'
PLATFORM
=
'cl'
EXEC_PATH
=
''
else
:
print
"bad CROSS TOOL!"
exit
(
1
)
BUILD
=
'debug'
#BUILD = ''
...
...
@@ -48,6 +57,35 @@ if PLATFORM == 'gcc':
POST_ACTION
=
''
elif
PLATFORM
==
'mingw'
:
# toolchains
PREFIX
=
''
CC
=
PREFIX
+
'gcc'
AS
=
PREFIX
+
'gcc'
AR
=
PREFIX
+
'ar'
LINK
=
PREFIX
+
'gcc'
TARGET_EXT
=
'exe'
SIZE
=
PREFIX
+
'size'
OBJDUMP
=
PREFIX
+
'objdump'
OBJCPY
=
PREFIX
+
'objcopy'
DEVICE
=
' -ffunction-sections -fdata-sections'
DEVICE
=
' '
CFLAGS
=
' -Wl,--output-def '
AFLAGS
=
' -c'
+
DEVICE
+
' -x assembler-with-cpp'
#LFLAGS = DEVICE + ' -Wl,-Map=rtthread-win32.map -T mingw.ld'
LFLAGS
=
DEVICE
+
' -Wl,-Map=rtthread-win32.map --gc-sections,--whole-archive -T mingw.ld '
CPATH
=
''
LPATH
=
''
if
BUILD
==
'debug'
:
CFLAGS
+=
' -g -O0 -gdwarf-2'
AFLAGS
+=
' -gdwarf-2'
else
:
CFLAGS
+=
' -O2'
POST_ACTION
=
''
elif
PLATFORM
==
'cl'
:
# toolchains
PREFIX
=
''
...
...
libcpu/SConscript
浏览文件 @
9ccdf417
...
...
@@ -18,6 +18,9 @@ if rtconfig.PLATFORM == 'iar':
if
rtconfig
.
PLATFORM
==
'cl'
:
src
=
Glob
(
path
+
'/*.c'
)
if
rtconfig
.
PLATFORM
==
'mingw'
:
src
=
Glob
(
path
+
'/*.c'
)
CPPPATH
=
[
RTT_ROOT
+
'/libcpu/'
+
rtconfig
.
ARCH
+
'/'
+
rtconfig
.
CPU
,
RTT_ROOT
+
'/libcpu/'
+
rtconfig
.
ARCH
+
'/common'
]
group
=
DefineGroup
(
rtconfig
.
CPU
.
upper
(),
src
,
depend
=
[
''
],
CPPPATH
=
CPPPATH
)
...
...
libcpu/sim/win32/cpu_port.c
浏览文件 @
9ccdf417
...
...
@@ -111,6 +111,7 @@ static DWORD WINAPI ThreadforKeyGet(LPVOID lpParam);
static
void
SetThreadName
(
DWORD
dwThreadID
,
char
*
threadName
)
{
#if defined(_MSC_VER)
THREADNAME_INFO
info
;
info
.
dwType
=
0x1000
;
info
.
szName
=
threadName
;
...
...
@@ -124,6 +125,7 @@ static void SetThreadName(DWORD dwThreadID, char* threadName)
__except
(
EXCEPTION_EXECUTE_HANDLER
)
{
}
#endif
}
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录