标准C库在独立系统中起作用 [英] Standard C library functions in freestanding systems

查看:92
本文介绍了标准C库在独立系统中起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

包含允许进程的库函数

Mlaunch,forking和termination,意味着它们都是b / b $ b可能并且需要一个进程来分叉。这是一个Unix思想过程的基本部分,但是

对于正常运行的操作系统来说,这是必不可少的。


有没有标准C库函数用于进程分叉或

覆盖。 fork()和execve()函数是与POSIX绑定的C

语言的一部分。它们不是标准C

库的一部分。


MWhy用户是否可以访问内存映射,

Mallocation和解除分配程序? [...]


同样,mmap()不是标准C库函数。


MWhat我想说的不是这些事情是对的

莫错了,但是执行了这些函数,

因此这个库,预先假设操作系统会工作

最小的Unix方式。


你在论证中犯的错误是它完全是

循环。您正在从POSIX C语言绑定中获取函数

并且认为它们预先设想类似Unix的操作系统。

当然他们做的。 POSIX是类似Unix的操作
系统的_definition_。但是,你不能根据_Standard C Library_中的

函数做出这样的论证。标准C库确实没有预先假设或强制使用类Unix操作系统。

的确,C或C ++语言的独立实现不是

预先假设操作系统。


Mmy点基本上是C库定义操作系统的API。

这个

强制操作系统拥有该API,这留下很少的余地



操作系统设计师偏离另一个UNIX克隆。 />

如上所述,这一点是错误的。赫德和计划9的存在证明其不正确性,以及用C和C ++语言编写的许多嵌入式
系统。

MThe library functions which are included to allow process
Mlaunch, forking, and termination, imply that it is both
Mpossible and desirable for a process to fork itself. This is
Ma fundamental part of the Unix thought process, but is
Mnot essential for a working OS.

There are no Standard C Library functions for process forking or
overlaying. The fork() and execve() functions are part of the C
language bindings to POSIX. They are not parts of the Standard C
Library.

MWhy should the user have access to memory mapping,
Mallocation and de-allocation routines? [...]

Similarly, mmap() is not a Standard C Library function.

MWhat I am trying to say is not that these things are right
Mor wrong, but that the implementation of the functions,
Mand thus the library, pre-supposes that the OS will work
Min the Unix manner.

The error that you are making in your argument is that it is entirely
circular. You are taking functions from the POSIX C language bindings
and arguing that they pre-suppose a Unix-like operating system. Of
course they do. POSIX is the _definition_ of a Unix-like operating
system. However, you cannot make such an argument based upon
functions from the _Standard C Library_. The Standard C Library does
not either pre-suppose or mandate a Unix-like operating system.
Indeed, freestanding implementations of the C or C++ languages do not
pre-suppose operating systems at all.

Mmy point is basically that the C library defines the API of the OS.
This
Mforces the OS to have that API, and this leaves very little leeway
for
Mthe OS designer to deviate from another UNIX clone.

That point is wrong, as explained above. The Hurd and Plan 9 are
existence proofs of its incorrectness, as are the many embedded
systems written in the C and C++ languages.

推荐答案



" J de Boyne Pollard" < j。************** @ tesco.netwrote in message

news:11 *************** *******@o80g2000hse.googlegr oups.com ...

"J de Boyne Pollard" <j.**************@tesco.netwrote in message
news:11**********************@o80g2000hse.googlegr oups.com...

标准C库确实

不是预先假设或强制使用类似Unix的操作系统。

的确,C或C ++语言的独立实现并没有预先考虑操作系统。
The Standard C Library does
not either pre-suppose or mandate a Unix-like operating system.
Indeed, freestanding implementations of the C or C++ languages do not
pre-suppose operating systems at all.



这正是马特的观点,如果你一直在阅读剩下的

aod线程...你的回答似乎与上下文无关。


他回复你的帖子,纠正你,但放弃了comp.lang.c和
$ b来自回复的$ b comp.std.misc。


我们正在讨论试图为应用程序编写应用程序的b / b
应用程序程序员的哲学,实际问题和局限性一个完整的现货操作系统,只有C而不是C,而操作系统特定的库可能包括标准C库,POSIX库,其他操作系统功能,或者
功能相当于那些。

Rod Pemberton

That was exactly Matt''s point, if you had been reading the rest of the
a.o.d. thread... Your response seems to be without regard to the context.

He replied to your post, correcting you, but dropped comp.lang.c and
comp.std.misc from the reply.

We were discussing the philosophical, practical issues, and limitations of
application programmers attempting to write applications for a complete
modern OS with C only versus C with the an OS specific library which might
include the standard C library, POSIX library, other OS functionality, or
functionality equivalent to those.
Rod Pemberton




" J de Boyne Pollard < j。************** @ tesco.netwrote in message

news:11 *************** *******@o80g2000hse.googlegr oups.com ...

"J de Boyne Pollard" <j.**************@tesco.netwrote in message
news:11**********************@o80g2000hse.googlegr oups.com...

包含的库函数允许进程

Mlaunch,分叉和终止,意味着它既是可靠的,也是一个可以自行分叉的过程。这是一个Unix思想过程的基本部分,但是

对于正常运行的操作系统来说,这是必不可少的。


有没有标准C库函数用于进程分叉或

覆盖。 fork()和execve()函数是与POSIX绑定的C

语言的一部分。它们不是标准C

库的一部分。
MThe library functions which are included to allow process
Mlaunch, forking, and termination, imply that it is both
Mpossible and desirable for a process to fork itself. This is
Ma fundamental part of the Unix thought process, but is
Mnot essential for a working OS.

There are no Standard C Library functions for process forking or
overlaying. The fork() and execve() functions are part of the C
language bindings to POSIX. They are not parts of the Standard C
Library.



我们正在讨论在OS开发中使用它们。 Matt说没有任何地方说他们是C库的一部分。关于OP的原始帖子,

这些将是作为DLL实现的操作系统特定库的一部分。该DLL

可能包含所有标准C库,可能包含所有POSIX

库,并且可能包含各种特定于操作系统的功能,或者可能不包含。 />
没有提到OP的操作系统DLL的

开发中包含或不包含的内容和范围。这些边界是讨论的


We were discussing the use of these in OS development. Nowhere did Matt say
they were part of the C library. In regards to the OP''s original post,
these would be part of a OS specific library implemented as a DLL. That DLL
may include all of the standard C library, may include all of the POSIX
libraries, and may include various OS specific functionality, or it may not.
The boundaries and scope of what was or wasn''t to be included in the
development of the OP''s OS DLL wasn''t mentioned. Those boundaries were
under discussion.


MWhy应该用户是否可以访问内存映射,

Mallocation和解除分配程序? [...]


同样,mmap()不是标准C库函数。
MWhy should the user have access to memory mapping,
Mallocation and de-allocation routines? [...]

Similarly, mmap() is not a Standard C Library function.



它是'确实,mmap不是C库的一部分,但是你的响应是什么?b $ b与控制各种形式的用户内存访问的操作系统有什么关系呢?操作系统

开发环境完全丢失...

It''s true that mmap isn''t part of the C library, but what does your response
have to do with an OS controlling various forms of user memory access? OS
development context lost completely...


MWhat我想说的不是这些事情是对的

Mor错了,但是那个函数的实现,因此这个函数库是
Mand,预先假设操作系统会工作

最小的Unix方式。 />

您在论证中所犯的错误是它完全是

循环。
MWhat I am trying to say is not that these things are right
Mor wrong, but that the implementation of the functions,
Mand thus the library, pre-supposes that the OS will work
Min the Unix manner.

The error that you are making in your argument is that it is entirely
circular.



不,这与手头的谈话毫无关系。他说他不希望POSIX或C库影响他的操作系统的设计。

他说在他的操作系统中使用它们实际上会迫使他继承

他们设计背后的一些概念 - 其中大部分是由于UNIX,

,例如分层文件系统以及用于访问的功能或API
文件系统。

No, this has nothing to do with the conversation at hand. He was stating
that he didn''t want POSIX or C libraries to influence the design of his OS.
He stated that using them in his OS would essentially force him to inherit
some of the concepts behind their design - most of which were due to UNIX,
such as a hierarchical filesystem and the functions or API used to access
the filesystem.


您正在从POSIX C语言绑定中获取函数

并争辩说他们预先假设一个类Unix操作系统。

当然他们做的。 POSIX是类似Unix的操作
系统的_definition_。
You are taking functions from the POSIX C language bindings
and arguing that they pre-suppose a Unix-like operating system. Of
course they do. POSIX is the _definition_ of a Unix-like operating
system.



不,UNIX是类Unix操作系统的_definition_ ... POSIX是_b $ b定义_portable_类Unix操作系统。

