in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

March 2008 - Posts

  • 在ICH8南桥上开启AHCI

    http://casparchen.blog.51cto.com/235671/43997
    AHCI是一种由Intel、AMD、迈拓、微软、希捷等厂商制定的一种硬盘接口标准,全称是 Advanced Host Controller Interface ,它允许存储驱动程序启用高级串行 ATA 功能,如本机命令队列和热插拔。可以提高硬盘在高IOPS请求下的磁盘性能。Intel最新的南桥芯片都提供了对AHCI的支持,但是也有被遗忘的角落,那就是ICH8,当然很有可能它是被Intel故意“遗忘”的。
    在Intel的官方网站上并没有提及ICH8可以支持AHCI,而且在采用ICH8的主板在推出之初在BIOS里也确实没有打开AHCI的选项。但是经过几轮BIOS的更新,各大主板厂家并没有乖乖的顺从于Intel,陆续的在新版的BIOS中打开了AHCI功能。技嘉的965P-DS3在F12版本开始就加入了AHCI的支持。

    打开主板BIOS的AHCI支持以后,还需要安装AHCI的驱动,但是Intel提供的所有版本的驱动都无法安装在ICH8的主板上。不过由于Intel提供了ICH8R的AHCI驱动,而ICH8R和ICH8的区别仅仅是对RAID的支持,因此只需要修改一下ICH8R的驱动,就可以在ICH8上使用AHCI了。
    下载Intel的Intel Matrix Storage Manager驱动,在运行中加上 -a 参数运行,然后在C:\Program Files\Intel\Intel Matrix Storage Manager\Driver目录下(64为系统的在Driver64目录下)找到iaahci.inf文件。我们发现,ICH8开启AHCI之后的的设备ID是2824,在iaahci.inf文件中我们发现如下字段:
    [Strings]
    DiskName                = "Intel Matrix Storage Manager Driver"
    *PNP0600.DeviceDesc  = "Intel RAID Controller"
    PCI\VEN_8086&DEV_2652&CC_0104.DeviceDesc = "Intel(R) 82801FR SATA RAID Controller"
    PCI\VEN_8086&DEV_27C3&CC_0104.DeviceDesc = "Intel(R) 82801GR/GH SATA RAID Controller"
    PCI\VEN_8086&DEV_2682&CC_0104.DeviceDesc = "Intel(R) 631xESB/632xESB SATA RAID Controller"
    PCI\VEN_8086&DEV_27C6&CC_0104.DeviceDesc = "Intel(R) 82801GHM SATA RAID Controller"
    PCI\VEN_8086&DEV_2822&CC_0104.DeviceDesc = "Intel(R) ICH8R/DO/DH SATA RAID Controller"
     
    其中并没有ICH8的描述,但是有ICH8R的描述,他的设备ID为2822,所以我们可以用2824替换掉所有的2822,这样系统就会把ICH8识别成ICH8R了。

    由于技嘉在DS3主板上还集成了JM363芯片,以提供IDE支持,并且能多提供两个SATA支持(就是紫色的那两个)。我们就利用这个来实现不重装系统安装ICH8的AHCI驱动。
    首先,进入BIOS,将ICH8的ACHI打开,并将JM363的ACHI关闭(这是为了保证系统能顺利进入)。ICH8的ACHI在 Integrated Peripherals 目录中的最上边,JM363的是Onboard SATA/IDE Ctrl Mode选项,选为IDE。将串口硬盘的线连接到紫色的接口上。开机。系统会找到一个PCI设备,指定为修改过的驱动。这时系统会将这个PCI设备检测为Intel(R) 82801HR/HH/HO SATA AHCI Controller设备。关机,再将硬盘线装回黄色的接口上,重启机器就可以了。
     
    本文仅对本人的GA-965PDS3做过测试,但是大部分采用ICH8的主板都会集成JM363这样的第三方芯片,所以这篇文章应该具有普遍性,拥有其他品牌的采用ICH8芯片的主板的朋友们也不妨试试看。

    将自己的DS3升级到F10后发现多了一个AHCI选项,然后经历了电话咨询、网上查找、重做系统等等事件,终于有了一些心得,说出来与大家讨论一下。

    首先,DS3使用的是 Intel ICH8南桥,Intel声明ICH8不支持AHCI,其实只是Intel没有提供驱动并且不允许主板厂商对ICH8提供AHCI支持而已。

    现在,坚冰终于被打破,不少主板厂商纷纷开启了ICH8主板的AHCI。DS3的主板升级BIOS到F10后,在Integrated Peripherals(整合周边设备)目录中就能看到ACHI选项。其实我给技嘉客服咨询的时候,客服告诉我,其实DS3在F1就开始支持AHCI,只是隐藏了,在BIOS主菜单中按Ctrl+F1就能打开隐藏选项,可惜我的已经升级到F10了,无法测试,没有升级的朋友可以试试看。

    由于Intel提供了ICH8R的AHCI驱动,而ICH8R和ICH8的区别仅仅是对RAID的支持,因此只需要修改一下ICH8R的驱动,就可以在ICH8上使用AHCI了。

    由于技嘉在DS3主板上还集成了JM363芯片,以提供IDE支持,并且能多提供两个SATA支持(就是紫色的那两个)。我们就利用这个来实现不重装系统安装ICH8的AHCI驱动。

    首先,下载修改过的ICH8驱动,http://up2.zol.com.cn/bbs_upload/upload/2007/04_19/1176964584907.rar

    然后进入BIOS,将ICH8的ACHI打开,并将JM363的ACHI关闭(这是为了保证系统能顺利进入)

    ICH8的ACHI在 Integrated Peripherals 目录中的最上边,JM363的是Onboard SATA/IDE Ctrl Mode选项,选为IDE

    保存。关机

    将串口硬盘的线连接到紫色的接口上。

    开机。系统会找到一个PCI设备,指定为刚下载的驱动。这时系统会将这个PCI设备检测为Intel(R) 82801HR/HH/HO SATA AHCI Controller设备。

    关机,再将硬盘线装回黄色的接口上。

    OK,重启机器就可以了。

    以上说了ICH8的AHCI驱动安装,安装后就我主观来看,并没有太大的性能提升。这是因为硬盘性能的瓶颈主要是在内部传输上。

    希捷7200.10 为例,这已经是内部传输最高的型号了,也仅仅是1030Mb/S,换算过来也就是128.75MB/S,比SATA1的150MB/S都低,更不要说SATA2的300MB/S了,将内部传输速率比喻为汽车,那么外部传输速率就是马路了,在汽车的性能没有提升的情况下,一味的提升马路可以承受的最高速度是没有意义的。

    当人,我并不是说打开AHCI没有一点好处,至少AHCI中的NCQ功能会在硬盘非常密集读取的时候对性能有所提升。

    另外,很多人在找华硕的P5B_AHCI驱动,其实没有必要,自己也能制作。

    下载Intel的Intel Matrix Storage Manager驱动,在运行中加上 -a 参数运行,然后在C:\Program Files\Intel\Intel Matrix Storage Manager\Driver目录下(64为系统的在Driver64目录下)找到iaahci.inf文件。

    将iaahci.inf文件中所有的2821替换为2824后就可以了。

    以上就是我对ICH8开启AHCI的一些经验,欢迎大家讨论。

    只有硬盘支持SATA2才能真正开启AHCI。
    这个驱动就是Intel的SATA2驱动,只不过修改了一下,让它支持ICH8而已。
    另外,因为刚开发的希捷的7200.9系列有很多兼容问题,因此7200.9有很多的改版。所以部分的7200.9和7200.10的硬盘上是有一个跳线的,这个跳线的作用就是为了兼容而设置,带跳线的硬盘都强制工作在SATA1状态下,所以,只要主板支持,还是把跳线拔下来吧,这样才能达到SATA2 的 300MB/s

    SATA II是在SATA的基础上发展起来的,其主要特征是外部传输率从SATA的1.5Gbps(150MB/sec)进一步提高到了3Gbps(300MB/sec),此外还包括NCQ(Native Command Queuing,原生命令队列)、端口多路器(Port Multiplier)、交错启动(Staggered Spin-up)等一系列的技术特征。单纯的外部传输率达到3Gbps并不是真正的SATA II。

    SATA II的关键技术就是3Gbps的外部传输率和NCQ技术。NCQ技术可以对硬盘的指令执行顺序进行优化,避免像传统硬盘那样机械地按照接收指令的先后顺序移动磁头读写硬盘的不同位置,与此相反,它会在接收命令后对其进行排序,排序后的磁头将以高效率的顺序进行寻址,从而避免磁头反复移动带来的损耗,延长硬盘寿命。另外并非所有的SATA硬盘都可以使用NCQ技术,除了硬盘本身要支持 NCQ之外,也要求主板芯片组的SATA控制器支持NCQ。此外,NCQ技术不支持FAT文件系统,只支持NTFS文件系统。

    按照以上方法,完全可以开通,本人已经成功开通!如果有疑问,请留言!

    Posted Mar 31 2008, 02:46 PM by wicky with no comments
    Filed under:
  • 威刚PD9 4G(慧荣主控芯片)量产启动成功

    http://bbs.mydigit.cn/read.php?tid=25548

    今天下午新购的威刚ADATA PD9 4G U盘(慧荣SM321/SM324主控芯片)顺利量产成功!

    主要步骤如下:

    1.用论坛上下载的ChipGenius识别U盘信息如下:


      设备名称: [I:][J:]USB Mass Storage Device(SMI USB DISK USB Device)(SMI USB DISK USB Device)

    PNP设备ID: VID = 090C PID = 1000
    设备序列号: AA04012700007473
      设备版本: 1100/1100

      设备类型: 标准USB设备 - USB2.0高速

    芯片制造商: SMI(慧荣)
      芯片型号: SM321/SM324

    产品制造商: Feiya
      产品型号: Flash Disk

      资料下载:  http://bbs.mydigit.cn/read.php?tid=4345


    2.下载慧荣SM32X主控量产修复工具G1219,将U盘插入后,运行sm32Xtest.exe打开主界面

    3.点击scanusb查找U盘,找到后选中U盘,然后点击setting按钮

    4.在弹出的password框中输入  320

    5.然后会提示你选择default.ini文件,正常选中打开即可

    6.然后出现的就是设置界面,和其他量产工具类似,“Make Auto Run”前面的勾打上,并选择好本地的启动光盘镜像文件(我用的是WinXP sp2上海政府完整版607MB)即表示做成可启动的USB光驱,注意CDROM only 不要选中,Format和ToFAT32要选中,表示进行格式化后,给光驱自动分配ISO文件大小的空间,剩余自动转为U盘,其他选项建议不改动。然后点击ok确认设置。

    7.在主界面点击start即可开始,这个速度应该比较块的。完成后拔查插U盘即可识别出,记得U盘部分还需要在Windows中格式化下,快速格式化就ok了

    我的制做好后,可以在笔记本和虚拟机正常启动并安装XP,其他机器还没试。希望大家都一次成功。

    Posted Mar 31 2008, 08:12 AM by wicky with no comments
    Filed under:
  • 制作集成SATA驱动的WindowsXP/2003安装盘

    http://dgibm.net/bbs/viewthread.php?tid=10

    完整教学 制作集成SATA驱动的WindowsXP安装盘

    废话少说,这是查阅各种制作方法,花了近2天时间自己反复制作试验完成的最终完美方法,不仅轻易集成了目前多数SATA/SCSI驱动也易于自己添加更新驱动。(比较容易google或百度到的一种手动修改txtsetup.sif的方法实践证明无法通过,在安装时提示目录结构错误)
    总之,就这样,以后原生AHCI模式安装SATA2硬盘或RAID告别软驱。


    所需软件:
    一. 用到的软件
    DriverPacks BASE
    下载
    http://driverpacks.net/DriverPacks/download.php?pag=b

    DriverPackMassStorage下载 http://driverpacks.net/DriverPacks/download.php?pag=m
    (这个driverpack massstorage里面包含有我们要添加的1420ICH8MSATA驱动)
    Ultraiso://www.crsky.com/soft/1134.html 用于制作刻录用的ISO
    Nero burning 下载 http://www.crsky.com/soft/168.html
    刻录作好的ISO

    DELLomexp在网上有很多,用google搜索 dell ome xp 有很多可以下载的地址。例如ftp://ct1:ct1$gwvq7t3kh7@ftp.ctinic.com/-=%20Microsoft%20=-/Windows/Windows%20OEM/DELL%20OEM%20Windows/DELL%20Windows%20XP%20Professional%20SP2(Simplified%20Chinese)/XP_PRO_SP2(DELL_OEM).iso


    1. 复制Windows XP光盘里的文件至硬盘,比如G:\WinXP。


    2. 安装DrivePacks。硬盘里新建一个目录(如E:\DriverPacks),把下载到的DriverPacks BASE文件放进来,运行,所有程序文件将被自解压到该目录下。


    3. 把DriverPack MassStorage的7zip格式压缩包放到E:\DriverPacks\DriverPacks目录下,不需要解压缩。这是DriverPacks小组制作好的SATA/SCSI驱动包,包括常见的大多数磁盘设备,可以到这个页面查看所支持设备的列表和驱动版本:http://forum.driverpacks.net/viewtopic.php?id=1449

    4. 运行E:\DriverPacks\ DPs_BASE.exe。初始界面可以选择语言。


    5. 选择“设置-位置”,选中“磁盘”项,点击“浏览”按钮。选中刚才的G:\WinXP目录,确定。这时候左边的窗口会多出几项设置内容。

    6. 在“设置-驱动包”中选中“DriverPack MassStorage 7.05”。这个软件也可以集成显示卡驱动、芯片组驱动等其它驱动,详细指南请访问
    http://forum.driverpacks.net/viewtopic.php?id=1449
    http://bbs.stage1st.com/attachments/forumid_23/20070614_7e3ce40590f0072e3200YYWD9EhRlliF.jpg[/img]

    7. “驱动包整合方式”选择方式2。方式1虽然比较正统,但是会受到Windows安装程序检索文件夹数量的限制,导致有部分驱动可能无法被载入。


    8. 在“选项设置-快速整合缓存”里选中第一项。

    9. 点击“整合”按钮,程序会自动把驱动整合进Windows XP安装目录里。

    10. 把Windows XP安装光盘放入光驱,打开UltraISO,选择菜单“工具-制作光盘映像文件”或直接按F5。

    11. 先选定有XP安装盘的光驱,然后选择“提取引导文件”,保存得到一个bif后缀的引导文件。有了这个文件才能在制作ISO的时候依然保留XP安装盘的引导启动功能。

    12. 然后选择菜单“启动光盘-加载引导文件”,读入刚才的引导文件,现在工具栏上就显示“可引导光盘”了。

    13. 把G:\WinXP目录下的全部文件和文件夹拖放到上栏右边的窗口,选择菜单“开始-保存”,存成一个ISO文件。

    14. 用Nero Burning Rom把ISO刻出来就可以使用了,在安装的时候Windows会自动加载刚才集成的SATA/SCSI驱动,避免找不到硬盘或直接蓝屏。


    ==============================进阶分隔线===============================


    进阶使用:更新最新的驱动程序

    DriverPacks小组放出的驱动包都是定期更新的,但难免不能及时更新到最新的驱动,比如DriverPack MassStorage 7.05里包含的驱动只支持到Intel ICH8R,不支持最新的ICH9R。现在要说的就是如何手动添加ICH9R的驱动进DriverPacks的驱动包。

    1. 首先要获得ICH9R的安装驱动包。很多厂商包括Intel自己也只提供软盘制作程序下载,不过技嘉提供了自解压文件。到技嘉官方网站寻找ICH9R的主板如P35-DQ6的驱动,下载到一个目录解压缩得到一堆驱动文件。



    2. 这堆驱动文件里一般都有一个扩展名为inf或者oem的文本格式文件,比如这里的就是“txtsetup.oem”。用UltraEdit32打开,在其中以“[HardwareIds.”为关键字进行搜索,可以找到类似这样一段文字:

    [HardwareIds.scsi.iaAHCI_ICH9R]
    id = "PCI\VEN_8086&DEV_2922&CC_0106","iaStor"



    3. 回到E:\DriverPacks\DriverPacks目录,用7-zip把DP_MassStorage_wnt5_x86-32_705.7z解压缩,比如解压到E:\DriverPacks\DriverPacks\DP_MassStorage_wnt5_x86-32_705。在这个目录下会有一个DriverPack_MassStorage_wnt5_x86-32.ini文件,用UltraEdit32打开。


    4. 因为Intel SATA RAID驱动已经存在于DriverPacks驱动包里,所以只需要更新这个驱动到支持ICH9R就可以了,不必全新添加。在ICH9R驱动文件中,有一个后缀是sys的文件名为iastor.sys,在DriverPack_MassStorage_wnt5_x86-32.ini里搜索“iastor.sys”,最终可以看到这样一段文字:

    [IN-1]
    ms_count                                = 1
    ms_1_deviceName                       = "Intel SATA RAID Controllers"
    ms_1_tag                               = "iastor"
    ms_1_sysFile                       = "iastor.sys"
    ms_1_hwids                               = "PCI\VEN_8086&DEV_2652&CC_0104,PCI\VEN_8086&DEV_27C3&CC_0104,PCI\VEN_8086&DEV_2682&CC_0104,PCI\VEN_8086&DEV_27C6&CC_0104,PCI\VEN_8086&DEV_2822&CC_0104,PCI\VEN_8086&DEV_2652&CC_0106,PCI\VEN_8086&DEV_2653&CC_0106,PCI\VEN_8086&DEV_27C1&CC_0106,PCI\VEN_8086&DEV_27C5&CC_0106,PCI\VEN_8086&DEV_2681&CC_0106,PCI\VEN_8086&DEV_2821&CC_0106"
    ms_1_isBusExtender               = false



    一开始的[IN-1]代表了驱动的存放地址,这些驱动就放在 E:\DriverPacks\DriverPacks\DP_MassStorage_wnt5_x86-32_705\D\M\IN\1 目录下。把刚才得到的ICH9R驱动复制到这个目录下覆盖就完成了驱动版本的更新。

    但这个时候硬件ID还没有添加进新的硬件,就是ms_1_hwids那段的部分。在步骤2里找到的字段就是这个硬件ID,取出其中的“PCI\VEN_8086&DEV_2922&CC_0106”字段添加进这个驱动包ini文件里。于是现在修改成这样:

    [IN-1]
    ms_count                                = 1
    ms_1_deviceName                       = "Intel SATA RAID Controllers"
    ms_1_tag                               = "iastor"
    ms_1_sysFile                       = "iastor.sys"
    ms_1_hwids                               = "PCI\VEN_8086&DEV_2652&CC_0104,PCI\VEN_8086&DEV_27C3&CC_0104,PCI\VEN_8086&DEV_2682&CC_0104,PCI\VEN_8086&DEV_27C6&CC_0104,PCI\VEN_8086&DEV_2822&CC_0104,PCI\VEN_8086&DEV_2652&CC_0106,PCI\VEN_8086&DEV_2653&CC_0106,PCI\VEN_8086&DEV_27C1&CC_0106,PCI\VEN_8086&DEV_27C5&CC_0106,PCI\VEN_8086&DEV_2681&CC_0106,PCI\VEN_8086&DEV_2821&CC_0106, PCI\VEN_8086&DEV_2922&CC_0106"
    ms_1_isBusExtender               = false


    其实ICH9R原厂驱动里增加的其它兼容驱动,比如ICH8M等也可以用相同方法添加进来。


    5.         保存ini文件,重新打包成7zip格式,就完成了对驱动包的更新。再按前面的方法制作XP光盘,这样制作出来就能支持ICH9/ICH9R南桥,测试通过。重新打包的驱动包也可以命名为不同的名字,比如DP_MassStorage_wnt5_x86-32_708.7z,软件会优先识别版本号新的一个包。

    Posted Mar 30 2008, 09:11 AM by wicky with 2 comment(s)
    Filed under:
  • Enforcing single instance with argument passing


    http://www.flawlesscode.com/post/2008/02/Enforcing-single-instance-with-argument-passing.aspx 

    Note: this approach is only for .Net 3.5.

    There are several implementations out there already for doing this, but for one reason or another they all did something I didn't like. Some use the registry, some can't pass parameters, some use P/Invoke, some use remoting and others use the VB libraries. Not quite high treason but even so, an all C# and very light implementation has got to be worth the effort.

    The class that does all the work is, imaginatively, called SingleInstance. The single public constructor takes a Guid which is used to identify out application. Like some of the other examples out there I use a Mutex object to tell whether the application is already running or not.

    mutex = new Mutex(true, identifier.ToString(), out ownsMutex);

    The out parameter tells us whether we were able to create and own the Mutex or whether someone else (another instance of our app) already has. Given this, we have a simple property telling us if we're the first instance or not.

    public Boolean IsFirstInstance

    { get { return ownsMutex; } }

    The only piece left of the single instance puzzle is making sure that we release the mutex, if we happen to own it, and for this I implemented IDisposable and did the following in the dispose method:

    if (mutex != null && ownsMutex)

    {

        mutex.ReleaseMutex();

        mutex = null;

    }

    Couldn't be more simple, right? Next we need to handle passing any command line arguments onto the initial instance. For this I use the new NamedPipeClientStream and NamedPipeServerStream classes here is the client end:

    using (NamedPipeClientStream client = new NamedPipeClientStream(identifier.ToString()))

    using (StreamWriter writer = new StreamWriter(client))

    {

        client.Connect(200);

     

        foreach (String argument in arguments)

            writer.WriteLine(argument);

    }

    On the server end it's pretty much just as simple, we read in all the arguments and the fire the ArgumentsReceived event which the class exposes.

    using (NamedPipeServerStream server = new NamedPipeServerStream(identifier.ToString()))

    using (StreamReader reader = new StreamReader(server))

    {

        server.WaitForConnection();

     

        List<String> arguments = new List<String>();

        while (server.IsConnected)

            arguments.Add(reader.ReadLine());

     

        ThreadPool.QueueUserWorkItem(new WaitCallback(CallOnArgumentsReceived), arguments.ToArray());

    }

    Everything works really nicely, the only odd looking bit here is that we spawn a new thread to fire the event. I did this simply because I we need to create a new NamedPipeServerStream to handle any subsequent clients and I didn't want to wait for the app to have to process the event. That's all, we leave the responsibility of giving focus to the first instance to itself, should it so wish. Here is a snippet of how it looks in action.

    static void Main(String[] args)

    {

        Guid guid = new Guid("{6EAE2E61-E7EE-42bf-8EBE-BAB890C5410F}");

        using (SingleInstance singleInstance = new SingleInstance(guid))

        {

            if (singleInstance.IsFirstInstance)

            {

                singleInstance.ArgumentsReceived += singleInstance_ArgumentsReceived;

                singleInstance.ListenForArgumentsFromSuccessiveInstances();

     

                //Do whatever your application is supposed to do here...

            }

            else

                singleInstance.PassArgumentsToFirstInstance(args);

        }

    }

     

    static void singleInstance_ArgumentsReceived(object sender, ArgumentsReceivedEventArgs e)

    {

        //Process the arguments here...

    }

    One thing to note, remember to make your own Guid to use, and make a new one for each application which uses this class (Tools->Create Guid->Registry Format->Copy)! Hope you like the excessively long method names, but hey, for a code sample on a blog it makes it much clearer...

    Packaged with the code download is a simple Windows Forms application to demonstrate the functionality, the best way to see it work is to launch one instance in the debugger then minimise it. Next, drag and drop some jpeg files in explorer onto the exe.

     

  • Backup Outlook Express Mail Rules

    Outlook Express's message rules are stored entirely in the Registry. This tweak will transfer those rules to another machine, wiping out existing rules on the target machine. On each machine, you will have to determine the correct subkey of the HKCU\Identities key. Select each in turn and check the Username value in the right-hand pane. Substitute the value there for identity in the key below.


    HKCU\Identities\identity\Software\Microsoft\Outlook Express\5.0\Rules\Mail
    Action: Select the key and choose Export from the Registry menu. With Win NT 4.0, use the REGEDIT4 format. Open the REG file in WordPad and use Search/Replace to replace the source identity string with that of the target. Delete the above key on the target machine using the target identity string. Move the resulting REG file to the target computer and launch it.

    Posted Mar 24 2008, 03:02 PM by wicky with no comments
    Filed under:
  • 理财有道

    请看附件。

     

    Posted Mar 21 2008, 09:19 PM by wicky with no comments
    Filed under:
  • Using Windows Server 2008 as a SUPER workstation OS

    http://blogs.msdn.com/vijaysk/archive/2008/02/11/using-windows-server-2008-as-a-super-desktop-os.aspx

    Windows Server 2008 is the best OS to be released till date from Microsoft's stable. And the moment I got hold of the RTM build I could not resist installing it on my workstation. Due to the nature of my work I always prefer running a Server OS on my main workstation... I have been running Windows 2003 disguised as XP (with all the themes and stuff) all these days.

    So here is my tale of how I went about setting up Windows Server 2008 to look and fell like its desktop counterpart Windows Vista.

    1. Enable Hardware Virtualization

    My workstation is a x64 machine with hardware virtualization capabilities. This means I can run Hyper-V on my machine. Even if your machine's hardware supports virtualization it is most likely not going to be enabled by default. You have to enable it via your BIOS setup.

    2. Install the latest Graphics and Audio drivers

    Being a server OS Windows 2008 carries with it basic graphics and audio drivers. To utilize the full strength of your hardware ensure you install the latest drivers for both graphics and audio hardware. Only with the proper graphics drivers will you be able to enable the "Aero" experience on Windows 2008.

    3. Desktop Experience Feature

    The Desktop Experience Feature enables a bunch of stuff that is by default present on a desktop OS. Most importantly it includes Themes, Windows Media player and the Aero related features. You will have to enable it form the Server Manager. The "Turn Windows features on or off" / "Add remove windows components" has all been rolled into the Server Manager now.

    Server Manager > Features > Desktop Experience

    Installing the Desktop Experience feature does not enable them. You have to manually set them up.

    4. Themes

    To enable Themes you will basically have to enable the Themes Service. Again being a server OS it is not enabled by default.

    Services.MSC > Themes

    Set the start up type to Automatic

    Enabling the Aero Theme.

    For this go to Control Panel > Personalization >Theme and select Windows Aero

    5. Search

    Search is also disabled by default on Windows 2008. Searching is important for me as I use it a lot to find my emails. To enable search you will have to add the File Services Role via Server Manager.

    Server Manager > Roles > File Services > Windows Search

    Outlook relies on this search service.

    6. Disable Shutdown Event Tracker

    Since I am using it as a workstation I do not want to keep a track of all the Shutdowns. The Shutdown Event Tracker is the pop up that you get asking you for a shutdown reason. To disable it

    Open mmc.msc

    Add the Group Policy snap-in

    Under Administrative Templates expand System

    Set Display Shutdown Event Tracer to Disabled

    7. Audio

    For audio you need to enable the Windows Audio service. You do this by setting the startup type to Automatic.

    Services.msc > Windows Audio

    Ensure you have proper drivers for your audio hardware... for me the default driver was not enabling the headphones ... it started working fine after I got the proper driver.

    8. SuperFetch

    As a workstation, enabling SupertFetch will give you that additional bit of responsiveness. The SuperFetch services is disabled by default and when you try to enable it you will most likely get an error message "The operating system is not presently configured to run this application"

    You will have to make two registry changes to enable this service. I basically copied them over from my Vista machine.

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters

    EnablePrefetcher DWORD 3

    EnableSuperfetch DWORD 3

    9. Get a codec pack.

    For media hungry buffs download a codec pack. This will ensure you can play all media files.

    10. Enable Hyper-V

    With Hyper-V you can run virtual machines on your workstation. This is useful if you want to run your tests on older OS versions. Enabling  Hyper-V is easy

    Server Manager > Roles > Hyper-V

    Remember you need a Hyper-V enabled Windows 2008 licence and also your hardware has to support virtualization.

    Also If you are using an existing VHD it may ask you to re-Activate Windows as it detected hardware changes.

    One good thing about Windows Server 2008 is that it no longer asks for the i386 folder like Windows 2003 while you enable features.

    11. Processor Scheduling

    As pointed out in a comment on my previous post; On Windows Server 2008 background services are given preference over interactive programs. You can change this behavior by

    Control Panel > System and Maintenance > System > Advanced System Settings > Advanced > Performance > Settings > Advanced > Processor Scheduling

    Setting this to Programs will make foreground programs more responsive.

    12. Visual Effects

    One thing you will notice on Windows Server 2008 is that by default you will not see Preview Thumbnails in your Documents / Music / Video folders. This has to be enabled explicitly.

    Control Panel > System and Maintenance > System > Advanced System Settings > Advanced > Performance > Settings > Visual Effects

    Based on your preference you can tweak these settings.

    13. Power Options

    Do your bit for a Green World! The Balanced (default) power plan on Windows Server 2008  does not turn off hard disks by default. On Vista hard disks are turned off after 20 mins. You can change this by

    Control Panel > Hardware and Sound > Power Options > Change plan settings

    It does take a bit to kick start the hard disks when you resume work but that's a sacrifice worth making for a greener world :).

    14. IE Enhanced Security 

    IE Enhanced Security Configuration has been moved from Add Remove Windows Components (on Windows 2003) to the Server Manager on Windows Server 2008.

    Server Manager > Security Information > Configure IE ESC

    You now have a choice to disable it only for Administrators. 

    And to end with a couple of clarifications

    * Why am I recommending Windows Server 2008 over Windows Vista ?

    I am not!

    * How to get Sidebar / Media center on Windows Server 2008?

    My honest opinion would be to look for alternatives.

    * Will hardware problems go away moving to Windows Server 2008?

    Not likely. One of the biggest complaints against Vista was hardware issues. Without proper  drivers from your hardware vendors your ride on Windows Server 2008 is again going to be bumpy. For me all Vista compatible drivers worked fine with Server 2008 and I believe they should work for you as well.

    * Will all software work on Windows Server 2008?

    Most will but some setups detect Windows Server 2008 as a server OS and may not install. The compatibility mode does not have a Vista option only XP / Windows 2003 and other legacy OS.

    Posted Mar 21 2008, 12:53 PM by wicky with no comments
    Filed under:
  • 电话激活Windows 2008

    [benben]

    1.安装好系统或用slmgr.vbs -ipk载入本帖提到的密匙.slmgr.vbs -ipk命令是安装新密匙或替换现有密匙.
    2.运行slmgr.vbs -dti命令.就会跳出一个显示安装ID的窗口.窗口内容是54位阿拉伯数字和
    教你怎样查找激活电话号码.
    3.拨打8008203800或者8008301832接通后自己选择语音服务器还是人工服务.
    4.把那54位数字按6个一组报给激活系统,系统会返回一组48位阿拉伯数字的激活ID,记录下来
    5.运行slmgr.vbs -atp命令载入48位阿拉伯数字.
    6.完成激活.以后在硬件不变动的情况下可以离线激活.

     

    Posted Mar 20 2008, 12:49 PM by wicky with 1 comment(s)
    Filed under:
  • c#四种eval方法

    http://www.yaosansi.com/post/446.html


    有时候需要表达式运算,如
    String strExpression="-12 * ( - 2.2 + 7.7 ) - 44 * 2";

    网上找的,一般是利用CodeDom,见
    http://www.codeproject.com/csharp/runtime_eval.asp

    简化为:
    System.CodeDom.Compiler.ICodeCompiler comp = (new Microsoft.CSharp.CSharpCodeProvider().CreateCompiler());
    System.CodeDom.Compiler.CompilerParameters cp = new System.CodeDom.Compiler.CompilerParameters();

    object qswhEval2(string Expression){
    StringBuilder code = new StringBuilder();
    code.Append("using System; \n");
    code.Append("namespace ADOGuy { \n");
    code.Append(" public class _Evaluator { \n");
    code.Append(" public object __foo() ");
    code.Append("{ ");
    code.AppendFormat(" return ({0}); ", Expression);
    code.Append("}\n");
    code.Append("} }");
    System.CodeDom.Compiler.CompilerResults cr = comp.CompileAssemblyFromSource(cp, code.ToString());
    System.Reflection.Assembly a = cr.CompiledAssembly;
    object _Compiled = a.CreateInstance("ADOGuy._Evaluator");
    System.Reflection.MethodInfo mi = _Compiled.GetType().GetMethod("__foo");
    return mi.Invoke(_Compiled, null);
    }


    但用起来感觉很慢,毕竟需要实时编译。

    于是,就自己照数据结构书上写了一种算法:
    string Precede(string p, string q){
    switch(p){
    case "+":
    case "-":return ("*/(".IndexOf(q)!=-1)?"<":">";
    case "*":
    case "/":return (q=="(")?"<":">";
    case "(":return (q==")")?"=":"<";
    case ")":return (q=="(")?"?":">";
    case "#":return (q=="#")?"=":"<";
    }
    return "?";
    }
    Double Operate(Double a,char o,Double b)
    {
    switch(o)
    {
    case '+':return a+b;
    case '-':return a-b;
    case '*':return a*b;
    case '/':return a/b;
    }
    return 0;
    }

    Object qswhEval1(string Expression){
    /*************(qiushuiwuhen 2002-12-14)****************/
    Stack nArr=new Stack(),oArr=new Stack();
    int j=0;
    Double a=0,b=0;
    string w="";
    char o;
    MatchCollection arr=Regex.Matches(Expression.Replace(" ","")+"#",@"(((?<=(^|\())-)?\d+(\.\d+)?|\D)");

    oArr.Push('#');
    w=Convert.ToString(arr[j++]);
    while(!(w=="#"&&Convert.ToString(oArr.Peek())=="#")){
    if("+-*/()#".IndexOf(w)!=-1){
    switch(Precede(oArr.Peek().ToString(),w)){
    case "<":
    oArr.Push(w);
    w=Convert.ToString(arr[j++]);
    break;
    case "=":
    oArr.Pop();
    w=Convert.ToString(arr[j++]);
    break;
    case ">":
    o=Convert.ToChar(oArr.Pop());
    b=Convert.ToDouble(nArr.Pop());
    a=Convert.ToDouble(nArr.Pop());
    nArr.Push(Operate(a,o,b));
    break;
    default:
    return "Error";
    break;

    }
    }else{
    nArr.Push(w);
    w=Convert.ToString(arr[j++]);
    }
    }
    return nArr.Pop();
    }

    还有利用JScript的Eval的两种算法
    Microsoft.JScript.Vsa.VsaEngine ve=Microsoft.JScript.Vsa.VsaEngine.CreateEngine();
    object qswhEval3(string Expression){
    return Microsoft.JScript.Eval.JScriptEvaluate(Expression,ve);
    }

    object qswhEval4(string Expression){
    return qswhJs.qswhEval.Eval(Expression);
    }

    第四种需先建立一js编译为dll,如下代码
    import System;

    package qswhJs {
    class qswhEval {
    static function Eval(Expression):Object { return eval(Expression); }
    }
    }

    测试代码如下:
    void Page_Load(Object o,EventArgs ea){
    String strExpression="-12 * ( - 2.2 + 7.7 ) - 44 * 2";
    int i=0,c=100;
    DateTime d1,d2;
    cp.GenerateExecutable = false;
    cp.GenerateInMemory = true;

    d1=DateTime.Now;
    for(i=0;i d2=DateTime.Now;
    Response.Write("方法一:对表达式分析 "+d2.Subtract(d1)+"
    ");

    d1=DateTime.Now;
    for(i=0;i d2=DateTime.Now;
    Response.Write("方法二:利用CodeCom "+d2.Subtract(d1)+"
    ");

    d1=DateTime.Now;
    for(i=0;i d2=DateTime.Now;
    Response.Write("方法三:利用Jscript+Vsa "+d2.Subtract(d1)+"
    ");

    d1=DateTime.Now;
    for(i=0;i d2=DateTime.Now;
    Response.Write("方法四:利用Jsc+Dll "+d2.Subtract(d1)+"
    ");
    }

    测试结果:

    方法一:对表达式分析 00:00:00.1702448
    方法二:利用CodeCom 00:00:23.7942144
    方法三:利用Jscript+Vsa 00:00:00.1902736
    方法四:利用Jsc+Dll 00:00:00.2403456

    在此推荐第一种(如果要纯CSharp的话)
    和第三种(代码简单,功能更多)
    本文来源于yaosansi'Blog http://www.yaosansi.com/ , 原文地址:http://www.yaosansi.com/post/446.html


     

  • Top 5 javascript frameworks

     http://www.whenpenguinsattack.com/2007/04/24/top-5-javascript-frameworks/

    this article talks about top 5 javascript frameworks.
    however, you can find more in comments.

     

  • Javascript with ASP.Net 2.0

  • Monitoring a Printer Queue

    For .Net 3.0 or upper, you may look into System.Printing, and PrintServer related classes.

    For .Net 2.0, you need to call windows api.

    http://www.codeproject.com/KB/printing/printwatchvbnet.aspx

    Latest version on CodePlex:

    http://www.codeplex.com/PrintQueueWatch/Wiki/View.aspx

Copyright SDT, 2006-2009. All rights reserved.