kun 的个人资料WiKi照片日志列表更多 工具 帮助

日志


3月15日

实践引导Windows7 VHD

很早之前就看到可以直接从VHD引导Windows7,一直懒得试,今天终于试了一下。
我在机器上安装了Windows7,所以用imagex抓了个wim镜像,然后把他布到vhd文件上。
1. 用AIK for Windows7里的imagex抓wim:
imagex /compress fast /capture F: G:\win7.wim "Windows 7"
F:是安装Windows7的分区。
2. 在Windows7里attach一个VHD磁盘,diskpart或“磁盘管理”都可以。新建一个磁盘分区,并且make active。
3. 用imagex把wim镜像恢复到VHD分区:
imagex /apply G:\win7.wim 1 I: /verify
I:是(2)中新建的分区。
4. 添加bcd条目:
bcdedit /copy {current} /d "Windows 7 (VHD)"
This will Return the GUID of the Loader Object that you will use to replace <guid> below
bcdedit /set <guid> device vhd=[G:]\win7.vhd
bcdedit /set <guid> osdevice vhd=[G:]\win7.vhd
bcdedit /set <guid> detecthal on
 
OK,重启,选择添加的“Windows 7 (VHD)"。
可能是把VHD放在了一块比较慢的硬盘上,比直接启动Windows7慢了不少。。。
 
2月27日

WINDOWS SERVER 2008 AND WINDOWS VISTA SERVICE PACK 2

Available on both Windows Vista and Windows Server 2008:

  • SP2 adds support for 64-bit central processing unit (CPU) from VIA Technologies, which adds the ID and vendor strings for the new VIA 64-bit CPU.
  • SP2 includes Windows Search 4.0 (previously a separate download).
  • SP2 introduces an improved power management policy that is up to 10% more efficient than the original in some configurations (both on the server and the desktop), and includes the ability to manage these settings via Group Policy.
  • SP2 adds support for UTC timestamps to the exFAT file system, enabling correct file synchronization across time zones
  • SP2 adds the ability to natively record data on to Blu-Ray media
  • SP2 includes drivers for ICCD and CCID smart card readers
  • SP2 increases the authentication options for WebDAV rediretor, enabling Microsoft Office users greater flexibility when authenticating custom applications using the WebDAV redirector

Available only on Windows Vista:

  • SP2 includes the Windows Vista Feature Pack for Wireless (previously a separate download for computers running Windows Vista SP1).  This contains:
  • Bluetooth v2.1 support
  • Windows Connect Now (WCN) updates
  • SP2 updates the RSS feeds sidebar for improved performance and responsiveness.
  • SP2 includes improvements to Windows Media Center (WMC) in content protection for TV.
  • Autotuning Diagnostics in SP2 now interprets current network conditions when implementing Windows scaling. This feature includes full netsh support.
  • SP2 adds a registry key that enables modification of the maximum number of open TCP connections to increase application compatibility.
  • SP2 corrects an issue in Windows Media Player 11 whereby customers who upgraded to WMP 11 lost access rights to previously purchased DRM content.

Available only on Windows Server 2008: 

  • SP2 provides the Hyper-V virtualization environment as a fully integrated feature of Windows Server 2008, including one free daughter OS with Windows Server 2008 Standard, four free licenses with Windows Server 2008 Enterprise and an unlimited number of free licenses with Windows Server 2008 Datacenter.
  • SP2 improves backward compatibility for Terminal server license keys
1月10日

启用hyper-v后的显卡性能问题

启用hyper-v之后,总是发现显卡性能下降了很多,例如播放wmp视频,切换到登录页面的时候,比以前慢了很多,
微软的一篇kb文件解释了这个问题:
This issue occurs when a device driver or other kernel mode component makes frequent memory allocations by using the PAGE_WRITECOMBINE protection flag set while the hypervisor is running. When the kernel memory manager allocates memory by using theWRITECOMBINE attribute, the kernel memory manager must flush the Translation Lookaside Buffer (TLB) and the cache for the specific page. However, when the Hyper-V role is enabled, the TLB is virtualized by the hypervisor. Therefore, every TLB flush sends an intercept into the hypervisor. This intercept instructs the hypervisor to flush the virtual TLB. This is an expensive operation that introduces a fixed overhead cost to virtualization. Usually, this is an infrequent event in supported virtualization scenarios. However, some video graphics drivers may cause this operation to occur very frequently during certain operations. This significantly magnifies the overhead in the hypervisor.
满心欢喜的看下去想找到解决方法,真是让人无语啊:
When you enable the Hyper-V role in Windows Server 2008, do not install the drivers for high performance accelerated graphics adapters. This behavior will not occur when you use the Vga.sys or Vgapnp.sys generic video drivers that are included with Windows Server 2008. To revert to the generic video driver, you can uninstall any high performance vendor-specific video driver.
居然是不安装显卡驱动程序,而是使用默认的vga驱动程序。。。。。。
 
