我怎样才能建立一个旧的台式机电脑上的小型操作系统? [英] How can I build a small operating system on an old desktop computer?

查看:124
本文介绍了我怎样才能建立一个旧的台式机电脑上的小型操作系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是徒劳的,因为我知道写一个操作系统是无法忍受的复杂(特别是自己的)。

This might be in vain, as I know writing an operating system is unbearably complicated (especially by oneself).


  • 我不希望打造的下一个Linux或Windows。

  • I don't expect to build the next linux, or windows.

我知道这将是可怕的,和越野车,并不会工作,但是这很好。

I know it will be horrible, and buggy, and won't work, but that's fine.

我想写的一切我自己,的组装 C 的和(部分)的 C ++

I want to write everything myself, in Assembly, C, and (some) C++.

这是一个未来的项目,因为我忙的时刻一些其他的事情,并不会立即有时间,但我想我会问,现在,也许我能得到很多答案这一点,它可以建立起来,并成为这种方法(一切我所看到的建筑物参与了MINIX的,使用现有的引导程序,它建立在一个虚拟的引导程序的事情,等等)一个有用的资源。

This is a future project, as I'm busy with some other things at the moment and don't have the time immediately, but I figured I would ask it now, so maybe I could get lots of answers to this, and it could build up and be a useful resource for this kind of approach (everything else I have seen involved building off of minix, using an existing bootloader, building it in a virtual booting program thing, etc).

我想设置我的显示器,键盘和鼠标较早的桌面系统之一,并开始工作的一个的空白的硬盘驱动器。

I want to set up one of my older desktops with a monitor, keyboard and mouse, and start working on a blank hard drive.

我想学习如何写我自己的引导程序(我发现很多关于这个资源,但是对于完整性,请还添加一些不错的),我自己的USB驱动程序(如果必要),光盘驱动器(如果这是必要的),等等一切,从地上爬起来。

