您正在查看 "linux1.0 学习笔记" 分类下的文章
2008年05月04日 星期日 17:34
实验环境: FC8, bochs2.1.1 代码linux0.00(改的乱七八糟了~ ~)
快要疯... 到PMODEL 下, 刚跳过去, bochs 就出错... 然后自动关闭....
 
# "-m elf_i386": Output 32-bit code for the i386 in elf format.
# "-Ttext 0": Code should be loaded\aligned at 0.
|
2008年04月30日 星期三 17:42
实验 环境 FC8 bochs2.1.1
boot.s 文件 代码如下:
.text
entry _start
_start:
jmpi boot1 ,#0x07c0
boot1:
mov ax,cs
mov ds,ax
mov es,ax
mov ss,ax
print_msg:
mov ah,#0x03
xor bh,bh
int 0x10
mov cx,#29
mov bx,#0x0007
mov bp,#msg
mov ax,#0x1301
int 0x10
jmp print_msg
msg:
.byte 13,10
.ascii |
2008年04月28日 星期一 12:57
#define do_div(n,base) ({ \
int __res; \
__asm__("divl %4":"=a" (n),"=d" (__res):"0" (n),"1" (0),"r" (base)); \
__res; })
这是在linux/kernel/vsprintf.c 中的 一点点代码, 会了他是没什么值的炫耀.
不过我还是很高兴, 因为之前看到嵌入 汇编的情况都要 去查看嵌入汇编的规则
再回头进行分析, |
2008年04月24日 星期四 12:07
Refers to RAM that has been configured to simulate a disk drive. You can access files on a RAM disk as you would access files on a real disk. RAM disks, however, are approximately a thousand times faster than hard disk drives. They are particularly useful, therefore, for applications that require frequent disk accesses.
Because they are made of normal RAM, RAM disks lose their contents once the computer is turned off. To use a RAM disk, therefore, you need to copy files from a real hard d |
2008年04月18日 星期五 16:23
在linux 0.11 中 head.s 最后 用了一个 ret 来 返回main.c的 地址......
虽然以前知道 RET 但是 这样的用法 还是第一次看见...
然后 看了下intel 的手册
This instruction transfers program control to a return address located on the top of the stack. The
address is usually placed on the stack by a CALL instruction, and the return is made to the
instruction that follows the CALL instru |
|
|