我觉得,还不如bcdedit一个没有启用hyper-v的启动项来得实惠:
 

Creating a "no hypervisor" boot entry

From time to time I want to run Virtual PC / Virtual Server on my Hyper-V system.  While I can do this with the hypervisor running, the result is that Virtual PC / Virtual Server run quite slowly.  An easy fix for this is to create a second boot entry for my system that starts Windows without starting the hypervisor.  To do this you need to open an administrative command prompt and run:

 

bcdedit /copy {current} /d "Microsoft Windows Server 2008 - no hypervisor"

 

This copies your currently active boot entry (assuming that this is the one you want to copy) and gives the new copy an appropriate description.

 

bcdedit /set {identifier for the new boot entry (copy from the output of a plain 'bcdedit' command)} hypervisorlaunchtype off

 

After doing this you can choose whether the hypervisor gets loaded whenever you boot the system.

怪诞的xcopy参数

看了一篇介绍怎样将iso安装镜像copy到u盘的kb文章,里面提到xcopy拷贝参数是/s/e/f。
xcopy /?查了一下:
/S           Copies directories and subdirectories except empty ones.
/E           Copies directories and subdirectories, including empty ones.
             Same as /S /E. May be used to modify /T.
貌似/S排除空目录,/E包含空目录,那这两个参数一起用是啥意思捏。。。
4月8日

光盘卷标引起的郁闷VS2005安装问题。。。

从来没想到过卷标会影响到程序的安装,这几天遇到了:
重装了XP,并且WU了5508版本的SP3,然后装上.net3.5,然后装VS2005的时候居然失败了:
vs2005_install_fail
一个老男人咧着嘴让我插入安装光盘,可是我是挂载iso文件安装的啊,只能点cancel,然后回滚……
这太夸张了,装了n遍vs2005,从来没见过这种错误提示,想当然的以为是xp sp3引起的安装失败问题,还认真的到connect上提交了一个bug……
MS的人这次比较热情,可能是看到我写的bug题目吧:VS2005 install failed on Windows XP Sp3 V5508。。。
继续跟进,让我把C:\Documents and Settings\Administrator\Local Settings\Temp\VSMsiLog325D.txt日志发过去,我很配合的照做。
发完之后我突发奇想,MS的那个兄弟不会是想用WiLogUtl.exe分析msi安装日志吧,呵呵,果然看到了一个让人吐血的错误:
 
MSI (s) (20:44) [23:16:47:875]: Source is incorrect. Volume label should be DVD1 but is VS2005.
MSI (s) (20:44) [23:16:48:218]: Source is incorrect. Volume label should be DVD1 but is VS2005.
MSI (s) (20:44) [23:16:48:515]: Source is incorrect. Volume label should be DVD1 but is VS2005.
MSI (s) (20:44) [23:16:49:578]: User policy value 'DisableRollback' is 0
MSI (s) (20:44) [23:16:49:578]: Machine policy value 'DisableRollback' is 0
Action ended 23:16:49: InstallFinalize. Return value 2.
 
我晕啊,iso文件是我自己做的,卷标写的是VS2005,而不是默认的DVD1(这个名字实在太不专业),遂,用winiso把iso文件的卷标改回了DVD1,果然,VS2005正常安装了…………
我沉默无语,光盘的卷标影响了vs2005的安装,遇上了,解决了,疑惑+兴奋中……
3月19日

伟大的Eye-Fi

在SD卡里放了这么多东西,真是太伟大了Surprised

eye-fi-splayedinnards-2innards-small

2月4日

验证码,恶心!

回家了,又换了个地方上qq,它又开始弹出窗口让我输验证码了,真是恶的不行。不过也无所,现在平均3天上5分钟qq,在可以遇见的将来,本本里肯定不会再看到qq的身影。
最近发现“大名鼎鼎”的瑞星也开始喜欢上验证码了,手动禁用监控的时候居然也弹出一个输入验证码的窗口,苍天啊,杀软使用验证码,这可真是前无古人啊!目的很简单,为了防止有针对性的病毒结束杀软进程,要是有个恶意进程要结束杀软,难道你要我满桌面是验证码输入窗口,然后资源耗尽,死机???不从根本上加强自身的防御性,想这种幼稚、低级(此处省略N多形容词)的方法来自欺欺人,说不定瑞星升级到123.456.789版本的时候,用户每点击一个exe文件,都会弹出一个窗口,问你这个exe文件是不是病毒Don't tell anyone
12月23日