I want to learn how to write my own bootloader (I've found lots of resources about this, but for completeness, please still add some good ones), my own USB driver (if that's necessary), a CD driver (if that's necessary), etc. Everything, from the ground up.


  • 我如何把code到电脑上?它是最好用软盘办呢?大多数计算机都可以通过USB记忆棒呢?

  • How do I put the code onto the computer? Is it best to do it with a floppy disk? Can most computers do it from a USB stick?

司机做什么,我需要的,你可以提出任何引用建立这些?

What drivers do I need, and can you suggest any references to building those?

引导顺序后 - 然后呢?我如何进入保护模式等。

After the booting sequence--then what? How do I get into protected mode etc.

我如何管理内存没有操作系统的帮助?难道我只是用我想要的地址?没有初始化必要吗?

How do I manage memory without the help of an operating system? Do I just use whatever addresses I want? No initialization necessary?

什么我会毫无疑问,碰上会混淆我?

What will I undoubtedly run into that will confuse me?

我怎样才能使它一个命令行O / S,和图形界面?

How can I make it either a command line O/S, and a graphical one?

什么是图形化的O / S建?就像,我怎么会做这样的事情,一个命令行,用的字体,并在顶部的照片吗?

What is a graphical O/S built on? Like, how would I do something like, a command line, with a font, and a picture at the top?

我在哪里可以阅读有关建立一个多任务环境? (即,具有运行并排侧的两个图形般的命令行)。

Where can I read about setting up a multitasking environment? (ie., having two graphical-like command lines running side-by-side).

我将如何建立一种窗口系统的?如何显示一次简单的多任务设置在屏幕上的图形?

How would I set up a sort of windowing system? How do I display graphics on the screen once simple multitasking is set up?

相信我,我明白,这是一个的非常的复杂的工程,我可能永远不会真正地在完成它,或者在其上写任何使用任何东西。

Believe me, I understand that this is a very complicated project, and I probably will never get around to completing it or writing anything on it of any use.

有很多件等这个我没有提到,如果你想到的任何,随意添加那些过于

There are lots of other pieces to this I haven't mentioned, if you think of any, feel free to add those too.

请放置一个主题每个答案 - 例如,USB驱动程序,然后可能的资源,事情的清单看出来的,等等。

Please put one "topic" per answer--for example, USB drivers, and then maybe a list of resources, things to look out for, etc.

另外,请不建议构建了另一个O / S或pre-现有code的。我知道我会的阅读的很多pre-现有code(如Linux内核,或者例如资源,现有的驱动程序等),但最终我想要做的所有文字我。我知道我的的蓄客别的东西,还有很多其他问题上的SO有关,如果我改变了主意,走这条路,我可以阅读。但是这一次是所有关于从头开始做这件事。

Also, please don't suggest building off of another O/S or pre-existing code. I know I will read a lot of pre-existing code (such as the linux kernel, or example resources, existing drivers, etc) but ultimately I want to do all the writing myself. I know I should build off of something else, and there are lots of other questions on SO about that that I can read if I change my mind and go that route. But this one is all about doing the whole thing from scratch.

我有很多伟大的答案这一点,主要是关于引导过程,文件系统和现有的各种项目,以阅读参考。

I've got lots of great answers to this, mostly about the booting process, file systems and various existing projects to read for reference.

这是如何得到它的图形有什么建议?不同的视频模式,以及如何与他们合作,等等?

Any suggestions on how to get it graphical? Different video modes and how to work with them, etc?

推荐答案

首要的事情。读,读,读,读,读。你需要有操作系统的工作原理,然后才能希望实现自己的一个坚定的认识。

First things first. Read, read, read, read, read. You need to have a firm understanding of how the OS works before you can hope to implement your own.

抢的Andr​​ew Tanenbaum的对操作系统的书籍之一。这是我们在我的OS类中使用在大学之一:

Grab one of Andrew Tanenbaum's books on operating systems. This is the one we used in my OS class in college:

亚马逊现代操作系统

尽管荒谬的封面,这是一个梦幻般的阅读,尤其是对一本教科书。 Tanenbaum的是一个真正的专家在这方面和他的OS是如何工作的引擎盖下面的解释是明确的,容易理解。这本书主要是理论,但我相信他也有一本书,讨论更多的实施。我从来没有读过它,虽然,所以我不能对此发表评论。

Despite the ridiculous cover, it's a fantastic read, especially for a textbook. Tanenbaum is really an expert in this area and his explanations of how the OS works underneath the hood are clear and easy to understand. This book is mostly theory, but I believe he also has a book that discusses more of the implementation. I've never read it, though, so I can't comment on it.

这应该可以帮助您钻研进程管理,内存管理,文件系统,以及其他一切你的操作系统内核需要做的就是它最多可启动状态。从它那点基本上你需要支持的硬件编写设备驱动程序,并提供的C库函数的实现做出的东西像打开文件和设备,阅读和写作,流程之间传递消息等内核调用的问题

That should help you bone up on process management, memory management, filesystems, and everything else your OS kernel needs to do to get it up to a bootable state. From that point on it's basically a matter of writing device drivers for the hardware you need to support, and offering implementations of the C library functions to make kernel calls for things like opening files and devices, reading and writing, passing messages between processes, etc.

在x86汇编阅读了(假设你正在设计本作在x86机器)。这应该回答很多你的问题与问候处理器的运行模式之间移动。

Read up on x86 assembly (assuming you are designing this for an x86 machine). That should answer a lot of your questions with regards to moving between processor operating modes.

如果您有任何电子产品的知识,它可能更容易开始编写操作系统对于具有大量文档的嵌入式设备,因为它通常比一个x86 PC简单。我一直想写我自己的操作系统,以及,我开始写一个微内核嵌入式操作系统的的从Digilent的这个开发板。它可以运行赛灵思,里面有非常完整的文档软核MicroBlaze处理器。它也得到了一些RAM,闪存数据存储,LED,开关,按钮,VGA输出等东西用大量编写简单的驱动戏耍。

If you've got any electronics knowledge, it may be easier to start with writing an operating system for an embedded device that has ample documentation, because it will generally be simpler than an x86 PC. I've always wanted to write my own OS as well, and I'm starting with writing a microkernel embedded OS for this development board from Digilent. It can run the soft-core MicroBlaze processor from Xilinx, which has very thorough documentation. It's also got some RAM, flash data storage, LEDs, switches, buttons, VGA output, etc. Plenty of stuff to play around with writing simple drivers for.

一个的嵌入式设备的益处也是可能能够避免写一个VGA驱动很长一段时间。在我的情况下,Digilent的开发板板载UART,这样我就可以有效地利用串行输出作为我的控制台得到了整个事情了,并启动以最小做文章的命令行。

One of the benefits of an embedded device is also that you may be able to avoid writing a VGA driver for a long time. In my case, the Digilent development board has an onboard UART, so I can effectively use the serial output as my console to get the whole thing up and booting to a command line with minimal fuss.

只要确保无论你选择的目标有一个现成的,经过严格测试的编译器吧。你做的不可以希望被写在同一时间的操作系统和编译器。

Just make sure that whatever you choose to target has a readily available and well-tested compiler for it. You do not want to be writing an OS and a compiler at the same time.

这篇关于我怎样才能建立一个旧的台式机电脑上的小型操作系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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