linux-0.0.1版中IDT表项设置分析。
时间:2003-05-25
来源:互联网
#define _set_gate(gate_addr,type,dpl,addr) \
__asm__ ("movw %%dx,%%ax\n\t" \
"movw %0,%%dx\n\t" \
"movl %%eax,%1\n\t" \
"movl %%edx,%2" \
: \
: "i" ((short) (0x8000+(dpl<<13)+(type<<8))), \
"o" (*((char *) (gate_addr))), \
"o" (*(4+(char *) (gate_addr))), \
"d" ((char *) (addr)),"a" (0x00080000))
这里共输入5个数据(这里没有输出部),%1与gate_addr结合,%2与
(gate_addr+4)结合,它们都是内存单元;先将%%dx的低16位移入%%ax的低16位
(注意%%dx与%%edx的区别)。这样,在%eax中就形成了所需要的中断门的第一个
长整数,其高16位为_KERNEL_CS,而低16位为addr的低16位。接着把第一个输入
立即数(0x8000+(dpl<<13)+(type<<8)装入%%edx的低16位。这样,%%edx中高16
位为addr的高16位,而低16位的P位为1(因为是0x8000),DPL位段为DPL(因为
dpl<<3),而D位加上类型位段则为type(因为type<<8),其余各位皆为0。这就形
成了中断门中的第2个长整数。然后,将%eax 写入*gate_addr,而%%edx写入
*(gate_addr+4)。呵呵,效率高,但难得读懂。但对于像设置IDT表项一类并不
是平凡发生的操作,这样做是否值得牺牲可读性。。。(我想也没有多少人愿意
读这样很底层的东东,更谈不上维护了)
作者: 有影 发布时间: 2003-05-25
编译成功的
成功了,也不能用......
作者: qing 发布时间: 2003-05-25
lingix
这个可以用grub来启动的....
作者: qing 发布时间: 2003-05-25
作者: 有影 发布时间: 2003-05-25
可我还是不行 .....
作者: qing 发布时间: 2003-05-25
Linux-0.01 was compiled with gcc-1.40 and released by Linus Torvalds
Linux boots from floppy drive.
- It was binary compatible with single threaded file system of mimix,
- no message passing and linux used multithreaded filesystem instead,
- true multi-tasking was available with a 'better" scheduler
than that on mimix.
- Device drivers used interrupts which was not hidden.
- There was no distinction in the kernel/fs/mm, and was all linked to the
same heap and in its own subdirectory source tree and running
in the same data/code space.
- Simple memory management algorithm took advantage of page and segment faults
features of the intel386 CPU.
- linux partitions could be mounted from mimix but linux cound not mount mimix ( no mount command )
- Linux' kernel goes into supervisor mode to solve the multirace conditions
and deadlocks to access the multithreaded file system.
- GNU provided the shell (bash), compilers and libraries.
作者: qing 发布时间: 2003-05-25
不用floppy,
的
和虚拟器的
说说吧
作者: qing 发布时间: 2003-05-25
http://asmcos.51.net/
我自己认为就因为0.0.1还没有自己的文件系统吧。所以不能在EXT2
下引导,必须要MINIX的文件系统支持。我只出于学习目的,分析代
码,所以没有去编译它。
作者: 有影 发布时间: 2003-05-26
下载两个文件
bochs和要模拟系统的文件(img)
动一下配置就可以了
................
作者: qing 发布时间: 2003-05-26
最初由 qing 发表 bochs我搞定了 下载两个文件 bochs和要模拟系统的文件(img) 动一下配置就可以了 ................ |
作者: seablue 发布时间: 2003-05-27
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28