让VS2008的时间暂停吧~

90天试用版的VS2008,过期之后把系统时间改回来还能继续用,这是大前提Wink
导入注册表文件:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\devenv.exe]
"Debugger"="C:\\Program Files\\Debugging Tools for Windows\\windbg.exe -c$<C:\\2007-12-22.txt"
 
意思是devenv.exe启动的时候自动加载windbg,-c<$指定windbg的启动参数,C:\2007-12-22.txt内容如下:
bp kernel32!GetSystemTime+0x36 "r cx=0n2007;g"
bp kernel32!GetSystemTime+0x3d "r cx=0n12;g"
bp kernel32!GetSystemTime+0x45 "r cx=0n6;g"
bp kernel32!GetSystemTime+0x4d "r cx=0n22;g"
bp kernel32!GetSystemTime+0x55 "r cx=0n15;g"
bp kernel32!GetSystemTime+0x5d "r cx=0n36;g"
bp kernel32!GetSystemTime+0x65 "r cx=0n12;g"
bp kernel32!GetSystemTime+0x6d "r cx=0n687;g"
bp kernel32!getsystemtimeasfiletime+0x1b "r eax=0x1c844b0;r edx=0x61dd2578;g"
g
很清楚吧,设一堆条件断点,当调用到GetSystemTime和GetSystemTimeAsFileTime的时候改变相应的寄存器,上面那一堆断点把时间设置到了2007-12-6-22-15-36-12-687,对应的意义参照SYSTEMTIME结构,合适的时间自己找。
 
试试Wink
cheersNerd
12月20日

实践证明,helix不好玩:(

一直想build一个PDA上用的helix player,从星期二开始一直到今天,一直在cvs,build,到现在为止,别说rm了,连mp3都没出来,各种编译错,缺各种包,branch无数,target n多,文档巨少还超旧,maillist太乱,不是一般的抓狂。。。。。。
决定了,不为它熬夜了,睡觉去。

 

ps.今天联系到了real中国负责license的哥们,他很确定的告诉我个人没有权限拿到real的解码代码,即使是库文件。。。。。

9月24日

这几个域名。。。

今天瞎想的结果是几个无聊的域名:
 跑到IE里try了一下,结果前三个都已经被人注册了,只有最后一个是404错误,要不,咱把最后那个给注了?
Wink
9月19日

今天

今天有几件事情值得记一下:
1.微软中国区的CEO跑去当NBA中国CEO了。
——我第一次发现IT业和体育界还有这种联系。
2.doc.google.com现在全面支持word文档、excel表格和ppt了,这对微软确实是个不小的打击。
——在线软件离我们越来越近了,虽然网速还是个问题。。。。
3.终于知道了在linux下怎么挂载windows下都共享目录: 

mount -t smbfs -o username=user,password=foobar,ip=192.168.**.** //HOSTMACHINE_NAME/Tinix /mnt/smb/Tinix

很有用的一句话,以前是用ftp的。。。。
——解决了虚拟机里的linux用宿主windows文件的历史遗留问题。
4.Office2003系列出SP3了。
——真佩服微软hotfix的频率和速度。
9月10日

被Reflector涮啦!

用Reflector看到了这么一句话:
this.currentTiltY = Math.Asin((accData.y - 566) / 157);
这句话怎么看怎么别扭,accData.y的定义是short,那么传入Asin的参数会丢失精度啊,可奇怪的是被Reflector的程序运行正常。。。。。。
 
本着………………的精神,决定研究它一下:
写个函数:
static public void foo()
        {
            short x = 500;
            double r1 = (x - 532) / 160; //不会按预期执行
            double r2 = (x - 532.0) / 160;
            ++r1;
            ++r2;
        }
 
用Reflector:
public static void foo()
{
    short x = 500;
    double r1 = (x - 0x214) / 160;
    double r2 = (x - 532) / 160;
    r1 += 1;
    r2 += 1;
}
而IL里相关的代码是:
//000017:
//000018:             double r1 = (x - 532) / 160;
  IL_0006:  ldloc.0
  IL_0007:  ldc.i4     0x214
  IL_000c:  sub
  IL_000d:  ldc.i4     0xa0
  IL_0012:  div
  IL_0013:  conv.r8
  IL_0014:  stloc.1
//000019:             double r2 = (x - 532.0) / 160;
  IL_0015:  ldloc.0
  IL_0016:  conv.r8
  IL_0017:  ldc.r8     532.
  IL_0020:  sub
  IL_0021:  ldc.r8     160.
  IL_002a:  div
  IL_002b:  stloc.2
真相大白了:Reflector把“.0"给吃了,而恰恰是这个”.0“影响到了数据的转型。
 
结论:不能照搬Reflector的代码Wink
 
9月8日

可爱的微软,可爱的Vista:)

