当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: Write Your Own Operating System
 

 

    摘要: ado.net 中引入了数据库连接池的概念,其实默认我们在连接数据库的时候已经用了数据库连接池。比如 sqlconnection conn = new sqlconnection();conn.connectionstring = "integrated security=sspi;initial catalog=pubs";conn.connectionstring......
    摘要:我使用的是zend studio 3.51,找了很多资料总算把这个问题解决了,其实很简单,只是没有想到会是字体的原因。打开软件,选择菜单栏——“tools”—“preferneces”—“color&fonts”—当前“scheme name......


Write Your Own Operating System Tutorial [转载]
write your own operating system tutorial

in this lesson we’ll learn about the contents of the boot sector so that we can learn to write our own boot program. 【程序编程相关:ASP.NET 2.0 的内部变化

lesson 1: the boot sector 【推荐阅读:HTML元素的Z-index属性是如何工

the first thing to do is to take a look inside the boot record.  the dos utility debug is a widely available tool that can be used to view the contents of memory and disks.  we’ll use debug to look at a floppy disk’s boot record. 【扩展信息:如何实现100%的动态数据管道(二)

when the computer boots from a floppy, bios (basic input/output system) reads the disk and loads the first sector into memory at address 0000:7c00.  this first sector is called the dos boot record (dbr).  bios jumps to the address 0x7c00 and begins executing instructions there.  it is these instructions (the “boot loader”) that will load the operating system (os) into memory and begin the os’s boot process.

at a dos (or windows) command prompt type debug.  this will leave you with just a hyphen as a prompt.  if you enter letter ‘d’ as a command and press enter, it will show you a portion of the contents of ram.  typing the question mark as a command will give you a list of all the available commands in debug.  (be very careful when using the debug utility.  this utility can be used to overwrite data on any disk drive, possibly causing loss of data.)

place a freshly formatted disk in the a: drive.  to load the boot record off your floppy disk, type the following command.

-l 0 0 0 1

(the first character is the letter ‘l’, not the number ‘1’.)  this command loads sectors off a disk into a portion of ram.  the 4 numbers after the ‘l’ represent in order, the beginning address where you want the data loaded, the drive number (0 for first floppy driver), the first sector on the disk to load, and how many sectors to load.  typing this command will load the first sector of the floppy into memory starting at address 0.

now that we have the boot record loaded into memory, we want to view its contents.  type the following command.

-d 0

what you see are 8 lines that represent the first 128 (0x80 in hex) bytes in the floppy’s boot record.  the results (for my floppy disk) are the following.

0af6:0000  eb 3c 90 4d 53 44 4f 53-35 2e 30 00 02 01 01 00   .<.msdos5.0.....

0af6:0010  02 e0 00 40 0b f0 09 00-12 00 02 00 00 00 00 00   ...@............

0af6:0020  00 00 00 00 00 00 29 f6-63 30 88 4e 4f 20 4e 41   ......).c0.no na

0af6:0030  4d 45 20 20 20 20 46 41-54 31 32 20 20 20 33 c9   me    fat12   3.

0af6:0040  8e d1 bc f0 7b 8e d9 b8-00 20 8e c0 fc bd 00 7c   ....{.... .....|

0af6:0050  38 4e 24 7d 24 8b c1 99-e8 3c 01 72 1c 83 eb 3a   8n$}$....<.r...:

0af6:0060  66 a1 1c 7c 26 66 3b 07-26 8a 57 fc 75 06 80 ca   f..|&f;.&.w.u...

0af6:0070  02 88 56 02 80 c3 10 73-eb 33 c9 8a 46 10 98 f7   ..v....s.3..f...

 

at first glance, this doesn’t tell me much.  i can see that it looks like this is a ms-dos 5.0 disk with no name and a fat12 file system.  the numbers in the far left column show the memory addresses in ram.  the hexadecimal numbers in the middle show all the bytes in this portion of memory, and the column on the right shows the ascii characters that the hex bytes represent (a period is shown if the byte does not translate to any visible character).  some of the bytes you see in this portion of the boot record are parts of instructions in the boot loader, and some of them hold information about the disk such as the number of bytes per sector, the number of sectors per track, etc…

now it’s time to take a glance at the code for the boot loader.  type the following command.

-u 0

this performs an “unassemble” operation.  this shows us the same bytes as before (starting with address 0), but this time debug shows us the intel instructions that these bytes represent.  the results for my floppy are the following.

0af6:0000 eb3c          jmp     003e


...   下一页
 ·改变文件夹图标    »显示摘要«
    摘要:说白修改文件里的隐藏文件desktop.ini下面是源代码unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; type tform1 = class(tform) button1: tbutton; pr......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE