-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6edf3db
Showing
1,331 changed files
with
278,326 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.sh linguist-detectable=false | ||
*.vim linguist-detectable=false | ||
vimrc linguist-detectable=false | ||
Gemfile linguist-detectable=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Jekyll site CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the site in the jekyll/builder container | ||
run: | | ||
# docker run \ | ||
# -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ | ||
# jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" | ||
- name: fix | ||
run: | | ||
sudo apt-get install asciidoctor tree \ | ||
&& cd Notes/004-3d-rendering/vulkan/ \ | ||
&& ( asciidoctor -a toc=right -n -s -e -R ./ -D ../vulkan_html/ $(find . -name "*.adoc") || true ) \ | ||
&& ( cp -r chapters/images ../vulkan_html/chapters/ || true ) \ | ||
&& ( cp -r chapters/extensions/images ../vulkan_html/chapters/extensions/ || true ) \ | ||
&& ( cp index.md ../vulkan_html/ || true ) \ | ||
&& ( cp chapters/index.md ../vulkan_html/chapters/ || true ) \ | ||
&& ( cp chapters/extensions/index.md ../vulkan_html/chapters/extensions/ || true ) \ | ||
&& ( for file in $(find ../vulkan_html/ -name "*.html"); do mv -- "$file" "${file%.html}.md"; done) \ | ||
&& tree | ||
rm -rf ${{ github.workspace }}/.git || true | ||
- name: GitHub Pages | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }} | ||
uses: crazy-max/[email protected] | ||
with: | ||
domain: github.com | ||
target_branch: ghp1 | ||
build_dir: . | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.unotes/unotes_meta.json | ||
.idea | ||
node_modules | ||
package-lock.json | ||
cmake-build-debug | ||
.obsidian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
// Place your GitNote 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | ||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | ||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | ||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | ||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | ||
// Placeholders with the same ids are connected. | ||
// Example: | ||
"note": { | ||
"scope": "markdown", | ||
"prefix": "note", | ||
"body": [ | ||
"{% raw %}", | ||
"", | ||
"```note", | ||
"### $1", | ||
"", | ||
"$2", | ||
"```", | ||
"", | ||
"{% endraw %}" | ||
], | ||
"description": "Log output to console" | ||
}, | ||
"warning": { | ||
"scope": "markdown", | ||
"prefix": "warning", | ||
"body": [ | ||
"{% raw %}", | ||
"", | ||
"```warning", | ||
"### $1", | ||
"", | ||
"$2", | ||
"```", | ||
"", | ||
"{% endraw %}" | ||
], | ||
"description": "Warning block" | ||
}, | ||
"tip": { | ||
"scope": "markdown", | ||
"prefix": "tip", | ||
"body": [ | ||
"{% raw %}", | ||
"", | ||
"```tip", | ||
"### $1", | ||
"", | ||
"$2", | ||
"```", | ||
"", | ||
"{% endraw %}" | ||
], | ||
"description": "tip block" | ||
}, | ||
"danger": { | ||
"scope": "markdown", | ||
"prefix": "danger", | ||
"body": [ | ||
"{% raw %}", | ||
"", | ||
"```danger", | ||
"### $1", | ||
"", | ||
"$2", | ||
"```", | ||
"", | ||
"{% endraw %}" | ||
], | ||
"description": "danger block" | ||
}, | ||
"information": { | ||
"scope": "markdown", | ||
"prefix": "information", | ||
"body": [ | ||
"{% raw %}", | ||
"", | ||
"```information", | ||
"### $1", | ||
"", | ||
"$2", | ||
"```", | ||
"", | ||
"{% endraw %}" | ||
], | ||
"description": "information block" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
layout: 404 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
project(GitNote) | ||
|
||
add_executable(GitNote main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
www.xjbcode.fun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
source "https://rubygems.org" | ||
|
||
# Hello! This is where you manage which Jekyll version is used to run. | ||
# When you want to use a different version, change it below, save the | ||
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: | ||
# | ||
# bundle exec jekyll serve | ||
# | ||
# This will help ensure the proper Jekyll version is running. | ||
# Happy Jekylling! | ||
gem "jekyll", "~> 3.9.0" | ||
|
||
# This is the default theme for new Jekyll sites. You may change this to anything you like. | ||
gem "minima", "~> 2.0" | ||
|
||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and | ||
# uncomment the line below. To upgrade, run `bundle update github-pages`. | ||
# gem "github-pages", group: :jekyll_plugins | ||
|
||
# If you have any plugins, put them here! | ||
group :jekyll_plugins do | ||
gem "jekyll-feed", "~> 0.6" | ||
gem 'jekyll-asciidoc' | ||
end | ||
|
||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem | ||
# and associated library. | ||
platforms :mingw, :x64_mingw, :mswin, :jruby do | ||
gem "tzinfo", "~> 1.2" | ||
gem "tzinfo-data" | ||
end | ||
|
||
# Performance-booster for watching directories on Windows | ||
gem "wdm", "~> 0.1.0", :platforms => [:mingw, :x64_mingw, :mswin] | ||
|
||
# kramdown v2 ships without the gfm parser by default. If you're using | ||
# kramdown v1, comment out this line. | ||
gem "just-the-docs" | ||
gem 'asciidoctor', '~> 2.0', '>= 2.0.17' | ||
gem "kramdown-parser-gfm" # github flavored markdown | ||
gem 'jekyll-asciidoc' | ||
gem 'jemoji' | ||
# gem 'kramdown-math-katex' | ||
gem 'jekyll-avatar' | ||
gem 'jekyll-mentions' | ||
gem 'jekyll-gist' | ||
gem "jekyll-jupyter-notebook" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 张福文 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# x86的启动过程 | ||
|
||
# 1.1 CPU的第一条指令 | ||
|
||
借用网友的一张图片,上面讲述了x86系统启动到Linux内核的流程。从图中可以看到,CPU上电后从CS:IP=FFFF:0000这地址处获取第一条指令并执行。 | ||
|
||
![X86架构下的从开机到Start_kernel启动的总体过程](/assets/20140807152559130.jpeg) | ||
|
||
这条指令即是BIOS的指令,但它并不是BIOS的第一条指令,反而是最后一条指令。这个指令通常是一个跳转指令,跳转到BIOS中合适的位置去执行。 | ||
|
||
需要知道这时CPU处于实模式(实模式、保持模式、系统管理模式),实模式下,CPU采用段式管理内存,CPU访存的物理地址由段选择寄存器CS和指令指针寄存器IP决定。两个寄存器都是16位寄存器,一个16位的地址只能访问2的16次方即64KB字节的内存范围,但是在8086中,地址总线已经扩展到20位,即它最多可以访问1MB的内存。为了组成20位的地址,CPU将CS这个16位寄存器左移4位,与IP寄存器相加做为地址,相加得到的数是一个20位的数。在CS的值的不变的情况下,CPU只能访问CS到CS+64KB之间的地址,如果想访问超过这个范围的地址,就需要修改CS的值。这种访存模式就好人一个人牵着一个小狗,人不动的情况下,小狗运行的距离超不过那跟绳子。 | ||
在我们现在讨论的环境中,地址CS:0xFFFF,IP:0x即物理地址0xFFFF0。 | ||
|
||
# 1.2 现代计算机中的CPU第一条指令 | ||
|
||
在现代CPU中,BIOS存储在一块SPI接口的flash中。从网上找了一张简单的架构图。这个图比较过时了,然而仍然可以用来解释这个问题。 | ||
|
||
在现在计算机中,北桥基本已经不存在了,或者说这个北桥的功能已经被合并到CPU Die上面去了。所以大家可以看到的只是南桥。从图中可以看出,北桥的功能主要是提供PCIe接口用来接入独立显卡,或是在北桥内部集成一个显卡,北桥的功能非常单一,单独搞成一个芯片不划算,又给画电路板带来不必要的麻烦,所以直接把这个芯片合并在CPU Die上是非常合理的。 | ||
|
||
去掉北桥之后,CPU通过DMI总线与南桥通信。这里要大致介绍一下Intel CPU中的总线系统。Intel CPU的系统总线称为QPI,它由20个lane组成,每个lane是一对差分传输线。Intel的外部总线是PCIe总线,PCIe可以说是QPI的 一个子集,它与QPI采用类似的上传协议,在物理层支持4,8,16,32等多种个数的lane。DMI总线几乎只用在CPU和南桥之间,它由4个lane组成,它只实现了总线的底层协议,对上层协议来讲,它是透明的。如果在CPU和南桥之间通过PCIe连接,那么南桥上的设备就挂这个PCIe总线的下面,但通过DMI总线连接时,南桥上的设备也是挂在系统了CPU_BUS_NO0下面。南桥上有LPC总线控制器和SPI总线控制器,SPI总线上接的就是存储BIOS的flash。在另一些系统中,SPI总线控制器也会挂在LPC总线上。 | ||
|
||
所有这些总线上传输的都是CPU发出来的load/store访存指令(对于x86来讲,类似于一个mov汇编指令)或in/out 访问IO指令。各级总线的控制器可以理解为一个桥,它接收来自上级总线的访存请求,转换成下级总线(如spi)的对应一个或多个transaction,得到数据后再返回给上级总线。 | ||
|
||
这里先不谈IO指令,只谈访存,在不同的总线上,总线地址代表的含义是不一样的。比如说通常使用的8MB SPI flash。在SPI总线上,它的地址范围是0~8MB。对CPU来讲,这个8MB的数据被映射为到4GB地址的末尾8MB。0xFFFF0这个物理地址上的数据,在spi flash上可能存储的位置是实际是0xFFFFFFF0(4GB-16Bytes),对这个地址的数据读请求路由到SPI总线时,SPI控制器会做一个转换,转换为0x7FFFF0地址(8MB-16Bytes),发给spi flash,取回数据,再给CPU回复一个memory read response。由于QPI是异步总线,所以SPI总线慢它可以等。 | ||
|
||
![](/assets/cd306921220602561.png) | ||
|
||
说CPU取的第一条指令地址是0xFFFF0,这是针对8086而言,对于80386之后的CPU,这个地址就变成了0xFFFFFFF0。 | ||
|
||
这里可能需要细讲一个CPU的段寄存器,CPU的段寄存器有几个,CS, DS, ES, FS,即代码段寄存器、数据段寄存器等。CPU执行的第一条指令的地址是由CS寄存器和IP寄存器共同指定的。在CPU上电后,CPU内部一些硬件逻辑做执行一次自检,检查自己的状态是否正常,如果正常的话,将eax寄存器写为0.不正常则会写入错误编码。 | ||
然后CPU清空Cache, TLB等缓存类硬件,将CS的初始值设置为0xF000,将IP设置为0xFFF0,所得到的物理地址值即为0xF000 << 4 | 0xFFF0 = 0xFFFF0。 | ||
|
||
看起来已经很明白了,然而还没完。 | ||
现代CPU中为了加速指令地址的计算,为每个段寄存器增加了两个寄存器:Base和Limit。Base存放基址,Limit存放最大偏移值。Base和Limit寄存器不能通过指令直接读写,他们的值是在写段寄存器时由CPU自动设置的。通常Base等于段寄存器左移四位,如果CS的值为0xF000,CS的Base寄存器则为0xF0000,但CPU初始化时例外。CS的值为0xF000, 但其Base为0xFFFF0000,EIP为0xFFF0,此时对应的指令地址为0xFFFF0000+0xFFF0 = 0xFFFFFFF0。0xFFFFFFF0就是CPU将要执行的第一条指令。这造成这样一个有趣的事实,16位程序眼中的指令地址空间0x0000~0xFFFF(大小为64K)被CPU翻译到物理地址空间(0xFFFF0000~0xFFFFFFFF)。也就是说,从CPU初始化,到段寄存器被重写(通过跨段跳转指令)前,指令空间0x0000~0xFFFF通过段寄存器被映射到物理地址空间0xFFFF0000~0xFFFFFFFF。 | ||
|
||
参考资料: | ||
http://www.cppblog.com/djxzh/archive/2015/07/12/uefi_resetvector.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Nandflash基础知识 | ||
|
||
## 1. 封装 | ||
|
||
Nandflash一颗芯片中封装一个硅片称为一个Die,一个Die内部可能再分为两个平面,称为Plane。Plane有多个Block,每个Block又分为多个Page。 | ||
|
||
![](/assets/nand-flash-die-layout.png) | ||
|
||
通常大家不会关心Die和Plane。而是从Block以下开始关注。 | ||
一页的数据有时还分为上半页和下半页,并且每页附带几个字节的多余存储空间,称为spare area。一些Nandflash管理程序会利用spare erea来做一些管理数据、ECC校验数据等。 | ||
通常一个block有256、1024、2048个pages。 | ||
一个page通常有512、1024、2048等个字节。 | ||
|
||
![](/assets/2vdf3phSdKcGP5c7tDkl_nand_structure.png) | ||
|
||
## 2. Nandflash的基本操作 | ||
|
||
Block是擦除的最小单位,Page是读写的基本单位。 | ||
![](/assets/nand-flash-blocks-pages-program-erases.jpg) | ||
|
||
### 2.1 擦除 | ||
|
||
Nandflash不像内存或是硬盘一样可以改写。它上面的一个比特(对于SLC\)而言)一旦被写为1,就不能再单独改写为0,而必须和它所在的Block上的所有其它位一起全部擦除为0. | ||
|
||
### 2.2 写 | ||
|
||
我们说Nandflash的写操作是以Page为单位的,但是实际上你可以精确到Page上的单位。比如说你可以先写bit 0为1,再写bit 1为1。但是你不可以回过头来把bit 0写为0,因为只有擦除操作才能把写为1的位改回0. | ||
|
||
### 2.3 读 | ||
|
||
说读的基本单位为Page。你当然也可以一次中读Page中的几个位,但是所有的时间都是一样长的。 | ||
|
||
## 3. Nandflash的内部结构 | ||
|
||
下图是Nandflash的一个块的内部结构,这个图片非常经典。可以看到,一个Block实际上是芯片中晶体管组成的一个阵列。而一个Page才是这个阵列的一个行或是行的一部分,即一行可能又分成多个Page。 | ||
|
||
![](/assets/lp8RT.jpg) | ||
|
||
WLx为第x行的行选线,但WLx为高电平时,整个行(即一个Page\)上的cell都可以操作。WL是Word Line的缩写。 | ||
|
||
BLx为行上第x位的位选线,在一个行WLx被选中的情况下,给BLy加高电平就可以在相应的位上写入1。 | ||
|
||
### 3.1 读时内部路行为 | ||
|
||
在通常的Nandflash芯片中,一个Block有一行的sense amplifier,连接在每个bit line上,读数据时,先用Vread选中一行,将不选中的行的word line置为Vpass,使那个晶体管有导通功能。然后选中的行上的各cell上的数据就会被sense amplifier读出来。 | ||
![](/assets/未命名.png)**读操作各部位电压** | ||
|
||
### 3.2 写(编程)时内部电路行为 | ||
|
||
编程是往一个cell写1的过程同样是将不选中的行置为Vpass,要选中的行的word line置为Vpgm,选中的bit line置为GND,其他bit line置为VDD。 | ||
![](/assets/未命名1.png)**写操作各部位电压** | ||
即: | ||
![](/assets/3.png) | ||
|
||
### 3.3 擦除时内部电路行为 | ||
|
||
擦除。 | ||
|
||
## 4. Nandflash不支持in-place update | ||
|
||
Nandflash的一个页不能写了之后几乎不可以改写,只前整块擦除。如果要改变一个页上的数据,通常的做法不是擦除整个块然后再全部修改了再写上去,而是将这个页的内容标志为无效,将修改后的数据写到新的页上,然后更新指针指到新的页上。这是flash translation layer的一基本操作。Flash translation layer简称FTL,是一个业界常研究的课题。 | ||
|
||
![](/assets/nand-flash-page-update.jpg)**nand flash page update\(out-of-place update\)** | ||
|
||
## 5. SLC、MLC和TLC对比 | ||
|
||
SLC = Single-Level Cell ,即1bit/cell,速度快寿命长,价格超贵(约MLC 3倍以上的价格),约10万次擦写寿命 | ||
|
||
MLC = Multi-Level Cell,即2bit/cell,速度一般寿命一般,价格一般,约3000---10000次擦写寿命 | ||
|
||
TLC = Trinary-Level Cell,即3bit/cell,也有Flash厂家叫8LC,速度慢寿命短,价格便宜,约500次擦写寿命,目前还没有厂家能做到1000次。 | ||
|
||
### 5.1 速度对比 | ||
|
||
SLC速度最快,MLC速度比TLC更快。但也有资料显示,MLC是不是比TLC快要看制程的,新制程的TLC比老的MLC快多了,不过寿命的确是MLC要长点。 | ||
|
||
### 5.2 擦写次数对比 | ||
|
||
“TLC芯片”只能写500次并非意味着U盘拔插500次就完蛋了!简单举例,假设一个8G U盘,往里面写入8G,就算一次;清空写入3G,算第二次,在清空写入5G,仍然算第二次;再写入1G,那现在就开始算第三次。 | ||
换个角度来理解,假设8G U盘一生只能擦写500次,那么这个U盘一生理论上可以重复装载4000G 文件。而MLC芯片的U盘一生最少都能装载2.4万G到8万G。这就是为什么说TLC芯片的U盘相对短命的原因。 | ||
关于TLC: | ||
X3\(3-bit-per-cell\)架构的TLC芯片技术是MLC和TLC技术的延伸,最早期NAND Flash技术架构是SLC\(Single-Level Cell\),原理是在1个存储器储存单元\(cell\)中存放1位元\(bit\)的资料,直到MLC\(Multi-Level Cell\)技术接棒后,架构演进为1个存储器储存单元存放2位元。 | ||
2009年TLC架构正式问世,代表1个存储器储存单元可存放3位元,成本进一步大幅降低。 | ||
如同上一波SLC技术转MLC技术趋势般,这次也是由NAND Flash大厂东芝\(Toshiba\)引发战火,之后三星电子\(Samsung Electronics\)也赶紧加入战局,使得整个TLC技术大量被量产且应用在终端产品上。 | ||
TLC芯片虽然储存容量变大,成本低廉许多,但因为效能也大打折扣,因此仅能用在低阶的NAND Flash相关产品上,象是低速快闪记忆卡、小型记忆卡microSD或随身碟等。 | ||
象是内嵌世纪液体应用、智能型手机\(Smartphone\)、固态硬碟\(SSD\)等技术门槛高,对于NAND Flash效能讲求高速且不出错等应用产品,则一定要使用SLC或MLC芯片。 | ||
2010年NAND Flash市场的主要成长驱动力是来自于智能型手机和平板计算机,都必须要使用SLC或MLC芯片,因此这两种芯片都处于缺货状态,而TLC芯片却是持续供过于求,且将整个产业的平均价格往下拉,使得市调机构iSuppli在统计2010年第2季全球NAND Flash产值时,出现罕见的市场规模缩小情况发生,从2010年第1季43亿美元下降至41亿美元,减少6.5%。 | ||
|
||
## 6. ECC、坏块和wear leveling | ||
|
||
由于Nandflash的Cell是有擦写次数限制的,多次使用之后某个cell就可能无法再被擦除并写入正确的数据。这时,这个块称为坏块。 | ||
软件在使用Nandflash时,需要管理这些坏块,将坏块记录下来,以后写数据是避开。 | ||
软件再使用Nandflash时,还需要注意尽量将擦除操作分配到不同的块上。这样可以减小坏块的产生(直到所有Block接近一起坏掉)。这个行为称为wear leveling。 | ||
你为法预料到哪个块的哪个cell在什么时候出错,因而通常在写入数据时同时在spare erea写入ECC校验数据,以便在出现坏的某个cell首次坏掉时可以检测到并恢复数据。 | ||
|
||
## 7. 参考资料 | ||
|
||
[1. Understanding Flash: Blocks, Pages and Program / Erases](https://flashdba.com/2014/06/20/understanding-flash-blocks-pages-and-program-erases/) | ||
|
||
[2. SD知识篇——关于闪存芯片SLC、MLC和TLC](http://bbs.ixpub.net/thread-9814705-1-1.html) | ||
|
||
[3. Nand Flash 基本介紹](http://cmchao.logdown.com/posts/60216) | ||
|
||
[4. Sense Amplifier for Flash Memories: Architectural | ||
Exploration and Optimal Solution](https://repository.iiitd.edu.in/jspui/bitstream/123456789/377/1/MT13156.pdf) | ||
|
||
[5. MODELING THE PHYSICAL CHARACTERISTICS | ||
OF NAND FLASH MEMORY](http://itzbhushan.gitlab.io/files/Thesis.pdf) | ||
|
Oops, something went wrong.