这幅可爱的图片是在Vista里面想用管理员权限运行IE的时候截下来的,自己人不认自家人啊Wink
 
9月5日

如何:在Vista下抓DUMP

以前在XP里面用Drwtsn32抓程序的Crash Dump,可是在Vista里面Drwtsn32已经退休了,只能用WinDbg抓了。
贴一下注册表设置:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"UserDebuggerHotKey"=dword:00000000
"Auto"="1"
"Debugger"="C:\\Program Files\\Debugging Tools for Windows\\windbg.exe -p %ld -e %ld -c \".dump /mfh E:\\Temp\\CrashDump.dmp ;q\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusionList]
"DWM.exe"=dword:00000001
 
注意:
1.WinDbg的安装位置。
2.dump到保存位置。像C:根目录这种我们习惯的地方在Vista里面是拒绝访问滴:)
9月3日

这个东东蛮有创意--Wi-Fi Detector (with built-in display)

Wireless Access Point, Wireless Access Point, wherefore art thou, Wireless Access Point?

Need to sniff out a nearby hotspot? Want to be a nearby hotspot? Mobile workers, students and casual users rejoice! StarTech.com has a device for you, the Wi-Fi Detector with a built-in (LCD) display. Slightly larger than the typical USB memory stick it can easily fit into a pocket for those times when hauling out a laptop or other mobile device and spending time looking for a hotspot isn’t convenient.

box1

Right kind of hotspot:

wifi1

Wrong kind of hotspot:

hot1

Contents of Package:

WiFi Detector

USB extension cable

Note: A CD with the WLAN/driver software would normally be included, as would an instruction manual, but were not included in my review version.  I was able to obtain these from StarTech.com’s website.   

Turn on the device via its ON/OFF slider switch, and in about 10 seconds it will show you if there are any networks within range on the display. If none are found, you will see a “No WiFi Detected!” message on the display.

 on_off

Next to the power slider are two buttons marked Back and Next that enable the user to view additional hotspot information if more than one hotspot is detected.

backnext

Opposite these buttons on the other side of the unit is a Seek/Lock button.

seeklock

By pressing and holding the button for 4 seconds the user changes the mode of the device so that it attempts to locate a dedicated SSID signal. When put in this mode, the device will constantly update the display, thereby allowing the user to move about to find the strongest signal.

The backside…why do I keep thinking of my old Commodore 64?

back

 

But wait! There’s more!

Remove the cap at the end of the device to reveal a USB connector, and voila! the Detector becomes either a Wi-Fi access point or a Wi-Fi network adaptor when plugged into a PC’s USB port. The USB connector is also the means by which the device charges its internal Li-Ion battery.

dongle

The software on the CD will install the Detector’s device drivers and ZyDAS WLAN software enabling you to configure your PC to access a wireless connection. The device is reported as a ZD1211B, and for those of you that might want to use this on a Linux system, there is a Linux driver from Sourceforge  that may work.

 Nightlight?

Incidentally, if you’re in a low-light situation, simply press the Seek/Lock button briefly or else either the Back or Next buttons.  You’ll be rewarded with about 4 seconds of a nice cerulean blue backlight (thanks, Crayola). It won’t be enough to dispel those scary monsters in the closet or under the bead, but at least they’ll know if you’ve discovered their hotspot. 

DSC00075

 

Interpreting the Display

wifi12

A. Access Points Detected & Current Channel  The 01/01 indicates the first item viewed out of x number of APs detected.  In other words, were there 3 APs and I were viewing AP #2, I would see 02/03.  The CH text below indicates the channel of the current AP.

B. Seek Lock Status   This indicator comes on when the unit has entered the

C. Encryption Indicator  This shows the type of encryption the current network being viewed has.  The types shown will be one of the following: Open for no encryption, WEP for WEP encryption, WPA for WPA encryption and WPA2 for WPA2 encryption.