No, UNIX is the _definition_ of a Unix-like operating system... POSIX is
the definition of a _portable_ Unix-like operating system.


但是,你不能根据_Standard C Library_中的

函数做出这样的论证。标准C库确实没有预先假设或强制使用类Unix操作系统。

的确,C或C ++语言的独立实现不是

预先假设操作系统。
However, you cannot make such an argument based upon
functions from the _Standard C Library_. The Standard C Library does
not either pre-suppose or mandate a Unix-like operating system.
Indeed, freestanding implementations of the C or C++ languages do not
pre-suppose operating systems at all.



他不是。你刚刚从之前的帖子中重申了他的观点。但是,他还要求b $ b想要先进。他的操作系统中的功能如:

"文件I / O,目录管理,(非自动)内存管理,系统

时钟,流程执行,环境和信号(C中断)。这个

功能不是C语言的一部分。它是C库的一部分。

(引用自己......)

He wasn''t. You just restated his point from prior posts. But, he also
wants "advanced" features in his OS such as:
"file I/O, directory management, (non-automatic) memory management, system
clock, process execution, environment, and signals (C interrupts). This
functionality isn''t part of the C language. It''s part of the C library."
(quoting myself...)


Mmy点基本上就是C库定义了操作系统的API。

这个

强制操作系统拥有该API,这留下很少的余地

for

操作系统设计师偏离另一个UNIX克隆。


如上所述,这一点是错误的。赫德和计划9是存在不正确性的证据,就像用C和C ++语言编写的许多嵌入式系统一样。
Mmy point is basically that the C library defines the API of the OS.
This
Mforces the OS to have that API, and this leaves very little leeway
for
Mthe OS designer to deviate from another UNIX clone.

That point is wrong, as explained above. The Hurd and Plan 9 are
existence proofs of its incorrectness, as are the many embedded
systems written in the C and C++ languages.



首先,我不是在谈论嵌入式系统。我在谈论操作系统

足够先进,可以编写应用程序。 我的假设是

,如果有人在为自己的操作系统编写应用程序,那么他的操作系统是运行在功能强大的东西上,以便为其编写应用程序,

说一台PC或1U路由器,而不是功能强大的东西,比如一个Lego

Robot或1U数字效果处理器。任何比PC强大的东西都不会比单个主程序运行更多。 (引用自己......是的,我

知道有小设备可以做。请不要发布示例。)


其次,我已经提出隐藏在现有API背后实现不同操作系统概念的复杂性的问题。 问题

是:''新范式是否足够复杂,以至于不能轻易隐藏

落后于旧范式的功能?'' ; (引用自己......)Matt还没有在这里提供他的想法。

如果你读过帖子,...

Rod Pemberton

First, I wasn''t talking about embedded systems. I was talking about OSes
sufficiently advanced that applications can be written. "My assumption was
that if someone was writing an application for his OS, that his OS is
running on something powerful enough to have applications written for it,
say a PC or 1U router, and not on something far less powerful, say a Lego
Robot or a 1U digital effects processor. Anything less powerful than a PC
rarely runs more than a single master program." (quoting myself... Yes, I
know there are small devices which do. Please don''t post examples.)

Second, I already brought up the issue of hiding the complexity of
implementing different OS concepts behind an existing API. "The question
is: ''Is the new paradigm sufficiently complex that it can''t be easily hidden
behind the functions of the old paradigm?''" (quoting myself...) Matt has
yet to provide his thoughts here.
If you''d read the thread,...
Rod Pemberton


Rod Pemberton写道:
Rod Pemberton wrote:

我们正在讨论哲学,

实际问题和限制

应用程序程序员试图用
为完整的现代操作系统编写应用程序

with C只针对具有操作系统特定库的C

,其中可能包括标准C库,
POSIX库,其他操作系统功能或

功能相当于那些。
We were discussing the philosophical,
practical issues, and limitations of
application programmers attempting to
write applications for a complete modern OS
with C only versus C with the an OS specific library
which might include the standard C library,
POSIX library, other OS functionality, or
functionality equivalent to those.



我用便携式独立式C代码写了一些数学函数。

http://www.mindspring.com/~pfilandr/C/fs_math/


-

pete

I wrote some math functions in portable freestanding C code.

http://www.mindspring.com/~pfilandr/C/fs_math/

--
pete


这篇关于标准C库在独立系统中起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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