While editing the blog, there's two tab named "modify html" and "write"(I use the Chinese interface, so I'm not sure the exact name of this two tab)
Whenever there are lines leading with spaces (spaces at the beginning of the line), switching between the two tab would remove one leading space of these lines, until no space at the beginning of the line.
For unknown reason, kernel set the obsolete bit in both device control register and device register, and never used.
Device Control Register
Device/Head Register
include/linux/ata.h
ATA_DEVICE_OBS = (1 << 7) | (1 << 5), /* obs bits in dev reg */ ATA_DEVCTL_OBS = (1 << 3), /* obsolete bit in devctl reg */ ATA_BUSY = (1 << 7), /* BSY status bit */
drivers/ata/libata-core.c
/** * ata_port_alloc - allocate and initialize basic ATA port resources * @host: ATA host this allocated port belongs to * * Allocate and initialize basic ATA port resources. * * RETURNS: * Allocate ATA port on success, NULL on failure. * * LOCKING: * Inherited from calling layer (may sleep). */ struct ata_port *ata_port_alloc(struct ata_host *host) { struct ata_port *ap;
DPRINTK("ENTER\n");
ap = kzalloc(sizeof(*ap), GFP_KERNEL); if (!ap) return NULL;
/** * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure * @tf: Taskfile to convert * @pmp: Port multiplier port * @is_cmd: This FIS is for command * @fis: Buffer into which data will output * * Converts a standard ATA taskfile to a Serial ATA * FIS structure (Register - Host to Device). * * LOCKING: * Inherited from caller. */ void ata_tf_to_fis(const struct ata_taskfile *tf, u8 pmp, int is_cmd, u8 *fis) { fis[0] = 0x27; /* Register - Host to Device FIS */ fis[1] = pmp & 0xf; /* Port multiplier number*/ if (is_cmd) fis[1] |= (1 << 7); /* bit 7 indicates Command FIS */
用 IECacheView 檢視所有快取檔案 (Mozilla, Opera 和 Chrome 也有對應版本) http://blog.joaoko.net/archives/945 IE的沒什麼大問題,因為它的Cache就是在某個目錄下,我的W2k是在C:\Documents and Settings\user\Local Settings\Temporary Internet Files,直接就是原來的檔案改個名字,直接去那個目錄直接看也行
MozillaCacheView v1.16 - View the cache files of Mozilla/Firefox browsers http://www.nirsoft.net/utils/mozilla_cache_viewer.html 可能是因為firefox的Cache還多了一層index的關係,所以在index還沒寫入map檔的時候,cache viewer會讀到不正確的index 實際使用時常有有缺少檔案,或Cache都產生也看到了,開cache viewer也看不到或是只看的到部份,使用時最好把firefox關掉,以強迫index寫入檔案,再開cache viewer,會比較沒問題
git checkout <SHA1_code> :切換到某次的commit,you are on "no branch" after checkout
git checkout <tag_name> :切換到某個tag,you are on "no branch" after checkout
git checkout <branch_name> :切換到某個branch
git checkout -b <branch_name> :新增某個branch並切換到它上面
git diff
git merge
git reset
git reset --mixed
(--mixed is the default action)
git reset HEAD :把某個檔案移出index(staging)
現在似乎除了看reflog外沒有其他辦法,新版的git會有warning on dangling commit...
<mkl> Is there anyway to check if there is dangling commit in current database?
<mkl> git log --all or gitk --all won't show dangling commit
<Ilari> mkl: You could extract recent such commits from reflogs, but I don't know easy and fast way to cross-reference them with current branches...
<mkl> yes, reflog seems the only way to find the dangling commit, but only if you aware that there is one, and you have to dig into a long log full with hex code.....
<Ilari> mkl: Also, commit followed by checkout moving from something non-symbolic is pretty good indication that something left dangling.
<mkl> yes, but only if you do aware of the situation....
<mkl> and also commit followed by checkout from tag
<charon> mkl: newer git says which branch you committed on, and indicates a dangling commit with [detached HEAD]
<charon> mkl: 72c69ebc035 which is in 1.6.1
<mkl> Thanks charon, Ilari, drizzd, milli, I finally got the problem clearified and fixed....
git log --all
list 出所有的commit(但是似乎dangling commit不會被list出來)
git reflog
Reflog is a mechanism to record when the tip of branches are updated. This command is to manage the information recorded in it. 它會log所有的 commit和checkout
---1 current stable image Our current stable image is called 'Om2008.9', available at http://downloads.openmoko.org/releases/Om2008.9/ We are sometimes cherry-picking fixes into it, but admittedly not as many as we would like. If someone wants to step up to become stable maintainer for this image and cherry-pick more fixes into it, please let me know. Alternatively, a number of other images are available, Debian, Qt Extended, Android, FDOM, SHR, etc. See http://wiki.openmoko.org/wiki/Distributions for a more comprehensive list.
---2 Mickey's framework milestones As many people know, the next big thing for Openmoko will be Mickey's FSO framework around d-bus and Python, and the Paroli telephony UI. See http://wiki.openmoko.org/wiki/OpenmokoFramework A few weeks ago, Mickey released milestone 4, available at http://downloads.freesmartphone.org/fso-stable/milestone4.1/ In late January, he plans to come out with milestone 5, in late March with milestone 6. See here for a more detailed roadmap: http://trac.freesmartphone.org/roadmap
---3 next major release, Om2009 After the next 2 FSO milestones, Openmoko will fork off a stable branch, and spend 2-3 months on testing and bug fixing. This will lead to our next major release, Om2009. The telephony UI will be Paroli, see http://code.google.com/p/paroli/ The way things are going right now, we will probably have this release mid-next year.
1. fso-console-image: minimal system with frameworkd, no user interface manager. 2. fso-illume-image: everything in console-image plus X-Window, plus Enlightenment plus Illume window manager. 3. fso-image: everything in illume-image plus Zhone. Can be used for phone calls. Like previous milestones. But Zhone is going to be faded out.
Intel Core2Quad Q9550 @ 2.83GHz Asus P5Q 8G DDR2 800 EN9500GT OC/DE/512M SATA ExcelStor Technology J8160S 160GB SATA Optiarc DVD RW AD-7200S
Ubuntu 7.04 have problem while starting X
Ubuntu 8.04 lte, Ubuntu 8.10 no matter AHCI or not,installing to a SATA disk, or USB to IDE (WD1600JB WD Caviar SE, IDE 160GB) Stop while installing system around 50% with following reported:
The installer encountered an error copying files to the hard disk:
[Errno 5] Input/output error
This is often due to a faulty CD/DVD disk or drive, or a faulty hard disk. It may help to clean the CD/DVD, to burn the CD/DVD at a lower speed, to clean the CD/DVD drive lens (cleaning kits are often available from electronics suppliers), to check whether the hard disk is old and in need of replacement, or to move the system to a cooler environment.
nVidia+8GB RAM issue, all ok after remove RAM to size
Debian 4.0r3
No common CD-ROM driver was detected ........
This seems that AHCI CD-ROM not supported yet
Fedora 9 Finished installation, rebooting, then there comes the Welcome menu, system hang after finish [Hardware Profile]. nVidia+8GB RAM issue, all ok after remove RAM to size
The server kernel has been compiled with PAE (which solves the problem) and with Xen related things. The latter prevents the installation and use of the NVidia proprietary drivers. Depending on your configuration, this may create another problem, which can be solved by compiling your own kernel, with PAE but without Xen support.
Ubuntu desktop have PAE and Xen disabled Ubuntu server have both PAE and Xen enabled
but why Ubuntu desktop installation would failed? (unknown)
Solutions
Remove RAM to size < 3GB, install ubuntu desktop, rebuild kernel to enable PAE, re-insert RAM (Ubuntu could reboot with 8GB RAM installed and w/o PAE enabled, but there is only 3292MB RAM available, shown on htop, while w/ PAE,8106MB.
Besides, enabling nVidia accelerated graphics driver w/o PAE enabled w/ 8GB RAM installed, error like the following might be seen while restarting:
Ubuntu is running in low-graphics mode The following error was encountered. You may need to update your configuration to solve this. (EE) NVIDIA(0): Failed to load the NVIDIA kernel module! (EE) NVIDIA(0): *** Aborting *** (EE) Screen(s) found, but none have a usable configuration.
I'm trying to install the 169.12 driver (from nvidia's .run file). The kernel I am using is from Ubuntu 8.04, the "2.6.24-16-server" kernel. The installer refuses to install into this kernel: it reports Code:
The kernel you are installing for is a xen kernel.
#class class sample: def __double_underscore_would_be_renamed_should_not_access(self): print ("should not be access directly") def access(self): print("access first") self.__double_underscore_would_be_renamed_should_not_access() def _single_underscore_method_would_not_be_imported(self): print("I will not be imported")
Convert to list >>> list("hello") ['h', 'e', 'l', 'l', 'o']
string is not changable, like tuple. >>> x="hello" >>> x[3]="a" Traceback (most recent call last): File "<pyshell#34>", line 1, in <module> x[3]="a" TypeError: 'str' object does not support item assignment >>> xx=list(x) >>> xx[3]="a" >>> xx ['h', 'e', 'l', 'a', 'o']
Membership check -- in >>> xxx=[1,2,3,4,5,6,7,8,9,0] >>> 3 in xxx True >>> 10 in xxx False
List methods - object.method(argument) append(value) count(value) - count the occurances of the given value extend(list_object) index(value) - find the index of the given value insert(pos,value) pop(pos) - remove the element of the given position, the last one if pos not given remove(value) reverse() sort() sort(cmp) sort(key=len) sort(reverse=True|False)
Tuple
>>> 1 1 >>> 1, (1,) >>> (1,) (1,) >>> (1) 1
Convert list to tuple >>> tuple([1,2,3]) (1, 2, 3) >>>
Strings
single quote ' double quote " escape \
String Concatenation + String representations
str(x) repr(x) or backticks `x`
Long string """ or ''' Raw string r"xxx" Unicode string u"xxx"
The number of seeks per second should be fairly bound by your hardware
The rewrite test is important if you are running applications that modify data in place
benchmarks reported as +++++ when that particular benchmark completes too quickly use the -n option to specify that more files should be used for the metadata tests -n file_num:file_size_max:file_size_min:dir_num default is 16:0:0:1
/* * Early initcalls run before initializing SMP. * * Only for built-in code, not modules. */ #define early_initcall(fn) __define_initcall("early",fn,early)
/* * A "pure" initcall has no dependencies on anything else, and purely * initializes variables that couldn't be statically initialized. * * This only exists for built-in code, not for modules. */ #define pure_initcall(fn) __define_initcall("0",fn,0)
/** * module_init() - driver initialization entry point * @x: function to be run at kernel boot time or module insertion * * module_init() will either be called during do_initcalls() (if * builtin) or at module insertion time (if a module). There can only * be one per module. */ #define module_init(x) __initcall(x);
The PCI initial sequence: (arch specific not included)
Rather than taking advantage of multiple traffic classes and virtual lanes, existing PCI-Express adapters only support one virtual channel and one traffic class. Moreover, the primary operating systems, i.e. Microsoft Windows and Linux, only use one traffic channel and one virtual lane. As a result, currently known environments often encounter problems where the total possible bandwidth of a set of PCI-Express adapter cards within an I/O drawer attached to a CPU complex via an I/O hub or switch may far exceed the capabilities of the I/O hub, switch, and/or the front-side bus.
You may want to run ifconfig usb0 down prior to switching to USB host mode
USB host/device mode setting /sys/devices/platform/s3c2410-ohci/usb_mode echo "host" > /sys/devices/platform/s3c2410-ohci/usb_mode
Enable USB 5 volt USB power to an attached USB device /sys/devices/platform/neo1973-pm-host.0/hostmode echo "1" > /sys/devices/platform/neo1973-pm-host.0/hostmode
script
#!/bin/sh grep -q 'host' /sys/devices/platform/s3c2410-ohci/usb_mode if [ $? -eq 0 ] then echo "0" > /sys/devices/platform/neo1973-pm-host.0/hostmode echo "device" > /sys/devices/platform/s3c2410-ohci/usb_mode echo USB-Port is in device-mode now. else ifconfig usb0 down echo "host" > /sys/devices/platform/s3c2410-ohci/usb_mode echo "1" > /sys/devices/platform/neo1973-pm-host.0/hostmode echo USB-Port is in host-mode now. fi
desktop icons is at /usr/share/applications for non-QT? /opt/Trolltech/Qtopia/services for Qt
ata_init subsys_initcall(ata_init); --do nothing but simply create a workqueue "ata"(ata_wq) and a single thread workqueue "ata_aux"(ata_aux_wq)
struct pci_driver ahci_pci_driver::probe=ahci_init_one --each host driver would register a pci_driver to kernel, once the devid/vendorid matches, the probe function will be ran, which is ahci_init_one in this case
ahci_init_one --if any host controller found, it would register devices with scsi layer
ata_host_activate(ahci_sht) ata_host_activate(scsi_host_template ) --It would call scsi_host_add to get hooked into scsi layer
--Upon used to queue up a scsi command block to the low-level device driver (LLDD) struct scsi_host_template ahci_sht::queuecommand = ata_scsi_queuecmd ata_scsi_queuecmd ata_qc_issue struct ata_port_operation ahci_ops::qc_prep = ahci_qc_prep --write command slot
ahci_qc_prep --convert taskfile to fis, and fill the command slot
ata_port_operations inherits relations SFF: Small Form Factor committee http://en.wikipedia.org/wiki/Small_Form_Factor_committee
The parity blocks are not read on data reads, since this would be unnecessary overhead and would diminish performance. The parity blocks are read, however, when a read of blocks in the stripe and within the parity block in the stripe are used to reconstruct the errant sector. The CRC error is thus hidden from the main computer.
Fails
totally failed, can't read
partially failed, but write-then-read check would failed
Parity check on read is very expensive, a read would require N(disks amount) read.
Can RAID 5 detect 2nd type fails, if no parity check on read?
Shone, my colleague, says that HD itself should be capable of detecting the fail first, while some hardware RAID do have a option to turn on "parity check on read".Does HD have the ability to detect the 2nd type failure?(My guessing) check parity on read, if failed:
write-then-read check for each relative block on each disk, in order to know which block fails
Bad Blocks on Disk Drive The most common form of disk drive failure is a slow but steady loss of 'blocks' on the disk drive. Blocks can go bad in a number of ways: the thin film of magnetic media can separate or slide on its underlying disk platter; the film of magnetic media can span a pit or gouge in the underlying platter, and eventually, like a soap bubble, it can pop. Although disk drives have filters that prevent dust from entering, the filters will not keep out humidity, and slow corrosion can set in. Mechanical abrasion can occur in several ways: the disk head can smash into the disk; alternately, a piece of broken-off media can temporarily jam under the head, or can skitter across the disk patter. Disk head crashes can be caused by kicking or hitting the CPU cabinet; they can also be caused by vibration induced by cooling fans, construction work in the room, etc. There are many other mechanical causes leading to (permanent) bad blocks. In addition, there are also "soft" or corrupted blocks: in modern hard drives, the size of one bit is so small that ordinary thermal noise (Boltzmann noise) is sufficient to occasionally flip a bit. This occurs so frequently that it is normally handled by the disk firmware: modern disk drives store ECC bits to detect and correct such errors. The number of ECC-corrected errors on a disk can be monitored with smartmon tools. Although on-disk ECC correction is sufficient to correct most soft errors, a tiny fraction will remain uncorrectable. Such soft errors damage the data, but do not render the block permanently (physically) unusable. Other soft errors are described in the next section below.
Over time, bad blocks can accumulate, and, from personal experience, do so as fast as one a day. Once a block is bad, data cannot be (reliably) read from it. Bad blocks are not uncommon: all brand new disk drives leave the factory with hundreds (if not thousands) of bad blocks on them. The hard drive electronics can detect a bad block, and automatically reassign in its place a new, good block from elsewhere on the disk. All subsequent accesses to that block by the operating system are automatically and transparently handled by the disk drive. This feature is both good, and bad. As blocks slowly fail on the drive, they are automatically handled until one day the bad-block lookup table on the hard drive is full. At this point, bad blocks become painfully visible to the operating system: Linux will grind to a near halt, while spewing dma_intr: status=0x51 { DriveReady SeekComplete UnrecoverableError } messages.
Using RAID can mitigate the effect of bad blocks. A Linux md-based software RAID array can be forced to run a check/repair sequence by writing the appropriate command to /sys/block/mdX/md/sync_action (see RAID Administration commands, and also below, for details). During repairs, if a disk drive reports a read error, the RAID array will attempt to obtain a good copy of the data from another disk, and then write the good copy onto the failing disk. Assuming the disk has spare blocks for bad-block relocation, this should trigger the bad-block relocation mechanism of the disk. If the disk no longer has spare blocks, then syslog error messages should provide adequate warning that a hard drive needs to be replaced. In short, RAID can protect against bad blocks, provided that the disk drive firmware is correctly detecting and reporting bad blocks. For the case of general data corruption, discussed below, this need not be the case.
BTW, I don't see any field that is related to the number of ECC-corrected errors on a disk:
root@test-laptop# smartctl --all /dev/sda smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION === Device Model: WDC WD1600BEVS-22RST0 Serial Number: WD-WXE108Y89770 Firmware Version: 04.01G04 User Capacity: 160,041,885,696 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 7 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Mon Nov 3 19:02:24 2008 CST SMART support is: Available - device has SMART capability. SMART support is: Enabled
=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED
General SMART Values: Offline data collection status: (0x00) Offline data collection activity was never started. Auto Offline Data Collection: Disabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: (6780) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 87) minutes. Conveyance self-test routine recommended polling time: ( 6) minutes.
SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 0 -
SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.
I write for myself to remember things, and it's just a note, or memo. Not always complete, or meaningful, and also not necessary created by me. Reference at will.