D. Signal Type  The letter icon that appears here describes the 802.11x signal type.  B indicates an 802.11b network, G indicates an 802.11g network.

E. Signal Strength Indicator This shows the relative strength of the signal for the current viewed network, from 1 (low strength) to 5 (full strength).

F. SSID Indicator Shows the name of the current SSID.  If the SSID is too long, it will auto-scroll to show the complete name.

G. Detector Battery Level  This shows the charge on the unit’s internal battery.

 

Left-handed or right-handed?

While minor, note that if the Detector is inserted into a USB port on the right side of a laptop, the display will of course be upside down.

up1 down1

Note that when the device is plugged in, it ceases hotspot scanning and converts to either the battery charge mode and/or wireless adapter function.

Testing

Oh the life of a reviewer can be difficult.  Here I am in action testing the Detector while getting a pedicure as a wedding anniversary treat for my wife and me.  More organic tea, please?

pedic1

Just to show I’m not kidding, here’s a surreptitious shot of my wife sitting next to me consulting a nail color manual.  For her, not me. 

wifey

While enduring this ordeal, I was able to locate the spa’s Wi-Fi settings (it was encrypted, drat!), plus the Starbucks nearby, and yet another store’s setup a down the road within about 15 seconds.  I was able to connect to Starbucks’ via my Axim and do some surfing.

 WLAN Configuration Software

If you wish to use the Wi-Fi Detector as a network adapter on your PC, simply install the software and plug in the adapter into an available USB port.

The WLAN Configuration tool will show you relevant network and adapter info. In the upper right is a dropdown that shows the choice of Station or Access Point.  Station allows for normal network client operations; Access Point allows you to configure the unit to act as its own hotspot for other network devices.

zdlan1

More Settings takes you to this screen for encryption settings and profile configuration:

zdlan more settings

WEP configuration screen:

zdlan wep key

WPA Configuration screen:

 zdlan wpa

If you set the unit to operate as an Access Point, this is the Setting screen for AP:

zdlan access point settings

You will also have the option of being able to filter MAC addresses in AP mode:

 zdlan access point mac filter

Technical specifications:

Wireless standard: IEEE 802.11g/b

Internal antenna

Frequency Band 2.4000~2.4835GHz

Data Rate 54/48/36/24/18/12/11/9/6/5.5/2/1Mbps auto fallback

Security 64/128/256-bit WEP Data Encryption, WPA (TKIP with IEEE 802.1x) and WPA2 (AES with IEEE 802.1x)

Battery 4.2V Rechargeable Lithium-Polymer

Transmit Power 16dBm (Typical)

Unit Dimensions: 3.58 x 1.12 x 0.55 inches (91 x 28.5 x 14 mm)

Weight: ~1.06 oz (30 g)

Final Thoughts

Overall I thought this was a nifty little gadget, and was lot faster at locating network information than was my Axim or my laptop, not to mention considerably more convenient.  The fact that it can double as a wireless adapter itself is a nice feature too, but I’m not sure how useful that feature would be given the number of wireless embedded devices in portable applications.  Most laptops have wireless functionality built in, so in that sense it might be redundant.  Nevertheless it was a breeze to use and set up, and extremely portable.  My one concern is the price, which seems a little high at about $75.00.  Other than that, I really liked the Wi-Fi Detector, which if nothing else looks smarter than a Pringles cantenna. 

8月31日

4GB SDHC Plus from Sandisk, COOL!

 
Beyond speed and capacity, the 4GB SanDisk Ultra II SDHC Plus card offers both SD™ and USB functionality in one card. Designed with SanDisk’s unique, patented Hinge Lock technology, the card may be inserted into a USB port on any computer. This two-in-one SD-plus-USB feature eliminates the need to carry cables or card readers to transfer photos and videos from cameras or camcorders. Despite its small size, the hinge is sturdy – having survived more than 10,000 open-close cycles in SanDisk’s durability testing.

 

 

Woo! Removable BT headset.

I saw this from internet:
When not using the BT headset, put it into the cellphone, charging it and can also contol the media player using the keys.
8月18日

移动硬盘对性能的影响

先用两幅测试图说话:
测试对象:日立5K100,80GPATA硬盘。
首先是把硬盘装在R32的U2k里面的测试:

下面这幅是把5K100请到硬盘盒里的曲线,可以看到,前60%硬盘的性能收到USB传输瓶颈的影响都没有发挥出来,并且CPU占用率也很高: