- 博客(971)
- 资源 (35)
- 收藏
- 关注
原创 指针地址长度
<br /> <br /> int * p<br /> <br /> int *q;<br /> <br /> q = p;<br /> p++;<br /> <br /> p - q = 1
2010-06-01 21:19:00 1277
原创 操作系统学习笔记(23)--系统内存获取
设置内存,首先需要获取内存大小。 ; Use int 15h to find out size of extended memory in KB. ; Extended memory is the memory above 1MB. So by ; adding 1MB to this amount, we get the total amount ; of syst
2010-05-30 20:44:00 719
原创 操作系统学习笔记(22)--全局描述符表
在保护模式下访问内存步骤:1 获取段选择子2 根据GDTR寄存器获得基地址3 和偏移地址结合获得线性地址 与内存有关的描述符 align 8, db 0 (内存对齐) GDT: ; Descriptor 0 is not used dw 0 dw 0 dw 0 dw 0 ; Descriptor 1: kernel code segment
2010-05-30 18:08:00 1284
原创 操作系统学习笔记(21)--中断描述符表设置
与此相关的IDTR 基本定义IDT_Pointer: dw 0 -- 表长 dd 00 -- 基地址 lidt [IDT_Pointer] 基地址和表长 IDT_Pointer是6个字节长,高4个字节是32 Bit Linear Base Address,低2个字节是16 Bit Table Limit
2010-05-30 17:22:00 956
原创 操作系统学习笔记(20)--开中断、关中断及原子操作
操作系统在很多情况下,需要进行原子操作,此时是不可以进行中断响应的。根据需要此时需要关闭中断,在原子操作完了之后再进行开中断。 中断相关的操作有:1 知道EFFLAG的中断位2 中断开、关的指令3 如果进行C语言设置时的参数传递 下面给出部分伪码: 原子操作() { 开始原子操作(); 操作; 结束原子操作();}
2010-05-30 12:13:00 12316
原创 操作系统学习笔记(19)--贴一个内存设置的代码
void* memset(void* s, int c, size_t n){ unsigned char* p = (unsigned char*) s; while (n > 0) { *p++ = (unsigned char) c; --n; } return s;}
2010-05-29 22:35:00 820
原创 操作系统学习笔记(18)--bss段设置
bss段需要填充为0 #include "stdio.h"extern char __bss_start, end;int main() {printf("bss start %x /n", &__bss_start);printf("bss end %x /n", &end);printf("bss start %x /n", __bss_star
2010-05-29 21:50:00 1793 1
原创 操作系统学习笔记(17)--获取Main位置
还是使用前面的下列代码#include "stdio.h"#include "test.h"int main() { printf("this is a test. /n"); PAUSE(1000); printf("this is second test. /n"); KASSERT(1==1); printf("this is 3 test. /n")
2010-05-28 21:32:00 921 1
原创 公司给的perl的参考文献
http://www.cbi.pku.edu.cn/chinese/documents/perl/index.htm 好像很多地方有。 看了一天,感觉个大概。
2010-05-28 20:31:00 780
原创 操作系统学习笔记(16)--进入内核
操作系统进入保护模式后,通过配置GDT表和内核代码的装载设置。跳入内核代码段,此时在保护模式下运行。 跳入地址需要首先获得,一般是Main函数地址。jmp kenerlSegment:offset 进入包含模式。 进入内核后,一般是C语言写的代码。
2010-05-28 20:29:00 803
原创 操作系统学习笔记(15)--保护模式
程序一般运行在保护模式下。 关闭软驱马达(使用软驱启动)要启动A20总线设置GDT设置IDT开启包含模式 跳转到指定代码处,进入保护模式。详细资料需要查看Intel的CPU设计文档等。 ; Switch to protected mode! mov ax, 0x01 lmsw ax
2010-05-27 22:23:00 759
原创 perl的HelloWorld
perl作为一种脚本语言,可以快速建立原型和处理。介于Shell和C及Java等语言之间。 perl文件#! /usr/bin/perlprintf("Hello World! /n"); $chmod a+x perl$./perlHello World! 有不少地方用到,稍微看一下。
2010-05-27 21:38:00 1196
原创 操作系统学习笔记(14)--C和汇编相互调用
; 编译链接方法; (ld 的‘-s’选项意为“strip all”); gcc -c not link;; [root@XXX XXX]# nasm -f elf foo.asm -o foo.o; [root@XXX XXX]# gcc -c bar.c -o bar.o; [root@XXX XXX]# ld -s foo.o bar.o -o foobar; [
2010-05-26 23:07:00 849
原创 objdump的使用
; hello.asm a first program for nasm for Linux, Intel, gcc;; assemble: nasm -f elf hello.asm -o hello.o; link: gcc -o hello hello.o; run: hello ; output is: Hello World SECTION .data
2010-05-26 22:27:00 972
原创 操作系统学习笔记(13)--NASM的HelloWorld
hello.asm ; hello.asm a first program for nasm for Linux, Intel, gcc;; assemble: nasm -f elf hello.asm -o hello.o; link: gcc -o hello hello.o; run: hello ; output is: Hello
2010-05-26 21:39:00 2322
原创 操作系统学习笔记(12)--代码地址
00011388 t Add_Digit00012570 t Add_Page_Range00014d5e t Add_To_Back_Of_All_Thread_List00015096 t Add_To_Back_Of_Thread_Queue00016978 t After_Err00016908 t After_No_Err000128fc T Alloc_Page00012bdc T A
2010-05-25 23:20:00 1757
原创 操作系统学习笔记(11)--makefile的$@
$@ The file name of the target. 实例: # Standard floppy image - just boots the kernelfd.img : geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin cat geekos/fd_boot.bin geekos/setup.bin gee
2010-05-25 23:06:00 684
原创 操作系统学习笔记(10)--NASM编译传参
#targets : prerequisites# command# ...#kernel : floppy.bin object floppy.bin : bootsect.asm nasm bootsect.asm -o floppy.bin / -DNUMBER=1234 object :
2010-05-25 22:15:00 856
原创 操作系统学习笔记(9)--内核2进制文件
从图中可见文件的存储和执行。 从b80000开始执行代码。 ; This macro is used to calculate padding needed; to ensure that the boot sector is exactly 512 bytes; in size. The argument is the desired offset to be
2010-05-24 22:53:00 781
原创 操作系统学习笔记(8)--Bochs调式
Bochs User Manual 常用命令b 0x07c00contsnu 0x07c00 0x07c10 -- 反汇编一段内存r ctrl + c 详细信息: http://bochs.sourceforge.net/cgi-bin/topper.pl?name=New+Bochs+Documentation&url=http://boch
2010-05-24 22:34:00 816
原创 操作系统学习笔记(7)--打印内存地址
文件的makefile中修改掉部分内容,我这里用到了前面的多余的东西。删除即可。 ; This macro is used to calculate padding needed; to ensure that the boot sector is exactly 512 bytes; in size. The argument is the desired offset to
2010-05-24 22:19:00 1093
原创 操作系统学习笔记(6)--启动盘制作
启动盘 ; This macro is used to calculate padding needed; to ensure that the boot sector is exactly 512 bytes; in size. The argument is the desired offset to be; padded to.%macro PadFromStart
2010-05-23 22:54:00 1525
原创 操作系统学习笔记(5)--makefile文件实例
Makefile文件的实例应用 test.c #include "stdio.h"#include "test.h"int main() { printf("this is a test. /n"); PAUSE(1000); printf("this is second test. /n"); KASSERT(1==1); printf("th
2010-05-23 00:01:00 959
原创 操作系统学习笔记(4)--断言和延时功能
1 断言2 延时 #include "stdio.h"#define PAUSE(count) /do { / unsigned long i; / for (i = 0; i < (count); ++i) / ; /} while (0)#define KASSERT(cond) /
2010-05-22 21:37:00 1058
原创 操作系统学习笔记(3)--内核启动过程
跳转到Main函数时使用堆栈给Main函数传递参数。 在Main函数中通过堆栈访问这些参数。 初始化BSS段,用来存放全局静态变量。初始化屏幕输出初始化内存(内存大小从参数获得)初始化任务状态段初始化中断初始化进程调度初始化陷阱初始化定时器初始化键盘初始化文件系统 ......
2010-05-21 21:53:00 789 1
原创 操作系统学习笔记(2)--内核系统设置
进入初始化段后,对系统内存等进行读取并设置。 重新设置PIC。(Intel 和 IBM的不同设置) 关闭软驱。 跳转到32位保护模式和程序Main函数。 LIDT(设置中断描述符表) LGDT->段描述符基地址和大小段选择子->段描述符段描述符(8字节)->段基地址、段界限(大小)、段属性等信息。 段选择子 : 描述符索引、TI(Tab
2010-05-20 21:41:00 838
原创 操作系统学习笔记(1)--软驱启动
软驱启动0x55的启动标志,最大512个字节。 汇编代码,将自己复制到内存并跳转到指定地址运行初始化的程序。系统启动是在实地址模式下运行的。初始化使用系统初始化过程,设置内存,重新设置中断,跳转到保护模式,装载内核,最后跳转到内核开始函数。部分参数使用编译命令传递。 复制软驱内容及Setup.bin、Kernel.bin到指定位置,然后跳转到特定位置
2010-05-19 22:38:00 1252 1
原创 C++的Hello World
using namespace std;class CRectangle { int x, y; public: void set_values (int,int); int area () {return (x*y);}};void CRectangle::set_values (int a, int b) { x = a; y = b;}int main (
2010-05-16 21:17:00 773 1
myclipse+jboss+ejbStateless
2008-05-01
jsf_ajax_hibernate_jdbc_mysql_dwr演示视频
2009-02-28
工作流人工任务 Websphere Integeration Development 开发
2009-02-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人