Fortune Telling Collection - Free divination - How does memory store things? I still don't understand how memory stores things. Now I don't know why.
How does memory store things? I still don't understand how memory stores things. Now I don't know why.
Faces, tracks and sectors
After the hard disk is partitioned, it will be divided into edges, tracks and sectors. It should be noted that these are just virtual concepts, not really on the hard disk. Let's start with the surface. Hard disk generally consists of one or several circular films. As we said, each circular film has two "faces", both of which are used to store data. According to the number of faces, it is called 0 face, 1 face, 2 face ... Because each face has a read-write head, it is also commonly known as 0 head and 1 head. According to the different capacities and specifications of hard disks, the number of hard disks (or magnetic heads) is not necessarily the same, ranging from two to dozens. Tracks with the same track number on each side are combined into a cylinder (as shown in figure 1). (figure)
We mentioned the concept of track above. So what exactly is a track? Because the disk is rotating, the data written continuously are arranged in a circle. We call such a circle an orbit. (Figure 2) If the pickup head moves a certain distance along the radial direction of the circular film, the data written later will be arranged on another track. According to the different specifications of hard disk, the number of tracks ranges from hundreds to thousands; A track can hold thousands of bytes of data, but the host often doesn't need to read and write so much at once, so the track is divided into several segments, and each segment is called a sector. A sector usually stores 5 12 bytes of data. Sectors also need to be numbered. Sectors in the same track are called sector 1, and sector 2. ...
In order to improve efficiency, computers read and write hard disks in sectors. Even if the computer only needs a byte stored on the hard disk, it must read all 5 12 bytes of the sector where the byte is located into the memory at one time, and then use the required bytes. However, as mentioned above, there is no trace on the hard disk, and there is no division of tracks and sectors on the surface. Although the magnetic head can aim at a track according to the appropriate radius, how to find the required sector in a circle of sectors connected end to end? It turns out that each sector not only consists of 5 12 bytes, but also some specific data at the front end and back end of these data accessed by the computer constitute a sector boundary tag, which contains information such as sector number. Computers use these flags to identify sectors.
Data structure of hard disk
Above, we talked about the general principle of data storage in hard disk. In order to have a deeper understanding of the hard disk, we must also have a simple understanding of the data structure of the hard disk. The data on the hard disk can be roughly divided into five parts according to its different characteristics and functions: MBR area, DBR area, FAT area, DIR area and data area. Let's introduce them separately:
1.MBR area
MBR (master boot record master boot record area)? 0 track, 0 cylinder and 1 sector are located throughout the hard disk. However, among the total ***5 12 bytes of the main boot sector, MBR only accounts for 446 bytes, and the other 64 bytes are handed over to DPT (disk partition table) (see table). The last two bytes "55, AA" are the end marks of the partition. This whole constitutes the main boot sector of the hard disk. (figure)
The master boot record contains a series of parameters of the hard disk and a boot program. The main function of the hard disk boot program is to check whether the partition table is correct and boot the operating system on the partition with the activation mark after the system hardware completes the self-check, and hand over the control to the boot program. MBR is generated by partition program (such as Fdisk.exe) and does not depend on any operating system. The hard disk boot program can also be changed to realize multi-system storage.
Below, let's use an example to make you understand the master boot record more intuitively:
Example: 80010100bfebffc3f00 000 007e86bb00
Here we can see that the front "80" is an activation sign of a partition, indicating that the system can boot; "0 1 0 1 00" means that the number one at the beginning of the partition is 0 1, the sector number at the beginning is 0 1, and the cylinder number at the beginning is 00; "0B" indicates that the system type of the partition is FAT32, and other common ones are 04(FAT 16) and 07 (NTFS); "FE BF FC" means that the number one at the end of the partition is 254, the number of sectors at the end of the partition is 63, and the number of columns at the end of the partition is 764; "3F 00 00 00" means that the relative sector number of the first sector is 63; "7E 86 BB 00" means that the total number of sectors is 12289622.
2.DBR area
DBR(Dos boot record) refers to the boot record area of the operating system. Usually located in track 0 1 cylinder 1 sector of the hard disk, it is the first sector that the operating system can directly access. It includes a boot program and a parameter record table of this partition called BPB(Bios parameter block). The main task of the boot program is to judge whether the first two files of this partition and directory are boot files of the operating system (in the case of DOS, it is Io.sys and Msdos.sys) when MBR gives it control of the system. If it exists, read it into memory and give control to the file. The BPB parameter block records the important parameters of this partition, such as start sector, end sector, file storage format, hard disk media descriptor, root directory size, fat number, allocation unit size, etc. DBR is made by advanced format programs (Format.com and others).
3. Fat area
Behind the DBR is the familiar FAT (File Allocation Table) area. Before explaining the concept of file allocation table, let's talk about the concept of cluster. When files occupy disk space, the basic unit is not bytes but clusters. Generally speaking, each cluster of floppy disks has 1 sector, and the number of sectors in each cluster of hard disks is related to the total capacity of hard disks, which may be 4,8,16,32,64. ...
The data of the same file is not necessarily completely stored in a continuous area of the disk, but is often divided into several segments and stored like a chain. This storage method is called file chain storage. Because the connection information between segments (that is, FAT) is stored on the hard disk, the operating system can always find the location of each segment and read it correctly when reading files.
In order to realize the chain storage of files, it is necessary to accurately record which clusters on the hard disk have been occupied by files, and at the same time, it is necessary to indicate the next cluster number for storing subsequent content for each occupied cluster. For the last cluster of the file, it is necessary to indicate that there is no successor cluster in this cluster. These are all stored in the FAT table, and there are many entries in the table, and each entry records the information of a cluster. Because of the importance of FAT for file management, FAT has a backup, that is, an identical FAT is built behind the original FAT. All items in the newly formed FAT are marked as "unoccupied", but if the disk is damaged locally, the formatter will detect the damaged cluster and mark it as "bad cluster" in the corresponding items, so the cluster will not be used when saving files in the future. The number of FAT items is equivalent to the total number of clusters on the hard disk, and the number of bytes occupied by each item should also be adapted to the total number of clusters, because the cluster number needs to be stored. There are many formats of FAT, the most common ones are FAT 16 and FAT32.
4. Deere County
DIR (directory) is the root directory area, followed by the second FAT table (that is, the backup FAT table), which records the initial unit of each file (directory) under the root directory, the attributes of the file and so on. When locating the file location, the operating system can know the specific location and size of the file in the hard disk according to the starting unit in DIR and the FAT table.
5. Data area
The data area is the real data storage place, which is located behind the DIR area and occupies most of the data space on the hard disk.
disk file system
I often hear experts talk about terms such as FAT 16, FAT32 and NTFS. Friends may vaguely know that this refers to the file system. But what do you mean by so many file systems? Today, let's learn together:
1. What is a file system?
The so-called file system is the structure of organizing, storing and naming files in the operating system. The difference between a disk or partition and the file system it contains is very important. Most applications run on file systems and cannot work on different file systems.
2. File system series
There are many commonly used file systems. MS-DOS and Windows 3.x use FAT 16 file system, and Windows 98 also uses FAT 16 by default. Windows 98 and Me can support both FAT 16 and FAT32 file systems. Windows NT supports FAT 16 and NTFS, Windows 2000 can support FAT 16, FAT32 and NTFS, and Linux can support many file systems, such as FAT 16, FAT32, NTFS, Minix, ext, ext2, xiafs, HPFS and VFAT. Below, the author briefly introduces the relevant situation of these file systems:
( 1)FAT 16
The full name of FAT is "file allocation table", which was first applied to MS-DOS in 1982. The main advantage of FAT file system is that it can allow multiple operating systems to access, such as MS-DOS, Windows 3.x, Windows 9x, Windows NT, OS/2, etc. This file system follows the naming rules of 8.3 (that is, the file name is 8 characters at most and the extension is 3 characters).
(2)VFAT
VFAT means "extended file allocation table system" and is mainly used in Windows 95. It extends the FAT 16 file system and supports long file names up to 255 characters. VFAT still retains the extension and supports the file date and time attributes, and reserves three dates/times for each file: the date/time when the file was created, the date/time when the file was last modified, and the date/time when the file was last opened.
(3)FAT32
FAT32 is mainly used in Windows 98 system, which can enhance disk performance and increase available disk space. Because the size of a cluster is much smaller than FAT 16, it can save disk space. It supports partition sizes above 2G. Friends can see from the attached table that FAT 16 is different from FAT32.
⑷HPFS
High performance file system. The high performance file system (HPFS) of OS/2 mainly overcomes the shortcoming that the FAT file system is not suitable for high-end operating systems. HPFS supports long file names and has stronger error correction ability than FAT file system. Windows NT also supports HPFS, which makes the transition from OS/2 to Windows NT easier. HPFS and NTFS have many common features, including long file names, but their reliability is poor.
(5) Non-tariff barriers
NTFS is an advanced file system dedicated to Windows NT/2000 operating system, which supports file system fault recovery, especially for large storage media and long file names. The main weakness of NTFS is that it can only be recognized by Windows NT/2000. Although it can read the files of FAT file system and HPFS file system, its files cannot be accessed by FAT file system and HPFS file system, so its compatibility is more problematic.
ext2
This is the most used file system in Linux, because it is specially designed for Linux, which is the fastest and takes up the least CPU. Ext2 can be used for both standard block devices (such as hard disks) and removable storage devices (such as floppy disks). Now there is a new generation of Linux file systems, such as XFS, ReiserFS and ext3 file systems of SGI.
Summary: Although the author introduced six file systems above, FAT 16/32 and NTFS are dominant, and FAT32 is the most used. Just right-click the properties of a drive in my computer, and you can see the file system used in the general options (pictured).
Clearly identify the hard disk number.
At present, the hard disk brands in the electronic market are nothing more than "old brands" such as IBM, Quantum, Seagate and Maituo. The numbers of these hard disk models are different and dazzling. In fact, these figures all have certain rules, indicating some specificity? Meaning of. Generally speaking, you can know the performance index of the hard disk, including the interface, from the serial number of the hard disk. Type, speed, capacity, etc. As a friend of DIY, it is much more convenient to buy a hard disk only if you really master the correct identification of the hard disk number (to avoid being "hacked"), at least people who will not be sold will say what is what. Here are some examples for your reference.
I. International Business Machines Corporation
IBM is a giant in the hard disk industry, and its products cover almost all hard disk fields. And IBM was the initiator of hard disk capacity and price war last year. Thanks to IBM, we can use cheap and large-capacity hard disks today.
Each product of IBM is divided into several series, and its naming method is: product name+series code+interface type+disk size+speed+capacity. Take 13.5GB hard disk of Deskstar 22GXP as an example. The model of the hard disk is: DJNA-37 1350, the letter D stands for Deskstar products, JN stands for Deskstar25GP and 22GP series, A stands for ATA interface, 3 stands for 3-inch disk, 7 stands for 7200 rpm products, and the last four digits are 65438+ hard disk capacity. IBM serial number (IDE) has the following meanings:
TT=Deskstar 16GP or 14GXP JN=Deskstar 25GP or 22GXP RV=Ultrastar 18LZX or 36ZX.
The meaning of interface type is as follows: a = ATA.
S and u = ultra SCSI, Ultra SCSI Wide, Ultra SCSI SCA, enhanced SCSI,
Enhanced extended SCSI(SCA)
C = serial storage architecture Continuous storage system SCSI L= = Fibre Channel SCSI
Second, Maituo (Maituo)
Maituo is an independent subsidiary of Hyundai Electronics. In the past, its products also covered both IDE and SCSI, but due to the lack of competitiveness of SCSI products, it finally gave up this high-end market and focused on IDE hard disks. Therefore, Maituo should be the most exclusive hard disk manufacturer today.
MAXTOR hard disk numbering rules are as follows: first place+capacity+interface type+number of magnetic heads, MAXTOR? From the fourth generation of diamonds, its first number is 9, which has continued until now, so the first number of Maituo hard disks you can see in the electronic market today is basically 9. In addition, there is a concept of magnetic head number in MAXTOR number, because MAXTOR hard disk is the initiator of each disk storage, so each disk storage should be reflected by the magnetic head number in its hard disk model. Storage capacity of each disk = 2 * total hard disk capacity/number of heads.
Now take the 10.2 GB hard disk of Diamond Max Plus 6800 as an example: This hard disk? The model number is 9 1024U3, 9 is the first, 1024 is the capacity, u is the interface type UDMA66, and 3 indicates that the hard disk has three heads, indicating that one side of one disk has data. The storage capacity of each disk is 2* 10.2/3=6.8GB. MAXTOR hard disk interface type letters have meanings such as:
A = Pio mode d = udma33 mode u = udma66 mode.
Third, SEAGATE.
Seagate technology is the largest disk drive in the world. Manufacturer of magnetic disks and read/write heads, which has been a major hard disk supplier in industries such as IBM, Compaq and Sony. Seagate also holds the record of the industry's first 10000 rpm hard disk (Jaguar Cheetah Series SCSI) and the record of the maximum capacity (Jaguar III 73GB), which shows the strength of the company. But? Because Seagate has been focusing on high-end applications (such as SCSI hard drives) without paying special attention to the development of low-end household products, it is not as good as quantum and other hard disk suppliers in DIY eyes? . Fortunately, Seagate noticed this problem in time, and the barracuda series that was put on the market not long ago swept away Seagate's hard disk. In the past, it could work stably under the abnormal storage, speed, noise and external frequency of each disk. Shortcomings in quality and comprehensive performance.
The product names of Seagate hard disk series are U4 series, Medalist series, U8 series, Medalist Pro series and Barracuda series from low end to high end. Medalist Pro and Barracuda series are 7200 rpm products, and others are 5400 rpm products. The models of hard disks all start with ST, now take Cool Fish 10.2GB hard disk as an example to illustrate. The model of the hard disk is ST3 10220A, the first digit after ST represents the size of the hard disk, and 3 indicates that the hard disk uses a 3-inch disk. Now there are basically no hard disks of other specifications, you see? The digits of most hard disks are not 3, and 1022 after 3 means that the formatted capacity of the hard disk is 10.22GB, and the last digit of 0 means 7200 rpm products. This point should not be confused with Seagate's previous entry-level product Medalist ST38420A. Most Seagate Medalist Pro series start with products ending with 7200 rpm hard disk, and other numbers (including 1 and 2) start with products ending with 5400 rpm. The letter at the end of the model is the interface type of the hard disk. The letter meanings of Seagate hard disk interface type are as follows:
A=ATA UDMA33 or UDMA66 IDE interface AG is a special ATA interface hard disk for notebook computers.
W is ultra-wide SCSI,
Its data transmission rate is 40MB per second, n is ultra-narrow SCSI, and its data transmission rate is 20MB per second.
FC (Fibre Channel) in ST3450 1W/FC and ST1910/N/FC stands for Fibre Channel, which can provide data transmission rate up to 100MB per second and support hot plug.
Development history of hard disk and interface standards
First of all, the history of the hard disk
Speaking of the history of hard disk, we can't help but mention the important role played by the blue giant IBM, which invented the hard disk and made a series of significant contributions to its development. Before the invention of disk system, computers used punched paper tape and magnetic tape to store programs and data. These storage methods not only have low capacity and slow speed, but also have a big defect: they are all stored sequentially, and in order to read the following data, they must start from scratch, so random access to data cannot be realized.
1September 1956, IBM showed the world the first commercial hard disk IBM 350 RAMAC (accounting and control of random access method). The total capacity of this system is only 5MB, but it is a behemoth composed of 50 disks with a diameter of 24 inches. 1968, IBM first proposed "Winchester" Winchester technology. The essence of "Winchester" technology is: "Using a sealed, fixed and high-speed rotating plated disk, the magnetic head moves along the radial direction of the disk, and the magnetic head is suspended above the high-speed rotating disk without direct contact with the disk", which is the prototype of modern hard disk. 1973, IBM manufactured the first hard disk manufactured by Winchester technology, and the development of hard disk technology had a correct structural foundation. 1979, IBM invented the thin-film magnetic head, which made it possible to further reduce the size of the hard disk, increase the capacity and improve the reading and writing speed. The late 1970s and early 1980s were the embryonic period of microcomputers, during which many famous hard disk manufacturers including Seagate, Quantum and Maituo were born. 1979, two employees of IBM, Alan Shugart and Fenice Connor, decided to develop a hard disk drive with the size of a 5.25-inch floppy disk drive. After they left IBM, Seagate was founded. The following year, Seagate released the first hard disk suitable for microcomputers, with a capacity of 5MB and a volume similar to that of floppy disks.
The hard disk system before the PC era was characterized by large volume, small capacity, slow speed and high price. At that time, the application scope of computers was too small, and the relationship between technology and market restricted each other, which limited the development of the whole computer industry, including the storage industry. At the end of 1980s, IBM made another great contribution to the development of hard disk, that is, it invented MR (Magnetoresistive) head, which is quite sensitive to signal changes when reading data, so that the storage density of the disk can be increased by dozens of times compared with the previous 20MB per inch. 199 1 year, the 3.5-inch hard disk produced by IBM used MR head, which made the hard disk capacity reach 1GB for the first time, and the hard disk capacity began to enter the era of GB order. 1September 7th, 999, Maxtor)_ Company _ announced the first ATA hard disk with a storage height of 10.2GB per disk, thus introducing the capacity of the hard disk into a new milestone.
Second, the development of interface standards.
(1) Origin of IDE and EIDE
The earliest IBM PC didn't have a hard disk, and its BIOS and DOS 1.0 operating system didn't support any hard disk, because the system's memory was only 16KB, even the floppy drive and DOS were optional. Later, DOS 2 introduced the subdirectory system, which increased the support for "large-capacity" storage devices, so some companies began to sell the hard disk system of IBM PC. These hard disks, together with the control card and independent power supply, are packaged in an external box and connected to the adapter inserted into the expansion slot through cables. In order to use such a hard disk, it is necessary to start from the floppy drive and load a special device driver.
1983, IBM introduced PC/XT. Although XT still uses 8088 CPU, its configuration is much higher. IBM has a built-in 10MB hard disk, which integrates the functions of the control card into an interface control card, thus forming what we often call a hard disk controller. There is a ROM chip on its interface control card, which stores the hard disk read-write program. It was not until the introduction of PC/AT based on 80286 processor that the hard disk interface control program was added to the BIOS of the motherboard.
Hard disks used by PC/XT and PC/AT machines are called MFM hard disks or ST-506/4 12 hard disks. MFM (modified frequency modulation) refers to a coding scheme, and ST-506/4 12 is a hard disk interface developed by Seagate. ST-506 interface does not need any special cables and connectors, but it does.
1983, maxtor developed ESD (enhanced small driver interface) interface. This interface puts the codec on the hard disk itself, and the theoretical transmission speed is 2 ~ 4 times that of ST-506. However, due to the high cost, it was gradually eliminated after the 1990 s.
IDE(Integrated Drive Electronics) actually refers to the hard disk drive that integrates the controller with the disk body, thus reducing the number and length of cables of the hard disk interface, enhancing the reliability of data transmission, making the hard disk easier to manufacture and more convenient for users to install. IDE interface is also called ATA (Advanced Technology Attachment) interface.
ATA interface was originally developed by CDC, Compaq and Western Digital in 1986. They decided to use a 40-core cable. The earliest IDE hard disk was 5 inches in size and 40MB in capacity. Since the late 1980s, ATA interface has gradually replaced other old interfaces.
At the end of 1980s, IBM invented MR magnetic head, which is very sensitive to signal changes when reading data, making the storage density of the disk increase by dozens or hundreds times compared with the previous 20MB/in2. 199 1 year, the 3.5-inch hard disk 0663-E 12 produced by IBM used MR heads, and the capacity reached 1GB for the first time. Since then, the capacity of hard disks has entered the order of GB, and until today, most hard disks still use MR heads.
When talking about hard disks, people often talk about PIO mode and DMA mode. What are they? At present, there are two ways to exchange data between hard disk and host. One method is to read and write data by CPU executing I/O port instructions. In addition, one is DMA mode without CPU.
PIO mode is a programming input/output mode. This mode uses PC I/O port instructions to transmit all commands, status and data. Because there are multiple buffers in the drive, I/O string operation instructions are generally used to read and write the hard disk. This kind of instruction can complete many I/O operations only once, so it is possible to achieve a high data transmission rate.
DMA is a direct memory access. It means that data is directly transferred between hard disk and memory without CPU. In multitasking operating systems, such as OS/2, Linux, Windows NT, etc. When the disk transfers data, the CPU can make time to do other things, while in DOS/Windows3. In the X environment, the CPU has to wait for the completion of data transmission, so in this case, DMA mode is meaningless.
There are two types of DMA modes: third-party DMA and first-party DMA (or bus-controlled DMA). The third-party DMA obtains the bus and transmits data through the arbitration of the DMA controller on the system motherboard. The first-party DMA is completely completed by the logic circuit on the interface card, which of course increases the complexity and cost of the bus master interface. Now, all newer chipsets support bus master DMA.
(2)SCSI interface
The interface of small computer system is completely different from ATA. It is not specially designed for hard disk, but a bus system interface. Each SCSI bus can connect eight SCSI devices, including SCSI control cards. The advantage of SCSI is that it supports a variety of devices, the transmission rate is much faster than ATA interface, but the price is also high, and the independent bus makes it occupy less CPU. The earliest SCSI was formulated in 1979 by Shugart Company (the predecessor of Seagate Company) in the United States. At the beginning of 1990s, SCSI developed to SCSI-2, 1995 introduced SCSI-3, commonly known as Ultra SCSI, and 1997 introduced Ultra 2 SCSI (FAST-40). With LVD (low voltage differential) transmission mode, the highest transmission rate of 16-bit Ultra2SCSI(LVD) interface can reach 80MB/S, and the longest interface cable is allowed to be 12m, which greatly increases the flexibility of the equipment. 1998, the specification of ultra 160/m SCSI (fast-80 under wide) with higher data transmission rate was officially released, and its highest data transmission rate was160mb/s. Atlas 10K, Atlas IV and other products from Quantum supported ultra/Ultra3 SCSI.
SCSI hard disk has excellent transmission performance. However, most motherboards do not have built-in SCSI interfaces, so it is necessary to install corresponding SCSI cards to connect SCSI hard disks. At present, there are three official standards for SCSI cards, namely SCSI- 1, SCSI-2 and SCSI-3, and some intermediate versions. In order to obtain the best performance of SCSI hard disk, it is necessary to ensure that SCSI card and SCSI hard disk have the same version (the newly produced SCSI hard disk and SCSI card are forward compatible at present, and the version is not necessarily the same).
(3) IEEE1394: IEEE1394, also known as firewire or P 1394, is a high-speed serial bus. The existing IEEE 1394 standard supports the transmission rates of 100Mbps, 200Mbps and 400Mbps. In the future, it will reach 800Mbps, 1600Mbps, 3200Mbps or even higher. Such a high speed makes it possible to use it as an interface for mass storage devices such as hard disk, DVD and CD-r om. IEEE 1394 is expected to replace the existing SCSI bus and IDE interface in the future, but due to the high cost and immature technology, there are still few products using IEEE 1394 interface at present, and even fewer hard disks.
- Previous article:Lion man and shooter woman
- Next article:Chao's four-character idioms
- Related articles
- Brief introduction of actors watching meteor shower together
- What does Andromeda mean?
- When the archaeological team opened the tomb of Wanli, they saw the posture of the bones. What secrets did they discover?
- Six hexagrams divination, ask the master for advice, thank you very much.
- What zodiac are mother and son referring to?
- coarse cotton cloth
- What should ancient people do with toothache? Can ancient toothache be extracted?
- Does a woman's forehead exposure have anything to do with wealth? Is there wealth or wealth from a woman's face?
- About lottery fortune telling
- High-definition in women's eyes: eternal God