| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3362 人关注过本帖
标题:Linux 0.11
只看楼主 加入收藏
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
以下是引用信箱有效在2012-10-1 21:05:03的发言:

胖丁所言好象很有道理,我前天看了这个帖子,也有这个感觉。

前段时间看深入解析windows操作系统,在内存管理这块也基本上是这样实现的。
这部分感觉是linux比win先进。 win64上才和linux一样。

欢迎提供具体细节

The quieter you become, the more you can hear
2012-10-01 20:30
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
如果不开启分页,下面一图让人豁然开朗,物理地址是从segment descriptor中可以定位的
图片附件: 游客没有浏览图片的权限,请 登录注册

The quieter you become, the more you can hear
2012-10-01 23:32
pangding
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:北京
等 级:贵宾
威 望:94
帖 子:6784
专家分:16751
注 册:2008-12-20
收藏
得分:0 
以下是引用madfrogme在2012-10-1 19:55:49的发言:

 
版主所言极是, 0.11内核好像无法在80286上运行,至少要是80386,不知道GDT这个东西,随着intel CPU ,比如 386 ,486, 奔腾,这样升级,是不是GDT也会有一些变化
没变化,随着升级顶多多加一点功能(升级的都是矢量运算,多媒硬解码之类的功能吧,我也不是很懂这方面的)。没点向下兼容能力 intel 还作什么芯片。

最大的变化,应该就是除了实模式以外还有一个保护模式(是这么叫吧,术语我也记不太清了)。主要区别就是以前 dos 用的内存是平坦内存模型。后来就可以分页了,内存寻址访问的机制也更加现代化。
那个所谓 dos 模式只有加载系统内核之前有用吧。现在的技术一般只在那个模式下加载一个系统引导器,那个引导器好像就已经开始启用保护模式了来加载系统内核了。
2012-10-02 11:11
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
回复 43楼 pangding
嗯,我也来看看从实模式转换到保护的的工作流程

The quieter you become, the more you can hear
2012-10-02 22:24
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册

notice the "I/O Devices". They are connected to the system bus.

All I/O Ports are mapped to a given memory location.

This allows us to use the IN and OUT instructions.


所有的I/O设备都连接到系统总线上。 

所有的I/O 端口也都被映射到某个内存地址上,

所以这使我们能够使用IN 和OUT 命令

 if we write a byte to a memory location for a hardware device controller to read,

the processor can signal the device that there are data at that address.

It does this through the Control Bus part of the entire System Bus.

如果我们向内存的某个位置写一个字节让硬件设备控制器来读,

这时处理器向设备发出信号:有数据在那个地址上。

处理器就是通过控制总线来完成的


[ 本帖最后由 madfrogme 于 2012-10-3 23:08 编辑 ]

The quieter you become, the more you can hear
2012-10-02 22:31
有容就大
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:东土大唐
等 级:版主
威 望:74
帖 子:9048
专家分:14309
注 册:2011-11-11
收藏
得分:0 
表示强烈 顶这个 中英文对照的发帖方式!

梅尚程荀
马谭杨奚







                                                       
2012-10-02 22:46
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
关于端口地址
A "Port Address" is a special number that each Controller listens to.

When booting, the ROM BIOS assigns different numbers to these controller devices.

端口地址是一个特别的数字,控制器都会监听这个数字。

机器启动时,ROM BIOS为不同的控制器分配了不同的数字

so controllers have a way to identify themselves.

This allows the BIOS to set up the Interrupt Vector Table,

which communicates to the hardware using this special number.

所以控制器也可以辨认自己了,这使BIOS 可以建立中断向量表。

中断向量表使用这些特别的数字和硬件交流


[ 本帖最后由 madfrogme 于 2012-10-3 23:09 编辑 ]

The quieter you become, the more you can hear
2012-10-02 22:50
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
以下是引用有容就大在2012-10-2 23:46:55的发言:

表示强烈 顶这个 中英文对照的发帖方式!

谢了啊, 小段的我还能翻译,大段引用我就见机行事了

The quieter you become, the more you can hear
2012-10-02 22:54
madfrogme
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:21
帖 子:1160
专家分:1106
注 册:2009-6-24
收藏
得分:0 
To make starting an OS easy, we will be using a lot of existing parts,

GRUB will be the bootloader, and the kernel will be in ELF format.

GRUB (a Multiboot compliant boot loader) puts the system in to the correct state

for your kernel to start executing.

This includes enabling the A20 line

(to give you access to all available memory addresses)

and putting the system in to 32-bit Protected Mode, giving you access to a theoretical 4GiB of memory.

We will not use a flat binary but a kernel in ELF format,

so that we have a lot of control to tell GRUB where to load which part in memory.

为了能容易的启动OS, 我们使用很多已经存在的部件,

包括使用GRUB做为引导程序, 内核为ELF格式。

GRUB使系统进入正确的状态,从而使内核能够运行。

这包括开启A20线(使能够访问所有可用内存);

让系统进入32位保护模式,使能多访问理论上4G的内存;

我们还使用ELF内核而不是平坦的二进制格式内核,

这样我们就可以有更多的控制力来告诉GRUB将内核的哪个部分加载到哪里


[ 本帖最后由 madfrogme 于 2012-10-3 23:48 编辑 ]

The quieter you become, the more you can hear
2012-10-03 22:19
fufa1029
Rank: 2
等 级:论坛游民
帖 子:2
专家分:10
注 册:2013-3-15
收藏
得分:0 
看着学习一下!
2013-03-15 09:55
快速回复:Linux 0.11
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024926 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved