嵌入式系统插件的C或C ++? [英] C or C++ for embedded system plug-in?

查看:67
本文介绍了嵌入式系统插件的C或C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为嵌入式系统生产一款软件,一般基于电信运行,主要是在ARM处理器上运行,但我不能保证

,当然。


我的软件应该与其他软件配合使用,这些软件一般用C或C ++编写(偶尔用ADA甚至汇编程序)。


我认为C编译器的处理器比C ++略多一些,但是,实际上,我不确定它是否会成为一个主要的

的差异。


我认为C会产生稍微小一点的代码,但是如果它产生重大影响,我想知道它们是不是b $ b。


我喜欢C ++异常处理(但知道6它增加了开销)。我有一个明确定义的接口和接口软件将获得

没有真正通过实例化任何类,如果我使用C ++


我想要泛化主机软件应该提供的功能,以便我可以使用他们的内存分配例程,定时器,

调试跟踪等等 - 可能只是通过提供一些#defines,

,他们可以根据需要在单个头文件中更改 - 但欢迎任何

建议。


我认为我倾向于C,但我愿意接受输入...


提前感谢您的帮助。

I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can''t guarantee
that, of course.

My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).

I suppose that there are C compilers for marginally more processors
than C++, but, realistically, I am not sure that it makes a major
difference.

I suppose that C produces slightly smaller and faster code, but wonder
if it makes a major difference.

I like C++ exception handling (but know 6that it adds an overhead). I
have clearly defined interfaces and interfacing software would gain
nothing really by instantiating any classes, if I used C++

I want to genericize functionality which the host software ought to
provide, so that I can use their memory allocation routines, timers,
debug tracing, etc, etc - probably just by offering some #defines,
which they can change in a single header file, as necessary - but any
advice is welcome.

I think that I am leaning towards C, but am open to input ...

Thanks in advance for any help.

推荐答案

Baron Samedi写道:
Baron Samedi wrote:

我想为嵌入式系统制作一个软件,一般来说

基于电信,主要运行在ARM处理器上,但我当然不能保证



我的软件应该与其他一般用

的软件用C或C ++编写(偶尔用ADA甚至汇编程序)。
I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can''t guarantee
that, of course.
My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).



在大多数情况下,你只需要一种方法来提供C

链接和调用约定的功能,以便能够给他打电话来自另一个

语言。大多数语言实现都提供了这样做的方法,然后你就可以根据其他要求或偏好选择使用哪种语言。


-

Salu2

In the majority of cases you just need a way to provide functions with C
linkage and calling conventions, to be able to call him from another
languages. Most language implementations provide ways to do that, then you
can choose what language to use based in other requirements or preferences.

--
Salu2




Baron Samedi写道:

Baron Samedi wrote:

我想要为嵌入式系统生产一个软件,通常基于电信运行,主要是在ARM处理器上运行,但我当然不能保证这是一个很好的商品。


我的软件应该和其他软件一起工作,这些软件通常用C或C ++编写(偶尔用ADA甚至汇编程序)。


我认为C编译器的处理器比C ++略多一些,但是,实际上,我不确定它是否会产生一个主要的b
差异。


我想C会产生更小更快的代码,但是如果它产生重大影响的话,我会想知道它们是多少。


我喜欢C ++ ex ception处理(但知道6它增加了开销)。我有一个明确定义的接口和接口软件将获得

没有真正通过实例化任何类,如果我使用C ++


我想要泛化主机软件应该提供的功能,以便我可以使用他们的内存分配例程,定时器,

调试跟踪等等 - 可能只是通过提供一些#defines,

,他们可以根据需要在单个头文件中更改 - 但欢迎任何

建议。


我认为我倾向于C,但我愿意接受输入...


提前感谢您的帮助。
I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can''t guarantee
that, of course.

My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).

I suppose that there are C compilers for marginally more processors
than C++, but, realistically, I am not sure that it makes a major
difference.

I suppose that C produces slightly smaller and faster code, but wonder
if it makes a major difference.

I like C++ exception handling (but know 6that it adds an overhead). I
have clearly defined interfaces and interfacing software would gain
nothing really by instantiating any classes, if I used C++

I want to genericize functionality which the host software ought to
provide, so that I can use their memory allocation routines, timers,
debug tracing, etc, etc - probably just by offering some #defines,
which they can change in a single header file, as necessary - but any
advice is welcome.

I think that I am leaning towards C, but am open to input ...

Thanks in advance for any help.



我在一家大型网络公司的嵌入式系统上工作。我工作在UMTS& GPRS GSN节点。我们的各种GSN节点不同

在实现中我们的SGSN是用C ++编写的(但是编译器是非常老的,而且有些功能因为某种原因而被禁用)

和我们的GGSN是用C语言编写的,主要是因为我们继承了很多用C编写的基础路径,服务和用户管理代码。虽然我是
就像在我们的GGSN上工作一样,主要是为了IP服务开发,我敦促你们......如果你正在开始一个项目并且有一个选择..使用C ++ ....没有

你的意图有多好,使用C是维护

噩梦。更不用说可扩展性和代码重用将显着地取决于你的项目的大小
。有些代码可能仍然需要用汇编语言或C语言编写(即任何特殊硬件

,如同快速以太网线卡可能仍需要
由于性能原因而在程序集中编程



至于C与C ++相比的性能,我主要看到的是

容量问题交易更多与系统的设计。而C ++

提供的绳索比C更少。

I work on embedded systems for a large networking company. I work in
the packet core on UMTS & GPRS GSN nodes. Our various GSN nodes differ
in implementation our SGSN was written in C++ (however the compiler is
very old and some of the features were disabled for whatever reason)
and our GGSN was written in C, mainly since we inherited a lot of base
routing, service and subscriber managment code written in C. Although I
like working on our GGSN, mostly for the IP Service development, I urge
you... if you are starting a project and have a choice.. use C++.... no
matter how good your intentions are, using C is a maintainence
nightmare. Not to mention extensibility and code reuse will suffer
dramatically depending on the size of your project. Some code may still
be needed to be written in Assembly or C (i.e. any special hardware
like a fast ethernet line card would probably still need to be
programmed in assembly for performance reasons).

As for performance in C compared with C++, what I mainly seen are the
capacity issues deal more with the design of the system. And C++
provides less rope to hang yourself with than C.


bjeremy写道:
bjeremy wrote:

Baron Samedi写道:
Baron Samedi wrote:

我想为嵌入式系统制作一个软件,一般来说

telecoms基于,主要在ARM处理器上运行,但我当然不能保证




我的软件应该与其他软件配合使用通常

用C或C ++编写(偶尔在ADA或甚至汇编程序中)。


我认为有C编译器可以处理更多的处理器
比C ++,但实际上,我不确定它是否会产生一个主要的
差异。


我认为C产生的略小和更快的代码,但不知道

如果它有重大区别。


我喜欢C ++异常处理(但知道6它增加了一个ove rhead)。我有一个明确定义的接口和接口软件将获得

没有真正通过实例化任何类,如果我使用C ++


我想要泛化主机软件应该提供的功能,以便我可以使用他们的内存分配例程,定时器,

调试跟踪等等 - 可能只是通过提供一些#defines,

,他们可以根据需要在单个头文件中更改 - 但欢迎任何

建议。


我认为我倾向于C,但我愿意接受输入...


提前感谢您的帮助。
I want to produce a piece of software for embedded systems, generally
telecoms based, mostly running on ARM processors, but I can''t guarantee
that, of course.

My software should work along with other software which will generally
be written in C or C++ (occasionally in ADA or even assembler).

I suppose that there are C compilers for marginally more processors
than C++, but, realistically, I am not sure that it makes a major
difference.

I suppose that C produces slightly smaller and faster code, but wonder
if it makes a major difference.

I like C++ exception handling (but know 6that it adds an overhead). I
have clearly defined interfaces and interfacing software would gain
nothing really by instantiating any classes, if I used C++

I want to genericize functionality which the host software ought to
provide, so that I can use their memory allocation routines, timers,
debug tracing, etc, etc - probably just by offering some #defines,
which they can change in a single header file, as necessary - but any
advice is welcome.

I think that I am leaning towards C, but am open to input ...

Thanks in advance for any help.



我在一家大型网络公司的嵌入式系统上工作。我工作在UMTS& GPRS GSN节点。我们的各种GSN节点不同

在实现中我们的SGSN是用C ++编写的(但是编译器是非常老的,而且有些功能因为某种原因而被禁用)

和我们的GGSN是用C语言编写的,主要是因为我们继承了很多用C编写的基础路径,服务和用户管理代码。虽然我是
就像在我们的GGSN上工作一样,主要是为了IP服务开发,我敦促你们......如果你正在开始一个项目并且有一个选择..使用C ++ ....没有

你的意图有多好,使用C是维护

噩梦。更不用说可扩展性和代码重用将显着地取决于你的项目的大小
。有些代码可能仍然需要用汇编语言或C语言编写(即任何特殊硬件

,如同快速以太网线卡可能仍需要
由于性能原因而在程序集中编程



至于C与C ++相比的性能,我主要看到的是

容量问题交易更多与系统的设计。而C ++

提供的绳索比C更少。


I work on embedded systems for a large networking company. I work in
the packet core on UMTS & GPRS GSN nodes. Our various GSN nodes differ
in implementation our SGSN was written in C++ (however the compiler is
very old and some of the features were disabled for whatever reason)
and our GGSN was written in C, mainly since we inherited a lot of base
routing, service and subscriber managment code written in C. Although I
like working on our GGSN, mostly for the IP Service development, I urge
you... if you are starting a project and have a choice.. use C++.... no
matter how good your intentions are, using C is a maintainence
nightmare. Not to mention extensibility and code reuse will suffer
dramatically depending on the size of your project. Some code may still
be needed to be written in Assembly or C (i.e. any special hardware
like a fast ethernet line card would probably still need to be
programmed in assembly for performance reasons).

As for performance in C compared with C++, what I mainly seen are the
capacity issues deal more with the design of the system. And C++
provides less rope to hang yourself with than C.



感谢您的回复(也很快)。


基本上,我想为协议栈上方的

手机/调制解调器/终端适配器提供一个通用适配层

(AS / NAS,第1层至第3层)并在一侧提供24.007接口,并为不同设备驱动程序(USB,以太网等)提供

通用接口,

可能出现作为虚拟串口。


代码可能不会被最终用户扩展,我也看不到

他们实例化任何对象,但我喜欢C ++。


正如我所说,双方都会有固定的接口,CCITT / ETSI / 3GPP定义了一个b $ b和b其他抽象设备驱动程序,所以

可能是虚拟串口。用户只需要调整一些宏来确定我的软件如何分配内存,执行调试跟踪,

处理定时器等。


你当然给了我深思。谢谢。


Thanks for the great reply (and quick too).

Basically, I want to have a common adaptation layer for
handsets/modems/terminal adapters which sits above the protocol stack
(AS/NAS, Layers 1 to 3) and offers a 24.007 interface at one side and a
generic interface to different device drivers (USB, Ethernet, etc),
probably appearing as a virtual serial port.

The code probably won''t be extensible by the end user, and I don''t see
them instantiating any objects, but I do like C++.

As I stated, there will be fixed interfaces on both sides, one defined
by CCITT/ETSI/3GPP and the other abstracting device drivers, so
probably Virtual Serial Port. Users only get to tweak a few macros to
determine how my software allocates memory, performs debug tracing,
handles timers and the like.

You have certainly given me food for thought. Thanks.


这篇关于嵌入式系统插件的C或C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