'你好世界'操作系统 [英] 'hello world' OS

查看:152
本文介绍了'你好世界'操作系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想知道操作系统如何启动计算机。

为此,作为一个开始,我想看一个e_ample(读取

下划线作为y之前的字母,因为这里的键盘是

有缺陷)C程序(以及如何编译的说明

和usae it)将在计算机启动时接管并打印你好世界。当''enter''按下
时重新启动机器。这将是一个你好世界的东西。操作系统(对我来说)

(我已经尝试通过boot.S(不确定名称)

程序在Linu_内核源代码中,但我不能理解

因为我不熟悉汇编语言。)


如果有人可以请我点右边我会很高兴

方向。


问候,

Santanu

Hello all,

I would like to know how an OS makes a computer boot up.
For that, as a start I would like to see an e_ample (read the
underscore as the letter before y, as the keyboard here is
defective) C program (along with instructions on how to compile
and usae it) that will take over when the computer boots and
print "hello world" and reboots the machine when ''enter'' is
pressed. This will be something of a "hello world" OS (for me)
(I have tried to go through the boot.S (not sure about the name)
program in the Linu_ kernel source, but I could not understand
it since I am not familiar with assembly language).

I would be glad if someone could please point me in the right
direction.

Regards,
Santanu

推荐答案

Santanu Chatterjee写道:
Santanu Chatterjee wrote:
大家好,

我想知道一个操作系统是如何启动计算机的。
为此,作为一个开始,我想看一个e_ample(在y之前读取
下划线作为字母,因为这里的键盘是有缺陷的)C程序(以及如何编译
和usae它的说明)将接管当电脑启动并打印hello world时
按下Enter后重新启动机器。这将是一个你好世界的东西。操作系统(对我来说)
(我已经尝试通过Linu_内核源代码中的boot.S(不确定名称)
程序,但我无法理解
它因为我我不熟悉汇编语言。

如果有人能指出我正确的方向,我会很高兴。
Hello all,

I would like to know how an OS makes a computer boot up.
For that, as a start I would like to see an e_ample (read the
underscore as the letter before y, as the keyboard here is
defective) C program (along with instructions on how to compile
and usae it) that will take over when the computer boots and
print "hello world" and reboots the machine when ''enter'' is
pressed. This will be something of a "hello world" OS (for me)
(I have tried to go through the boot.S (not sure about the name)
program in the Linu_ kernel source, but I could not understand
it since I am not familiar with assembly language).

I would be glad if someone could please point me in the right
direction.




这是一个等待''x'的程序。使用任何其他输入

这样的程序是危险的而不是标准的C.


#include< stdio.h>


int main(无效)

{

printf(" hello world \ n");

while( getchar()!=''y'' - 1)

{

}

}


HTH


案例



Here''s a program that waits for an ''x''. Using any other input
for a program like this is dangerous and not standard C.

#include <stdio.h>

int main(void)
{
printf("hello world\n");
while (getchar() != ''y'' - 1)
{
}
}

HTH

Case


sa ***** @softthome.net (Santanu Chatterjee)写道:
sa*****@softhome.net (Santanu Chatterjee) wrote:
我想知道操作系统是如何启动计算机的。
I would like to know how an OS makes a computer boot up.




它没有。 ROM引导加载程序。 _How_它确实这是

完全取决于系统,所以你应该在一个专门用于你感兴趣的架构的
新闻组中询问它。有

没有C程序可以证明这个超过一个

架构,对于大多数你需要低级系统调用,因为

更高ISO C使用的级别功能取决于你想要更换的操作系统



Richard



It doesn''t. The ROM bootstrap loader does. _How_ it does this is
completely system-dependent, and therefore you should ask about it in a
newsgroup dedicated to the architecture you are interested in. There is
no C program which can demonstrate this for more than a single
architecture, and for most you will need low-level system calls, since
the higher level functions used by ISO C are dependent on the very OS
you want to replace.

Richard


Case< no@no.no>写道:
Case <no@no.no> wrote:
Santanu Chatterjee写道:
Santanu Chatterjee wrote:
我想知道操作系统如何启动计算机。
I would like to know how an OS makes a computer boot up.


Here'是一个等待''x'的程序。对这样的程序使用任何其他输入
是危险的而不是标准C.
#include< stdio.h>

int main(void)
{
printf(hello world \ n);
while(getchar()!=''y'' - 1)
{
}
}

Here''s a program that waits for an ''x''. Using any other input
for a program like this is dangerous and not standard C.
#include <stdio.h>

int main(void)
{
printf("hello world\n");
while (getchar() != ''y'' - 1)
{
}
}




漂亮。这个问题不仅没有任何关系,

甚至是错误的。 (提示:是什么让你认为ISO C标准

要求ASCII?)


Richard



Beautiful. Not only has it nothing whatsoever to do with the question,
it is even wrong. (Hint: what makes you think the ISO C Standard
mandates ASCII?)

Richard


这篇关于'你好世界'操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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